Application building methods, devices, equipment, and media

By offloading the compilation task of the application's project files to a remote host, the problem of limited CPU resources on the development host is solved, thereby improving the efficiency and performance of application builds.

CN113094051BActive Publication Date: 2025-10-31NETEASE MEDIA TECH BEIJING
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110458724.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-27
Publication Date
2025-10-31
Estimated Expiration
2041-04-27

AI Technical Summary

Technical Problem

The limited CPU resources of the development host result in a large memory overhead and heavy processor load for building application project files, which reduces build efficiency and performance.

Method used

The project files of the target application are sent to a remote host for compilation. The remote host executes the compilation task and generates an installation package, which is then returned to the local host.

Benefits of technology

By offloading compilation tasks to a remote host, the CPU resources of the local host are freed up, avoiding memory overhead and heavy load issues, thus improving the efficiency and performance of application builds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113094051B_ABST
    Figure CN113094051B_ABST
Patent Text Reader

Abstract

This disclosure provides a method, apparatus, device, and medium for building an application, relating to the field of computer software technology. A local host sends a first project file of a target application to a remote host, enabling the remote host to execute a compilation task based on the first project file to obtain a target installation package of the target application. The remote host then receives the target installation package sent by the remote host. By transferring the compilation task of the application project file to the remote host, the CPU of the local host can be freed up, thus avoiding the situation where the local host performs project file development while simultaneously executing the compilation task, resulting in high memory consumption and heavy load on the local host, leading to low application build efficiency and performance. Therefore, the embodiments of this disclosure can improve the build efficiency and performance of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer software technology, and in particular to a method, apparatus, device, and medium for constructing an application. Background Technology

[0002] This section is intended to provide background or context for the embodiments of this disclosure as set forth in the claims. The description herein is not intended to be a prior art simply because it is included in this section.

[0003] During application development, developers create the application project, write the source code, and generate the application's project files on the development host. After the application's project files are developed, they need to be built on the development host to execute the compilation task and ultimately obtain the application's installation package.

[0004] Because the central processing unit (CPU) resources of the development host are limited, and the application project files are usually quite large, the construction of the project files requires a large amount of memory and the processor load is also heavy, resulting in low application construction efficiency and performance. Summary of the Invention

[0005] This disclosure provides an application building method, apparatus, device, and medium to improve application building efficiency and performance.

[0006] In a first aspect, embodiments of this disclosure provide a method for building an application, comprising:

[0007] The first project file of the target application is sent to the remote host, so that the remote host can perform a compilation task based on the first project file to obtain the target installation package of the target application;

[0008] Receive the target installation package sent by the remote host.

[0009] In one possible implementation, before sending the first project file of the target application to the remote host, the method further includes:

[0010] In response to a remote compilation instruction, a connection request is sent to the remote host, so that the remote host can authenticate the connection request and establish a connection with the local host.

[0011] In one possible implementation, sending a connection request to the remote host includes:

[0012] The configuration information for remote compilation is executed to send a connection request to the remote host; wherein the configuration information for remote compilation is pre-configured based on the Configuration component and stored in the first project file.

[0013] In one possible implementation, the configuration information for performing remote compilation includes:

[0014] Obtain the Secure Shell Protocol (SSH) configuration information and key file from the project file; wherein, the SSH configuration information includes the device information of the remote host, and the decryption key corresponding to the key file is stored in the remote host;

[0015] Based on the SSH configuration information, a connection request carrying the key file is sent to the remote host via the SSH command, so that the remote host can decrypt the key file using the decryption key. If the decryption is successful, the connection request is authenticated.

[0016] In one possible implementation, the method further includes:

[0017] Send the configuration information for the remote compilation to other local hosts so that the other local hosts can establish a connection with the remote host; and / or

[0018] The configuration information for remote compilation is managed through a version management component.

[0019] In one possible implementation, the method further includes:

[0020] A synchronization request is sent to the remote host to cause the remote host to return the file information of the second project file of the target application currently stored; wherein the second project file is the same as the first project file, or the second project file is determined based on the first project file;

[0021] Based on the file information of the second project file, the third project file that needs to be synchronized is compared with the second project file to obtain an incremental file; wherein, the third project file is obtained by updating the first project file;

[0022] The incremental file is sent to the remote host, so that the remote host can perform a compilation task based on the second project file and the incremental file to obtain the update installation package of the target application.

[0023] In one possible implementation, the file information of the second project file includes first verification information for each data block;

[0024] The step of comparing the third project file to be synchronized with the second project file based on the file information of the second project file to obtain the incremental file includes:

[0025] For each target data block in the third project file, the second verification information of the target data block is obtained, and the second verification information is matched with the first verification information of each data block in the second project file. If the second verification information is not matched, the target data block is used as a data block in the incremental file.

[0026] In one possible implementation, prior to sending the synchronization request to the remote host, the method further includes:

[0027] The target format file in the third project file is stored in the server corresponding to the local host, and the target format file in the second project file is removed; wherein, the target format is used to represent the version information of the target application.

[0028] In one possible implementation, before sending the first project file of the target application to the remote host, the method further includes:

[0029] The local host sends its username to the remote host, so that the remote host can create a username directory based on the username; wherein, the username directory stores the files sent by the local host.

[0030] Secondly, embodiments of this disclosure also provide a method for building an application, applied to a remote host, including:

[0031] Receive the first project file of the target application sent by the local host;

[0032] After executing the compilation task of the first project file, the target installation package of the target application is obtained;

[0033] Send the target installation package to the local host.

[0034] In one possible implementation, before receiving the first project file of the target application sent by the local host, the method further includes:

[0035] Receive connection requests sent by the local host and authenticate the connection requests;

[0036] If the connection request is successfully authenticated, a connection is established with the local host.

[0037] In one possible implementation, the connection request is sent by the local host via an SSH command and carries a key file; receiving the connection request sent by the local host and authenticating the connection request includes:

[0038] Receive connection requests sent by the local host via the SSH process;

[0039] The key file is decrypted using a pre-stored decryption key;

[0040] If decryption is successful, the connection request is authenticated.

[0041] In one possible implementation, the method further includes:

[0042] After receiving a synchronization request sent by the local host, the file information of the currently stored second project file is obtained; wherein, the second project file is the same as the first project file, or the second project file is determined based on the first project file;

[0043] The file information of the second project file is sent to the local host, so that the local host compares the third project file that needs to be synchronized with the second project file based on the file information of the second project file to obtain an incremental file; wherein, the third project file is obtained by updating the first project file;

[0044] The system receives the incremental file sent by the local host and performs a compilation task based on the third project file and the incremental file to obtain the update installation package of the target application.

[0045] In one possible implementation, sending the file information of the second project file to the local host, so that the local host compares the third project file to be synchronized with the second project file based on the file information of the second project file to obtain the incremental file, includes:

[0046] The first verification information of each data block in the second project file is sent to the local host, so that the local host can obtain the second verification information of each target data block in the third project file, and match the second verification information from the first verification information of each data block. If the second verification information is not matched, the target data block is used as a data block in the incremental file.

[0047] In one possible implementation, the incremental file includes a first target file, which stores the local storage path of the signature file of the target application, and a second target file in the third project file corresponds to the first target file, which stores the remote storage path of the signature file.

[0048] After receiving the incremental file sent by the local host, and before executing the compilation task based on the third project file and the incremental file, the process further includes:

[0049] Remove the local storage path of the signature file in the first target file and merge the remote storage path of the signature file in the second target file into the first target file;

[0050] Replace the second target file with the merged first target file.

