Software package construction method and device and related equipment
By obtaining historical construction information and dependencies, priority is given to building dependent software packages, the problem of invalid and repeated construction in software development is solved, and development efficiency and user experience is improved.
Patent Information
- Application Number
- CN202310970621.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-06-09
- Filing Date
- 2023-08-02
- Publication Date
- 2024-12-10
AI Technical Summary
During the software development process, the construction tool is invalid and repeated construction due to the dependencies between software packages, which affects the development efficiency.
By obtaining historical construction information, determine the software packages that need to be rebuilt and their dependencies, and prioritize the dependent software packages to avoid invalid duplicate construction.
It improves the efficiency of software package construction, reduces the number of source code construction times, estimates the build time, and improves the user experience.
Smart Images

Figure CN119105789A_ABST
Abstract
Description
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 9, 2023, with application number 202310684680.2 and application name “A method for building a software package”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a software package construction method, apparatus and related equipment. Background Art
[0003] Building a software package refers to the process of converting the source code of the software into an executable software package, wherein the obtained software package refers to one or more groups of programs with specific functions and used to complete specific tasks. Exemplarily, the software package may include one or more Red Hat Package Managers (RPMs), and each RPM is used to implement at least one function in the software. In the process of software development, developers can use build tools to build software packages corresponding to each software in the development project.
[0004] In actual application scenarios, the source code of some software in the development project may change, such as when the developer optimizes the code logic of this part of the software. At this time, the user can use the build tool to adopt the incremental build method to build a new software package corresponding to this part of the software. Since there are usually dependencies between the software packages corresponding to multiple software in the development project, such as the construction of software package a depends on the completion of the construction of software package b first, each time the build tool rebuilds the software package corresponding to a software, it will also rebuild all other software packages that depend on this software package, which will cause the build tool to execute a large number of invalid repeated software package construction processes, thereby affecting the overall development efficiency of the development project.
[0005] For example, suppose that the development project includes software A, B, C, and D. The software packages constructed based on these four software are software package a, software package b, software package c, and software package d, respectively. Moreover, the construction of software package a depends on the completion of the construction of software packages b, c, and d first. When the source code of software B, C, and D changes, the construction tool can rebuild a new software package b based on the source code of software B. Since software package a depends on software package b, after rebuilding software package b, the construction tool will also rebuild software package a that depends on software package b. Then, the construction tool rebuilds a new software package c based on the source code of software C. Since software package a also depends on software package c, the construction tool will rebuild software package a again after building the new software package c. By analogy, the construction tool will repeat the process of building software package a three times in the process of building new software packages b, c, and d. Among them, only the software package a obtained by the last construction is valid, and the processes of building software package a twice before are invalid repeated construction processes.
[0006] Therefore, there is an urgent need for a method to avoid invalid repeated construction of software packages as much as possible. Summary of the invention
[0007] The present application provides a software package construction method to avoid executing the process of invalid and repeated software package construction as much as possible, thereby improving the overall development efficiency of the development project. In addition, the present application also provides a corresponding software package construction device, a computing device, a computer-readable storage medium, and a computer program product.
[0008] In a first aspect, the present application provides a software package construction method, which can be executed by a corresponding software package construction device. Specifically, the software package construction device obtains historical construction information of multiple software, and the historical construction information includes relevant information of the software packages constructed for the multiple software within a historical time period, such as the identification of each sub-software package in the software package constructed for each software in the process of incrementally constructing software packages for multiple software in a development project last time, the dependency relationship between different software packages, and other information; and the software package construction device determines first description information of a first software among the multiple software (such as the identification of the first software, or the storage location of the source code of the first software, etc.), there is a difference between the source code to be constructed of the first software and the constructed source code of the first software, and the source code to be constructed refers to the source code of the first software. The source code of the software package that needs to be rebuilt in the pre-incremental construction process, the built source code refers to the source code used to build the software package within the historical time period; then, the software package construction device determines the second description information (such as the identification of the second software, or the storage location of the source code of the second software) of the second software among the multiple software according to the acquired historical construction information, wherein the second software package corresponding to the second software depends on the first software package corresponding to the first software; finally, the software package construction device constructs the source code to be built of the first software and the source code to be built of the second software respectively according to the first description information, the second description information, and the historical construction information, and obtains the first software package and the second software package, wherein the source code to be built of the first software is constructed before the source code to be built of the second software. The software package construction device can obtain the source code to be built of the first software and the second software from the third-party hosting platform according to the first description information and the second description information, or can obtain the source code to be built of all software before determining the first description information and the second description information, and then filter out the source code to be built of the first software and the second software.
[0009] Since, in the process of incrementally building multiple software, the description information of all software (i.e., the first software and the second software) that need to rebuild the software package among the multiple software is first determined, and the source code of the first software corresponding to the first software package that is relied on is preferentially built according to the description information and the historical construction information, the source code of the first software can be built only once during the entire incremental building process, thereby avoiding invalid construction of the source code of the first software by repeated multiple times, thereby improving the incremental building efficiency of the software package and improving the overall development efficiency of the development project. In addition, since it is possible to determine which software needs to rebuild the software package according to the first description information and the second description information, and the source code of each software can be built only once, the time required to build the software packages corresponding to the source codes of these software can be estimated, thereby predicting the end time of the incremental building process and improving the user experience.
[0010] In a possible implementation, when the software package construction device constructs the source code to be constructed of the first software and the source code to be constructed of the second software, the software package construction device may first construct the source code to be constructed of the first software according to the first description information to obtain the first software package, and determine that the first sub-package in the first software package on which the second software package depends has changed according to the historical construction information, so that the software package construction device then constructs the source code to be constructed of the second software according to the second description information to obtain the second software package. Optionally, if the first sub-package in the first software package on which the second software package depends has not changed, the software package construction device may not need to rebuild the software package for the second software. Since the software package is rebuilt for the second software only when it is determined that the sub-package in the first software package on which the second software package depends has changed, this can avoid the invalid construction of the second software package being repeated multiple times, thereby further improving the incremental construction efficiency of the software package and improving the overall development efficiency of the development project.
[0011] In a possible implementation, the first software package may include multiple sub-packages, each of which may be, for example, RPM, etc., and each of the multiple sub-packages is used to implement at least one function of the first software, such as an image cropping function, an image zooming function, etc.; in this way, when the software package construction device determines that the sub-package in the first software package on which the second software package depends has changed, it may specifically determine the identifier of the second sub-package on which the historical software package corresponding to the second software depends based on the historical construction information, wherein the historical software package corresponding to the second software is obtained by building the constructed source code of the second software, so that the software package construction device may detect that there is no first sub-package matching the second sub-package in the first software package according to the identifier of the second sub-package, which indicates that the sub-package on which the software package corresponding to the second software depends has changed compared to before, that is, it is determined that the sub-package in the first software package on which the second software package depends has changed. In this way, the software package construction device can determine whether to rebuild the software package for the second software by comparing whether the sub-package on which the software package corresponding to the second software depends has changed, so as to avoid invalidly building the software package for the second software when the sub-package on which it depends has not changed.
[0012] In a possible implementation, the multiple software in the incremental construction process may include a third software in addition to the first software and the second software, and the software package corresponding to the third software depends on the second software package; in this way, when the software package construction device constructs the source code to be constructed of the first software and the source code to be constructed of the second software, it can be determined based on the historical construction information, and the dependency relationship between the first software package, the second software package and the third software package is generated according to the dependency relationship between the first software package, the second software package and the third software package. The first dependency chain indicates that the source code to be constructed of the first software is constructed before the source code to be constructed of the second software, and the second dependency chain indicates that the source code to be constructed of the second software is constructed before the source code to be constructed of the third software; thus, the software package construction device can construct the source code to be constructed indicated in the first dependency chain and the source code to be constructed indicated in the second dependency chain in parallel according to the first description information, the second description information, and the third description information of the third software. In this way, the software package construction device can simultaneously construct software packages for software in multiple dependency chains, which can effectively improve the efficiency of constructing software packages for multiple software, thereby further improving the overall development efficiency of the development project. In actual application, the software package construction device can generate a larger number of dependency chains to achieve a higher degree of concurrency.
[0013] In a possible implementation, the third software package corresponding to the third software depends on the third sub-package in the second software package, and the fourth sub-package in the second software package depends on the first software package. Then, after the second software package is constructed based on the source code to be constructed of the second software, the sub-package on which the software package corresponding to the third software depends is changed to the third sub-package. In this way, the software package construction device rebuilds the software package for the first software, which will only affect the fourth sub-package in the second software package, but will not affect the third sub-package on which the third software package depends, so that the process of the software package construction device building the software package for the third software will not be affected. In this way, the process of the software package construction device concurrently building software packages for software in multiple dependency chains can be independent of each other, while improving the efficiency of incremental construction, and avoiding invalid construction of some software repeated multiple times as much as possible.
[0014] In a possible implementation, the historical construction information also includes the content identifier of the constructed source code of the first software. Then, when the software package construction device determines the first description information of the first software among the multiple software, it can specifically obtain the content identifier of the candidate source code of the first software first, such as by taking a snapshot of the information in the code repository. For example, the content identifier can be the identifier assigned to the candidate source code when it is submitted by the user, the version number, or the information calculated by the digest algorithm. Thus, when the content identifier of the candidate source code of the first software is inconsistent with the content identifier of the constructed source code of the first software, the software package construction device determines the first description information of the first software among the multiple software, and uses the candidate source code as the source code to be constructed, that is, the software package construction device will rebuild the software package for the first software according to the candidate source code (that is, the source code to be constructed). The first description information includes the content identifier of the first software and the indication information of the storage location of the constructed source code of the first software. In this way, the software package construction device can determine the software whose source code has changed by comparing the content identifiers corresponding to the new and old source codes, and thus rebuild the software package for the software by further determining the description information of the software.
[0015] In a possible implementation, the historical build information includes a dependency relationship between a historical software package corresponding to the second software and a historical software package corresponding to the first software, wherein the historical software package corresponding to the second software is obtained by building the constructed source code of the second software, and the historical software package corresponding to the first software is obtained by building the constructed source code of the first software; thus, when the software package building device determines the second description information of the second software among the multiple software, it can specifically be firstly detected from the multiple software according to the historical build information that there is a dependency relationship between the historical software package corresponding to the second software and the historical software package corresponding to the first software, so that the software package building device can determine the second description information of the second software, and the second description information includes the content identifier of the second software and the indication information of the storage location of the constructed source code of the second software. In this way, the software package building device can determine which software packages among the multiple software will depend on the software package corresponding to the first software according to the dependency relationship between the historical software packages corresponding to different software recorded when the multiple software packages are built within the historical time period, and further determine the description information of the part of the software, so as to determine the software whose source code has not changed but still needs to be rebuilt according to the description information.
[0016] In a possible implementation, the software package construction device may also store the content identifier of the source code to be constructed of the first software, the identifier of the sub-package included in the first software package, the content identifier of the source code to be constructed of the second software, the identifier of the sub-package included in the second software package, and the dependency relationship between the first software package and the second software package. For example, the software package construction device may create a new database to record this information, etc. In this way, when it is necessary to incrementally construct software packages for the multiple software packages next time, the software package construction device may incrementally construct software packages for the multiple software packages based on the stored information, while avoiding the situation where the software is repeatedly and invalidly constructed as much as possible, so as to improve the efficiency of the next incremental construction of the software package. Moreover, when tracing problems for the multiple software packages later, the software packages corresponding to the first software and the second software may be repeatedly constructed based on the information recorded in the database, so as to analyze the root cause of the problem based on the constructed software packages.
[0017] In a possible implementation, the software package construction device can also use the first software package to replace the historical software package corresponding to the first software in the second database, and use the second software package to replace the historical software package corresponding to the second software in the second database; wherein the second database includes historical software packages corresponding to multiple software, the historical software package corresponding to the first software is obtained by constructing the constructed source code of the first software, and the historical software package corresponding to the second software is obtained by constructing the constructed source code of the second software. In this way, the software packages stored in the second database are the latest versions of the software packages corresponding to the multiple software, thereby realizing the update of the software packages of the multiple software.
[0018] In a second aspect, the present application provides a software package construction method, which can be executed by a corresponding software package construction device. Specifically, the software package construction device obtains historical construction information of multiple software, and the historical construction information includes relevant information of the software packages constructed for the multiple software within a historical time period, such as the identification of each sub-software package in the software package constructed for each software in the process of incrementally constructing software packages for multiple software in a development project last time, the dependency relationship between different software packages, and other information; and the software package construction device determines first description information of a first software among the multiple software (such as the identification of the first software, or the storage location of the source code of the first software, etc.), there is a difference between the source code to be constructed of the first software and the constructed source code of the first software, the source code to be constructed refers to the source code of the software package that needs to be reconstructed in the current incremental construction process, and the constructed source code refers to the source code used to construct the software package within the historical time period; wherein the determined first description information and second description information are used to indicate the construction of a first software package corresponding to the first software and a second software package corresponding to the second software. In this way, in the process of incrementally building multiple software, the software package building device can determine the description information of all software (i.e., the first software and the second software) that need to rebuild the software package among the multiple software, so that when the corresponding software package is subsequently built according to the description information of these software, the source code of the first software can be built only once, so as to avoid the invalid construction of the source code of the first software being repeated many times, thereby improving the incremental building efficiency of the software package and improving the overall development efficiency of the development project. In addition, since it is possible to determine which software needs to rebuild the software package according to the first description information and the second description information, the source code of each software can be built only once, so the time required to build the software package corresponding to the source code of these software can be estimated, so that the end time of the incremental building process can be expected, and the user experience is improved.
[0019] In a third aspect, the present application provides a software package construction device, wherein the software package construction device includes modules for executing the software package construction method in the first aspect or any possible implementation of the first aspect.
[0020] In a fourth aspect, the present application provides a software package construction device, wherein the software package construction device includes modules for executing the software package construction method described in the first aspect or the second aspect.
[0021] In a fifth aspect, the present application provides a computing device, the computing device comprising a processor and a memory. The processor and the memory communicate with each other. The processor is used to execute instructions stored in the memory, so that the computing device executes the software package construction method in the first aspect or any one of the implementations of the first aspect, or executes the software package construction method in the second aspect. It should be noted that the memory can be integrated into the processor or can be independent of the processor. The computing device may also include a bus. The processor is connected to the memory via the bus. The memory may include a readable memory and a random access memory.
[0022] In a sixth aspect, the present application provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium, which, when executed on a computing device, causes the computing device to execute the operating steps of the software package construction method described in the first aspect or any one of the implementations of the first aspect, or to execute the operating steps of the software package construction method as in the second aspect.
[0023] In a seventh aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device, causes the computing device to execute the operating steps of the software package construction method described in the first aspect or any one of the implementations of the first aspect, or to execute the operating steps of the software package construction method as in the second aspect.
[0024] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram of the structure of an exemplary software package construction system provided in this application;
[0026] Figure 2 A schematic diagram of a software package construction method provided in this application;
[0027] Figure 3 A schematic diagram of historical build information recorded by the software build device 200;
[0028] Figure 4 A schematic diagram for breaking the dependency loop and obtaining the dependency chain;
[0029] Figure 5 A schematic diagram of the structure of another exemplary software package building system provided by the present application;
[0030] Figure 6 A schematic diagram of another software package construction method provided in this application;
[0031] Figure 7A schematic diagram of the structure of a software package building device provided in this application;
[0032] Figure 8 A schematic diagram of the structure of another software package construction device provided in this application;
[0033] Fig. 9 A schematic diagram of the hardware structure of a computing device provided for this application;
[0034] Fig.10 A schematic diagram of the hardware structure of a computing device cluster provided for this application. DETAILED DESCRIPTION
[0035] In order to avoid executing the process of invalidly and repeatedly building a software package as much as possible, the present application provides a software package building method, by determining all the software that needs to rebuild the software package among the multiple software, and preferentially building the source code of the first software corresponding to the dependent first software package, thereby reducing the number of times the source code of the first software is built, such as the source code of the first software is only built once, thereby avoiding invalid construction of the source code of the first software repeatedly, thereby improving the incremental construction efficiency of the software package and improving the overall development efficiency of the development project.
[0036] To facilitate understanding of the technical solution of the present application, the relevant technical terms involved in the present application are explained below.
[0037] Source code, also known as source program, refers to an uncompiled text file written in accordance with certain programming language specifications, including a series of computer language instructions.
[0038] Software refers to a collection of computer data and instructions organized in a specific order, including computer programs, procedures, rules, and possible files, documents, and data related to the operation of a computer system.
[0039] A software package is a group or multiple groups of programs that have specific functions and are used to complete specific tasks. A software package can be obtained by compiling and packaging the source code, and the software package is used to implement all the functions of the software.
[0040] A sub-package refers to one or more sub-packages included in a software package, each of which is used to implement at least one function of the software.
[0041] See also Figure 1 , which shows a schematic diagram of the structure of a software package construction system provided by the present application. Figure 1As shown, the software package construction system 10 may include a client 100 and a software package construction device 200, and the client 100 and the software package construction device 200 may be interconnected via a network. The software package construction device 200 may be deployed in the cloud to provide cloud services for building software packages for users (such as software developers, etc.).
[0042] The client 100 is used to interact with the user, such as receiving a new version of source code (or the storage location of the source code) provided by the user, and requesting the cloud-based software package construction device 200 to perform full or incremental construction of multiple software packages. Exemplarily, the client 100 can be an application running on a user-side device, or a web browser provided by the software package construction system 10.
[0043] The software package construction device 200 is used to construct a software package according to the source code (or the storage location of the source code) sent by the client 100. After the software package construction device 200 constructs the corresponding software packages for the multiple software in the development project, the user can update the source code of some of the multiple software and submit the source code of the new version of the multiple software (or the storage location of the source code of the new version) to the software package construction device 200 through the client 100. The source code of some of the software in the new version of the source code remains unchanged, and the source code of the other part of the software is updated by the user. At this time, the software package construction device 200 can construct the corresponding software packages for the multiple software by incremental construction.
[0044] In specific implementation, the software package construction device 200 obtains the software package related information constructed for the multiple software in the past time period, which is referred to as historical construction information below. The historical construction information may include, for example, the identification of the software package constructed for the multiple software in the past time period, the identification of the sub-software package included in each software package, and the dependency relationship between the software packages. Then, the software package construction device 200 determines the first description information of the first software among the multiple software, the source code to be constructed of the first software is different from the constructed source code of the first software (that is, the source code submitted to the software package construction device 200 in the past time period), and the first description information may include, for example, the content identification and storage location of the source code to be constructed of the first software. In addition, the software package construction device 200 also determines the second description information of the second software among the multiple software based on the historical construction information, the software package corresponding to the second software depends on the software package corresponding to the first software, and the second description information may include, for example, the content identification and storage location of the source code to be constructed of the second software. Finally, the software package construction device 200 constructs the source code to be constructed of the first software and the source code to be constructed of the second software respectively according to the first description information, the second description information and the historical construction information, and obtains the software package corresponding to the first software and the software package corresponding to the second software. Moreover, since the second software package depends on the first software package, in the incremental construction process, the software package construction device 200 first constructs the first software package according to the source code to be constructed of the first software, and then constructs the second software package according to the source code to be constructed of the second software.
[0045] Since in the process of incrementally building multiple software, the software package building device 200 will first determine the description information of all the software (that is, the first software and the second software) in the multiple software that need to rebuild the software package, and then preferentially build the source code of the first software according to the dependency relationship between the software packages, this can effectively reduce the number of times the source code of the first software is built during the entire incremental building process. For example, the source code of the first software can be built only once, thereby avoiding invalid construction of the source code of the first software being repeated multiple times, thereby improving the incremental building efficiency of the software package and improving the overall development efficiency of the development project.
[0046] Furthermore, since the software package construction device 200 can determine which software needs to be rebuilt, and the source code of each software can be built only once, the software package construction device 200 can estimate the total time required to build the software packages corresponding to the source code of these software, and thus can estimate the end time of the incremental construction process, which is convenient for user perception, thereby improving user experience.
[0047] Exemplarily, the software package construction device 200 may be implemented by software or hardware.
[0048] In the first example, when implemented by software, the software package construction device 200 can be implemented by program code in a computing device, for example, it can be implemented by at least one of a virtual machine, a container, a bare metal server (BMS), a computing engine, etc. The computing device can be a server located on the cloud, etc.
[0049] In the second example, when implemented by hardware, the software package construction device 200 can be implemented by at least one physical device including a processor, such as a server, and the physical device can be deployed on the cloud. Among them, the processor can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a system on chip (SoC), a software-defined infrastructure (SDI) chip, an artificial intelligence (AI) chip, a data processing unit (DPU), and any processor core or any combination thereof. In addition, the number of processors included in the software package construction device 200 can be one or more, and the type of processors included can be one or more. The number and type of processors can be set according to the business requirements of the actual application, and this embodiment does not limit this.
[0050] It is worth noting that the above Figure 1The software package building system 10 that can provide software package building cloud service is only used as an exemplary description. In other possible implementations, the software package building system may also include other devices, such as at least one database for storing source codes of multiple software, or storing software packages corresponding to multiple software, or storing the above historical building information, etc. Alternatively, in other possible implementations, the software package building system may be deployed on a terminal device on the user side. In this case, the software package building system can provide the user with a localized service for building a software package. In this case, the software package building system may not include a client, so that the user can directly provide the source codes of multiple software on the local terminal device, and the software package building system executes the above processing for incrementally building a software package. Alternatively, in other possible implementations, the operations performed by the software package construction device 200 may be performed collaboratively by multiple devices, such as by device 1 and device 2, wherein device 1 is used to determine the above-mentioned first description information and second description information based on historical construction information, specifically, device 1 is used to obtain the above-mentioned historical construction information, determine the first description information of the first software whose source code to be constructed is different from the constructed source code, and determine the second description information of the second software based on the historical construction information, and the second software package corresponding to the second software depends on the first software package corresponding to the first software; device 2 is used to construct the source code to be constructed of the first software and the source code to be constructed of the second software respectively according to the historical construction information, the first description information and the second description information, obtain the second software package corresponding to the first software and the second software package corresponding to the second software, and device 2 will first construct the first software package based on the source code to be constructed of the first software, and then construct the second software package based on the source code to be constructed of the second software, etc. The specific architecture of the software package construction system and its deployment method are not limited in this application.
[0051] Next, the software package construction method provided by the present application is described in conjunction with the accompanying drawings.
[0052] See also Figure 2 , Figure 2 A schematic diagram of a software package construction method provided in this application, which can be applied to Figure 1 The software package building system shown in FIG. 1 may be applied to other applicable software package building systems. For ease of explanation, the method is applied to Figure 1 The software package construction system 10 shown is taken as an example for illustrative description.
[0053] in, Figure 2 The software package building method shown may specifically include:
[0054] S201: The client 100 sends a full build request to the software package building device 200 to request the software package building device 200 to build a software package for each software in the development project.
[0055] In this embodiment, during the process of software development, the user can use the software package construction system 10 to construct corresponding software packages for each software in the development project, and the software package corresponding to each software may include multiple sub-software packages. Exemplarily, the software package may be, for example, an RPM package, which may include one or more RPMs (i.e., sub-software packages), and each RPM may generally include an executable file, a configuration file, a library file, etc., wherein the executable file may be, for example, a binary file. The constructed software package can be used to implement at least one function of the software, such as an image cropping function, an image zooming function, etc., and is managed by the RPM package manager in the software package construction device 200.
[0056] As an implementation example, the user can provide the storage address of the source code of each software in the development project on the client 100, such as a uniform resource locator (URL), etc. Then, the client 100 can generate a full build request according to the storage address of the source code of each software, and send it to the software package building device 200 to request the software package building device 200 to build the software package of each software.
[0057] S202: The software package construction device 200 responds to the received full construction request, constructs the software packages of each software, and generates historical construction information.
[0058] In specific implementation, the software package construction device 200 can create a code warehouse and multiple databases, wherein the code warehouse is used to store the source code of each software, and the multiple databases are used to store different information in the software package construction process, such as database 1 is used to store the software packages corresponding to each software obtained by construction, and database 2 is used to store information such as the dependency relationship between different software packages. Among them, the dependency relationship between software packages can also be called the dependency relationship between software, or the dependency relationship between software and the software packages of other software. If the construction of software package a corresponding to software A depends on the completion of the construction of software package b corresponding to software B first, then software package a depends on software package b, or software A depends on software B, or software A depends on software package b, which is not limited to this. After receiving the full build request, the software package construction device 200 can parse the storage address of the source code of each software. Then, the software package construction device 200 accesses the source code of each software according to the storage address and writes it into the created code warehouse. In this way, the software package construction device 200 can respectively construct the software packages corresponding to multiple software according to the source code stored in the code warehouse. Among them, the specific implementation of the software package obtained by construction according to the source code has already existed in the actual application scenario, and will not be repeated here.
[0059] After constructing the software packages corresponding to the various software, the software package construction device 200 may store the software packages corresponding to the various software in the database 1; and the software package construction device 200 may also record the relevant information of the software packages constructed for the multiple software in the database 2, which is referred to as historical construction information. In actual application, the historical construction information recorded by the software package construction device 200 in the database 2 may also include information related to the source code. Exemplarily, the historical construction information recorded by the software package construction device 200 may be as follows: Figure 3 The specific information content included in the historical build information is described in detail below.
[0060] 1. Record the identifiers of each sub-package in each package, such as Figure 3 The identifier "pkg_id_a1" of the sub-package rpm a1 in the sub-package rpm a1, etc., which identifier can be generated according to the information content in the sub-package by using a digest algorithm.
[0061] For example, the digest algorithm may be the MD5 message-digest algorithm; or the digest algorithm may be the secure hash algorithm (SHA) 256, which uses a 256-bit string to identify the sub-package. In actual application, the software package construction device 200 may also generate the identification of the sub-package based on other types of algorithms, which is not limited to this.
[0062] 2. Record the dependencies between different software packages.
[0063] The recorded dependency relationship may be a dependency relationship at the software package level. For example, "software package A -> software package X" may be recorded in the database to indicate that software package A depends on software package X.
[0064] Alternatively, the recorded dependencies can be dependencies at the sub-package granularity. Figure 3 As shown, the software package corresponding to software A depends on the sub-package "pkg_id_x1" in the software package corresponding to software X and the sub-package "pkg_id_y1" in the software package corresponding to software Y. Accordingly, the software package corresponding to software A does not depend on other sub-packages in the software package corresponding to software X.
[0065] 3. Record the content identifier of the source code of each software, which can uniquely identify the content in the source code. Accordingly, source codes with different contents correspond to different content identifiers.
[0066] For example, the content identifier of the source code may be a submission identifier when a user submits a new source code, that is, each time a user submits a source code, the source code may be configured with a unique submission identifier. Alternatively, the content identifier of the source code may be a version number corresponding to the source code, or may be information generated by using a digest algorithm based on the information content in the sub-package.
[0067] 4. Record the software to which each software package and source code belongs.
[0068] In actual application, the software package construction device 200 may also record more types of information, such as source code submission time, submission location, user identity, etc., which is not limited in this embodiment.
[0069] S203: The client 100 sends an incremental construction request to the software package construction apparatus 200 to request the software package construction apparatus 200 to perform incremental construction on the software packages of the multiple software included in the development project.
[0070] In actual application scenarios, users may modify the source code of some software in the development project, such as optimizing the code logic in the source code of some software, etc. Since the source code of not all software will be modified, if the software package is rebuilt for all software, it is easy to generate a large number of invalid reconstruction processes. Therefore, the user can send an incremental build request to the software package building device 200 through the client 100 to request the software package building device 200 to incrementally build the software packages of multiple software included in the development project, that is, only a new software package can be built for some of the multiple software, and after the incremental build, the software packages corresponding to the multiple software can be the same as the software packages obtained by the full build (that is, the effect of the full build is achieved).
[0071] S204: The software package construction apparatus 200 responds to the received incremental construction request and determines first description information of a first software among the multiple software, where the source code to be constructed of the first software is different from the constructed source code of the first software.
[0072] In this embodiment, for the convenience of distinction and description, the source code that the software package construction device 200 has not yet determined to be constructed is called candidate source code, the source code that is currently determined to be constructed is called source code to be constructed, and the source code that has been constructed in the last construction process is called constructed source code. In actual application, since the software package construction device 200 can determine the software that needs to be rebuilt from multiple software in the incremental construction process, the candidate source code of the determined part of the software, that is, the source code to be constructed, indicates that the software package needs to be constructed according to the source code to be constructed.
[0073] The first description information can be used to indicate the first software that needs to be rebuilt. For example, the first description information can be the identifier of the first software, or the content identifier of the source code to be built of the first software and the indication information of the storage location of the source code to be built.
[0074] After obtaining the incremental construction request, the software package construction device 200 can determine the first software whose source code is updated from the multiple software. Exemplarily, this embodiment provides the following three implementation methods.
[0075] In the first implementation, since the source code is modified and submitted by the user, the user can enter the identifier of the software whose source code is updated on the client 100, such as the software name. For the convenience of distinction and description, the software whose source code is updated is referred to as the first software in this embodiment, and the first software can be one software or multiple software. Then, the client 100 can generate an incremental build request including the identifier of the first software, and send it to the software package construction device 200. In this way, the software package construction device 200 can parse the identifier of the first software from the incremental build request, that is, determine the first description information of the first software whose source code is updated.
[0076] In the second implementation, the software package construction device 200 can parse the storage address of the source code to be constructed of all software from the received incremental construction request, and access the candidate source code of each software according to the storage address, and take a snapshot of the content identifier of each candidate source code. Then, the software package construction device 200 can traverse each software, and compare the content identifier of the candidate source code of the currently traversed software with the content identifier of the constructed source code of the software in the last construction process (such as the full construction process in step S202), and determine whether there is a content difference between the candidate source code of the software and the constructed source code. If there is, it indicates that the source code of the software has been updated, then the software package construction device 200 can determine the software as the first software that needs to be repackaged, and record the first description information of the first software, such as the content identifier and storage address of the source code to be constructed of the first software, and use the candidate source code of the first software as the source code to be constructed, indicating that the software package needs to be rebuilt for the first software according to the candidate source code (that is, the source code to be constructed). If it does not exist, it indicates that there is no update in the source code of the software package, then the software package construction device 200 does not need to determine the software as the first software. Alternatively, when there is no difference between the candidate source code and the constructed source code, the software package construction device 200 can also verify whether the software package is constructed based on the constructed source code, and if the software package has been constructed, the software package construction device 200 may not need to determine it as the first software; and if the software package has not been constructed based on the constructed source code, such as the software package construction failure due to program running errors, etc., the software package construction device 200 can determine the software as the first software, and use the candidate source code of the first software as the source code to be constructed, so as to subsequently construct the corresponding software package based on the source code to be constructed of the first software.
[0077] The content identifier of the candidate source code may be, for example, a submission sequence number or a version number configured when the candidate source code is submitted by a user, or may be an identifier calculated using a digest algorithm.
[0078] In actual application scenarios, the source code of some software in the development project may be modified multiple times within a period of time, and by taking a snapshot of the content identifier of the candidate source code, the source code of the latest version of each software in the development project can be determined. In this way, the software package construction device 200 performs an incremental construction process according to the source code of the latest version, which can avoid the source code of the same software being modified multiple times during this period of time, resulting in the software package construction device 200 repeatedly performing an invalid incremental construction process. For example, assuming that within a period of time, the source code of software A in the development project is first updated for the first time, at this time, the software package construction device 200 may not perform the incremental construction process temporarily; then, within this period of time, the source code of software A in the development project is updated for the second time, and the source code of software B in the development project is also updated, then, the software package construction device 200 can take a snapshot of the content identifier of the source code of the latest version of each software (such as the software package construction device 200 can take snapshots regularly), and perform an incremental construction process. In this way, the software package construction device 200 can avoid the invalid construction process performed when the source code of software A is updated for the first time.
[0079] In a third implementation, the software package construction device 200 can directly compare the candidate source code of each software with the constructed source code to see if it is consistent, and determine the software whose candidate source code is inconsistent with the constructed source code as the first software that needs to be repackaged. For example, the software package construction device 200 can obtain the candidate source code of multiple software submitted by the user, and compare the candidate source code of each software with the constructed source code of the software in the code repository, so as to determine the first software whose candidate source code is inconsistent with the constructed source code. At this time, the candidate source code of the first software, that is, the source code to be constructed as the first software, indicates that the software package needs to be rebuilt for the first software based on the source code to be constructed.
[0080] In actual application, after determining the first description information of the first software, the software package construction device 200 may add the first description information to a construction list, where the construction list is used to record the software / source code of the software package that needs to be rebuilt.
[0081] S205: The software package construction device 200 determines second description information of a second software among the plurality of software according to the historical construction information, wherein a second software package corresponding to the second software depends on a first software package corresponding to the first software.
[0082] It is understandable that, since different software packages may have dependencies, when a software package of some software depends on a software package corresponding to a first software, and the first software needs to rebuild the software package because of source code updates, the software package of the part software usually also needs to be adaptively rebuilt. For ease of distinction and description, in this embodiment, the part software is referred to as the second software, and the second software can be one software or multiple software.
[0083] As an exemplary implementation method for determining the second software, the software package construction device 200 can detect whether there is a dependency relationship between the historical software packages corresponding to other software except the first software and the software package corresponding to the first software according to the historical construction information recorded in the database. The historical software package of the first software refers to the software package constructed by using the constructed source code of the first software in the last construction process; the historical software packages corresponding to the remaining software are similar. When there is a historical software package corresponding to a software that depends on the historical software corresponding to the first software, the software package construction device 200 can determine that the software is the second software that needs to be rebuilt, and further determine the second description information of the second software. At this time, the candidate source code of the second software, that is, the source code to be constructed as the second software, indicates that the software package needs to be rebuilt for the second software according to the source code to be constructed. The second description information can be used to indicate the second software that needs to be rebuilt. For example, the second description information can be the identifier of the second software, or can be the content identifier of the source code to be constructed of the second software and the indication information of the storage location of the source code to be constructed. If the historical software package corresponding to the other software does not depend on the historical software package corresponding to the first software, the software package construction device 200 can determine not to rebuild the software package for the other software.
[0084] In actual application, after determining the second description information of the second software, the software package construction device 200 can add the second description information to the construction list, so that the software package construction device 200 can subsequently reconstruct the software packages for the first software and the second software according to the description information recorded in the construction list.
[0085] The process of determining the first description information and the second description information is described by first determining the first software that has a source code update, and then determining the second software that depends on the first software according to the dependency relationship between the software packages. In other possible implementations, the software package construction device 200 can traverse each software in the development project, and for the software A currently traversed, the software package construction device 200 can first verify whether the candidate source code of the software A is consistent with the constructed source code, such as by verifying through the content identifier. When the candidate source code is inconsistent with the constructed source code, the software package construction device 200 can add the description information of the software A (as the first software) to the construction list, and use the candidate source code of the first software as the source code to be constructed. When the candidate source code is consistent with the constructed source code, the software package construction device 200 can verify whether the source code of each software in the dependent environment corresponding to the software A has changed, specifically, according to the historical construction information, determine the historical software packages corresponding to other software (hereinafter referred to as candidate software) that the historical software package corresponding to the software A depends on, and verify whether the constructed source code of the candidate software is consistent with the candidate source code, for example, it can be verified whether the content identifier of the constructed source code corresponding to the candidate software is consistent with the content identifier of the candidate source code. If they are inconsistent, the description information of software A (as the second software) and the description information of the candidate software (as the first software) are added to the build list; if they are consistent, representing that the source code of software A itself has not changed, and the source code of other software it depends on has not changed, it is determined not to rebuild the software package for software A.
[0086] S206: The software package construction device 200 constructs the source code to be constructed of the first software and the source code to be constructed of the second software respectively according to the first description information, the second description information and the historical construction information to obtain a first software package corresponding to the first software and a second software package corresponding to the second software, wherein the source code to be constructed of the first software is constructed before the source code to be constructed of the second software.
[0087] For the first software and the second software that need to rebuild the software package, the software package building device 200 can build the source code to be built of the software according to the description information of each software recorded in the building list to obtain the corresponding software package.
[0088] Exemplarily, the software package construction device 200 can obtain the source code to be built of the software according to the description information of each software, and construct the corresponding software package according to the obtained source code to be built. Taking the construction of the first software package as an example, the software package construction device 200 can access the third-party hosting platform according to the indication information of the storage location of the source code to be built in the first description information, and pull the source code to be built of the first software according to the content identifier of the source code to be built included in the first description information, so that the software package construction device 200 can construct the first software package according to the obtained source code to be built of the first software. Similarly, the software package construction device 200 can construct the second software package according to the second description information recorded in the construction list.
[0089] Among them, since the second software package depends on the first software package, therefore, in the process of building the software package, the software package building device 200 can determine the dependency relationship between different software packages based on the historical building information, and based on the dependency relationship, give priority to completing the construction of the first software package that is dependent. After the first software package is built based on the source code to be built of the first software, the software package building device 200 then builds the second software package based on the source code to be built of the second software. In this way, it is possible to avoid repeated construction of the second software package, that is, it is possible to avoid the need to rebuild the second software package due to the reconstruction of the first software package on which it depends after the second software package is built.
[0090] In this way, during the entire incremental construction process, the source code of the first software does not need to be repeatedly built, thereby avoiding invalid construction of the source code of the first software by repeated construction, thereby improving the incremental construction efficiency of the software package and improving the overall development efficiency of the development project.
[0091] In addition, the software package construction device 200 can determine the source code of all software that needs to be rebuilt, so the total time required to build the software packages corresponding to the source code of these software can be estimated. For example, the software package construction device 200 can record the time required to build the corresponding software package for each software in the full construction process (that is, the construction process described in step S201 to step S202), for example, it can be recorded in the historical construction information. In this way, in the incremental construction process, after the software package construction device 200 determines the software that needs to be rebuilt, it can estimate the time required to build the software package for these software by searching the historical construction information, and thus calculate the total time according to the time corresponding to each software. In this way, the software package construction device 200 can predict the end time of the incremental construction process, which is convenient for user perception, thereby improving the user experience.
[0092] In actual application, since the first software package may include multiple sub-software packages, and when the first software package is rebuilt, some of the multiple sub-software packages change, while the other sub-software packages do not change (e.g., some functions in the software are optimized, while the other functions remain unchanged, etc.), therefore, in a further possible implementation, the software package construction device 200 may first construct the source code to be constructed of the first software package according to the first description information of the first software package to obtain the first software package, and determine whether the sub-software package in the first software package that the second software package depends on has changed according to the historical construction information, so that after the sub-software package that the second software package depends on has changed, the source code to be constructed of the second software package is constructed according to the second description information to obtain the second software package.
[0093] As an implementation example, the software package construction device 200 can determine the identifier of the second sub-package in the historical software package corresponding to the first software that the historical software package corresponding to the second software depends on based on the historical construction information, and the historical software package is obtained by constructing the constructed source code. Then, the software package construction device 200 can detect whether there is a first sub-package that matches the second sub-package among the multiple sub-packages included in the newly constructed first software package based on the identifier of the second sub-package. For example, the software package construction device 200 can match the identifier of the second sub-package with the identifiers of each sub-package in the first software package, and the identifier can be calculated by the MD5 algorithm or the hash algorithm, for example.
[0094] When there is no sub-package matching the second sub-package in the first software package, indicating that the sub-package in the first software package that the second software package depends on has changed, the software package construction device 200 can reconstruct the software package according to the source code to be constructed of the second software package.
[0095] When the first sub-package in the first software package matches the second sub-package, it indicates that the sub-package in the first software package that the second software package depends on has not changed. At this time, the reconstruction of the first software package has no effect on the second software package. Therefore, the software package construction device 200 may not build a new software package for the second software, for example, the second description information of the second software may be deleted from the construction list. In this way, the invalid re-construction of the source code of some software can be further avoided, and the incremental construction efficiency of the software package can be improved.
[0096] In actual application, the number of software included in the development project may be large, such as including more than 100 software, and accordingly, the number of software packages that need to be rebuilt determined by the software package building device 200 may also be large. In this case, the software package building device 200 can further speed up the overall efficiency of incremental building by building multiple software packages concurrently. For example, the following two implementation examples are provided in this embodiment.
[0097] In the first implementation example, the software package construction device 200 can group multiple software that need to build a software package according to the dependency relationship between the software packages, and there is a dependency relationship between the software packages corresponding to different software in each group, and there is no dependency relationship between the software packages corresponding to software in different groups. In this way, the software package construction device 200 can execute the process of building a software package for the software in multiple groups in parallel, thereby improving the concurrency of building the software package and improving the efficiency of incremental construction.
[0098] Accordingly, the overall duration of the incremental construction performed by the software package construction device 200 may be the maximum time required to construct software packages for the software in each group. For example, assuming that the multiple software to be constructed can be divided into three groups, namely, group A, group B, and group C, and the total time required by the software package construction device 200 to construct software packages for each software in group A is 5 minutes, the total time required to construct software packages for each software in group B is 8 minutes, and the total time required to construct software packages for each software in group C is 6 minutes, then the overall duration of the incremental construction performed by the software package construction device 200 may be 8 minutes, which is the total time required to construct software packages for all software in group B.
[0099] In the second implementation example, the software package construction device 200 can determine the dependency relationship between different software in the construction list (specifically, the dependency relationship between the software packages corresponding to different software), and the dependency relationship includes direct dependency and indirect dependency. Wherein, direct dependency means that the software package corresponding to software A directly depends on at least one sub-package in the software package corresponding to software B, and software A and software B have a direct dependency relationship. Indirect dependency means that the software package corresponding to software C directly depends on at least one sub-package in the software package corresponding to software D, and the software package corresponding to software D directly depends on at least one sub-package in the software package corresponding to software E, and software C and software E have an indirect dependency relationship. In addition, when multiple software have dependencies in sequence, a dependency chain is formed between the multiple software, for example, software a depends on software b, software b depends on software c, software c depends on software d, software d depends on software e, and software e depends on software f, then software a, b, c, d, e, f form a dependency chain, which can be expressed as "a→b→c→d→e→f".
[0100] Then, the software package construction device 200 can determine the number of multiple software included in the dependency chain. And, when the number of multiple software constituting serial dependency exceeds a threshold value (such as 5, etc.), the software package construction device 200 can truncate the dependency chain to obtain multiple dependency chains (or sub-dependency chains), and the same software is between two adjacent dependency chains, and the software package corresponding to the software in each dependency chain is updated, which has no effect on the construction of the software packages corresponding to the software in the remaining dependency chains. For example, assuming that the development project includes the first software package, the second software package and the third software package, and the third software package depends on the sub-package 1 in the second software package, and the sub-package 2 in the second software package depends on the first software package, then the software package construction device 200 can classify the first software package and the second software package into dependency chain 1, and classify the second software package and the second software package into dependency chain 2. In this way, after the software package corresponding to the second software is reconstructed, when the sub-package 1 in the second software package changes, the remaining software in the dependency chain 2 can reconstruct the software package according to the dependency relationship between the software packages. When the sub-package 1 does not change, the software package construction device 200 can decide whether to build the remaining software according to whether the source code of the remaining software in the dependency chain 1 changes. In this way, the software package construction device 200 can build the source code to be built indicated by each dependency chain in parallel according to the description information and historical construction information of each software. The construction order of the software packages corresponding to the multiple software in each dependency chain is determined according to the dependency relationship between the software packages, thereby further improving the efficiency of incremental construction of software packages.
[0101] Taking the dependency chain of "a→b→c→d→e→f" as an example, assuming that the software package corresponding to software b depends on sub-package 1 in the software package corresponding to software c, and sub-package 2 in the software package corresponding to software c depends on the software package corresponding to software d, then when the software package corresponding to software d is updated, it may not affect sub-package 1 in the software package corresponding to software c, and thus does not affect the software package corresponding to software b. Therefore, the software package construction device 200 can truncate the dependency chain to obtain dependency chain 1 "a→b→c" and dependency chain 2 "c→d→e→f", and then the software package construction device 200 can construct software packages for the software in dependency chain 1 and dependency chain 2 in parallel, such as the software package construction device 200 can simultaneously construct software packages for software c in dependency chain 1 and software f in dependency chain 2, etc.
[0102] It can be understood that the above two implementation examples of building software packages in parallel are only used as an exemplary description. In other embodiments, the software package building device 200 can also use other methods to build multiple software packages in parallel. For example, the above two examples can be combined to build software packages for multiple groups in parallel, and software packages can be built in parallel according to multiple dependency chains in each group.
[0103] In actual applications, there may be dependencies between software packages corresponding to multiple software, forming a dependency cycle, such as Figure 4 The dependency ring shown in the figure, at this time, the software package construction device 200 can determine the sub-packages in other software packages that the software package corresponding to each software depends on according to the historical construction information, and break the dependency ring according to the changes of the sub-packages in other software packages. Specifically, the software whose sub-packages have not changed can be used as the breaking point, so that the dependency ring can be converted into a dependency chain, and the process of building the software package is executed according to the dependency relationship between the software packages indicated by the dependency chain, so as to avoid the software package construction device 200 repeatedly building software packages for multiple software in the dependency ring.
[0104] by Figure 4 Taking the dependency loop shown in the figure as an example, assuming that the software package corresponding to software b depends on sub-package 1 in the software package corresponding to software c, and sub-package 2 in the software package corresponding to software c depends on the software package corresponding to software d, when the software package corresponding to software d is updated, it may not affect sub-package 1 in the software package corresponding to software c, and thus will not affect the software package corresponding to software b. At this time, the software package construction device 200 can determine software c as the breaking point of the dependency loop and convert the dependency loop into a dependency chain, such as Figure 4 The dependency chain shown is "c→d→e→f→a→b→c". In this way, the software package construction device 200 can sequentially construct software packages for each software in the dependency chain according to the dependency relationship between the software packages, thereby avoiding the software package construction device from repeatedly constructing software packages for multiple software in the dependency loop.
[0105] Furthermore, when some of the software in the build list belongs to software in multiple dependency rings, the multiple software may form a complex dependency ring. At this time, the software package construction device 200 can break each dependency ring based on the above method, and build a software package for each software package in the dependency chain obtained after the break; or, the software package construction device 200 can first execute a software package construction process for the software in the build list, and then break each dependency ring based on the above method, and build a software package for each software package in the dependency chain obtained after the break.
[0106] In this embodiment, the software package construction device 200 can create a database 1, and the database 1 is used to store software packages corresponding to multiple software. Then, after constructing new software packages for the first software and the second software, the software package construction device 200 can use the new software package to replace the old software package stored in the database 1. In specific implementation, the software package construction device 200 can use the first software package obtained based on the source code to be constructed to replace the historical software package corresponding to the first software in the database 1, and use the second software package obtained based on the source code to be constructed to replace the historical software package corresponding to the second software in the database 1, and the remaining software packages in the database 1 can remain unchanged. In this way, the software packages stored in the database 1 are the latest versions of the software packages corresponding to the multiple software, thereby realizing the update of the software packages of the multiple software.
[0107] In actual application scenarios, the user may update the source code of multiple software in the development project multiple times in different time periods, so that the user can request the software package construction device 200 to incrementally build the software packages corresponding to the multiple software through the client 100 multiple times. Therefore, after the software package construction device 200 constructs the first software package and the second software package, it can store the relevant information of the multiple software after this incremental construction, for example, it can create a new database 3 to store the content identifiers of the source code to be constructed of the multiple software, the identifiers of each sub-software package in the software package corresponding to each software, and the dependency relationship between the software packages corresponding to different software. In this way, when the user requests to incrementally build software packages for the multiple software again through the client 100, the software package construction device 200 can incrementally build software packages for the multiple software based on the latest recorded information in the database 3 (as new historical construction information). The specific implementation method thereof is described in the above-mentioned relevant parts and will not be repeated here.
[0108] Furthermore, during each incremental build process, the software package building device 200 can create a new database to record the incremental build, and the content identifiers of the source codes of the multiple software, the identifiers of the sub-packages in the software package corresponding to each software, the dependency relationship between the software packages corresponding to different software, and other information can all be recorded in the database. In this way, when tracing problems of the multiple software later, the software packages corresponding to the first software and the second software can be repeatedly built according to the information recorded in the database, so as to analyze the root cause of the problem according to the built software packages.
[0109] It should be noted that Figure 2 The method steps shown are only used as an exemplary description. In other possible embodiments, Figure 2On the basis of the method steps shown, some steps may be added, deleted, or replaced, such as step S201 and step S202 may be deleted, or the user may directly send the source code to be constructed of each software to the software package construction device 200 through the client 100.
[0110] In this embodiment, in the process of incrementally building software packages for multiple softwares, the software package construction device 200 first determines the description information of all the softwares that need to rebuild the software packages among the multiple softwares, and then preferentially builds the source code of the first software according to the description information and the dependency relationship between the software packages, so that in the entire incremental construction process, the source code of the first software does not need to be repeatedly built multiple times, such as being built only once, so as to avoid invalid construction of the source code of the first software being repeatedly built multiple times, thereby improving the incremental construction efficiency of the software package and improving the overall development efficiency of the development project. In addition, since the software package construction device 200 can determine the source code of all the softwares that need to be rebuilt, and the source code of each software can be built only once, the software package construction device 200 can estimate the total time required to build the software packages corresponding to the source code of these softwares, so as to estimate the end time of the incremental construction process, which is convenient for user perception, thereby improving the user experience.
[0111] The technical solution of the present invention is exemplarily described below in conjunction with specific application scenarios.
[0112] See also Figure 5 as well as Figure 6 ,in, Figure 5 shows a schematic diagram of the structure of another software package building system, Figure 6 A schematic flow chart of another method for building a software package is shown.
[0113] like Figure 5 As shown, the software package construction device 200 may include multiple services, namely, a project management service 201, a code acquisition service 202, a task management service 203, a resource scheduling service 204, and a database creation service 205. In addition, the software package construction device 200 also includes a storage service 206 and an execution module 207, and can be externally connected to a third-party hosting platform 300.
[0114] The project management service 201 is used to manage the development project, specifically, it can manage the storage address of the source code of each software in the development project on the third-party hosting platform 300, the software package corresponding to each software, the architecture supported by the development project (such as X86 architecture or ARM architecture, etc.), the database that the development project relies on, etc. In addition, the project management service 201 is also used to interact with the client 100.
[0115] The code acquisition service 202 is used to pull the source codes of multiple software in the development project from the third-party hosting platform 300 .
[0116] The task management service 203 is used to generate full build tasks or incremental build tasks and issue tasks.
[0117] The resource scheduling service 204 is used to perform corresponding resource scheduling according to the received task to execute the task.
[0118] The database creation service 205 is used to create a database to store information generated during the full build or incremental build process.
[0119] The storage service 206 is used to store data, such as the source code, software package, the above historical build information, etc. Exemplarily, the storage service 206 may include multiple databases, and different databases may be used to store different types of data, such as database 1 for storing source code, database 2 for storing software packages, and database 3 for storing the above historical build information, etc.
[0120] The execution module 207 is used to execute the corresponding full build task or incremental build task under the scheduling of the resource scheduling service 204.
[0121] See also Figure 6 , Figure 6 The software package building method shown may specifically include:
[0122] S601 : the project management service 201 receives an incremental build request sent by a user through the client 100 .
[0123] In actual application, the user can submit new source code of some software in the development project to the third-party hosting platform 300 through the client 100, and after completing the submission of the new source code, request the software package construction device 200 to construct software packages for the multiple software increments through the client 100.
[0124] Exemplarily, the incremental build request may include an identifier of a development project, so as to use the identifier to indicate the development project for which the multiple software packages are to be incrementally built.
[0125] It should be noted that this embodiment focuses on the process of incrementally building multiple software in a development project by the software construction device 200. In actual application, the user can also send a full build request to the project management service 201 through the client 100 to request the software package construction device 200 to fully build the software package for the multiple software.
[0126] The code acquisition service 202 may take a snapshot of the acquired candidate source codes to obtain content identifiers of the candidate source codes of various software.
[0127] S602: The project management service 201 instructs the code acquisition service 202 to acquire content identifiers of candidate source codes of all software in the development project.
[0128] S603 : the code acquisition service 202 accesses the third-party hosting platform 300 , obtains the content identifiers of the candidate source codes of all the software in the development project through a snapshot, and feeds back the content identifiers of the candidate source codes of each software to the project management service 201 .
[0129] S604: the project management service 201 generates an incremental build task, and sends the incremental build task and the content identifiers corresponding to the candidate source codes of the plurality of software to the task management service 203 .
[0130] S605: The task management service 203 generates a build list according to the content identifiers corresponding to the received candidate source codes of the multiple software and the historical build information recorded in the storage service 206. The build list includes description information of the multiple software packages that need to be built.
[0131] Exemplarily, the description information may include, for example, a content identifier and a storage address of the candidate source code of the software.
[0132] The specific implementation process of the task management service 203 generating the build list can be found in the above Figure 2 The description of the relevant parts of the process of determining the description information of the first software and the second software in the illustrated embodiment is not repeated here.
[0133] S606: The task management service 203 instructs the code acquisition service 202 to acquire the to-be-built source codes of the multiple softwares indicated in the build list according to the build list.
[0134] At this time, the candidate source codes of the multiple software indicated in the build list are determined as the source codes that need to be built, hereinafter referred to as the source codes to be built, indicating that the software packages need to be rebuilt for the multiple software according to the source codes to be built. Therefore, the task management service 203 can instruct the code acquisition service 202 to acquire the source codes to be built required for rebuilding the software packages.
[0135] S607 : the code acquisition service 202 pulls the source codes to be built of the multiple software indicated in the build list from the third-party hosting platform 300 , and saves the pulled source codes to be built in the storage service 206 .
[0136] S608 : The task management service 203 generates a task including the build list, and sends the task to the resource scheduling service 204 .
[0137] S609: the resource scheduling service 204 performs corresponding resource scheduling for the task, and sends the task including the building list to the execution module 207 according to the resource scheduling result.
[0138] S610 : the execution module 207 executes the task, builds the corresponding software package according to the source code to be built and the build list stored in the storage service 206 , and feeds back the execution result to the database creation service 205 .
[0139] The specific implementation process of the execution module 207 constructing software packages for multiple software according to the description information in the construction list can be seen in the above Figure 2 The description of the relevant parts of the process of constructing the software package for the first software and the second software in the illustrated embodiment will not be repeated here.
[0140] The execution result fed back by the execution module 207 may include information such as content identification of the source code, generated software packages, and dependencies between different software packages.
[0141] S611: The database creation service 205 creates a new database in the storage service 206, and uses the new database to record the execution result.
[0142] S612: The database creation service 205 feeds back the execution result to the task management service 203, thereby building software packages for multiple software increments in the development project.
[0143] In this way, during the entire incremental build process, the invalid construction of the source code of some software in the development project can be avoided by repeated construction, thereby improving the incremental build efficiency of the software package and improving the overall development efficiency of the development project.
[0144] In actual application, when the software package construction system is deployed on the user's terminal device, multiple services in the software package construction device 200 can perform an incremental construction process on the local terminal device. At this time, the software package construction system may not include the above-mentioned Figure 5 The client 100 shown in the figure, so that the project management service 201 can start the incremental construction process based on the operation performed by the user on the terminal device, and the code acquisition service 202 can obtain the candidate source code from the third-party hosting platform 300, or the user can provide the candidate source code to the terminal device. The operations performed by the remaining services in the software package construction device 200 during the incremental construction process can be referred to in the above Figure 6 The description of the related parts shown will not be repeated here.
[0145] It is worth noting that other reasonable step combinations that can be thought of by those skilled in the art based on the above description also fall within the scope of protection of this application. Secondly, those skilled in the art should also be familiar with the fact that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by this application.
[0146] Combination of the above Figures 1 to 6 The software package construction method provided in the embodiment of the present application is introduced. Next, the functions of the software package construction device provided in the embodiment of the present application and the computing device implementing the software package construction device are introduced in conjunction with the accompanying drawings.
[0147] See also Figure 7 , showing a schematic structural diagram of a software package building device. Figure 7 The software package construction device 700 shown may correspond to the above Figure 2 as well as Figure 5 The software package building apparatus 200 is shown.
[0148] like Figure 7 As shown, the software package construction device 700 may include:
[0149] An acquisition module 701 is used to acquire historical build information of multiple software, where the historical build information includes relevant information of software packages built for the multiple software within a historical time period;
[0150] The determination module 702 is used to determine first description information of a first software among the multiple software, where the source code to be built of the first software is different from the built source code of the first software; and to determine second description information of a second software among the multiple software according to the historical build information, where a second software package corresponding to the second software depends on a first software package corresponding to the first software;
[0151] The construction module 703 is used to construct the source code to be constructed of the first software and the source code to be constructed of the second software respectively according to the first description information, the second description information, and the historical construction information to obtain the first software package and the second software package, and the source code to be constructed of the first software is constructed before the source code to be constructed of the second software.
[0152] In a possible implementation, the construction module 703 is used to:
[0153] Building the source code to be built of the first software according to the first description information to obtain a first software package;
[0154] Determining, based on the historical build information, that a sub-package in the first software package on which the second software package depends has changed;
[0155] The source code to be built of the second software is built according to the second description information to obtain a second software package.
[0156] In a possible implementation, the first software package includes a plurality of sub-software packages, and each of the plurality of sub-software packages is used to implement at least one function of the first software;
[0157] Building block 703 is used to:
[0158] Determine, according to the historical build information, an identifier of a second sub-software package that a historical software package corresponding to the second software depends on, where the historical software package is obtained by building the built source code of the second software;
[0159] According to the identifier of the second sub-software package, it is detected that no first sub-software package matching the second sub-software package exists in the first software package.
[0160] In a possible implementation, the plurality of software further includes a third software, and a software package corresponding to the third software package depends on the second software package;
[0161] Building block 703 is used to:
[0162] Determine, according to the historical build information, a dependency relationship between the first software package, the second software package, and the third software package;
[0163] Generate a first dependency chain and a second dependency chain according to the dependency relationship between the first software package, the second software package, and the third software package, the first dependency chain indicating that the source code to be built of the first software is built before the source code to be built of the second software, and the second dependency chain indicating that the source code to be built of the second software is built before the source code to be built of the third software;
[0164] According to the first description information, the second description information, and the third description information of the third software, the source code to be built indicated in the first dependency chain and the source code to be built indicated in the second dependency chain are built in parallel.
[0165] In a possible implementation, a third software package corresponding to the third software depends on a third sub-package in the second software package, and a fourth sub-package in the second software package depends on the first software package. After the second software package is built based on the source code to be built of the second software package, the sub-package on which the software package corresponding to the third software depends is changed to the third sub-package.
[0166] In a possible implementation, the historical build information further includes a content identifier of the built source code of the first software;
[0167] The determination module 702 is used to:
[0168] Obtaining a content identifier of a candidate source code of the first software;
[0169] When the content identifier of the candidate source code of the first software is inconsistent with the content identifier of the constructed source code of the first software, first description information of the first software among the multiple software is determined, and the source code to be constructed of the first software is also the candidate source code. The first description information includes the content identifier of the first software and indication information of the storage location of the constructed source code of the first software.
[0170] In a possible implementation, the historical build information includes a dependency relationship between a historical software package corresponding to the second software and a historical software package corresponding to the first software, the historical software package corresponding to the second software being obtained by building the built source code of the second software, and the historical software package corresponding to the first software being obtained by building the built source code of the first software;
[0171] The determination module 702 is used to:
[0172] According to the historical build information, detecting from the plurality of software that there is a dependency relationship between the historical software package corresponding to the second software and the historical software package corresponding to the first software;
[0173] Second description information of the second software is determined, where the second description information includes a content identifier of the second software and indication information of a storage location of a constructed source code of the second software.
[0174] In a possible implementation, the software package construction device 700 further includes:
[0175] The storage module 704 is used to store the content identifier of the source code to be built of the first software, the identifier of the sub-package included in the first software package, the content identifier of the source code to be built of the second software, the identifier of the sub-package included in the second software package, and the dependency relationship between the first software package and the second software package.
[0176] In a possible implementation, the software package construction device 700 further includes:
[0177] A replacement module 705, configured to replace the historical software package corresponding to the first software in the second database with the first software package, and to replace the historical software package corresponding to the second software in the second database with the second software package;
[0178] The second database includes historical software packages corresponding to multiple software respectively. The historical software package corresponding to the first software is obtained by constructing the constructed source code of the first software, and the historical software package corresponding to the second software is obtained by constructing the constructed source code of the second software.
[0179] because Figure 7 The software package construction device 700 shown corresponds to Figure 2The software package construction device 200 in the method embodiment shown in FIG. Figure 7 The specific implementation method of the software package construction device 700 and its technical effects can be found in the relevant descriptions of the aforementioned embodiments, and will not be described in detail here.
[0180] See also Figure 8 , showing a schematic structural diagram of a software package building device. Figure 8 The software package construction device 800 shown may correspond to the above Figure 2 The software package construction device 200 shown in the figure may be specifically used to execute Figure 2 Steps S203 to S205 in the illustrated embodiment. Figure 8 As shown, the software package construction device 800 may specifically include:
[0181] An acquisition module 801 is used to acquire historical build information of multiple software, where the historical build information includes relevant information of software packages built for the multiple software within a historical time period;
[0182] The determination module 802 is used to determine first description information of a first software among the multiple software, where the source code to be built of the first software is different from the built source code of the first software; and to determine second description information of a second software among the multiple software according to the historical build information, where a second software package corresponding to the second software depends on a first software package corresponding to the first software;
[0183] The first description information and the second description information are used to indicate the construction of a first software package corresponding to the first software and a second software package corresponding to the second software.
[0184] because Figure 8 The software package construction device 800 shown corresponds to Figure 2 The software package construction device 200 in the method embodiment shown in FIG. Figure 8 The specific implementation method of the software package construction device 800 and its technical effects can be found in the relevant descriptions of the aforementioned embodiments, and will not be described in detail here.
[0185] Above Figure 7 as well as Figure 8 In the illustrated embodiment, the software package construction device involved in the software package construction process may be software configured on a computing device or a computing device cluster, and by running the software on the computing device or the computing device cluster, the computing device or the computing device cluster may implement the functions of the software package construction device 200. Below, based on the perspective of hardware device implementation, the software package construction device 200 involved in the software package construction process is described in detail.
[0186] Fig. 9 The schematic diagram of the structure of a computing device is shown. The software package construction device 200 can be deployed on the computing device. The computing device can be a computing device in a cloud environment (such as a server), or a computing device in an edge environment, or a terminal device, etc., which can be used to implement the above Figure 2 The functions of the software package building device 200 in the illustrated embodiment.
[0187] like Fig. 9 As shown, computing device 900 includes processor 910, memory 920, communication interface 930 and bus 940. Processor 910, memory 920 and communication interface 930 communicate through bus 940. Bus 940 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 The communication interface 930 is used to communicate with the outside, for example, to receive configuration information and batch information provided by the user.
[0188] Among them, the processor 910 can be a central processing unit (CPU), an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits. The processor 910 can also be an integrated circuit chip with signal processing capabilities. In the implementation process, the functions of each module in the software package construction device 200 can be completed by the hardware integrated logic circuit or software instructions in the processor 910. The processor 910 can also be a general processor, a digital signal processor (DSP), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, and can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. Among them, the general processor can be a microprocessor or the processor can also be any conventional processor, etc., and the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 920 , and the processor 910 reads the information in the memory 920 and completes part or all of the functions of the software package construction device 200 in combination with its hardware.
[0189] The memory 920 may include a volatile memory, such as a random access memory (RAM), or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a HDD, or a SSD.
[0190] The memory 920 stores executable codes, and the processor 910 executes the executable codes to execute the method executed by the aforementioned software package construction device 200 .
[0191] Specifically, in implementing Figure 2 In the case of the embodiment shown, and Figure 2 In the embodiment shown, the software package construction device 200 is implemented by software. Figure 2The software or program code required for the functions of the software package construction device 200 is stored in the memory 920. The interaction between the software package construction device 200 and other devices is realized through the communication interface 930. The processor is used to execute the instructions in the memory 920 to implement the method executed by the above-mentioned software package construction device 200.
[0192] Fig.10 A schematic diagram of the structure of a computing device cluster is shown. Fig.10 The computing device cluster 10 shown includes multiple computing devices, and the software package construction apparatus 200 can be distributedly deployed on multiple computing devices in the computing device cluster 10. Fig.10 As shown, the computing device cluster 10 includes multiple computing devices 1000 , each computing device 1000 includes a memory 1020 , a processor 1010 , a communication interface 1030 and a bus 1040 , wherein the memory 1020 , the processor 1010 , and the communication interface 1030 are communicatively connected to each other via the bus 1040 .
[0193] The processor 1010 may be a CPU, a GPU, an ASIC or one or more integrated circuits. The processor 1010 may also be an integrated circuit chip having signal processing capabilities. In the implementation process, some functions of the software package construction device 200 may be completed by the hardware integrated logic circuit or software instructions in the processor 1010. The processor 1010 may also be a DSP, an FPGA, a general processor, other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and may implement or execute some of the methods, steps and logic block diagrams disclosed in the embodiments of the present application. Among them, the general processor may be a microprocessor or the processor may also be any conventional processor, etc., and the steps of the method disclosed in the embodiments of the present application may be directly embodied as a hardware decoding processor for execution, or may be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1020. In each computing device 1000, the processor 1010 reads the information in the memory 1020 and can complete part of the functions of the software package construction device 200 in combination with its hardware.
[0194] The memory 1020 may include ROM, RAM, static storage device, dynamic storage device, hard disk (e.g., SSD, HDD), etc. The memory 1020 may store program codes, for example, part of the program codes for implementing the software package construction device 200, etc. For each computing device 1000, when the program codes stored in the memory 1020 are executed by the processor 1010, the processor 1010 executes part of the method executed by the software package construction device 200 based on the communication interface 1030, such as one part of the computing devices 1000 may be used to execute the method described in steps S203 to S205, and another part of the computing devices 1000 may be used to execute the method described in step S206. The memory 1020 may also store data, for example: intermediate data or result data generated by the processor 1010 during the execution process, for example, the above-mentioned historical construction information, the first software package, the second software package, etc.
[0195] The communication interface 1030 in each computing device 1000 is used for communicating with the outside, such as interacting with other computing devices 1000 .
[0196] The bus 1040 may be a peripheral component interconnect standard bus or an extended industry standard architecture bus. For ease of representation, Fig.10 The bus 1040 in each computing device 1000 is represented by only one thick line, but this does not mean that there is only one bus or one type of bus.
[0197] The plurality of computing devices 1000 establish communication paths through a communication network to implement the functions of the software package construction apparatus 200. Any computing device may be a computing device in a cloud environment (eg, a server), or a computing device in an edge environment, or a terminal device.
[0198] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned software package construction method.
[0199] The embodiment of the present application also provides a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.
[0200] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0201] The computer program product may be a software installation package, which may be downloaded and executed on a computing device when any of the aforementioned software package construction methods is required.
[0202] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0203] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for constructing a software package, characterized in that: The method comprises: Acquire historical construction information of the plurality of software, wherein the historical construction information includes relevant information of software packages constructed for the plurality of software within a historical time period; Determine first description information of a first software among the plurality of software, where source code to be built of the first software is different from the built source code of the first software; Determining, according to the historical build information, second description information of second software among the multiple software, where a second software package corresponding to the second software package depends on a first software package corresponding to the first software package; According to the first description information, the second description information, and the historical construction information, the source code to be built of the first software and the source code to be built of the second software are respectively built to obtain the first software package and the second software package, and the source code to be built of the first software is built before the source code to be built of the second software.
2. The method according to claim 1, characterized in that The step of constructing the source code to be constructed of the first software and the source code to be constructed of the second software respectively according to the first description information, the second description information, and the historical construction information includes: Building the source code to be built of the first software according to the first description information to obtain the first software package; Determining, according to the historical build information, that a first sub-package in the first package on which the second package depends has changed; The source code to be built of the second software is built according to the second description information to obtain the second software package.
3. The method according to claim 2, characterized in that The first software package includes a plurality of sub-software packages, each of the plurality of sub-software packages is used to implement at least one function of the first software; The determining, according to the historical build information, that a sub-package in the first software package on which the second software package depends has changed includes: Determining, according to the historical build information, an identifier of a second sub-software package that a historical software package corresponding to the second software depends on, wherein the historical software package is obtained by building the built source code of the second software; According to the identifier of the second sub-software package, it is detected that no first sub-software package matching the second sub-software package exists in the first software package.
4. The method according to any one of claims 1 to 3, characterized in that: The plurality of software further includes a third software, and a software package corresponding to the third software package depends on the second software package; The step of constructing the source code to be constructed of the first software and the source code to be constructed of the second software respectively according to the first description information, the second description information, and the historical construction information includes: Determining, according to the historical build information, a dependency relationship among the first software package, the second software package, and the third software package; Generate a first dependency chain and a second dependency chain according to the dependency relationship between the first software package, the second software package, and the third software package, wherein the first dependency chain indicates that the source code to be built of the first software is built before the source code to be built of the second software, and the second dependency chain indicates that the source code to be built of the second software is built before the source code to be built of the third software; According to the first description information, the second description information, and the third description information of the third software, the source code to be constructed indicated in the first dependency chain and the source code to be constructed indicated in the second dependency chain are constructed in parallel.
5. The method according to claim 4, characterized in that The third software package corresponding to the third software depends on the third sub-package in the second software package, and the fourth sub-package in the second software package depends on the first software package. Therefore, after the second software package is constructed based on the source code to be constructed of the second software package, the sub-package on which the software package corresponding to the third software depends is changed to the third sub-package.
6. The method according to any one of claims 1 to 5, characterized in that: The historical construction information further includes a content identifier of a constructed source code of the first software. The determining of the first description information of the first software among the plurality of software includes: Obtaining a content identifier of a candidate source code of the first software; When the content identifier of the candidate source code of the first software is inconsistent with the content identifier of the constructed source code of the first software, first description information of the first software among the multiple software is determined, the source code to be constructed of the first software is the candidate source code, and the first description information includes the content identifier of the first software and indication information of the storage location of the constructed source code of the first software.
7. The method according to any one of claims 1 to 6, characterized in that: The historical build information includes a dependency relationship between a historical software package corresponding to the second software and a historical software package corresponding to the first software, the historical software package corresponding to the second software being obtained by building the built source code of the second software, and the historical software package corresponding to the first software being obtained by building the built source code of the first software; The determining, according to the historical construction information, second description information of a second software among the plurality of software includes: According to the historical build information, detecting from the plurality of software that there is a dependency relationship between the historical software package corresponding to the second software and the historical software package corresponding to the first software; Second description information of the second software is determined, where the second description information includes a content identifier of the second software and indication information of a storage location of a constructed source code of the second software.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Store the content identifier of the source code to be built of the first software, the identifier of the sub-package included in the first software package, the content identifier of the source code to be built of the second software, the identifier of the sub-package included in the second software package, and the dependency relationship between the first software package and the second software package.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: Using the first software package to replace the historical software package corresponding to the first software in the second database, and using the second software package to replace the historical software package corresponding to the second software in the second database; The second database includes historical software packages corresponding to the multiple software respectively, the historical software package corresponding to the first software is obtained by building the built source code of the first software, and the historical software package corresponding to the second software is obtained by building the built source code of the second software.
10. A method for constructing a software package, characterized in that: The method comprises: Acquire historical construction information of the plurality of software, wherein the historical construction information includes relevant information of software packages constructed for the plurality of software within a historical time period; Determine first description information of a first software among the plurality of software, where source code to be built of the first software is different from the built source code of the first software; Determining, according to the historical build information, second description information of second software among the multiple software, where a second software package corresponding to the second software package depends on a first software package corresponding to the first software package; The first description information and the second description information are used to indicate that a first software package corresponding to the first software and a second software package corresponding to the second software are to be constructed.
11. A software package construction device, characterized in that: The device comprises: An acquisition module, configured to acquire historical construction information of the plurality of software, wherein the historical construction information includes relevant information of software packages constructed for the plurality of software within a historical time period; a determination module, configured to determine first description information of a first software among the plurality of software, where source code to be constructed of the first software differs from source code already constructed of the first software; and determine second description information of a second software among the plurality of software according to the historical construction information, where a second software package corresponding to the second software package depends on a first software package corresponding to the first software package; A construction module is used to construct the source code to be constructed of the first software and the source code to be constructed of the second software respectively according to the first description information, the second description information, and the historical construction information to obtain the first software package and the second software package, and the source code to be constructed of the first software is constructed before the source code to be constructed of the second software.
12. The device according to claim 11, characterized in that The building blocks are used to: Building the source code to be built of the first software according to the first description information to obtain the first software package; Determining, according to the historical build information, that a sub-package in the first software package on which the second software package depends has changed; The source code to be built of the second software is built according to the second description information to obtain the second software package.
13. The device according to claim 12, characterized in that The first software package includes a plurality of sub-software packages, each of the plurality of sub-software packages is used to implement at least one function of the first software; The building blocks are used to: Determining, according to the historical build information, an identifier of a second sub-software package that a historical software package corresponding to the second software depends on, wherein the historical software package is obtained by building the built source code of the second software; According to the identifier of the second sub-software package, it is detected that no first sub-software package matching the second sub-software package exists in the first software package.
14. The device according to any one of claims 11 to 13, characterized in that The plurality of software further includes a third software, and a software package corresponding to the third software package depends on the second software package; The building blocks are used to: Determining, according to the historical build information, a dependency relationship among the first software package, the second software package, and the third software package; Generate a first dependency chain and a second dependency chain according to the dependency relationship between the first software package, the second software package, and the third software package, wherein the first dependency chain indicates that the source code to be built of the first software is built before the source code to be built of the second software, and the second dependency chain indicates that the source code to be built of the second software is built before the source code to be built of the third software; According to the first description information, the second description information, and the third description information of the third software, the source code to be constructed indicated in the first dependency chain and the source code to be constructed indicated in the second dependency chain are constructed in parallel.
15. The device according to any one of claims 11 to 14, characterized in that The third software package corresponding to the third software depends on the third sub-package in the second software package, and the fourth sub-package in the second software package depends on the first software package. Therefore, after the second software package is built based on the source code to be built of the second software package, the sub-package on which the software package corresponding to the third software depends is changed to the third sub-package.
16. The device according to any one of claims 11 to 15, characterized in that The historical build information also includes a content identifier of the built source code of the first software; The determining module is used to: Obtaining a content identifier of a candidate source code of the first software; When the content identifier of the candidate source code of the first software is inconsistent with the content identifier of the constructed source code of the first software, first description information of the first software among the multiple software is determined, the source code to be constructed of the first software is the candidate source code, and the first description information includes the content identifier of the first software and indication information of the storage location of the constructed source code of the first software.
17. The device according to any one of claims 11 to 16, characterized in that The historical build information includes a dependency relationship between a historical software package corresponding to the second software and a historical software package corresponding to the first software, the historical software package corresponding to the second software being obtained by building the built source code of the second software, and the historical software package corresponding to the first software being obtained by building the built source code of the first software; The determining module is used to: According to the historical build information, detecting from the plurality of software that there is a dependency relationship between the historical software package corresponding to the second software and the historical software package corresponding to the first software; Second description information of the second software is determined, where the second description information includes a content identifier of the second software and indication information of a storage location of a constructed source code of the second software.
18. The device according to any one of claims 11 to 17, characterized in that The device also includes: A storage module is used for the content identifier of the source code to be built of the first software, the identifier of the sub-package included in the first software package, the content identifier of the source code to be built of the second software, the identifier of the sub-package included in the second software package, and the dependency relationship between the first software package and the second software package.
19. The device according to any one of claims 11 to 18, characterized in that The device also includes: A replacement module, configured to replace a historical software package corresponding to the first software in a second database with the first software package, and to replace a historical software package corresponding to the second software in the second database with the second software package; The second database includes historical software packages corresponding to the multiple software respectively, the historical software package corresponding to the first software is obtained by building the built source code of the first software, and the historical software package corresponding to the second software is obtained by building the built source code of the second software.
20. A software package construction device, characterized in that: The device comprises: An acquisition module, configured to acquire historical construction information of the plurality of software, wherein the historical construction information includes relevant information of software packages constructed for the plurality of software within a historical time period; a determination module, configured to determine first description information of a first software among the plurality of software, where source code to be constructed of the first software differs from source code already constructed of the first software; and determine second description information of a second software among the plurality of software according to the historical construction information, where a second software package corresponding to the second software package depends on a first software package corresponding to the first software package; The first description information and the second description information are used to indicate that a first software package corresponding to the first software and a second software package corresponding to the second software are to be constructed.
21. A computing device, characterized in that Including processor and memory; The processor is configured to execute instructions stored in the memory so as to enable the computing device to perform the steps of the method according to any one of claims 1 to 10.
22. A computer-readable storage medium, characterized in that: The method comprises instructions which, when executed on a computing device, cause the computing device to perform the steps of the method according to any one of claims 1 to 10.
23. A computer program product comprising instructions, characterized in that When the method is executed on at least one computing device, the at least one computing device is caused to execute the method according to any one of claims 1 to 10.
Citation Information
Cited By
Product alternative scheme generation method taking function data as center
CN121743567A
