Software source updating method and device, electronic equipment and readable storage medium

By combining the initial index information and the new index information, generating the updated index information, and directly updating the initial index information and adding new software packages in the software source, the problem of low software source update efficiency in the existing technology is solved, and the effect of simplifying the process and improving efficiency is achieved.

CN120010900APending Publication Date: 2025-05-16LOONGSON ZHONGKE (XIAN) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411922580.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the prior art, software source update efficiency is inefficient, and a new software warehouse is required to update the operating system configuration file, resulting in complex and inefficient methods.

Method used

By downloading the initial index information of the initial software package from the software source, building a new software package and obtaining the new index information, combining the initial index information and the new index information, obtaining the updated index information, replacing the initial index information in the software source with the update index information, and adding the new software package to the software source.

Benefits of technology

There is no need to create a new software warehouse, but it is directly updated in the original software source, which simplifies the process and improves the efficiency of software source updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120010900A_ABST
    Figure CN120010900A_ABST
Patent Text Reader

Abstract

The invention discloses a software source updating method and device, electronic equipment and a readable storage medium. The method comprises the steps that initial index information of an initial software package is downloaded from a software source; the initial index information is used for indexing the initial software package from the software source; constructing a new software package locally, and obtaining new index information of the new software package; the new index information is used for indexing the new software package from the software source; combining the initial index information and the new index information to obtain updated index information; using the updated index information to replace the initial index information in the software source, and adding the new software package to the software source, so that the new software package and the initial software package are jointly stored in the software source. Through downloading the initial index information, on the basis of the new software package and combining the initial index information and the new index information, the updating of the software source can be realized, and the updating efficiency of the software source is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and in particular relates to a software source updating method, device, electronic device and readable storage medium. Background Art

[0002] In the process of making an image file, the corresponding software package needs to be installed according to user needs. Usually, users can download software packages directly from the software warehouse, but when the software warehouse lacks the software package required by the user, the developer needs to make the software package required by the user and upload it to the software warehouse for users to download and use.

[0003] In the related art, a new software warehouse can be created, the prepared software package can be uploaded to the new software warehouse, and the address of the new software warehouse can be written into the configuration file of the operating system, so that the user can obtain the address of the new software warehouse from the configuration file and download the required software package according to the address.

[0004] However, each time a new software warehouse is created and a software package is uploaded to the new software warehouse, the user needs to be informed of the update status of the operating system configuration file, which makes the software warehouse update method complicated. In addition, since a new software warehouse needs to be created for each update, the software warehouse update efficiency is low. Summary of the invention

[0005] The present invention aims to provide a software source updating method, device, electronic device and readable storage medium, which at least solve the problem of low software source updating efficiency in the prior art.

[0006] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0007] In a first aspect, an embodiment of the present invention provides a software source update method, comprising:

[0008] Downloading initial index information of an initial software package from a software source; the initial index information is used to index the initial software package from the software source;

[0009] Building a new software package locally, and obtaining new index information of the new software package; the new index information is used to index the new software package from the software source;

[0010] Merging the initial index information and the newly created index information to obtain updated index information;

[0011] The updated index information is used to replace the initial index information in the software source, and the newly created software package is added to the software source, so that the newly created software package and the initial software package are stored together in the software source.

[0012] In a second aspect, an embodiment of the present invention further provides a software source update device, comprising:

[0013] A download module, used for downloading initial index information of an initial software package from a software source; the initial index information is used for indexing the initial software package from the software source;

[0014] A construction module, used to locally construct a new software package and obtain new index information of the new software package; the new index information is used to index the new software package from the software source;

[0015] A merging module, used for merging the initial index information and the newly created index information to obtain updated index information;

[0016] The update module is used to use the update index information to replace the initial index information in the software source, and add the newly created software package to the software source so that the newly created software package and the initial software package are stored together in the software source.

[0017] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor; and one or more programs, wherein the one or more programs are stored in a memory and are configured to be executed by the one or more processors, wherein the one or more programs include instructions for performing the following operations:

[0018] Downloading initial index information of an initial software package from a software source; the initial index information is used to index the initial software package from the software source;

[0019] Building a new software package locally, and obtaining new index information of the new software package; the new index information is used to index the new software package from the software source;

[0020] Merging the initial index information and the newly created index information to obtain updated index information;

[0021] The updated index information is used to replace the initial index information in the software source, and the newly created software package is added to the software source, so that the newly created software package and the initial software package are stored together in the software source.

[0022] In a fourth aspect, an embodiment of the present invention further provides a readable storage medium, which, when instructions in the readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the method described in the first aspect.

[0023] In summary, this embodiment obtains initial index information and merges the newly created index information of the newly created software package with the initial index information, so as to update the initial index information in the software source according to the obtained updated index information, and upload the newly created software package to the software source. Compared with the method of the related art, this embodiment does not need to create a new software warehouse, so it is not necessary to change the configuration file according to the address of the newly created software warehouse, and inform the user of the configuration file change, which greatly improves the update efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 It is a schematic diagram of an application scenario of a software source update method provided by an embodiment of the present invention;

[0025] Figure 2 is a flowchart of the steps of a software source updating method provided by an embodiment of the present invention;

[0026] Figure 3 is a flowchart of another software source update method provided by an embodiment of the present invention;

[0027] Figure 4 is a flowchart of the steps of another software source updating method provided by an embodiment of the present invention;

[0028] Figure 5 is a block diagram of a software source updating device provided by an embodiment of the present invention;

[0029] Figure 6 is a block diagram of an electronic device provided by an embodiment of the present invention;

[0030] Figure 7 is a block diagram of another electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The memory training method provided by the embodiment of the present invention is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0032] Figure 1 This is a schematic diagram of the application scenario of the software source update method. Figure 1 , the application scenario includes a server 10, a software source 20, and a user end 30.

[0033] The software source 20 may be a software source constructed by an operating system, and the software source includes an initial software package and initial index information of the initial software package. In the software source of some operating systems, only the software packages required for making images for part of the system architecture may be provided. When a user makes an image, a software package for a specific project needs to be installed. When the software source does not have the software package required by the user, the software developer who needs to develop the software package makes a new software package for the specific project through the server 10, and uploads the new software package to the software source 20 in time, so that the user can download the required new software package from the updated software source 20 through the user terminal 30. For different operating systems, the package management tools used to make software packages are different. For example, in the operating system Centos, the package management tool Createrepo provided by the operating system Centos can be used to directly make a new software package and update the software source.

[0034] In projects such as the Cloud Native Computing Foundation (CNCF), during the image creation or compilation process, because the functions to be implemented by the software corresponding to the image are different, the libraries and toolkits relied on when making the image are also different. The official software sources of some operating systems often only provide all the software packages required for making images based on the X86 architecture. However, for some other system architectures to be ported, the software packages provided in the official software sources of these operating systems are insufficient. When the user makes the image, the software developer who needs to develop the software package needs to create a new software package for a specific project through the server 10, and upload the new software package to the software source 20 in time to update the software source, ensuring that the user can update the index information through the user end 30 and download the required new software package from the updated software source 20.