[0051] In one possible implementation, the first project file includes source code files and resource files. After executing the compilation task of the first project file, obtaining the target installation package of the target application includes:

[0052] The source code file is converted into an executable file and the resource file is converted into compiled resources using a compilation tool.

[0053] The target executable file and the compiled resources are merged into an installation package, and the installation package is signed using a signing file to obtain the target installation package of the target application.

[0054] In one possible implementation, before receiving the first project file of the target application sent by the local host, the method further includes:

[0055] Create a username directory based on the username sent by the local host; wherein, the files sent by the local host are stored under the username.

[0056] Thirdly, embodiments of this disclosure also provide an application building apparatus, applied to a local host, comprising:

[0057] The file sending module is used to send the first project file of the target application to the remote host, so that the remote host can perform a compilation task based on the first project file and obtain the target installation package of the target application.

[0058] The installation package receiving module is used to receive the target installation package sent by the remote host.

[0059] In one possible implementation, the device further includes a connection request module for:

[0060] In response to a remote compilation instruction, a connection request is sent to the remote host, so that the remote host can authenticate the connection request and establish a connection with the local host.

[0061] In one possible implementation, the connection request module further includes:

[0062] An execution submodule is used to execute the configuration information for remote compilation in order to send a connection request to the remote host; wherein the configuration information for remote compilation is pre-configured based on the Configuration component and stored in the first project file.

[0063] In one possible implementation, the execution submodule is further configured to:

[0064] Obtain the Secure Shell Protocol (SSH) configuration information and key file from the project file; wherein, the SSH configuration information includes the device information of the remote host, and the decryption key corresponding to the key file is stored in the remote host;

[0065] Based on the SSH configuration information, a connection request carrying the key file is sent to the remote host via the SSH command, so that the remote host can decrypt the key file using the decryption key. If the decryption is successful, the connection request is authenticated.

[0066] In one possible implementation, the device further includes:

[0067] The configuration information sharing module is used to send the configuration information compiled remotely to other local hosts, so that the other local hosts can establish a connection with the remote host; and / or

[0068] The version management module is used to manage the configuration information of the remote compilation through the version management component.

[0069] In one possible implementation, the device further includes:

[0070] A synchronization request module is used to send a synchronization request to the remote host so that the remote host returns the file information of the second project file of the target application currently stored; wherein the second project file is the same as the first project file, or the second project file is determined based on the first project file;

[0071] The incremental acquisition module compares the third project file to be synchronized with the second project file based on the file information of the second project file to obtain the incremental file; wherein the third project file is obtained by updating the first project file;

[0072] An incremental sending module is used to send the incremental file to the remote host, so that the remote host can perform a compilation task based on the second project file and the incremental file to obtain the update installation package of the target application.

[0073] In one possible implementation, the file information of the second project file includes first verification information for each data block;

[0074] The incremental acquisition module is also used for:

[0075] For each target data block in the third project file, the second verification information of the target data block is obtained, and the second verification information is matched with the first verification information of each data block in the second project file. If the second verification information is not matched, the target data block is used as a data block in the incremental file.

[0076] In one possible implementation, the device further includes a storage module for:

[0077] The target format file in the third project file is stored in the server corresponding to the local host, and the target format file in the second project file is removed; wherein, the target format is used to represent the version information of the target application.

[0078] In one possible implementation, the device further includes a username sending module for:

[0079] The local host sends its username to the remote host, so that the remote host can create a username directory based on the username; wherein, the username directory stores the files sent by the local host.

[0080] Fourthly, embodiments of this disclosure also provide an application building apparatus, applied to a remote host, comprising:

[0081] The file receiving module is used to receive the first project file of the target application sent by the local host.

[0082] The compilation module is used to execute the compilation task of the first project file and obtain the target installation package of the target application.

[0083] The installation package sending module is used to send the target installation package to the local host.

[0084] In one possible implementation, the device further includes a connection authentication module for:

[0085] Receive connection requests sent by the local host and authenticate the connection requests;

[0086] If the connection request is successfully authenticated, a connection is established with the local host.

[0087] In one possible implementation, the connection request is sent by the local host via an SSH command and carries a key file;

[0088] The connection authentication module is also used for:

[0089] Receive connection requests sent by the local host via the SSH process;

[0090] The key file is decrypted using a pre-stored decryption key;

[0091] If decryption is successful, the connection request is authenticated.

[0092] In one possible implementation, the device further includes:

[0093] The information acquisition module is used to receive a synchronization request sent by the local host and then acquire the file information of the currently stored second project file; wherein the second project file is the same as the first project file, or the second project file is determined based on the first project file;

[0094] The information sending module is used to send the file information of the second project file to the local host, so that the local host can compare the third project file to be synchronized with the second project file based on the file information of the second project file to obtain an incremental file; wherein, the third project file is obtained by updating the first project file;

[0095] An incremental receiving module is used to receive the incremental file sent by the local host, and to perform a compilation task based on the third project file and the incremental file to obtain the update installation package of the target application.

[0096] In one possible implementation, the information sending module is further configured to:

[0097] The first verification information of each data block in the second project file is sent to the local host, so that the local host can obtain the second verification information of each target data block in the third project file, and match the second verification information from the first verification information of each data block. If the second verification information is not matched, the target data block is used as a data block in the incremental file.

[0098] In one possible implementation, the incremental file includes a first target file, which stores the local storage path of the signature file of the target application, and a second target file in the third project file corresponds to the first target file, which stores the remote storage path of the signature file.

[0099] The incremental receiving module further includes a merging submodule, used for:

[0100] After receiving the incremental file sent by the local host, and before executing the compilation task based on the third project file and the incremental file, the process further includes:

[0101] Remove the local storage path of the signature file in the first target file and merge the remote storage path of the signature file in the second target file into the first target file;

[0102] Replace the second target file with the merged first target file.

[0103] In one possible implementation, the first project file includes source code files and resource files, and the compilation module is further configured to:

[0104] The source code file is converted into an executable file and the resource file is converted into compiled resources using a compilation tool.

[0105] The target executable file and the compiled resources are merged into an installation package, and the installation package is signed using a signing file to obtain the target installation package of the target application.

[0106] In one possible implementation, the apparatus further includes a directory creation module for:

[0107] Create a username directory based on the username sent by the local host; wherein, the files sent by the local host are stored under the username.

[0108] Fifthly, embodiments of this disclosure also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and when the computer program is executed by the processor, causes the processor to implement the steps of the application construction method of either the first aspect or the second aspect.

[0109] In a sixth aspect, embodiments of this disclosure also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for constructing an application according to either the first or second aspect.

[0110] The application construction method provided in this disclosure has at least the following beneficial effects:

[0111] According to the solution provided in this disclosure, the local host sends the first project file of the target application to the remote host, so that the remote host executes a compilation task based on the first project file to obtain the target installation package of the target application, and then receives the target installation package sent by the remote host. In this way, by transferring the compilation task of the application project file to the remote host, the CPU of the local host can be freed up, thus avoiding the situation where the local host performs project file development while simultaneously executing the compilation task, resulting in high memory consumption and heavy load on the local host, leading to low application build efficiency and performance. Therefore, this disclosure embodiment can improve the build efficiency and performance of applications.

[0112] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objects and other advantages of this disclosure may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0113] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0114] Figure 1 A schematic diagram illustrating an application scenario for an application building method provided in this embodiment of the disclosure;

[0115] Figure 2 Signaling interaction diagram of an application construction method provided in this embodiment of the disclosure;

[0116] Figure 3 A schematic diagram illustrating configuration information for remote compilation provided in an embodiment of this disclosure;

[0117] Figure 4 Signaling interaction diagram of another application construction method provided in this disclosure embodiment;

[0118] Figure 5 A flowchart illustrating an application construction method provided in this disclosure embodiment;

[0119] Figure 6 A flowchart of another method for building an application provided in this disclosure embodiment;

[0120] Figure 7 A flowchart of another method for building an application provided in this disclosure embodiment;

[0121] Figure 8 A schematic diagram of an application building apparatus provided in an embodiment of this disclosure;

[0122] Figure 9 A schematic diagram of another application building apparatus provided in accordance with embodiments of this disclosure;

[0123] Figure 10 A schematic diagram of another application building apparatus provided in accordance with embodiments of this disclosure;

[0124] Figure 11 A schematic diagram of another application building apparatus provided in accordance with embodiments of this disclosure;

[0125] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0126] To make the objectives, technical solutions, and advantages of this disclosure clearer, the disclosure will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without creative effort are within the scope of protection of this disclosure.

[0127] The following explains some of the terms used in the embodiments of this disclosure.

[0128] Gradle is an automated build tool that can be used as open-source software to build different types of software. The software build process can include compiling source code and generating software installation packages.

[0129] Secure Shell (SSH) is a secure network transport protocol based on a shell, built at the application layer. SSH is a reliable protocol specifically designed to provide security for remote login sessions and other network services. Using SSH can effectively prevent information leakage during remote management.

[0130] It should be noted that the terms "first," "second," etc., used in the specification and claims of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein.

[0131] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.

[0132] The principles and spirit of this application will be explained in detail below with reference to several representative embodiments of this disclosure.

[0133] Currently, after developers complete application development on the development host, they still need to build the developed project files on the development host to perform the compilation task and ultimately obtain the application installation package. Because the CPU resources of the development host are limited, and the application project files are usually quite large, building the project files requires significant memory overhead and places a heavy load on the processor, resulting in low application build efficiency and performance.

[0134] In view of this, embodiments of this disclosure provide a method, apparatus, device, and medium for building an application. A local host sends a first project file of a target application to a remote host, enabling the remote host to perform a compilation task based on the first project file to obtain a target installation package of the target application, and then receives the target installation package sent by the remote host. This improves the efficiency and performance of application building.

[0135] The application scenarios of the embodiments of this disclosure are described below with reference to the accompanying drawings.

[0136] refer to Figure 1This diagram illustrates an application scenario of the application building method provided in this embodiment. The application scenario includes a local host 11 and a remote host 12. The local host 11 and the remote host 12 can be connected via a communication network for data transmission, etc. Both the local host 11 and the remote host 12 include, but are not limited to, electronic devices such as desktop computers, mobile computers, and tablet computers.

[0137] Application developers can develop the target application on local host 11, including writing the source code to generate the application's project files. After development, the project files can be sent from local host 11 to remote host 12, where remote host 12 will compile the files to generate an installation package, which will then be returned to local host 11. Local host 11 can then install the package onto a terminal device.

[0138] The following is combined Figure 1 The above application scenarios are used to describe a method for building an application according to exemplary embodiments of this disclosure. These application scenarios are shown only to facilitate understanding of the spirit and principles of this disclosure, and the embodiments of this disclosure are not limited in any way. Rather, the embodiments of this disclosure can be applied to any applicable scenario.

[0139] refer to Figure 2 This disclosure provides a signaling interaction diagram for an application construction method, executed collaboratively by a local host and a remote host. The local host and remote host can connect via a communication network for data transmission. The application construction method may include the following steps:

[0140] In step S201, the local host sends the first project file of the target application to the remote host.

[0141] The target application can be any type of application software, such as social networking applications, instant messaging applications, browser applications, game applications, etc., without any limitation.

[0142] Once the target application is developed, the local host obtains the first project file, establishes a connection with the remote host, and sends the first project file to the remote host. This first project file can include various files from the target application development process, such as source code files, resource files, and build configuration files.

[0143] In step S202, after the remote host executes the compilation task of the first project file, it obtains the target installation package of the target application.

[0144] In this step, the remote host can pre-install project build tools, such as Gradle. These tools can then be used to compile the first project file, resulting in the target installation package for the target application. For example, the remote host can execute the Gradle command to compile the first project file.

[0145] In one possible implementation, the first project file includes source code files and resource files, and step S202 may include the following steps:

[0146] 1) Use compilation tools to convert source code files into target executable files and resource files into compiled resources.

[0147] The compilation tool can be any of the project build tools mentioned above, and the target executable file can be a Dalvik Executable (DEX) file. Resource files can be resources obtained during the development of the target application, other than the source code, such as images, menus, and toolbars.

[0148] 2) Combine the target executable file and compiled resources into an installation package, and sign the installation package using a signing file to obtain the target installation package of the target application.

[0149] In this step, a packaging tool can be used to merge the target executable file and compiled resources into an installation package. The signature file can be understood as identification information; signing the installation package with a signature file facilitates subsequent version updates of the installed package and prevents malicious third-party replacement or overwriting of the installed package.

[0150] In step S203, the remote host sends the target installation package to the local host.

[0151] In this embodiment of the disclosure, during the compilation task of the first project file, the remote host can obtain intermediate compilation files and ultimately obtain the target installation package. To improve data transmission efficiency, the remote host can send only the target installation package to the local host, without needing to send the intermediate compilation files to the local host.

[0152] After obtaining the target installation package, the local host can implement the specified functions using the corresponding components in the application development tool (IDE). Since the implementation of some components in the IDE does not depend on the compiled intermediate files, the remote host only sending the compiled target installation package to the local host does not affect the local host's use of the corresponding components in the IDE. For example, if the IDE is Android Studio, its Apply Changes component does not depend on the compiled intermediate artifacts. The Apply Changes component is used to find the differences between the compiled installation package and the installation package already installed on the terminal device. After finding the differences, it can send the differences to the terminal device to perform difference merging, that is, merging the differences into the installation package on the terminal device, so that the installation package installed on the terminal device can be modified or updated.

[0153] It should be noted that, depending on actual needs, the remote host may also send the compiled intermediate files to the local host, and this embodiment of the disclosure does not limit this.

[0154] Furthermore, after receiving the target installation package from the remote host, the local host can also install the target installation package onto the terminal device. The terminal device can include, but is not limited to, personal computers, mobile phones, tablets, laptops, e-book readers, smart home appliances, and other electronic devices.

[0155] In this embodiment of the disclosure, by transferring the compilation task of the first project file of the target application to a remote host, the CPU of the local host can be freed up. This avoids the situation where the local host performs project file development and compilation tasks simultaneously, resulting in high memory consumption and heavy load on the local host, leading to low application build efficiency and performance. Therefore, this embodiment of the disclosure can improve the build efficiency and performance of the application.

[0156] In some embodiments, before performing step S201, the local host may also perform the following steps:

[0157] In response to a remote compilation command, a connection request is sent to the remote host.

[0158] In one possible implementation, the local host can execute the configuration information for remote compilation to send a connection request to the remote host; wherein the configuration information for remote compilation can be pre-configured based on the Configuration component and can be stored in the first project file.

[0159] For example, such as Figure 3As shown, the runConfigurations file in the first project file stores the configuration information for remote compilation. Executing the configuration information for remote compilation means that a connection request can be sent to the remote host.

[0160] The Configuration component mentioned above is a configuration component in Android Studio. By configuring the configuration information for remote compilation through the Configuration component, one-click remote build can be achieved. That is, after the developer triggers the remote compilation command on the local host with one click, the local host starts to execute the configuration information for remote compilation to establish a connection with the remote host, and then can execute the above steps S201 to S203, and can install the obtained target installation package to the terminal device.