[0035] In the related art, a new software warehouse needs to be created and a new software package needs to be uploaded to the new software warehouse. After each new software warehouse is created and the new software package is uploaded, the user needs to be informed of the update status of the configuration file. The method is complicated and the update efficiency is low because a new software warehouse needs to be created for each update.

[0036] In view of the above problems in the related art, the present application provides a software source update method, which downloads the initial index information of the initial software package from the software source, builds a new software package, obtains the new index information of the new software package, merges the initial index information and the new index information, obtains the updated index information, uses the updated index information to replace the initial index information in the software source, and adds the new software package to the software source to be stored in the software source together with the initial software package. The present application can realize the update of the software source without the need to create a new software warehouse, thereby improving the update efficiency of the software source.

[0037] Combine the following Figures 2 to 4 , a further exemplary description is given of the software source update method of the present application.

[0038] Figure 2 is a flowchart of a method for updating a software source provided by an embodiment of the present invention, referring to Figure 2 , the software source update method may include the following steps:

[0039] Step 101: download initial index information of an initial software package from a software source.

[0040] The initial index information is used to index the initial packages from the software sources.

[0041] Specifically, the software source stores the initial software package and initial index information of the initial software package.

[0042] For example, the software source may be a software source provided by an official platform of the operating system.

[0043] The initial software package stored in the software source may include the software package stored in the software source after the software source is last updated. For example, the initial index information of the initial software package may include the software package identifier of the initial software package, the storage path of the initial software package, the system architecture applicable to the initial software package, and other information related to the initial software package.

[0044] Further, an initial index file containing the initial index information can be downloaded, and the initial index information can be extracted from the initial index file. Further, an initial index compressed package containing the initial index file can be downloaded, the initial index file can be obtained by decompressing the compressed package, and then the initial index information in the initial index file can be extracted.

[0045] For example, the source path of the software source may be obtained, and the initial index information of the initial software package in the software source may be downloaded according to the source path of the software source.

[0046] For example, you can open the source path file / etc / apk / repositories that records the source path of the software source, obtain the source path of the software source, and directly download the initial index compressed package APKINDEX.tar.gz in the architecture directory of the software source source path. Decompress the initial index compressed package APKINDEX.tar.gz to obtain the initial index file APKINDEX, and obtain the initial index information according to the initial index file APKINDEX.

[0047] For example, the initial index information may include a checksum for verifying the integrity of the initial software package, the name of the initial software package, the version number of the initial software package, the architecture to which the initial software package is applicable, and other information.

[0048] Specifically, the initial index information may include the following:

[0049] C:Q1gsChxGjeF5cXEVJ5X6xf3rxI4s8= / / Checksum of the initial software package, used to verify the integrity of the software package

[0050] P:binutils-doc / / The name of the initial package

[0051] V:2.31.1-r18 / / version number of the initial software package

[0052] A:loongarch64 / / The architecture for which the initial software package is applicable

[0053] S:781924 / / Size of the initial package (bytes)

[0054] I:2748416 / / Initial software package installation size (bytes)

[0055] T: Tools necessary to build programs (documentation) / / Description of the initial software package

[0056] U:https: / / www.gnu.org / software / binutils / / / URL of the initial software package

[0057] L:GPL-2.0GPL-3.0-or-later LGPL-2.0BSD / / License information of the initial software package

[0058] o:binutils / / The original name of the initial package, indicating that it is part of binutils.

[0059] m:Natanael Copa ncopa@linux.org / / Initial package maintainer information

[0060] t:1691131783 / / Initial software package build timestamp (seconds)

[0061] c:8c26317a44d316ecebe7fb91454b62b199073962 / / The checksum of the initial software package, used to verify the integrity of the software package.

[0062] i:docs binutils=2.31.1-r18 / / Initial package dependencies

[0063] Step 102: Build a new software package locally and obtain new index information of the new software package.

[0064] New index information is used to index new software packages from software sources.

[0065] For example, the newly created index information may include a software package identifier of the newly created software package, a storage path of the newly created software package, a system architecture applicable to the newly created software package, and other information related to the newly created software package.

[0066] Furthermore, the format of the newly created index information of the newly created software package is the same as the format of the initial index information of the initial software package. Specifically, the format of the newly created index information of the newly created software package can refer to the format of the content included in the initial index information in step 101, which will not be repeated here.

[0067] For example, a new software package is built using a preset packaging tool, wherein the preset packaging tool is a packaging tool adapted to the operating system for building the software package. For example, if the operating system for building the software package is Centos, the preset packaging tool may be YUM.

[0068] Furthermore, the preset packaging tool can be used to build a new software package by running a software package building command (e.g., abuild command). For example, by building a new software package through the preset packaging tool, the preset packaging tool can generate a new software package in apk format and a new index file of the new software package.

[0069] Step 103: merge the initial index information and the newly created index information to obtain updated index information.

[0070] For example, different newly created software packages can be compiled in different build environments, wherein at least one newly created software package compiled in the same build environment has a corresponding newly created index information. One newly created index information can correspond to one newly created software package or to multiple newly created software packages, and the newly created index information includes index information segments of all corresponding newly created software packages.

[0071] When there are multiple newly created index information, the initial index information and all newly created index information are merged to obtain updated index information, so as to ensure that the updated index information includes the initial index information of all initial software packages and the newly created index information of all newly created software packages.

[0072] Specifically, the index information segments included in the initial index information and the index information segments included in the newly created index information are placed in the same index file to merge the initial index information and the newly created index information. The initial index information and the newly created index information have the same format to ensure that there is no data format conflict when the two are merged.

[0073] For example, the initial index information is recorded in the initial index file index0, and there are multiple newly created index information, each of which is recorded in a corresponding newly created index file. The newly created index files include index1, index2, ..., indexn. The newly created index information in the newly created index files index1, index2, ..., indexn can be appended to the initial index file index0 in sequence to obtain an updated index file index including the updated index information. Where n is the total number of newly created index files.

[0074] Step 104: Use the updated index information to replace the initial index information in the software source, and add the newly created software package to the software source so that the newly created software package and the initial software package are stored together in the software source.

[0075] For example, the update index information is recorded in the update index file, and the initial index information is recorded in the initial index file. The update index file is used to replace the initial index file in the software source, so that the initial index information in the software source is replaced with the update index information.

[0076] Further, a first number of initial software packages corresponding to the initial index information and a second number of newly created software packages corresponding to the newly created index information are obtained; after merging, a total number of software packages corresponding to the updated index information is obtained, and if the sum of the first number and the second number is equal to the total number, it is determined that the updated index information is valid.