[0161] Optionally, the local host can establish a connection with the remote host via SSH, and the remote host can have SSH service enabled beforehand. In this case, the configuration information for performing remote compilation can include the following steps:

[0162] a. Obtain the Secure Shell (SSH) configuration information and key file from the project file; the SSH configuration information includes the device information of the remote host, and the decryption key corresponding to the key file is stored on the remote host.

[0163] In this step, the device information of the remote host may include Internet Protocol (IP) address information, hostname, etc. The key file can be a file containing encrypted information, such as the hostname of the remote host, obtained by encrypting specified information with an encryption key. The encryption and decryption keys are used for SSH authentication; they can be symmetric or asymmetric, and this disclosure does not limit this.

[0164] For example, the encryption and decryption keys are asymmetric. The local host can pre-generate paired keys, including a public key and a private key, send the public key to the remote host, and store the public key on the remote host. The private key is stored in the first project file on the local host. In step a, the private key stored in the first project file can be copied to the local machine, and the SSH configuration information can also be copied to the local machine.

[0165] b. Based on the SSH configuration information, send a connection request carrying the key file to the remote host via the SSH command.

[0166] Furthermore, after receiving a connection request from the local host, the remote host can authenticate the connection request; if the connection request is successfully authenticated, a connection is established with the local host.

[0167] In one possible implementation, as described above, the connection request can be sent by the local host via SSH commands, carrying a key file; in this case, the remote host's authentication of the connection request can include the following steps:

[0168] A. Receive connection requests sent by the local host via the SSH process.

[0169] B. Decrypt the key file using the pre-stored decryption key.

[0170] The decryption key can be sent from the local host to the remote host in advance, and then the remote host stores the decryption key.

[0171] C. If decryption is successful, the connection request authentication is successful.

[0172] For example, the key file is obtained by encrypting the hostname of the remote host using the encryption key on the local host. If the remote host successfully decrypts the key file using the decryption key and obtains the hostname of the remote host, the connection request authentication is successful; otherwise, the connection request authentication fails.

[0173] In this embodiment, the local host uses SSH to authenticate with the remote host via a key file. This eliminates the need for developers to enter usernames and passwords for authentication, making the process simple and convenient. Furthermore, in collaborative development scenarios where multiple local hosts need to connect to the remote host simultaneously, developers no longer need to enter their individual usernames and passwords on their local hosts, providing convenience and enabling multiple local hosts to quickly establish connections with the remote host.

[0174] In some embodiments, a remote host can connect to multiple local hosts. To enable collaborative development, a local host can also send configuration information for remote compilation to other local hosts so that other local hosts can establish connections with the remote host.

[0175] To enable version management of configuration information for remote compilation, the local host can also manage the configuration information for remote compilation through a version management component.

[0176] In the above embodiments of this disclosure, steps S201 to S203 can be executed in the scenario of the target application being built for the first time. Considering that after the local host obtains the target installation package of the target application, it may update the first project file of the target application during subsequent maintenance. The updated project file will have differences compared with the first project file. Therefore, the local host needs to synchronize the updated project file of the target application to the remote host.

[0177] When synchronizing updated project files to a remote host, in order to improve transmission efficiency and save transmission resources, the local host can synchronize only the incremental files, that is, the difference files between the updated project files on the local host and the project files currently stored on the remote host.

[0178] In some embodiments, refer to Figure 4 As shown, the local host and remote host can perform the following steps respectively in the incremental synchronization scenario:

[0179] Step S401: The local host sends a synchronization request to the remote host.

[0180] Step S402: The remote host obtains the file information of the currently stored second project file; wherein the second project file is the same as the first project file, or the second project file is determined based on the first project file.

[0181] Since the remote host may modify the first project file after receiving it from the local host, or it may not modify it, the second project file currently stored on the remote host may be the same as or different from the first project file.

[0182] In step S403, the remote host sends the file information of the second project file to the local host.

[0183] In one possible implementation, the file information of the second project file may include first verification information for each data block of the second project file. The first verification information for each data block can be generated according to a preset method.

[0184] For example, the remote host can divide the second project file into fixed-size data blocks, such as 500-1000 bytes per block, and number each data block, while recording the starting offset address and length of each data block.

[0185] For each data block in the second project file, the remote host calculates checksum information based on the block's content. For example, the checksum information includes two checksums: a 32-bit weak rolling checksum and a 128-bit strong MD5 checksum. Then, all the calculated rolling checksums and strong MD5 checksums from the second project file are appended to the corresponding data block number to form a checksum set, thus obtaining the first checksum information for each data block.

[0186] In step S404, the local host compares the third project file to be synchronized with the second project file based on the file information of the second project file to obtain the incremental file; wherein the third project file is obtained by updating the first project file.

[0187] In one possible implementation, when the file information of the second project file includes the first checksum information for each data block, the local host can obtain the incremental file in the following manner:

[0188] For each target data block in the third project file, obtain the second verification information of the target data block, and match the second verification information with the first verification information of each data block in the second project file. If no second verification information is matched, the target data block is used as a data block in the incremental file.

[0189] For example, the first verification information for each data block uses the aforementioned checksum set, meaning each data block includes two checksums: a rolling checksum and an MD5 strong checksum. The local host can calculate a 16-bit hash value for each rolling checksum in the checksum set and place every 2^16 hash values ​​into a hash table in hash order. Each hash entry in the hash table points to the corresponding data block number in the checksum set. Then, the checksum set is sorted according to the hash values, so that the order of the checksums in the sorted checksum set corresponds to the order in the hash table.

[0190] Furthermore, for each target data block in the third project file, the local host can perform the following steps:

[0191] 1. Take the first target data block in the third project file, for example, 512 bytes in length. Calculate the rolling checksum of the first target data block and calculate a 16-bit hash value for the calculated rolling checksum. Then, match the calculated target hash value with the hash table mentioned above.

[0192] 2. If a target hash value is matched from the hash table above, it indicates that there is a potentially identical data block in the second project file. Take the first MD5 checksum of the data block corresponding to the first target data block from the hash table. Further, calculate the second MD5 checksum of the first target data block. Compare the first MD5 checksum and the second MD5 checksum. If they are the same, it means that the data block corresponding to the first MD5 checksum is the same as the first target data block. If they are different, it means that the data block corresponding to the first MD5 checksum is different from the first target data block. The first target data block is then used as a data block in the incremental file.

[0193] 3. If no target hash value is found in the hash table above, the first target data block is used as a data block in the incremental file. Furthermore, there is no need to compare the MD5 checksum. Therefore, if either the rolling checksum or the MD5 checksum of the corresponding target data block cannot be matched in the hash table of the second project file, the corresponding target data block is used as a data block in the incremental file.

[0194] In step S405, the local host sends the incremental file to the remote host.

[0195] In step S406, the remote host performs a compilation task based on the second project file and the incremental file to obtain the update installation package of the target application.

[0196] This step is similar to step S202 in the above embodiments of this disclosure, and will not be described again here.

[0197] In step S407, the remote host sends the update installation package to the local host.

[0198] In this embodiment, the local host can send the first project file to the remote host during the initial build (non-incremental build) of the target application, allowing the remote host to generate the target installation package; and it can also synchronize incremental files to the remote host during incremental builds, enabling the remote host to generate an updated installation package. This improves the build efficiency and performance of the target application in both non-incremental and incremental build scenarios. Furthermore, aside from some time loss during the initial file synchronization, the file synchronization time is negligible in incremental synchronization scenarios.

[0199] In some embodiments, the incremental file may include a first target file, which stores the local storage path of the signature file of the target application, and a second target file in the third project file that corresponds to the first target file and stores the remote storage path of the signature file.

[0200] The local storage path is the storage path of the signature file on the local host, such as folder A in drive C on the local host; the remote storage path is the storage path of the signature file on the remote host, such as folder B in drive D on the remote host. In addition to storing the local storage path of the signature file, the first target file may also store the first configuration information. Similarly, in addition to storing the remote storage path of the signature file, the second target file may also store the second configuration information.

[0201] After receiving the incremental file from the local host, and before executing the compilation task based on the third project file and the incremental file, the remote host can also perform the following steps:

[0202] 1. Remove the local storage path of the signature file in the first target file and merge the remote storage path of the signature file in the second target file into the first target file.

[0203] II. Replace the second target file with the merged first target file.

[0204] The signature file is the same as the signature file used to sign the installation package in the above embodiments.

[0205] For example, the signing file is named KeyStore. The target installation package is generated based on KeyStore, which is the unique identifier of the target installation package and is related to its security. On the local host, the local absolute path of KeyStore is stored in the local gradle.properties file (i.e., the first target file mentioned above). On the remote host, the remote absolute path of KeyStore is stored in the remote gradle.properties file (i.e., the second target file mentioned above). The local gradle.properties file is an incremental file.

[0206] When a remote compilation is triggered, the local host needs to synchronize its local gradle.properties file to the remote host. When the remote host receives the local gradle.properties file from the local host, it only synchronizes the configuration information in the local gradle.properties file, and does not synchronize the local absolute path of KeyStore. For example, the remote host can delete the local absolute path of KeyStore from the local gradle.properties file and merge the configuration information in the local gradle.properties file with the configuration information in the remote gradle.properties file.

[0207] In this way, since the remote host retains the absolute path of KeyStore in the remote gradle.properties file, the problem of KeyStore not being found can be avoided when generating the update installation package.

[0208] In some embodiments, the incremental file may include a target format file, which is used to characterize the version information of the target application. The remote host does not depend on the target format file during compilation. Therefore, in order to save transmission resources and improve transmission efficiency, the local host may not synchronize the target format file to the remote host.

[0209] Before sending a synchronization request to the remote host, the local host can also store the target format file in the third project file to the server corresponding to the local host, and remove the target format file in the second project file.

[0210] For example, the target format is .git. The remote host does not depend on the .git file during compilation. Considering that the .git file is changed frequently and has a large size, ignoring the transmission of the .git file during synchronization can greatly save transmission resources and improve transmission efficiency.

[0211] In some embodiments, a remote host can connect to multiple local hosts simultaneously. To distinguish project files from different local hosts, a local host can send its username to the remote host before sending the first project file of the target application to the remote host, so that the remote host can create a username directory based on the username. The username directory contains the files sent by the local host.

[0212] Furthermore, before receiving the first project file of the target application sent by the local host, the remote host can also create a username directory based on the username sent by the local host; the username directory contains the files sent by the local host.

[0213] Based on the above embodiments of this disclosure, the method for building applications on the local host side will be described below.

[0214] In some embodiments, this disclosure provides a method for building an application that can be applied to a local host, such as... Figure 5 As shown, the method for building this application includes the following steps:

[0215] In step S501, the local host sends the first project file of the target application to the remote host, so that the remote host can perform a compilation task based on the first project file and obtain the target installation package of the target application.

[0216] Step S502: The local host receives the target installation package sent by the remote host.

[0217] In some embodiments, such as Figure 6 As shown, before executing step S501, the local host can also execute the following steps:

[0218] In step S500, in response to the remote compilation instruction, a connection request is sent to the remote host so that the remote host can authenticate the connection request and establish a connection with the local host.

[0219] In one possible implementation, step S500 above can be achieved through the following steps:

[0220] The configuration information for remote compilation is executed to send a connection request to the remote host; the configuration information for remote compilation is pre-configured based on the Configuration component and stored in the first project file.

[0221] Optionally, the configuration information for performing remote compilation mentioned above may include the following steps:

[0222] Retrieve the Secure Shell (SSH) protocol configuration information and key file from the project file; the SSH configuration information includes the device information of the remote host, and the decryption key corresponding to the key file is stored on the remote host.

[0223] Based on the SSH configuration information, a connection request carrying a key file is sent to the remote host via the SSH command, so that the remote host can decrypt the key file using the decryption key. If the decryption is successful, the connection request is authenticated.

[0224] In one possible implementation, the local host may also perform the following steps:

[0225] Send the configuration information for remote compilation to other local hosts so that the other local hosts can establish a connection with the remote host; and / or

[0226] The configuration information for remote compilation is managed through a version management component.

[0227] In some embodiments, the local host may also perform the following steps:

[0228] Send a synchronization request to the remote host to cause the remote host to return the file information of the second project file of the target application currently stored; wherein the second project file is the same as the first project file, or the second project file is determined based on the first project file;

[0229] Based on the file information of the second project file, the third project file that needs to be synchronized is compared with the second project file to obtain the incremental file; wherein, the third project file is obtained by updating the first project file;

[0230] The incremental file is sent to the remote host so that the remote host can perform a compilation task based on the second project file and the incremental file to obtain the updated installation package of the target application.

[0231] In one possible implementation, the file information of the second project file includes the first verification information of each data block;

[0232] Based on the file information of the second project file, the third project file that needs to be synchronized is compared with the second project file to obtain the incremental file. This may include the following steps:

[0233] For each target data block in the third project file, obtain the second verification information of the target data block, and match the second verification information with the first verification information of each data block in the second project file. If no second verification information is matched, the target data block is used as a data block in the incremental file.

[0234] In one possible implementation, the following steps may also be performed before the local host sends a synchronization request to the remote host:

[0235] The target format file in the third project file is stored on the server corresponding to the local host, and the target format file in the second project file is removed; the target format is used to represent the version information of the target application.

[0236] In one possible implementation, before the local host sends the first project file of the target application to the remote host, the following steps may also be performed:

[0237] Send the username of the local host to the remote host so that the remote host can create a username directory based on the username; the username directory contains the files sent by the local host.

[0238] Based on the above embodiments of this disclosure, the following describes a method for constructing applications on the remote host side.

[0239] In some embodiments, this disclosure also provides a method for building an application that can be applied to a remote host, such as... Figure 7 As shown, the method for building this application may include the following steps:

[0240] Step S701: The remote host receives the first project file of the target application sent by the local host;

[0241] Step S702: After the remote host executes the compilation task of the first project file, it obtains the target installation package of the target application.

[0242] In step S703, the remote host sends the target installation package to the local host.

[0243] In one possible implementation, the remote host may also perform the following steps before executing step S701:

[0244] Receive connection requests sent by the local host and authenticate the connection requests;

[0245] If the connection request is successfully authenticated, a connection is established with the local host.

[0246] In one possible implementation, the connection request is sent by the local host via an SSH command, carrying a key file;

[0247] Receiving and authenticating connection requests from the local host can include the following steps:

[0248] Receive connection requests sent by the local host via the SSH process;

[0249] The key file is decrypted using a pre-stored decryption key;

[0250] If decryption is successful, the connection request is authenticated.

[0251] In one possible implementation, the remote host may also perform the following steps:

[0252] After receiving a synchronization request from the local host, obtain the file information of the currently stored second project file; wherein the second project file is the same as the first project file, or the second project file is determined based on the first project file;

[0253] The file information of the second project file is sent to the local host, so that the local host can compare the third project file that needs to be synchronized with the second project file based on the file information of the second project file and obtain the incremental file; wherein, the third project file is obtained by updating the first project file;