[0077] The update index information includes the initial index information of the initial software package and the newly created index information of the newly created software package, and the update index information is used to index the initial software package and the newly created software package. Further, based on the update index information, the initial software package and the newly created software package can be indexed from the software source.

[0078] In the related art, a new software warehouse needs to be created. After uploading the new software package in the new software warehouse, the address of the new software warehouse is configured to the configuration file of the operating system, and the user is informed of the configuration file update status. Compared with the method of the related art, the present embodiment only needs to obtain the initial index information of the initial software package in the software source, build a new software package, merge the initial index information and the new index information of the new software package, and upload the updated index information and the new software package in the software source to achieve the update of the software source. The present embodiment does not need to create a new software warehouse, so there is no need to change the configuration file according to the address of the new software warehouse, and inform the user of the configuration file change status. Compared with the method of the related art, the method of the present embodiment is simple and has high update efficiency.

[0079] In addition, compared with the method of building a construction environment corresponding to a new operating system, downloading all initial software packages from a source warehouse, then compiling newly added software packages in the construction environment, and generating index files for all initial software packages and newly added software packages through a package management tool, and then uploading the generated index files and software packages to the source warehouse, this embodiment does not need to download the initial software packages in the source warehouse, but only needs to download the initial index information of the initial software packages, obtain the updated index information according to the downloaded initial index information and the newly created index information of the newly created software packages, and update the software source according to the updated index information. This embodiment does not need to manually download the initial software packages in the software source to complete the update of the software source, which reduces the workload and the amount of data processing for the initial software packages, and the method is simple and has high processing efficiency.

[0080] Furthermore, compared to the method of building a new software package under the native build system for building software sources and updating the software source, this embodiment merges the initial index information and the new index information to obtain the update index information, and uses the update index information to update the software source. This embodiment does not need to build a new software package under the native build system to update the software source, and can merge the new index information of the new software package built in a single or multiple different build machines with the initial index information to update the software source according to the merged update index information. The problem of a single build environment and low task execution efficiency caused by only being able to use the native build system to update the software source is avoided, and the problem of a large workload caused by the need to rebuild each original software package when a single native build system is damaged is avoided. This embodiment solves the defects of updating the software source through a single original build system and improves the efficiency of software source updates.

[0081] Figure 3 is a flowchart of another software source update method provided by an embodiment of the present invention, referring to Figure 3 , the method may include the following steps:

[0082] Step 201, obtaining a source path file.

[0083] The source path file records the source path of the software source.

[0084] For example, the source path file may be a configuration file used by a package management tool, and is used to specify software source information and a source address corresponding to the software source.

[0085] For example, there may be multiple software sources in the source path file, each of which has a corresponding source path. For example, the software source may include an official warehouse (main warehouse) and a community warehouse (community warehouse), wherein the main warehouse is usually a software warehouse officially maintained by the operating system, and the community warehouse is usually a software warehouse where community members maintain and contribute software packages.

[0086] According to the software warehouse to which the newly created software package belongs, the corresponding software warehouse can be selected from the source path file, and the software warehouse can be used as the software source to be updated in this embodiment, and the source path of the software source can be used as the source path of the software source to be updated in this embodiment.

[0087] The source path of the software source is stored in the source path file in the form of a link. For example, the corresponding link of the source path of the software source is stored in the source path file / etc / apk / repositories.

[0088] For example, if the newly created software package belongs to the software package in the main repository, select the main repository as the software source to be updated. For another example, if the newly created software package belongs to the software package in the community repository, select the community repository as the software source to be updated.

[0089] Furthermore, a software warehouse to which a target software package having the same function as the newly created software package in this embodiment belongs can be obtained from software packages generated by the official platform of the operating system for other system architectures, and the software warehouse can be determined as the software warehouse to which the newly created software package in this embodiment belongs.

[0090] In other words, the target software package is a software package generated by the official platform for other system architectures, which has the same function as the new software package to be built. The software warehouse to which the target software package belongs is determined as the software warehouse to which the new software package belongs in this embodiment, and the new software package is stored in the software warehouse, which can meet the query habits of users and enable the new software package to be queried more quickly.

[0091] For example, the newly created software package in this embodiment is a software package generated using the first system architecture, and the newly created software package is used to implement the data visualization processing function, and the software warehouse to which the target software package generated by the second system architecture for implementing data visualization processing belongs can be obtained. If the target software package belongs to the main warehouse, it is determined that the newly created software package in this implementation also belongs to the main warehouse, and the main warehouse is determined as the software warehouse to which the newly created software package belongs, and the main warehouse is determined as the software source to be updated; if the target software package belongs to the community warehouse, it is determined that the newly created software package in this implementation also belongs to the community warehouse, and the community warehouse is determined as the software warehouse to which the newly created software package belongs, and the community warehouse is determined as the software source to be updated.

[0092] By way of example, the software source may be a software source provided by the operating system in this embodiment, and the source path may be obtained from a source path file for recording the source path.

[0093] For example, the source path file is / etc / apk / repositories file, from the source path file

[0094] The source path of the software source is obtained from / etc / apk / repositories, and then the initial index information of the initial software package in the software source is obtained from the source path. For example, the information in the source path file / etc / apk / repositories includes the corresponding link of the source path of the software source.

[0095] Step 202, obtaining the source path of the software source from the source path file.

[0096] For example, a source path file (eg, source path file / etc / apk / repositories) is opened, the software source required by the user is identified therefrom, and the source path corresponding to the software source is extracted.

[0097] Step 203: Download the initial index information of the initial software package through the source path.

[0098] Specifically, in the directory corresponding to the source path, the initial index information of the initial software package is downloaded.

[0099] For example, the directory corresponding to the source path includes the initial software package and the initial index compressed package APKINDEX.tar.gz. The initial index compressed package is downloaded and decompressed to obtain the initial index file APKINDEX containing the initial index information and the description file DESCRIPTION containing the system information of the build system. The build system is the operating system that builds the initial software package and the initial index file in the software source. The initial index information of the initial software package can be extracted from the initial index file APKINDEX.

[0100] Step 204: construct a new software package locally and obtain new index information of the new software package.

[0101] The method of this step has been described in the aforementioned step 102 and will not be repeated here.

[0102] Step 205: merge the initial index information and the newly created index information to obtain merged index information.

[0103] The merged index information includes multiple index information segments of multiple software packages, and the index information segments include software package identifiers of the software packages corresponding to the index information.

[0104] In this embodiment, the merged index information includes the index information segments of all initial software packages and the index information segments of all newly created software packages. The index information segment is a part of the merged index information, and the index information segment reflects the index information of the corresponding software package. The software package identifier can be a software package name, number, or other information that can uniquely identify the software package.

[0105] Furthermore, the newly created index information includes at least one index information segment of a newly created software package, an index information segment of the newly created software package, including information such as a software package identifier of the corresponding newly created software package; the initial index information includes at least one index information segment of an initial software package, an index information segment of the initial software package, including information such as a software package identifier of the corresponding initial software package.

[0106] The format of the index information segment of the newly created software package in the newly created index information is the same as the format of the index information segment of the initial software package in the initial index information. The index information segments of the newly created software package and the initial software package both include the software package identifier of the corresponding software package.

[0107] Furthermore, the index information segment of each initial software package in the initial index information includes the checksum of the initial software package shown in step 101, the name of the initial software package, the version number, the applicable architecture, the software package size, the software package installation size, the description of the initial software package, the URL of the initial software package, the license information of the initial software package, the original name, the maintainer information, the build timestamp, the dependencies, etc.

[0108] The index information segment of each newly created software package in the newly created index information includes the checksum of the newly created software package, the name of the newly created software package, the version number, the applicable architecture, the software package size, the software package installation size, the description of the newly created software package, the URL of the newly created software package, the license information of the newly created software package, the original name, the maintainer information, the build timestamp, the dependency relationship, etc. For details, please refer to the index information format of the initial software package in step 101, which will not be repeated here.

[0109] Step 206, sorting the multiple index information segments according to the software package identifier and the preset sorting strategy to obtain sorted merged index information.

[0110] For example, the software package identifier is the software package name, and the first letter of the software package name or the first letter of the pinyin of the software package name can be obtained, and the index information segments to which each software package identifier belongs are sorted in the order of letter a to letter z; the index information segments to which each software package identifier belongs can also be sorted in the order of letter z to letter a.

[0111] For another example, the software package identifier is a software package number, and the index information segments to which the software package identifiers belong may be sorted in order of numbers from large to small, or from small to large.

[0112] Step 207: determine the sorted merged index information as updated index information.

[0113] The sorted merged index information includes index information of all software packages arranged according to software package identifiers and preset sorting strategies. The index information of all software packages includes initial index information of all initial software packages to be merged and newly created index information of all newly created software packages.

[0114] According to the software package identifier and the preset sorting strategy, multiple index information segments are sorted to obtain sorted merged index information, and the sorted merged index information is determined as the update index information. When the user subsequently downloads the required software package from the updated software source, the software package management tool can respond to the software package identifier (e.g., software package name) input by the user, quickly determine the software package identifier that matches the software package identifier input by the user from the sorted update index information, and download the software package corresponding to the matching software package identifier.

[0115] Step 208: Perform digital signature processing on the update index information to obtain the updated index information with the signature.

[0116] For example, the abuild-sign command may be used to perform digital signature processing on the update index information to obtain the update index information processed with the signature.

[0117] Specifically, use the abuild-sign command to sign the compressed package containing all update index information. After signing, the file format remains unchanged, but the file size increases.

[0118] For example, the compressed package including the update index information is APKINDEX.tar.gz.21200. The APKINDEX file including the update index information is digitally signed by executing the command abuild-sign APKINDEX.tar.gz.21200. The file format remains unchanged before and after signing, both of which are tar.gz. The size of APKINDEX.tar.gz.21200 before signing is 129kb. Because the signature information is added, the file size will increase after the signing process. For example, the above file may increase to 794kb.

[0119] Step 209: Use the updated index information processed with the signature to replace the initial index information.

[0120] The updated index information processed with the signature is used to replace the initial index information, thereby ensuring the integrity and credibility of the updated index information.

[0121] For example, the update index information is recorded in the update index file, and the update index file is compressed to obtain an update index compressed package. The update index compressed package is digitally signed to obtain a signed update index compressed package, and the update index compressed package is used to replace the initial index compressed package. The initial index compressed package includes the initial index file, and the initial index file records the initial index information.

[0122] Step 210, adding the newly created software package to the software source, so that the newly created software package and the initial software package are stored together in the software source.

[0123] The method of this step has been described in the aforementioned step 104 and will not be repeated here.

[0124] In this embodiment, a source path file is obtained, and the source path of the software source is obtained from the source path file. Through the source path, the initial index information of the initial software package can be accurately obtained. A new software package is constructed, and the initial index information and the new index information are merged to obtain the merged index information. The multiple index information segments in the merged index information are sorted according to the software package identifier and the preset sorting strategy, and the sorted merged index information is determined as the updated index information. Based on the updated index information, the user can quickly obtain the required software package. The updated index information is digitally signed to obtain the updated index information with high integrity and credibility. The updated index information with the signature is used to replace the initial index information, and the newly created software package is added to the software source to be stored in the software source together with the initial software package. Therefore, there is no need to create a new software warehouse, and therefore there is no need to change the configuration file according to the address of the new software warehouse, and inform the user of the configuration file changes. The method is simple and greatly improves the update efficiency.

[0125] In one embodiment, after determining the sorted merged index information as updated index information in step 207, the method further includes:

[0126] Step 211, setting the operation authority for reading and writing the update index information, and obtaining the update index information with the authority setting.

[0127] The read and write operation permissions may include: reading and / or writing operations on update index information.

[0128] Furthermore, a read operation refers to reading required index information from the update index information, and a write operation refers to adding or deleting update index information from the update index information.

[0129] For example, the update index information is recorded in the update index file APKINDEX. The update index file APKINDEX can be compressed into an update index compressed package APKINDEX.tar.gz. The update index compressed package APKINDEX.tar.gz is digitally signed using the abuild-sign command, and read and write permissions are set for the update index compressed package APKINDEX.tar.gz.

[0130] For example, the operation permission can be set to 644. 644 is a common file permission that specifies that the creator of a file has the permission to read and write operations (6), while other users only have the permission to read operations (4). After the operation permission is set to 644, the creator of the update index file has the permission to read and write operations, while the user who needs to download the software package through the update index file only has the permission to read operations.

[0131] For another example, the operation permission may be set to 666. After the update index information is set to 666, the creator of the update index file and the user who downloads the software package through the update index file have read and write permissions.

[0132] Step 212: Use the updated index information set by the permission to replace the initial index information.

[0133] For example, the initial index compression package including the initial index information may be replaced by the updated index compression package including the updated index information.

[0134] Step 213: merge the initial index information and the newly created index information to obtain merged index information.

[0135] The merged index information includes multiple index information segments of multiple software packages, the index information segments correspond to the software packages one by one, and the index information segments include software package identifiers of the software packages corresponding to the index information segments.

[0136] The method of this step has been described in the aforementioned step 205 and will not be repeated here.

[0137] Step 214: Count the total number of all software package identifiers in the merged index information, and determine the total number of software package identifiers as the total number of all software packages in the merged index information.

[0138] For example, the index information segment includes a third description field for describing the software package identifier. The software package identifier can be extracted from the third description field, and the total number of software package identifiers can be counted.

[0139] For example, the number of the third description fields may be counted, and the number of the third description fields may be determined as the total number of all software packages in the merged index information.

[0140] Step 215: When it is identified that the total number of all software packages is equal to the sum of the first number of initial software packages and the second number of newly created software packages, the merged index information is determined as updated index information.