[0254] It receives incremental files sent from the local host and performs compilation tasks based on the third-party project file and the incremental files to obtain the update installation package of the target application.

[0255] In one possible implementation, the file information of the second project file is sent to the local host, so that the local host can compare the third project file to be synchronized with the second project file based on the file information of the second project file to obtain the incremental file. This may include the following steps:

[0256] The first verification information of each data block in the second project file is sent to the local host, so that the local host can obtain the second verification information of each target data block in the third project file, and match the second verification information from the first verification information of each data block. If no second verification information is matched, the target data block is used as a data block in the incremental file.

[0257] In one possible implementation, the incremental file includes a first target file, which stores the local storage path of the signature file of the target application, and a second target file in the third project file corresponds to the first target file, which stores the remote storage path of the signature file.

[0258] After receiving the incremental file from the local host, and before executing the compilation task based on the third project file and the incremental file, the remote host can also perform the following steps:

[0259] Remove the local storage path of the signature file in the first target file and merge the remote storage path of the signature file in the second target file into the first target file;

[0260] Replace the second target file with the merged first target file.

[0261] In one possible implementation, the first project file includes source code files and resource files. After executing the compilation task of the first project file, the target installation package of the target application is obtained, which may include the following steps:

[0262] The compilation tools convert source code files into target executable files and resource files into compiled resources.

[0263] The target executable file and compiled resources are merged into an installation package, and the installation package is signed using a signing file to obtain the target installation package of the target application.

[0264] In one possible implementation, the remote host may also perform the following steps before receiving the first project file of the target application sent by the local host:

[0265] Create a username directory based on the username sent by the local host; the username directory contains the files sent by the local host.

[0266] Based on the same inventive concept, this disclosure also provides an application building apparatus for a local host. The principle by which this apparatus solves the problem is similar to the method for a local host described above. Therefore, the implementation of this apparatus can be referred to the implementation of the method, and repeated details will not be elaborated further. See also... Figure 8 As shown in the figure, an application building apparatus provided in this disclosure includes a file sending module 81 and an installation package receiving module 82.

[0267] File sending module 81 is used to send the first project file of the target application to the remote host, so that the remote host can perform a compilation task based on the first project file and obtain the target installation package of the target application;

[0268] The installation package receiving module 82 is used to receive the target installation package sent by the remote host.

[0269] In one possible implementation, such as Figure 9 As shown, the device may further include a connection request module 80, for:

[0270] In response to a remote compilation command, a connection request is sent to the remote host, and after the remote host authenticates the connection request, a connection is established with the local host.

[0271] In one possible implementation, the connection request module 80 may further include:

[0272] The execution submodule is used to execute the configuration information for remote compilation in order to send a connection request to the remote host; the configuration information for remote compilation is pre-configured based on the Configuration component and stored in the first project file.

[0273] In one possible implementation, the execution submodule is further configured to:

[0274] Retrieve the Secure Shell (SSH) protocol configuration information and key file from the project file; the SSH configuration information includes the device information of the remote host, and the decryption key corresponding to the key file is stored on the remote host;

[0275] Based on the SSH configuration information, a connection request carrying a key file is sent to the remote host via the SSH command, so that the remote host can decrypt the key file using the decryption key. If the decryption is successful, the connection request is authenticated.

[0276] In one possible implementation, the apparatus may further include:

[0277] The configuration information sharing module is used to send remotely compiled configuration information to other local hosts, enabling those local hosts to establish connections with the remote host; and / or

[0278] The version management module is used to manage configuration information for remote compilation through version management components.

[0279] In one possible implementation, the apparatus may further include:

[0280] The synchronization request module 83 is used to send a synchronization request to the remote host so that the remote host can return the file information of the second project file of the target application currently stored; wherein the second project file is the same as the first project file, or the second project file is determined based on the first project file;

[0281] The incremental acquisition module 84 compares the third project file that needs to be synchronized with the second project file based on the file information of the second project file to obtain the incremental file; wherein, the third project file is obtained by updating the first project file;

[0282] The incremental sending module 85 is used to send the incremental file to the remote host so that the remote host can perform a compilation task based on the second project file and the incremental file to obtain the update installation package of the target application.

[0283] In one possible implementation, the file information of the second project file includes the first verification information of each data block;

[0284] Incremental acquisition module 84 can also be used for:

[0285] For each target data block in the third project file, obtain the second verification information of the target data block, and match the second verification information with the first verification information of each data block in the second project file. If no second verification information is matched, the target data block is used as a data block in the incremental file.

[0286] In one possible implementation, the device may further include a storage module for:

[0287] The target format file in the third project file is stored on the server corresponding to the local host, and the target format file in the second project file is removed; the target format is used to represent the version information of the target application.

[0288] In one possible implementation, the apparatus may further include a username sending module for:

[0289] Send the username of the local host to the remote host so that the remote host can create a username directory based on the username; the username directory contains the files sent by the local host.

[0290] Based on the same inventive concept, this disclosure also provides an application building apparatus for a remote host. The principle by which this apparatus solves the problem is similar to the method for a remote host described above. Therefore, the implementation of this apparatus can be referred to the implementation of the method, and repeated details will not be repeated. See also... Figure 10 As shown in the figure, an application building apparatus provided in this disclosure includes a file receiving module 101, a compilation module 102, and an installation package sending module 103.

[0291] File receiving module 101 is used to receive the first project file of the target application sent by the local host;

[0292] The compilation module 102 is used to execute the compilation task of the first project file and obtain the target installation package of the target application.

[0293] The installation package sending module 103 is used to send the target installation package to the local host.

[0294] In one possible implementation, such as Figure 11 As shown, the device may also include a connection authentication module 100 for use in...

[0295] Receive connection requests sent by the local host and authenticate the connection requests;

[0296] If the connection request is successfully authenticated, a connection is established with the local host.

[0297] In one possible implementation, the connection request is sent by the local host via an SSH command, carrying a key file;

[0298] The connection authentication module 100 is also used for:

[0299] Receive connection requests sent by the local host via the SSH process;

[0300] The key file is decrypted using a pre-stored decryption key;

[0301] If decryption is successful, the connection request is authenticated.

[0302] In one possible implementation, the apparatus may further include:

[0303] The information acquisition module 104 is used to receive a synchronization request sent by the local host and then acquire the file information of the currently stored second project file; wherein the second project file is the same as the first project file, or the second project file is determined based on the first project file;

[0304] The information sending module 105 is used to send the file information of the second project file to the local host, so that the local host can compare the third project file that needs to be synchronized with the second project file based on the file information of the second project file and obtain the incremental file; wherein, the third project file is obtained by updating the first project file;

[0305] The incremental receiving module 106 is used to receive incremental files sent by the local host, and perform compilation tasks based on the third project file and the incremental files to obtain the update installation package of the target application.

[0306] In one possible implementation, the information sending module 105 can also be used for:

[0307] The first verification information of each data block in the second project file is sent to the local host, so that the local host can obtain the second verification information of each target data block in the third project file, and match the second verification information from the first verification information of each data block. If no second verification information is matched, the target data block is used as a data block in the incremental file.

[0308] In one possible implementation, the incremental file includes a first target file, which stores the local storage path of the signature file of the target application, and a second target file in the third project file corresponds to the first target file, which stores the remote storage path of the signature file.

[0309] Incremental receiving module 106 may also include a merging submodule for:

[0310] Remove the local storage path of the signature file in the first target file and merge the remote storage path of the signature file in the second target file into the first target file;

[0311] Replace the second target file with the merged first target file.