[0141] The first number is the number of initial software packages, and the second number is the number of newly created software packages. When the total number of software packages corresponding to the merged index information is equal to the sum of the first number and the second number, it means that the merged index information includes the index information of all initial software packages and the index information of all newly created software packages.

[0142] The first quantity of the initial software packages is obtained through the initial index information; and the second quantity of the updated software packages is obtained through the updated index information.

[0143] For example, the initial index information may include at least one first description field for describing a software package identifier (e.g., a software package name); the first description field corresponds to the initial software package one by one. The number of first description fields in the initial index information may be counted, and the number of first description fields in the initial index information may be determined as the first number of initial software packages.

[0144] For example, the initial software package identifier may be obtained according to the first description field, the number of the initial software package identifiers may be counted, and the number of the initial software package identifiers may be determined as the first number of initial software packages.

[0145] For example, the first description field includes a keyword for indexing the software package identifier of the initial software package and a specific software package identifier. The number of keywords for indexing the software package identifier of the initial software package in the initial index information is obtained, and the number is determined as the first number; the number of code lines where the keyword for indexing the software package identifier of the initial software package is located in the initial index information can also be obtained, and the number of code lines is determined as the first number.

[0146] In one embodiment, the software package identifier of the initial software package is the software package name of the initial software package, and the first description field may be P:3proxy, which indicates P: initial software package name (3proxy), wherein the letter P is a keyword for indexing the software package identifier of the initial software package, and 3proxy is a specific software package identifier.

[0147] Specifically, the keyword is usually represented by a capital letter (for example, P) and is at the beginning of each line. When obtaining the first quantity, the number of lines starting with capital letter P in the initial index information can be counted, and the number of lines starting with capital letter P is the first quantity of the initial software package.

[0148] For example, the newly created index information may include at least one second description field for describing a software package identifier (e.g., a software package name); the second description field corresponds to the newly created software package one by one. The number of the second description fields in the newly created index information may be counted, and the number of the second description fields in the newly created index information may be determined as the second number of newly created software packages.

[0149] For example, the newly created software package identifiers may be acquired according to the second description field, the number of newly created software package identifiers may be counted, and the number of newly created software package identifiers may be determined as the second number of newly created software packages.

[0150] For example, the second description field includes a keyword for indexing the software package identifier of the newly created software package and a specific software package identifier. The number of keywords for indexing the software package identifier of the newly created software package in the newly created index information is obtained, and the number is determined as the second number; the number of code lines where the keyword for indexing the software package identifier of the newly created software package is located in the newly created index information can also be obtained, and the number of code lines is determined as the second number.

[0151] In one embodiment, the software package identifier of the newly created software package is the software package name of the newly created software package, and the first description field may be P:4proxy, which indicates P: initial software package name (4proxy), wherein the sub-string P is a keyword used to index the software package identifier of the initial software package.

[0152] Specifically, the keyword is usually represented by a capital letter and is at the beginning of each line. When obtaining the first quantity, the number of lines starting with a capital letter P in the initial index information is counted, and the number of lines starting with a capital letter P is the second quantity of the initial software package.

[0153] When the total number of all software packages is equal to the sum of the first number of initial software packages and the second number of newly created software packages, it indicates that the initial index information and the newly created index information are merged successfully, and the merged index information is determined as the updated index information. After the initial index information is subsequently replaced by the used index information, the user can successfully obtain the required initial software package and / or the newly created software package based on the updated index information.

[0154] In one embodiment, after step 214, the method further includes:

[0155] Step 216: When the total number is not equal to the sum of the first number and the second number, the initial index information and the newly created index information are re-merged until the total number obtained is equal to the sum of the first number and the second number.

[0156] When the total number of software packages corresponding to the merged index information is not equal to the sum of the first number and the second number, it means that the merged index information does not include the index information of all initial software packages and the index information of all newly created software packages. In this case, it means that the index information of some software packages is omitted in the merged index information, and the merging of the index information is unsuccessful. Among them, the problem of missing the index information of some software packages may be caused by the user's operational errors during the actual operation process. For example, in the process of merging the initial index information and the newly created index information, part of the newly created index information or the initial index information is mistakenly deleted.

[0157] Furthermore, when the total number is not equal to the sum of the first number and the second number, the initial index information and the newly created index information are re-merged until the total number obtained is equal to the sum of the first number and the second number, and new merged index information is obtained, and the new merged index information is determined as the updated index information.

[0158] Further, when it is identified that the total number of software packages is not equal to the sum of the first number and the second number, the operation of merging the initial index information and the newly created index information is re-executed to obtain new merged index information, until the total number of all software packages corresponding to the new merged index information is equal to the sum of the first number and the second number, and the new merged index information is determined as the updated index information. The updated index information thus obtained includes the index information of all initial software packages and the index information of all newly created software packages. After the initial index information is subsequently replaced with the updated index information, the user can successfully obtain the required initial software packages and / or newly created software packages based on the updated index information.

[0159] In one embodiment, the update index information is recorded in the update index file. Correspondingly, after step 207, the method further includes:

[0160] Step 217, obtaining a system description file.

[0161] Specifically, the system description file records system information of a construction system, where the construction system is an operating system for constructing an initial software package and an initial index file in a software source.

[0162] For example, the system information may include a system name of a build system, a system version, or other system information.

[0163] The system description file is stored in the software source of the system construction, and the system description file can be downloaded from the software source. For example, in this embodiment, the initial index file APKINDEX.tar.gz can be downloaded from the software source of the system construction, and the initial index file APKINDEX.tar.gz can be decompressed to obtain the initial index file APKINDEX and the system description file DESCRIPTION.

[0164] Step 218, compressing the update index file and the system description file into an update index compressed package.

[0165] For example, the update index file and the system description file are compressed into an update index compressed package having the same format as the initial index compressed package, wherein the initial index compressed package includes the initial index file and the system description file, and the initial index file includes the initial index information.

[0166] Step 219: Use the updated index compressed package to replace the initial index compressed package in the software source.

[0167] The initial index compression package includes a system description file and an initial index file recording initial index information.

[0168] When a new software package is built using a packaging tool, new index information of the new software package can be obtained, and the new index information is the index information not included in the software source before the update. Therefore, it is necessary to merge the initial index information of the initial software package and the new index information of the new software package to obtain the updated index information, and use the updated index information to replace the initial index information in the software source to update the index information in the software source, so that the updated software source includes the initial index information and the new index information.

[0169] The update index information includes index information of multiple software packages (including initial software packages and newly created software packages); one software package corresponds to one index information segment, and the index information segment of each software package includes information such as the software package name, version number, and applicable architecture of the corresponding software package. The format of the index information segment corresponding to each software package is the same, that is, the index information segment corresponding to each software package includes the same type of parameters, which can be specifically referred to the parameters included in the initial software package index information in step 101, and will not be repeated here.