[0312] In one possible implementation, the first project file includes source code files and resource files, and the compilation module 102 can also be used for:

[0313] The compilation tools convert source code files into target executable files and resource files into compiled resources.

[0314] The target executable file and compiled resources are merged into an installation package, and the installation package is signed using a signing file to obtain the target installation package of the target application.

[0315] In one possible implementation, the apparatus may further include a directory creation module for:

[0316] Create a username directory based on the username sent by the local host; the username directory contains the files sent by the local host.

[0317] Based on the same inventive concept, this disclosure also provides an electronic device, which can be a local host or a remote host. The principle of solving the problem is similar to the method in the above embodiments. Therefore, the implementation of this electronic device can refer to the implementation of the method, and repeated details will not be described again. Figure 11 A schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure is shown.

[0318] See Figure 12 As shown, the electronic device may include a processor 1202 and a memory 1201. The memory 1201 provides the processor 1202 with program instructions and data stored in the memory 1201. In this embodiment of the present disclosure, the memory 1201 may be used to store the program for building an application on the local host side or a remote host side in this embodiment of the present disclosure.

[0319] Processor 1202 executes the methods in any of the above method embodiments by calling program instructions stored in memory 1201, for example... Figure 5 or Figure 7 The illustrated embodiment provides a method for building an application.

[0320] This disclosure does not limit the specific connection medium between the memory 1201 and the processor 1202 described above. Figure 12 The memory 1201 and the processor 1202 are connected via a bus 1203, and the bus 1203 is in Figure 12 The connections between other components are shown in thick lines only and are not intended to be limiting. Bus 1203 can be divided into address bus, data bus, control bus, etc. For ease of illustration, Figure 12 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0321] The memory may include read-only memory (ROM) and random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0322] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0323] This disclosure also provides a computer storage medium storing a computer program. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to execute the application construction method in any of the above-described local host-side or remote host-side method embodiments.

[0324] In specific implementation, computer storage media can include: Universal Serial Bus Flash Drive (USB), portable hard drive, Read-Only Memory (ROM), Random Access Memory (RAM), magnetic disk or optical disk, and other storage media that can store program code.

[0325] In some possible implementations, various aspects of the application building method provided in this disclosure can also be implemented as a program product comprising program code that, when run on a computer device, causes the computer device to execute the application building method steps described above according to various exemplary embodiments of this disclosure, on a local host side or remote host side. For example, the computer device may execute... Figure 5 The application building process shown in steps S501-S502.

[0326] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0327] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0328] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.

[0329] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0330] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for building an application, characterized in that, Applied to a local host, the local host is used for developing the target application, including: The first project file of the target application is sent to the remote host, so that the remote host can perform a compilation task based on the first project file to obtain the target installation package of the target application; Receive the target installation package sent by the remote host; When the first project file is modified, the modified third project file is determined, and a synchronization request is sent to the remote host so that the remote host returns the file information of the currently stored second project file of the target application. The file information includes the weak checksum and strong checksum of each data block. The second project file is the same as the first project file, or the second project file is determined based on the first project file. The hash value of the weak checksum of each data block in the second project file is placed into the hash table in hash order; For each target data block in the third project file, the following operations are performed: the weak checksum of the target data block is matched against the hash table; if a target hash value is matched, the first strong checksum of the data block corresponding to the target hash value is obtained; if the second strong checksum of the target data block is different from the first strong checksum, the target data block is used as a data block in the incremental file; and if the target hash value is not matched against the hash table, the target data block is used as a data block in the incremental file. The incremental file is sent to the remote host, so that the remote host performs a compilation task based on the second project file and the incremental file to obtain the updated installation package of the target application; wherein, the incremental file includes a first target file, which stores the local storage path of the signature file of the target application and first configuration information, and the signature file is used to sign the installation package of the target application; the second target file in the second project file corresponds to the first target file, and the second target file stores the remote storage path of the signature file; before performing the compilation task based on the second project file and the incremental file, the remote host also removes the local storage path of the signature file in the first target file, merges the remote storage path of the signature file in the second target file into the first target file, and replaces the second target file with the merged first target file; Before sending the synchronization request to the remote host, the method further includes: The target format file in the third project file is stored in the server corresponding to the local host, and the target format file in the second project file is removed; wherein, the target format is used to represent the version information of the target application.

2. The method according to claim 1, characterized in that, Before sending the first project file of the target application to the remote host, the method further includes: In response to a remote compilation instruction, a connection request is sent to the remote host, so that the remote host can authenticate the connection request and establish a connection with the local host.

3. The method according to claim 2, characterized in that, Sending a connection request to the remote host includes: The configuration information for remote compilation is executed to send a connection request to the remote host; wherein the configuration information for remote compilation is pre-configured based on the Configuration component and stored in the first project file.

4. The method according to claim 3, characterized in that, The configuration information for performing remote compilation includes: Obtain the Secure Shell Protocol (SSH) configuration information and key file from the first project file; wherein, the SSH configuration information includes the device information of the remote host, and the decryption key corresponding to the key file is stored in the remote host; Based on the SSH configuration information, a connection request carrying the key file is sent to the remote host via the SSH command, so that the remote host can decrypt the key file using the decryption key. If the decryption is successful, the connection request is authenticated.

5. The method according to claim 3, characterized in that, The method further includes: Send the configuration information for the remote compilation to other local hosts so that the other local hosts can establish a connection with the remote host; and / or The configuration information for remote compilation is managed through a version management component.

6. The method according to any one of claims 1 to 5, characterized in that, Before sending the first project file of the target application to the remote host, the method further includes: The local host sends its username to the remote host, so that the remote host can create a username directory based on the username; wherein, the username directory stores the files sent by the local host.

7. A method for building an application, characterized in that, Applied to remote hosts, including: Receive the first project file of the target application sent by the local host; After executing the compilation task of the first project file, the target installation package of the target application is obtained; Send the target installation package to the local host; The system receives a synchronization request sent by the local host when it makes changes to the first project file, obtains the file information of the currently stored second project file of the target application, and sends the file information of the second project file to the local host. The file information includes weak checksums and strong checksums of each data block. The second project file is the same as the first project file, or the second project file is determined based on the first project file. The local host receives an incremental file sent by the local host, which is obtained by the local host through the following method: placing the hash values ​​of the weak checksums of each data block of the second project file into a hash table in hash order; for each target data block in the modified third project file of the first project file, the following operations are performed: matching the weak checksum of the target data block with the hash table; if a target hash value is matched, obtaining the first strong checksum of the data block corresponding to the target hash value; if the second strong checksum of the target data block is different from the first strong checksum, then using the target data block as a data block in the incremental file; and if the target hash value is not matched from the hash table, then using the target data block as a data block in the incremental file; before sending the synchronization request, the local host also stores the target format file of the third project file in the server corresponding to the local host, and removes the target format file from the second project file; wherein, the target format is used to represent the version information of the target application; Based on the second project file and the incremental file, a compilation task is performed to obtain the update installation package of the target application; The incremental file includes a first target file, which stores the local storage path of the signature file of the target application and first configuration information. The signature file is used to sign the installation package of the target application. The second target file in the second project file corresponds to the first target file, and the second target file stores the remote storage path of the signature file. After receiving the incremental file sent by the local host, and before executing the compilation task based on the second project file and the incremental file, the method further includes: Remove the local storage path of the signature file in the first target file and merge the remote storage path of the signature file in the second target file into the first target file; Replace the second target file with the merged first target file.

8. The method according to claim 7, characterized in that, Before receiving the first project file of the target application sent by the local host, the following are also included: Receive connection requests sent by the local host and authenticate the connection requests; If the connection request is successfully authenticated, a connection is established with the local host.

9. The method according to claim 8, characterized in that, The connection request is sent by the local host via SSH command and carries a key file; receiving the connection request sent by the local host and authenticating the connection request includes: Receive connection requests sent by the local host via the SSH process; The key file is decrypted using a pre-stored decryption key; If decryption is successful, the connection request is authenticated.

10. The method according to any one of claims 7 to 9, characterized in that, The first project file includes source code files and resource files. After executing the compilation task of the first project file, the target installation package of the target application is obtained, including: The source code file is converted into an executable file and the resource file is converted into compiled resources using a compilation tool. The target executable file and the compiled resources are merged into an installation package, and the installation package is signed using a signing file to obtain the target installation package of the target application.

11. The method according to any one of claims 7 to 9, characterized in that, Before receiving the first project file of the target application sent by the local host, the following are also included: Create a username directory based on the username sent by the local host; wherein, the files sent by the local host are stored under the username.

12. An application building apparatus, characterized in that, Applied to a local host, the local host is used for developing the target application, including: The file sending module is used to send the first project file of the target application to the remote host, so that the remote host can perform a compilation task based on the first project file and obtain the target installation package of the target application. The installation package receiving module is used to receive the target installation package sent by the remote host; The incremental acquisition module, when modifying the first project file, determines the modified third project file and sends a synchronization request to the remote host, so that the remote host returns the file information of the currently stored second project file of the target application. The file information includes weak checksums and strong checksums of each data block. The second project file is the same as the first project file, or the second project file is determined based on the first project file. The module places the hash values ​​of the weak checksums of each data block of the second project file into a hash table in hash order. For each target data block in the third project file, the module performs the following operations: matching the weak checksum of the target data block with the hash table; if a target hash value is matched, obtaining the first strong checksum of the data block corresponding to the target hash value; if the second strong checksum of the target data block is different from the first strong checksum, then the target data block is used as a data block in the incremental file; and if the target hash value is not matched with the hash table, then the target data block is used as a data block in the incremental file. An incremental sending module is used to send the incremental file to the remote host, so that the remote host can perform a compilation task based on the second project file and the incremental file to obtain the update installation package of the target application; The incremental file includes a first target file, which stores the local storage path of the signature file of the target application and first configuration information. The signature file is used to sign the installation package of the target application. The second target file in the second project file corresponds to the first target file, and the second target file stores the remote storage path of the signature file. Before the remote host performs the compilation task based on the second project file and the incremental file, it also removes the local storage path of the signature file in the first target file, merges the remote storage path of the signature file in the second target file into the first target file, and replaces the second target file with the merged first target file. The device further includes a storage module for: The target format file in the third project file is stored in the server corresponding to the local host, and the target format file in the second project file is removed; wherein, the target format is used to represent the version information of the target application.

13. The apparatus according to claim 12, characterized in that, The device further includes a connection request module for: In response to a remote compilation instruction, a connection request is sent to the remote host, so that the remote host can authenticate the connection request and establish a connection with the local host.

14. The apparatus according to claim 13, characterized in that, The connection request module also includes: An execution submodule is used to execute the configuration information for remote compilation in order to send a connection request to the remote host; wherein the configuration information for remote compilation is pre-configured based on the Configuration component and stored in the first project file.

15. The apparatus according to claim 14, characterized in that, The execution submodule is also used for: Obtain the Secure Shell Protocol (SSH) configuration information and key file from the project file; wherein, the SSH configuration information includes the device information of the remote host, and the decryption key corresponding to the key file is stored in the remote host; Based on the SSH configuration information, a connection request carrying the key file is sent to the remote host via the SSH command, so that the remote host can decrypt the key file using the decryption key. If the decryption is successful, the connection request is authenticated.

16. The apparatus according to claim 14, characterized in that, The device further includes: The configuration information sharing module is used to send the configuration information compiled remotely to other local hosts, so that the other local hosts can establish a connection with the remote host; and / or The version management module is used to manage the configuration information of the remote compilation through the version management component.

17. The apparatus according to any one of claims 12 to 16, characterized in that, The device further includes a username sending module, used for: The local host sends its username to the remote host, so that the remote host can create a username directory based on the username; wherein, the username directory stores the files sent by the local host.

18. An application building apparatus, characterized in that, Applied to remote hosts, including: The file receiving module is used to receive the first project file of the target application sent by the local host. The compilation module is used to execute the compilation task of the first project file and obtain the target installation package of the target application. The installation package sending module is used to send the target installation package to the local host; The information acquisition module is used to receive a synchronization request sent by the local host when the first project file is modified, and to acquire the file information of the second project file of the target application currently stored. The file information includes the weak checksum and strong checksum of each data block. The second project file is the same as the first project file, or the second project file is determined based on the first project file. The information sending module is used to send the file information of the second project file to the local host; Incremental receiver module, used for: The local host receives an incremental file sent by the local host, which is obtained by the local host through the following method: placing the hash values ​​of the weak checksums of each data block of the second project file into a hash table in hash order; for each target data block in the modified third project file of the first project file, the following operations are performed: matching the weak checksum of the target data block with the hash table; if a target hash value is matched, obtaining the first strong checksum of the data block corresponding to the target hash value; if the second strong checksum of the target data block is different from the first strong checksum, then using the target data block as a data block in the incremental file; and if the target hash value is not matched from the hash table, then using the target data block as a data block in the incremental file; before sending the synchronization request, the local host also stores the target format file of the third project file in the server corresponding to the local host, and removes the target format file from the second project file; wherein, the target format is used to represent the version information of the target application; Based on the second project file and the incremental file, a compilation task is performed to obtain the update installation package of the target application; The incremental file includes a first target file, which stores the local storage path of the signature file of the target application and first configuration information. The signature file is used to sign the installation package of the target application. The second target file in the second project file corresponds to the first target file, and the second target file stores the remote storage path of the signature file. The incremental receiving module further includes a merging submodule, used for: Remove the local storage path of the signature file in the first target file and merge the remote storage path of the signature file in the second target file into the first target file; Replace the second target file with the merged first target file.

19. The apparatus according to claim 18, characterized in that, The device further includes a connection authentication module for: Receive connection requests sent by the local host and authenticate the connection requests; If the connection request is successfully authenticated, a connection is established with the local host.

20. The apparatus according to claim 19, characterized in that, The connection request is sent by the local host via SSH command and carries a key file; The connection authentication module is also used for: Receive connection requests sent by the local host via the SSH process; The key file is decrypted using a pre-stored decryption key; If decryption is successful, the connection request is authenticated.

21. The apparatus according to any one of claims 18 to 20, characterized in that, The first project file includes source code files and resource files, and the compilation module is further used for: The source code file is converted into an executable file and the resource file is converted into compiled resources using a compilation tool. The target executable file and the compiled resources are merged into an installation package, and the installation package is signed using a signing file to obtain the target installation package of the target application.

22. The apparatus according to any one of claims 18 to 20, characterized in that, The device further includes a directory creation module for: Create a username directory based on the username sent by the local host; wherein, the files sent by the local host are stored under the username.

23. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores program code that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1-6 or any one of claims 7-11.

24. A computer-readable storage medium, characterized in that, It includes program code that, when run on an electronic device, causes the electronic device to perform the steps of the method according to any one of claims 1-6 or any one of claims 7-11.

Citation Information

Patent Citations

  • Method and device for constructing, publishing and downloading incremental files

    CN110032388A

  • Internet of Things application online compiling method based on multi-user cache

    CN111176654A

  • File processing method and device, server, electronic equipment and storage medium

    CN112540768A