[0170] For example, the applicable architecture, version number, website address and other information of the software package can be indexed from the update index information according to the software package identifier (eg, software package name), and the software package can be obtained and installed according to the information.

[0171] For example, execute "abuild index" in the directory of the specific newly created software package to complete the update of the index information of the software source in the system environment.

[0172] Specifically, the abuild index implementation mechanism is as follows:

[0173] Search for all packages in the build environment in turn, including initial packages and newly created packages, and then execute the following instructions:

[0174] apk index --quiet --index APKINDEX.tar.gz --output APKINDEX.tar.gz.21200

[0175] --description description information --rewrite-arch loongarch64*.apk;

[0176] Specifically, the purpose of executing this command is to create a new APK index file (APKINDEX.tar.gz.21200), which contains information about all .apk files in the current directory, rewrites the architecture of all software packages to loongarch64, and adds a specific description for this index.

[0177] abuild-sign-q APKINDEX.tar.gz.21200;

[0178] Specifically, the purpose of executing this command is to sign the APK index file named APKINDEX.tar.gz.21200.

[0179] chmod 644APKINDEX.tar.gz.21200;

[0180] Specifically, the purpose of executing this command is to modify the user's read and write permissions.

[0181] mv APKINDEX.tar.gz.21200APKINDEX.tar.gz;

[0182] Specifically, after the command is executed, the execution result of APKINDEX.tar.gz obtained is the updated index information.

[0183] However, the system description file is a file that records the system information of the build system, and the build system is the operating system that builds the initial software package and initial index file in the software source. When building a new software package, the system information of the build system remains unchanged. Therefore, there is no need to update the system information. The update index file and system description file can be directly compressed into an update index compressed package.

[0184] By replacing the initial index compressed package in the software source with the updated index compressed package, the index information in the software source can be updated, and the initial index information before the update can be updated to the updated index information that combines the initial index information and the newly created index information.

[0185] In addition, the update index compressed package is a compressed package obtained by compressing the update index file and the system description file. Therefore, the system information recorded in the system description file is still retained in the updated software source, ensuring the information integrity of the updated software source.

[0186] Figure 4 is a flowchart of another software source update method provided by an embodiment of the present invention, referring to Figure 4 , the method may include the following steps:

[0187] Step S1, open the / etc / apk / repositories file that records the source path of the software source, obtain the source path of the software source, and clean and update the directory file / var / cache / apk / .

[0188] Specifically, obtain the / etc / apk / repositories file from the official platform and open it, obtain the source path of the software source from the opened / etc / apk / repositories file, and obtain the directory file / var / cache / apk / for caching the index compressed package in the directory corresponding to the source path.

[0189] In this embodiment, the directory file / var / cache / apk / is cleaned up in the construction environment to delete the historical index compressed packages and other historical files stored therein, and then the directory file / var / cache / apk / is updated to obtain the latest index compressed package.

[0190] Step S2, downloading the initial index compression package APKINDEX(0).tar.gz from the software source and decompressing it to obtain the initial index file APKINDEX(0) and the system description file DESCRIPTION.

[0191] Specifically, the latest index compression package is downloaded from the cleaned and updated directory file / var / cache / apk / , and the latest index compression package is determined as the initial index compression package APKINDEX(0).tar.gz.

[0192] Use the decompression tool tar to decompress the initial index compressed package APKINDEX(0).tar.gz to obtain the initial index file APKINDEX(0) and the system description file DESCRIPTION. After the decompression tool obtains these two files by decompression, it obtains the first number of initial software packages contained in APKINDEX(0). Specifically, after the decompression is completed, retrieve and count the number of fields (for example, the "P:" field) that describe the initial software package identifier in APKINDEX(0), and determine the number as the first number of initial software packages contained in APKINDEX(0). Furthermore, the number of "P:" fields can be retrieved and counted according to the following instructions: cat APKINDEX|grep "P:"|wc -l.

[0193] Step S3, compile the newly created software package and obtain a newly created index file of the newly created software package.

[0194] A new software package can be created and compiled in different build environments. Furthermore, a package management tool can be used to compile and create at least one new software package in each build environment. The at least one new software package created and compiled in each build environment corresponds to a compressed package APKINDEX.tar.gz. After decompressing the compressed package, an index file APKINDEX and a system description file DESCRIPTION can be obtained, as well as a second number of new software packages corresponding to the index file APKINDEX. Among them, an index file APKINDEX includes an index information segment of at least one new software package.

[0195] Furthermore, a directory is set for the environment variable REPODEST, which is used to store the path of the newly created index file. The newly constructed software package is stored in the set directory path, and the software package is built through the abuild instruction. It should be noted that when the software package is built through the abuild instruction, a software package in APK format and a compressed package APKINDEX.tar.gz containing the newly created index file can be obtained. Unzip APKINDEX.tar.gz to obtain the newly created index file APKINDEX and the system description file DESCRIPTION contained in the compressed package.

[0196] Step S4, merging the initial index file APKINDEX(0) and the newly created index file to obtain an updated index file APKINDEX(1).

[0197] For example, if there is one new software package built in the same build environment, the corresponding index file APKINDEX includes the index information segment of the new software package. For example, if there are multiple new software packages built in the same build environment, the corresponding index file APKINDEX includes multiple index information segments of multiple new software packages, and the index information segments correspond to the new software packages one by one. The index information includes the software package name and software package address of the corresponding new software package, as well as other index information corresponding to the new software package.

[0198] The initial index file APKINDEX (0) is recorded as index0, and the index files APKINDEX obtained when building a new software package in each construction environment are marked as index files index1, index2, index3...indexn, where n is the total number of index files APKINDEX.

[0199] The contents of index files index1, index2, index3, ..., indexn are integrated into the initial index file index0. Specifically, the contents of index files index1, index2, index3, ..., indexn are appended to the index file index0 in sequence to obtain an updated new index file index.

[0200] The new index file index includes at least one index information segment of a software package, each of which is used to describe information of a corresponding software package. The index information segment includes at least an identifier of the corresponding software package, and the software package identifier may be a name of the software package.

[0201] Get the first letter of the software package name, or the first letter of the phonetic spelling of the software package name, and arrange the index information segments in order from a to z, or from z to a, to obtain the sorted index file index. The sorted index file index can be used as the update index file APKINDEX(1).

[0202] Step S5, obtaining the total number of software packages corresponding to the update index file APKINDEX(1).

[0203] For example, the update index file APKINDEX(1) includes a plurality of index information segments, each of which corresponds to a software package, and each of which has a software package identifier of the corresponding software package. The total number of software package identifiers in the update index file APKINDEX(1) can be counted and determined as the total number of software packages corresponding to the update index file APKINDEX(1).

[0204] The update index file APKINDEX(1) includes at least one index information segment of a software package, each index information segment includes a software package identifier of the corresponding software package and a keyword used to index the software package identifier; the number of keywords used to index the software package identifier in the update index file APKINDEX(1) or the number of code lines where the keywords are located is obtained, and the number of keywords or the number of code lines is determined as the total number of software package identifiers in the update index file APKINDEX(1).

[0205] For example, the keyword used to index the software package identifier is P, and the keyword used to index the software package identifier and the code corresponding to the specific software package identifier are: P: software package name. The keyword P is located at the beginning of the code line to which it belongs. The number of the code line to which the keyword belongs can be obtained by the following command, and the number of lines is determined as the total number of software package identifiers in the update index file APKINDEX(1): cat APKINDEX(1)|grep "P:"|wc -l.

[0206] For example, the index information segment includes a description field for describing the software package identifier of the corresponding software package, and the total number of description fields in the update index file APKINDEX(1) is counted and determined as the total number of software packages.

[0207] Step S6, determining whether the total number of software packages is equal to the sum of the first number of initial software packages and the second number of newly created software packages; if yes, proceed to step S7, otherwise, return to step S4.

[0208] The sum of the first number and the second number is equal to the sum of the numbers of all initial software packages and all newly created software packages. Check whether the total number of software packages corresponding to the update index file APKINDEX(1) is equal to the sum of the first number of initial software packages corresponding to index0 and the second number of all newly created software packages corresponding to index files index1, index2, index3, ..., indexn.

[0209] If the total number of software packages is equal to the sum of the first number of initial software packages and the second number of newly created software packages, it means that the update index file APKINDEX(1) includes index information of all initial software packages and all newly created software packages, and the index file is merged successfully.

[0210] If the total number of software packages is not equal to the sum of the first number of initial software packages and the second number of newly created software packages, it means that the update index file APKINDEX(1) lacks the index information of some initial software packages or the index information of some newly created software packages. In this case, it means that the merging of the initial index information and the newly created index information is wrong, so it is necessary to return to step S4 and re-merge the initial index information and the newly created index information to ensure that the merged newly created index file includes the initial index information of all software packages and the newly created index information of all newly created software packages.

[0211] Step S7, compressing the update index file APKINDEX(1) and the system description file DESCRIPTION into an update index compression package APKINDEX(1).tar.gz.

[0212] In this embodiment, when uploading the update index file in the constructed initial software source, it needs to be compressed into a compressed package in the tar.gz format so that the package management tool adapted to the software source can obtain the index file therein based on the compressed package in the tar.gz format, and retrieve and download the software package according to the index information in the index file.

[0213] Therefore, the update index file APKINDEX(1) and the system description file DESCRIPTION can be compressed into an update index compressed package APKINDEX(1).tar.gz for subsequent uploading of the update index file in tar.gz format, so that the package management tool can retrieve and download the software package required by the user based on the update index file in this format.

[0214] Step S8, digitally sign and set permissions for the update index compression package APKINDEX(1).tar.gz.

[0215] For example, abuild-sign can be used to digitally sign the update index compressed package APKINDEX(1).tar.gz to ensure that when subsequent users download the software package from the updated software source, they can verify the source and integrity of the software package through the digital signature.

[0216] For example, the permission can be set to 644 to ensure that when subsequent users download software packages from the updated software source, they only have the permission to read the update index file but not the permission to modify the update index file, so as to prevent the update index file from being modified arbitrarily by unauthorized users, thereby causing errors in the update index file.

[0217] Furthermore, the chmod command may be used to set permissions for the update index compression package APKINDEX(1).tar.gz.

[0218] Step S9, uploading the updated index compressed package APKINDEX(1).tar.gz with digital signature and permission settings, and the newly created software package to the software source.

[0219] Specifically, the updated index compressed package APKINDEX(1).tar.gz with digital signature and permission settings is used to replace the initial index compressed package APKINDEX(0).tar.gz in the software source, and the newly created software package is uploaded to the software source and stored in the software source together with the initial software package in the software source.

[0220] Figure 5 is a block diagram of a software source updating device provided by an embodiment of the present invention, such as Figure 5 As shown, the device 30 comprises:

[0221] The download module 301 is used to download the initial index information of the initial software package from the software source; the initial index information is used to index the initial software package from the software source;

[0222] The construction module 302 is used to construct a new software package locally and obtain new index information of the new software package; the new index information is used to index the new software package from the software source;

[0223] A merging module 303 is used to merge the initial index information and the newly created index information to obtain updated index information;

[0224] The updating module 304 is used to replace the initial index information in the software source with the updated index information, and add the newly created software package to the software source so that the newly created software package and the initial software package are stored together in the software source.

[0225] Optionally, the updating module 304 may include:

[0226] The signature submodule is used to perform digital signature processing on the update index information to obtain the update index information processed with the signature;

[0227] The first replacement submodule is used to replace the initial index information with the updated index information processed by the signature.

[0228] Optionally, the updating module 304 may further include:

[0229] The permission setting submodule is used to set the operation permission for reading and writing the update index information, and obtain the update index information of the permission setting;

[0230] The second replacement submodule is used to replace the initial index information with the updated index information set by the permission.

[0231] Optionally, the merging module 303 may include:

[0232] A first merging submodule is used to merge the initial index information and the newly created index information to obtain merged index information; the merged index information includes multiple index information segments of multiple software packages, and the index information segments include software package identifiers of the software packages corresponding to the index information segments;

[0233] A sorting submodule is used to sort the multiple index information segments according to the software package identifier and the preset sorting strategy to obtain sorted merged index information;

[0234] The first determining submodule is used to determine the sorted merged index information as the updated index information.

[0235] Correspondingly, the merging module 303 may further include:

[0236] A second merging submodule is used to merge the initial index information and the newly created index information to obtain merged index information; the merged index information includes multiple index information segments of multiple software packages, and the index information segments include software package identifiers of the software packages corresponding to the index information segments;

[0237] A second determining submodule is used to count the total number of all software package identifiers in the merged index information, and determine the total number of software package identifiers as the total number of all software packages in the merged index information;

[0238] The third determining submodule is configured to determine the merged index information as the updated index information when it is identified that the total number of all software packages is equal to the sum of the first number of initial software packages and the second number of newly created software packages.

[0239] Optionally, the merging module 303 may further include:

[0240] The execution submodule is used to re-merge the initial index information and the newly created index information when the total number is not equal to the sum of the first number and the second number, until the total number obtained is equal to the sum of the first number and the second number.

[0241] Optionally, the update index information is recorded in an update index file; the update module 304 may include:

[0242] The first acquisition submodule is used to acquire a system description file; the system description file records system information of the constructed system;

[0243] The compression submodule is used to compress the update index file and the system description file into an update index compressed package;

[0244] The third replacement submodule is used to replace the initial index compressed package in the software source with the updated index compressed package; the initial index compressed package includes a system description file and an initial index file recording initial index information.

[0245] Optionally, the download module 301 may include:

[0246] The second acquisition submodule is used to acquire a source path file; the source path file records the source path of the software source;

[0247] The third acquisition submodule is used to obtain the source path of the software source from the source path file;

[0248] The download submodule is used to download the initial index information of the initial software package through the source path.

[0249] This embodiment obtains initial index information and merges the newly created index information of the newly created software package with the initial index information, so as to update the initial index information in the software source according to the obtained updated index information, and upload the newly created software package to the software source. Compared with the method of the related art, this embodiment does not need to create a new software warehouse, so it is not necessary to change the configuration file according to the address of the newly created software warehouse, and the configuration file changes are notified to the user, which greatly improves the update efficiency.

[0250] Figure 6 4 is a block diagram of an electronic device 400 according to an exemplary embodiment. For example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0251] Reference Figure 6 , the electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .

[0252] The processing component 402 generally controls the overall operation of the electronic device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.

[0253] The memory 404 is used to store various types of data to support the operation of the electronic device 400. Examples of such data include instructions for any application or method operating on the electronic device 400, contact data, phone book data, messages, pictures, multimedia, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0254] The power supply component 406 provides power to the various components of the electronic device 400. The power supply component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 400.

[0255] The multimedia component 408 includes a screen that provides an output interface between the electronic device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the electronic device 400 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0256] The audio component 410 is used to output and / or input audio signals. For example, the audio component 410 includes a microphone (MIC), and when the electronic device 400 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio signals.

[0257] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0258] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the electronic device 400. For example, the sensor assembly 414 can detect the open / closed state of the electronic device 400, the relative positioning of components, such as the display and keypad of the electronic device 400, and the sensor assembly 414 can also detect the position change of the electronic device 400 or a component of the electronic device 400, the presence or absence of user contact with the electronic device 400, the orientation or acceleration / deceleration of the electronic device 400, and the temperature change of the electronic device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0259] The communication component 416 is used to facilitate wired or wireless communication between the electronic device 400 and other devices. The electronic device 400 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0260] In an exemplary embodiment, the electronic device 400 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to implement a software source update method provided in an embodiment of the present invention.

[0261] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of an electronic device 400 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0262] Figure 7is a block diagram of an electronic device 500 according to an exemplary embodiment. The electronic device 500 may be provided as a server. Figure 7 The electronic device 500 includes a processing component 522, which further includes one or more processors, and a memory resource represented by a memory 532 for storing instructions executable by the processing component 522, such as an application. The application stored in the memory 532 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 522 is configured to execute instructions to perform a software source update method provided by an embodiment of the present invention.

[0263] The electronic device 500 may also include a power supply component 526 configured to perform power management of the electronic device 500, a wired or wireless network interface 550 configured to connect the electronic device 500 to a network, and an input / output (I / O) interface 558. The electronic device 500 may operate based on an operating system stored in the memory 532, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0264] An embodiment of the present invention further provides a computer program product, including a computer program, and a software source updating method implemented when the computer program is executed by a processor.

[0265] Those skilled in the art will readily appreciate other embodiments of the invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.

Claims

1. A method for updating a software source, characterized in that: include: Download the initial index information of the initial packages from the software source; The initial index information is used to index the initial software package from the software source; Building a new software package locally and obtaining new index information of the new software package; The newly created index information is used to index the newly created software package from the software source; Merging the initial index information and the newly created index information to obtain updated index information; The updated index information is used to replace the initial index information in the software source, and the newly created software package is added to the software source, so that the newly created software package and the initial software package are stored together in the software source.

2. The method according to claim 1, characterized in that The merging of the initial index information and the newly created index information to obtain updated index information includes: Merging the initial index information and the newly created index information to obtain merged index information; the merged index information includes multiple index information segments of multiple software packages, and the index information segments include software package identifiers of the software packages corresponding to the index information segments; Sorting the plurality of index information segments according to the software package identifier and a preset sorting strategy to obtain sorted merged index information; The sorted merged index information is determined as the updated index information.

3. The method according to claim 1, characterized in that The merging of the initial index information and the newly created index information to obtain updated index information includes: Merging the initial index information and the newly created index information to obtain merged index information; the merged index information includes multiple index information segments of multiple software packages, and the index information segments include software package identifiers of the software packages corresponding to the index information segments; Counting the total number of all the software package identifiers in the combined index information, and determining the total number of the software package identifiers as the total number of all the software packages in the combined index information; When it is identified that the total number of all the software packages is equal to the sum of the first number of the initial software packages and the second number of the newly created software packages, the merged index information is determined as the update index information.

4. The method according to claim 3, characterized in that The method further comprises: When the total number is not equal to the sum of the first number and the second number, the initial index information and the newly created index information are re-merged until the total number obtained is equal to the sum of the first number and the second number.

5. The method according to claim 1, characterized in that The update index information is recorded in the update index file; Then, using the updated index information to replace the initial index information in the software source includes: Obtaining a system description file; the system description file records system information for building the system; Compressing the update index file and the system description file into an update index compressed package; The updated index compressed package is used to replace the initial index compressed package in the software source; the initial index compressed package includes the system description file and the initial index file recording the initial index information.

6. The method according to claim 1, characterized in that The using the updated index information to replace the initial index information in the software source includes: Performing digital signature processing on the update index information to obtain the update index information processed with the signature; The updated index information processed with the signature replaces the initial index information.

7. The method according to claim 1, characterized in that The using the updated index information to replace the initial index information in the software source includes: Setting the operation authority for reading and writing the update index information, and obtaining the update index information with the authority setting; The updated index information set using the authority replaces the initial index information.

8. The method according to claim 1, characterized in that: Download the initial index information of the initial packages from the software source, including: Obtaining a source path file; the source path file records the source path of the software source; Obtaining the source path of the software source from the source path file; The initial index information of the initial software package is downloaded through the source path.

9. A software source updating device, characterized in that: include: A download module, used to download the initial index information of the initial software package from the software source; The initial index information is used to index the initial software package from the software source; A construction module, used to locally construct a new software package and obtain new index information of the new software package; The newly created index information is used to index the newly created software package from the software source; A merging module, used for merging the initial index information and the newly created index information to obtain updated index information; The update module is used to use the update index information to replace the initial index information in the software source, and add the newly created software package to the software source so that the newly created software package and the initial software package are stored together in the software source.

10. An electronic device, characterized in that: The invention comprises a processor; and one or more programs, wherein the one or more programs are stored in a memory and are configured to be executed by the one or more processors, wherein the one or more programs include instructions for performing the following operations: Downloading initial index information of an initial software package from a software source; the initial index information is used to index the initial software package from the software source; Building a new software package locally and obtaining new index information of the new software package; The newly created index information is used to index the newly created software package from the software source; Merging the initial index information and the newly created index information to obtain updated index information; The updated index information is used to replace the initial index information in the software source, and the newly created software package is added to the software source, so that the newly created software package and the initial software package are stored together in the software source.

11. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method as claimed in any one of claims 1 to 8.