File processing method, device, server, electronic equipment and storage medium
By the pre -compilation file in the system installation package, the problem of time consumption of electronic equipment in the system installation process is solved in the system installation package, and a faster system installation is realized, and the user experience is improved.
Patent Information
- Application Number
- CN202011595375.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-12-29
AI Technical Summary
With the continuous increase in the application volume of the operating system and the continuous change of application versions, the time required for electronic devices to be in the system installation/upgrade process is also getting longer and longer, affecting the user experience.
Obtain the compiled file of the specified application in advance and add it to the system installation package, so that the electronic device can directly extract the compiled file from the system installation package during system installation to avoid compiling the application again during the installation process.
By pre-containing the compiled files of the application in the system installation package, the electronic device does not need to be compiled during the system installation process, which significantly saves system installation time and improves user experience.
Smart Images

Figure CN112540768B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically, to a file processing method, device, server, electronic device and storage medium. Background Art
[0002] With the continuous development of mobile networks, various electronic devices are becoming more and more popular. In order to maintain a good user experience, electronic device system service providers usually provide operating system update services for electronic devices regularly or irregularly. However, with the continuous increase in the size of operating system applications and the continuous update of application versions, the time for electronic devices to install / upgrade the system is getting longer and longer, affecting the user experience of electronic devices. Summary of the invention
[0003] In view of the above problems, the present application proposes a file processing method, device, server, electronic device and storage medium, which can improve the above problems.
[0004] In a first aspect, an embodiment of the present application provides a file processing method, the method comprising: obtaining a compiled file corresponding to a specified application, the compiled file being an executable file obtained by compiling the source code of the specified application; adding the compiled file to a system installation package, so that when an electronic device installs a system according to the system installation package, the compiled file is extracted from the system installation package.
[0005] In a second aspect, an embodiment of the present application provides a file processing method, the method comprising: receiving a system installation package, the system installation package containing a compiled file corresponding to a specified application; when installing the system according to the system installation package, extracting the compiled file from the system installation package.
[0006] In the third aspect, an embodiment of the present application provides a file processing device, which includes: a file acquisition module, used to obtain a compiled file corresponding to a specified application, wherein the compiled file is an executable file obtained by compiling the source code of the specified application; a file adding module, used to add the compiled file to a system installation package, so that when the electronic device installs the system according to the system installation package, the compiled file can be extracted from the system installation package.
[0007] In a fourth aspect, an embodiment of the present application provides a file processing device, characterized in that the device includes: a system acquisition module for receiving a system installation package, wherein the system installation package contains a compiled file corresponding to a specified application; and a system installation module for extracting the compiled file from the system installation package when the system is installed according to the system installation package.
[0008] In a fifth aspect, an embodiment of the present application provides a server, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the file processing method provided in the first aspect above.
[0009] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; a memory; one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the file processing method provided in the second aspect above.
[0010] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the file processing method provided in the first aspect above.
[0011] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the file processing method provided in the second aspect above.
[0012] The solution provided by the present application obtains the compiled file corresponding to the specified application, which is an executable file obtained by compiling the source code of the specified application, and then adds the compiled file to the system installation package, so that when the electronic device installs the system according to the system installation package, the compiled file of the specified application can be directly extracted from the system installation package. In this way, by adding the compiled file of the specified application to the system installation package, the electronic device does not need to compile the specified application during the system installation process, but only needs to directly extract the compiled file of the specified application from the system installation package, which saves the system installation time of the electronic device and improves the user experience of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0014] Figure 1 A schematic diagram showing an application scenario provided by an embodiment of the present application is shown.
[0015] Figure 2Another schematic diagram of an application scenario provided by an embodiment of the present application is shown.
[0016] Figure 3 A flow chart of a file processing method according to an embodiment of the present application is shown.
[0017] Figure 4 A flow chart of a file processing method according to another embodiment of the present application is shown.
[0018] Figure 5 A flow chart of step S210 in a file processing method according to another embodiment of the present application is shown.
[0019] Figure 6 Another flow chart of step S210 in the file processing method according to another embodiment of the present application is shown.
[0020] Figure 7 Another flowchart of step S210 in the file processing method according to another embodiment of the present application is shown.
[0021] Figure 8 A flow chart of step S220 in a file processing method according to another embodiment of the present application is shown.
[0022] Fig. 9 A flow chart of a file processing method according to yet another embodiment of the present application is shown.
[0023] Fig.10 A block diagram of a file processing device according to an embodiment of the present application is shown.
[0024] Fig.11 A block diagram of a file processing device according to another embodiment of the present application is shown.
[0025] Fig.12 It is a block diagram of an electronic device according to an embodiment of the present application for executing the file processing method according to an embodiment of the present application.
[0026] Fig.13 It is a block diagram of a server for executing a file processing method according to an embodiment of the present application.
[0027] Fig.14 It is a storage unit of an embodiment of the present application for storing or carrying a program code for implementing a file processing method according to an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0029] At present, the system installation package of electronic devices (such as the installation package when the Android operating system is upgraded or updated) usually contains some commonly used application (Application, APP) installation packages, and during the system installation process of the electronic device, these APPs are usually compiled one by one, so that these APPs can be used directly after the system is installed without installation. Among them, the APPs included in the system installation package can also be called built-in APPs (system built-in apps).
[0030] However, because the built-in apps need to be compiled one by one during the system installation process, when there are many built-in apps in the system installation package, the system installation time will also increase. In addition, during the installation of the system software of each electronic device, these built-in apps will be compiled once, which means that the time, computing resources and energy loss caused by the compilation of built-in apps are proportional to the number of electronic devices installed. The more electronic devices there are, the more loss caused by the compilation of built-in apps.
[0031] After long-term research, the inventor has discovered and proposed the file processing method, device, server, electronic device and storage medium provided in the embodiments of the present application, which can compile the built-in APP before the system software is packaged, so that when the system installation package is packaged, the compiled file compiled by the built-in APP can be directly included in the system installation package. In this way, when the electronic device installs the system, the compiled file of the built-in APP can be directly extracted from the system installation package without having to compile the specified application, thereby saving the electronic device time, computing resources and battery power loss caused by the built-in APP compilation. The specific file processing method is described in detail in the subsequent embodiments.
[0032] The following is an introduction to the application scenarios provided by the embodiments of the present application.
[0033] In some embodiments, see Figure 1 , Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application is shown, and the application scenario includes a file processing system 10, and the file processing system 10 includes: an electronic device 100 and a first server 200. The electronic device 100 communicates with the first server 200 through a network. The electronic device 100 can exchange data with the first server 200 to obtain file data such as an installation package of an application, a compiled file, etc. from the first server 200.
[0034] In some other embodiments, see Figure 2 , Figure 2Another schematic diagram of an application scenario provided by an embodiment of the present application is shown, and the file processing system 10 may also include: an electronic device 100, a first server 200, and a second server 300. Data is exchanged between the electronic device 100 and the first server 200, and data is also exchanged between the first server 200 and the second server 300. The first server 200 may be used to process the request of the electronic device 100, and the second server 300 may be used to store and manage file data such as installation packages and compiled files of the application. When the electronic device 100 obtains the file of the application from the first server 200, the first server 200 may obtain the file of the application from the second server 300 and send the file of the application to the electronic device 100.
[0035] Of course, the file processing system 10 may also include other servers. For example, the file processing system 10 may also include a third server, which may be used to collect compiled files of the application from the user's electronic device and transmit the collected compiled files to the second server 200 for sorting and storage; for another example, the file processing system 10 may also include a fourth server, which may be used to store and manage the installation package of the application, in which case the second server 200 may store and manage the compiled files of the application, so that the installation package of the application and the compiled files can be managed and stored separately.
[0036] In some embodiments, the electronic device 100 may be a smart phone, a tablet computer, an e-book, a smart watch or the like; the first server 200, the second server 300 and the like may be traditional servers or cloud servers, which are not limited here.
[0037] The following is a detailed introduction to the file processing method provided in the embodiment of the present application.
[0038] See also Figure 3 , Figure 3 The flowchart of the file processing method provided by an embodiment of the present application is shown. The file processing method can be applied to the server in the above-mentioned file processing system. The specific process of this embodiment will be explained below by taking the server as an example. Figure 3 The process shown is described in detail, and the file processing method shown can specifically include the following steps:
[0039] Step S110: Obtain a compiled file corresponding to a specified application, where the compiled file is an executable file obtained by compiling source code of the specified application.
[0040] In an embodiment of the present application, in order to save system installation time of an electronic device, the application program in the system installation package can be compiled in advance before the system is installed on the electronic device. Thus, during the system installation process, the electronic device no longer needs to compile the application program in the system installation package, thereby greatly reducing the system installation time and saving the loss of computing resources and energy caused by the compilation of the application program.
[0041] Specifically, the server can obtain the compiled file corresponding to the specified application, wherein the compiled file is an executable file obtained by compiling the source code of the specified application. That is, the compilation of the specified application has been completed before the server packages the system installation package, so that the server can obtain the compiled file corresponding to the specified application.
[0042] The above-mentioned compilation can be understood as converting source code (original language) written in a certain programming language into another programming language (target language). Its main purpose is to translate the source code program written in a high-level computer language that is easy for people to write, read, and maintain into a low-level machine language program that can be interpreted and run by the computer, that is, an executable file. In other words, the files in the compiled file corresponding to the specified application obtained by the above-mentioned server are actually binary machine codes.
[0043] In some embodiments, the above-mentioned designated application can be an application included in the system installation package every time the system is updated or upgraded, that is, the aforementioned built-in APP. It can be an application that comes with the system, such as a message application, a phone application, a camera application, a calendar application, etc., or it can be an application that does not come with the system, such as a mainstream application on the application store: an instant messaging application, a game application, a news client, etc. The specific application type is not limited here.
[0044] In some embodiments, the server may first determine the source code of the specified application to be carried or already carried in the system installation package when the current system is updated or upgraded, that is, the installation package, so that the server can obtain the compiled file corresponding to the specified application according to the source code of the specified application to be carried or already carried. The compiled file may be obtained by compiling the source code of the specified application by the server, or may be obtained by compiling the source code of the specified application by other devices and then transmitting the compiled file to the server, which is not limited here.
[0045] Step S120: adding the compiled file to the system installation package, so that when the electronic device installs the system according to the system installation package, the compiled file is extracted from the system installation package.
[0046] In the embodiment of the present application, after obtaining the compiled file corresponding to the specified application, the server can add the compiled file to the system installation package. Specifically, when the server packages the system installation package, it can package the compiled file corresponding to the specified application into the system installation package, so that when the electronic device obtains the system installation package and installs the system according to the system installation package, it can extract the compiled file from the system installation package.
[0047] In some embodiments, after the electronic device extracts the compiled file from the system installation package, it can store the compiled file in a designated storage location corresponding to the designated application in the electronic device. Then, after the system is installed, the designated application can be used directly without installation.
[0048] In some embodiments, the above-mentioned system installation package can be an update installation package when the system is updated within the current version, or it can be an upgrade installation package for upgrading the system from one version to another version (usually upgrading a lower version to a higher version), or it can be a system installation package of a version selected arbitrarily when reinstalling the system, which is not limited here.
[0049] In some embodiments, the system installation package may be an unpackaged system installation package, in which case the system installation package may contain the source code of the specified application or may not contain the source code of the specified application. In other embodiments, the system installation package may be an existing packaged system installation package, which may contain the source code of the uncompiled specified application.
[0050] As a method, when the above-mentioned system installation package does not contain the source code of the uncompiled specified application, by adding the compiled file of the compiled specified application to the system installation package, after packaging and generating the final system installation package, the finally generated system installation package can contain only the compiled file, thereby reducing the file size of the system installation package while also reducing the transmission time of the system installation package to the electronic device.
[0051] As another way, when the above-mentioned system installation package contains the source code of the uncompiled specified application, by adding the compiled file of the compiled specified application to the system installation package, after packaging and generating the final system installation package, the final generated system installation package can contain both the source code and the compiled file of the specified application. Thus, when the electronic device installs the system according to the system installation package, the compiled file of the specified application can be directly extracted and stored, and the source code of the specified application can also be stored without compiling. After the system is successfully installed, when the electronic device needs to run the specified application, if the operation is successful, the stored source code of the specified application can be deleted; if the operation is not successful, it can be considered that there is a problem with the compiled file. At this time, the stored source code of the specified application can be extracted and compiled, and the specified application can be run according to the newly obtained compiled file. In this way, the situation where the specified application cannot be run due to the abnormality of the compiled file in the system installation package can be avoided, and the success rate of the operation of the specified application is improved.
[0052] The file processing method provided in the embodiment of the present application obtains the compiled file corresponding to the specified application, which is an executable file obtained by compiling the source code of the specified application, and then adds the compiled file to the system installation package, so that when the electronic device installs the system according to the system installation package, the compiled file of the specified application can be directly extracted from the system installation package. In this way, by adding the compiled file of the specified application to the system installation package, the electronic device does not need to compile the specified application during the system installation process, but only needs to directly extract the compiled file of the specified application from the system installation package, which saves the system installation time of the electronic device and improves the user experience of the electronic device.
[0053] See also Figure 4 , Figure 4 A schematic diagram of a process flow of a file processing method provided by another embodiment of the present application is shown. The file processing method can be applied to a server in the above-mentioned file processing system. The specific process of this embodiment will be described below using the server as an example. Figure 4 The process shown is described in detail, and the file processing method shown can specifically include the following steps:
[0054] Step S210: Obtain a compiled file corresponding to a specified application, where the compiled file is an executable file obtained by compiling source code of the specified application.
[0055] In some embodiments, since the types and quantities of the updated and upgraded content are usually different each time the system is updated and upgraded, if the number of updated and upgraded specified applications in the system installation package is relatively small, the compilation time for compiling the specified applications during the system installation process will also be relatively short. Therefore, it is not necessary to compile the specified applications in advance every time. For details, please refer to Figure 5 , step S210 may include:
[0056] Step S211: Obtain installation parameter information corresponding to the specified application.
[0057] The installation parameter information may be an evaluation parameter used to analyze whether it is necessary to precompile the specified application to be carried or carried in the current system installation package, and it may be evaluated from multiple angles such as compilation time and compilation importance. For example, when evaluating from the perspective of compilation time, the installation parameter information corresponding to the specified application may be the number of specified applications, the file size of the source code, etc., and when evaluating from the perspective of compilation importance, it may be the application type, usage frequency, usage time, etc. of the specified application. This is not limited here.
[0058] In some embodiments, when the installation parameter information corresponding to the specified application is the number of specified applications, the file size of the source code, and the application type (such as film and television type, game type), the server can obtain the installation parameter information corresponding to the specified application by calculation and identification when obtaining the installation package or source code of the specified application. In other embodiments, when the installation parameter information corresponding to the specified application is the application type of the specified application (such as mainstream popular applications, unpopular applications), usage frequency, and usage duration, the server can obtain the installation parameter information corresponding to the specified application through the database of other platforms. For example, the application type of the specified application can be determined by obtaining the application download ranking data recorded on the application store platform, and the usage frequency and usage duration of the specified application can be determined by obtaining the user usage behavior database of the electronic equipment service provider.
[0059] Step S212: When the installation parameter information meets the preset installation parameter conditions, the compiled file corresponding to the specified application is obtained.
[0060] In some embodiments, after obtaining the installation parameter information corresponding to the specified application, it can be determined whether the installation parameter information meets the preset installation parameter conditions. When the installation parameter information meets the preset installation parameter conditions, it can be considered necessary to pre-compile the specified application to be carried or already carried in the current system installation package, that is, the server can obtain the compilation file corresponding to the specified application so that the compilation file can be added to the system installation package later. When the installation parameter information does not meet the preset installation parameter conditions, it can be considered unnecessary to pre-compile the specified application to be carried or already carried in the current system installation package, that is, the server can directly publish the system installation package containing the uncompiled specified application source code without obtaining the compilation file corresponding to the specified application.
[0061] The above-mentioned preset installation parameter condition may be a condition that the installation parameter information needs to meet when it is necessary to pre-compile a specified application to be carried or carried in the current system installation package, that is, once the installation parameter condition is met, it can be considered that there is no need to pre-compile the specified application. The specific installation parameter condition can be set in advance according to the actual scenario requirements and is not limited here.
[0062] As a method, the installation parameter information may include the number of specified applications, and the preset installation parameter condition may be a preset threshold condition for the number of specified applications. The number of specified applications may be the number of source code files of the specified applications planned to be carried in the system installation package, which usually corresponds to the number of specified applications, that is, if there are three specified applications, the number of corresponding source code files is also three.
[0063] Specifically, when the number of designated applications is greater than a first threshold, it is considered that the installation parameter information of the designated applications meets the preset installation parameter conditions, and the server can obtain the compiled files corresponding to the designated applications. When the number of designated applications is not greater than the first threshold, it is considered that the installation parameter information of the designated applications does not meet the preset installation parameter conditions, and the server can directly publish the system installation package containing the uncompiled source code of the designated applications without obtaining the compiled files corresponding to the designated applications.
[0064] The first threshold may be the lowest threshold in the preset threshold condition of the number of designated applications, that is, if the number of designated applications is greater than the lowest threshold condition, it may be considered necessary to precompile the designated applications, and the specific first threshold may be reasonably set according to actual needs and is not limited here. For example, it may be 3, 4, etc.
[0065] In other embodiments, the installation parameter information includes the file size of the source code of the specified application, and the preset installation parameter condition may be a preset threshold condition of the file size of the source code of the specified application. Specifically, when the file size of the source code of the specified application is greater than a second threshold, it is considered that the installation parameter information of the specified application meets the preset installation parameter condition, and the server may obtain the compiled file corresponding to the specified application. When the file size of the source code of the specified application is not greater than the second threshold, it is considered that the installation parameter information of the specified application does not meet the preset installation parameter condition, and the server may directly publish the system installation package containing the uncompiled source code of the specified application without obtaining the compiled file corresponding to the specified application.
[0066] The second threshold may be the lowest threshold in the preset file size threshold conditions of the source code of the specified application, that is, if the number of the specified application is greater than the lowest threshold condition, it can be considered necessary to precompile the specified application, and the specific second threshold can be reasonably set according to actual needs and is not limited here. For example, it can be 50M, 100M, etc.
[0067] In some other embodiments, the installation parameter information includes the application type of the specified application, and the preset installation parameter condition may be a preset popular application type. Specifically, when the application type of the specified application is a popular application type, it is considered that the installation parameter information of the specified application meets the preset installation parameter condition, and the server may obtain the compilation file corresponding to the specified application. When the application type of the specified application is not a popular application type, it is considered that the installation parameter information of the specified application does not meet the preset installation parameter condition, and the server may not need to obtain the compilation file corresponding to the specified application, and directly publish the system installation package containing the uncompiled source code of the specified application.
[0068] It is understandable that if the designated application is a popular application, it can be considered that the designated application is likely to be run within a short period of time after the system is successfully installed. At this time, the designated application needs to be compiled in advance. The server can include the compiled file of the designated application in the system installation package and publish it together. Therefore, during the system installation process of the electronic device, there is no need to compile the popular application, which not only saves the system installation time, but also ensures the timely operation of the designated running program.
[0069] It is understandable that if the specified application is a non-hot application, it can be considered that the specified application is very likely not to be run within a short period of time after the system is successfully installed. At this time, there is no need to compile the specified application in advance. At this time, the server does not need to obtain the compiled file corresponding to the specified application, and directly publishes the system installation package containing the uncompiled specified application source code, which reduces the size of the system installation package and reduces the download traffic consumption of the electronic device. Furthermore, during the system installation process of the electronic device, there is no need to compile the source code of the non-hot application. The source code of the non-hot application is directly stored, and the source code of the non-hot application is compiled when the electronic device is idle. It not only saves the time of system installation, but also tries to ensure that the operation of non-hot applications is not affected.
[0070] It should be noted that the above installation parameter information and installation parameter conditions are only examples, and other installation parameter information and other installation parameter conditions may also be used. The specific installation parameter information and installation parameter conditions are not limited here. For example, any combination of the above installation parameter information and installation parameter conditions may be used.
[0071] In some embodiments, the above-mentioned compiled file can be compiled by other terminals, so that the server can obtain the compiled file from other terminals. Specifically, the above-mentioned obtaining of the compiled file corresponding to the specified application may include: receiving the compiled file corresponding to the specified application uploaded by other terminals, and the compiled file is an executable file obtained by the other terminals compiling the source code of the specified application. Among them, the other terminal can be any terminal device other than the execution subject server of this application, and can be other servers, other electronic devices, and is not limited.
[0072] Specifically, after compiling the source code of the designated application to obtain an executable file, the other terminals may upload the executable file as a compiled file to the server, so that the server may receive the compiled file corresponding to the designated application uploaded by the other terminals.
[0073] In some embodiments, since the compilation environments of different terminals may be different, the compiled files may also be different, which may cause problems with the compiled files compiled by some terminals, and the electronic device cannot run the specified application according to the compiled files. Therefore, it is necessary to judge other terminals to determine whether the compiled files compiled by them are feasible. For details, please refer to Figure 6 , the above-mentioned receiving the compiled file corresponding to the specified application uploaded by other terminals may include:
[0074] Step S213: receiving an upload request sent by other terminals, wherein the upload request is used to request uploading of a compiled file of a specified application.
[0075] When compiling the compiled file of the specified application, other terminals can send an upload request to the server to request uploading of the compiled file of the specified application, so that the server can receive the upload request sent by other terminals and respond according to the upload request.
[0076] In some embodiments, the server may receive a specified number of upload requests to select the best compiled file. The server may also receive upload requests from other terminals of a specified type, so that different system installation packages can be generated according to the compiled files of different types of terminals, so as to be suitable for download and installation of different electronic devices. This is not limited here.
[0077] Step S214: Determine whether the terminal parameters of the other terminals meet the preset terminal parameter conditions.
[0078] Step S215: When the terminal parameters of the other terminals meet the terminal parameter conditions, an upload instruction is returned to the other terminals.
[0079] After receiving the upload request sent by other terminals, the server can determine whether the terminal parameters of other terminals meet the preset terminal parameter conditions. When the terminal parameters of other terminals meet the terminal parameter conditions, it can be considered that the compiled file compiled by the other terminal is available and can be released together with the system installation package. At this time, the server can return an upload instruction to the other terminal to instruct the other terminal to upload the compiled file of the specified application. When the terminal parameters of other terminals do not meet the terminal parameter conditions, it can be considered that the compiled file compiled by the other terminal is unavailable and cannot be released together with the system installation package. At this time, the server can return a rejection instruction to the other terminal, or make no response, to instruct the other terminal not to upload the compiled file of the specified application.
[0080] In some embodiments, compiled files compiled by terminals of the same type can usually be successfully executed on electronic devices of the same type. Therefore, the above terminal parameters can be the device type of other terminals, and the device type can be a device model, device manufacturer, etc. In some embodiments, due to the different system version numbers installed on terminals of the same type, the compilation environment may also be different, resulting in the compiled file being of the same device type, but the electronic device that does not have the same system version number cannot successfully execute the compiled file. Therefore, the above terminal parameters can also be the operating system type, operating system version number, etc. of other terminals. This is not limited here.
[0081] Step S216: receiving the compiled file corresponding to the designated application uploaded by the other terminal according to the upload instruction.
[0082] After returning the upload instruction to other terminals, the server may be in a waiting state to receive the compiled files corresponding to the specified application uploaded by other terminals according to the upload instruction, so that the server can obtain the available compiled files corresponding to the specified application.
[0083] In some embodiments, if the terminal parameters of other terminals do not meet the terminal parameter conditions, the compilation environment of other terminals can also be detected to see if it is qualified. If its compilation environment is qualified, the compiled file compiled by it is also available. Figure 7 , the above-mentioned receiving the compiled file corresponding to the specified application uploaded by other terminals may include:
[0084] Step S217: When the terminal parameters of the other terminals do not meet the terminal parameter conditions, detecting whether the compilation environment of the other terminals meets the preset compilation environment conditions.
[0085] Since the terminal parameters of other terminals do not meet the above terminal parameter conditions, the compilation environment built on other terminals can be considered as the cross-platform compilation environment of the electronic device (target machine). The cross-platform compilation environment needs to be verified for correctness. If the cross-platform compilation environment passes the correctness verification, the compilation file compiled by the cross-platform compilation environment can be considered to be usable.
[0086] Specifically, whether the correctness verification is passed can be determined by judging whether the compilation environment of other terminals meets the preset compilation environment conditions. Among them, the preset compilation environment conditions may include two aspects: one can be a compilation file compiled across platforms, which is consistent with the compilation file compiled by the electronic device; the other can be a compilation file compiled across platforms. After being installed on the electronic device, it can run correctly, and its running performance is not worse than the compilation file compiled by the electronic device. Specifically, the APP compiled by it can run correctly on the electronic device without performance loss, and the compilation environment of the other terminal meets the compilation environment conditions.
[0087] Step S218: When the compilation environment of the other terminal meets the compilation environment condition, receiving the compilation file corresponding to the designated application uploaded by the other terminal.
[0088] When the compilation environment of other terminals meets the above compilation environment conditions, the server can also return an upload instruction to other terminals to instruct other terminals to upload the compiled files of the specified application, so that the server can receive the compiled files corresponding to the specified application uploaded by other terminals. When the compilation environment of other terminals does not meet the compilation environment conditions, it can be considered that the compiled files compiled by the other terminals are unusable and cannot be released together with the system installation package. At this time, the server can return a rejection instruction to other terminals, or make no response, to instruct other terminals not to upload the compiled files of the specified application.
[0089] In some embodiments, the compiled file may also be compiled by the server. Specifically, a cross-platform compilation environment for the electronic device may also be built on the server, and the cross-platform compilation environment also needs to undergo the above-mentioned correctness verification. Thus, the server can add the compiled file compiled by itself to the system installation package and publish it together.
[0090] Step S220: adding the compiled file to the system installation package, so that when the electronic device installs the system according to the system installation package, the compiled file is extracted from the system installation package.
[0091] In some embodiments, system installation packages can be generated according to different device types and different system version numbers. Figure 8 After step S220, the file processing method of the present application may further include:
[0092] Step S221: Generate an installation package identifier according to the terminal parameter conditions.
[0093] In some embodiments, when the terminal parameters of other terminals meet the above terminal parameter conditions, or when the terminal parameters of other terminals do not meet the above terminal parameter conditions, but their compilation environment meets the above compilation environment conditions, it can be considered that the compilation files of the specified application obtained by the server from the other terminals are applicable to the electronic devices that match the terminal parameter conditions. Thus, the installation package identifier can be generated according to the terminal parameter conditions, so that the electronic devices that match the terminal parameter conditions can accurately download the system installation package suitable for themselves according to the installation package identifier.
[0094] It is understandable that when the server sets different terminal parameter conditions, the server can receive compiled files of specified applications uploaded by different other terminals, and then add them to the same system installation package respectively, thereby generating multiple types of system installation packages. In order to distinguish these system installation packages, the server can generate different installation package identifiers according to different terminal parameter conditions. Among them, the installation package identifier can be the terminal parameter required in the terminal parameter condition, such as the device model, the system version number installed on the device, etc.
[0095] Step S222: Generate a system installation package corresponding to the installation package identifier.
[0096] After generating the installation package identifier corresponding to the terminal parameter condition, the server can establish a corresponding relationship between the installation package identifier and the system installation package, that is, bind the installation package identifier corresponding to the same terminal parameter condition with the system installation package, thereby generating a system installation package corresponding to the installation package identifier, so that the electronic device matching the terminal parameter condition can quickly find a suitable system installation package for use according to the installation package identifier.
[0097] Step S230: receiving a download request sent by the electronic device, wherein the download request is used to request downloading of the system installation package.
[0098] The download request may be generated by the electronic device and sent to the server, and the download request is used to request downloading of the system installation package. Thus, the server may receive the download request sent by the electronic device and respond according to the download request.
[0099] In some embodiments, the electronic device can generate the above-mentioned download request based on the user's operation, and then send it to the server, so that the server receives the download request. For example, the terminal device detects the update operation of the system version in the interface of the system device, and then generates a download request to obtain the system installation package.
[0100] Step S240: In response to the download request, the system installation package is sent to the electronic device.
[0101] After receiving the download request sent by the electronic device, the server can respond to the download request and send the system installation package of the current system update / upgrade to the electronic device. The server can also send a matching system installation package to the electronic device according to the terminal parameters of the electronic device.
[0102] The file processing method provided by the embodiment of the present application obtains the installation parameter information corresponding to the specified application to determine whether the source code of the specified application needs to be compiled in advance. Specifically, when the installation parameter information meets the preset installation parameter conditions, it can be considered that the source code of the specified application needs to be compiled in advance. At this time, the compiled file corresponding to the specified application can be obtained, and the compiled file can be added to the system installation package. When a download request sent by an electronic device is received, the download request can be responded to, and the system installation package can be sent to the electronic device, so that when the electronic device installs the system according to the system installation package, the compiled file can be directly extracted from the system installation package. In this way, each time the system installation package is packaged, the installation parameter information of the built-in APP can be used to evaluate whether the built-in APP needs to be compiled in advance. Only when the installation parameter information of the built-in APP meets certain conditions, the compiled file of the specified application will be added to the system installation package, so that the electronic device does not need to compile the specified application during the system installation process, but only needs to directly extract the compiled file of the specified application from the system installation package, saving the system installation time of the electronic device and improving the user experience of the electronic device. That is, the selective processing of early compilation is realized.
[0103] See also Fig. 9 , Fig. 9 A schematic diagram of a process flow of a file processing method provided by another embodiment of the present application is shown. The file processing method can be applied to an electronic device in the above-mentioned file processing system. The specific process of this embodiment will be described below using an electronic device as an example. Fig. 9 The process shown is described in detail, and the file processing method shown can specifically include the following steps:
[0104] Step S310: receiving a system installation package, wherein the system installation package includes a compiled file corresponding to a specified application.
[0105] Step S320: when installing the system according to the system installation package, extracting the compiled file from the system installation package.
[0106] In some embodiments, when the electronic device detects the existence of a new system installation package, it can receive the system installation package, wherein the system installation package includes a compilation file corresponding to a specified application program. For details, please refer to the above-mentioned related description.
[0107] When the electronic device installs the system according to the received system installation package, the compiled file corresponding to the specified application can be directly extracted from the system installation package. Therefore, the electronic device does not need to compile the specified application during the system installation process, but only needs to directly extract the compiled file of the specified application from the system installation package, which saves the system installation time of the electronic device and improves the user experience of the electronic device.
[0108] As an implementation mode, after extracting the compiled file corresponding to the specified application, the electronic device can store it in a specified storage location corresponding to the specified application in the electronic device, and then after the system is installed, the specified application can be used directly without installation.
[0109] In some embodiments, when the installation parameter information of the specified application is the application type of the specified application, if the server has evaluated that the specified application does not need to be compiled in advance based on the installation parameter information of the specified application, the electronic device does not need to compile the specified application during the system installation process, and can wait until the system is successfully installed and then compile the specified application when the electronic device is in an idle state.
[0110] Specifically, the electronic device can determine whether to compile the specified application during the system installation process based on whether the received system installation package contains the compiled file of the specified application. If the received system installation package does not contain the compiled file of the specified application, it indicates that the server has evaluated the specified application as a non-hot or high-frequency application based on the application type of the specified application, so the specified application is not compiled in advance, and the compiled file of the specified application does not exist in the issued system installation package. Therefore, the electronic device can determine that the importance of the specified application is relatively low, and it is not necessary to compile it during the system installation process. The specified application can be compiled in the idle state of the electronic device after the system is successfully installed.
[0111] The file processing method provided in the embodiment of the present application receives a system installation package containing a compiled file corresponding to a specified application, so that when the electronic device installs the system according to the system installation package, the compiled file can be directly extracted from the system installation package. In this way, by adding the compiled file of the specified application to the system installation package, the electronic device does not need to compile the specified application during the system installation process, but only needs to directly extract the compiled file of the specified application from the system installation package, which saves the system installation time of the electronic device and improves the user experience of the electronic device.
[0112] See also Fig.10, which shows a structural block diagram of a file processing device 700 provided in an embodiment of the present application, and the file processing device 700 includes: a file acquisition module 710 and a file adding module 720. Among them, the file acquisition module 710 is used to obtain a compiled file corresponding to a specified application, and the compiled file is an executable file obtained by compiling the source code of the specified application; the file adding module 720 is used to add the compiled file to the system installation package, so that when the electronic device installs the system according to the system installation package, the compiled file is extracted from the system installation package.
[0113] In some embodiments, the file acquisition module 710 may include: a parameter acquisition unit and a parameter judgment unit. The parameter acquisition unit is used to obtain installation parameter information corresponding to the specified application; the parameter judgment unit is used to obtain the compiled file corresponding to the specified application when the installation parameter information meets the preset installation parameter conditions.
[0114] In some embodiments, the installation parameter information may include the number of specified applications, and the parameter determination unit may be specifically configured to: when the number is greater than a first threshold, obtain a compiled file corresponding to the specified application.
[0115] In some embodiments, the installation parameter information may also include a file size of the source code of the specified application, and the parameter determination unit may also be specifically used to obtain a compiled file corresponding to the specified application when the file size is greater than a second threshold.
[0116] In some embodiments, the file acquisition module 710 may include: a file receiving unit, configured to receive a compiled file corresponding to a specified application uploaded by other terminals, wherein the compiled file is an executable file obtained by compiling source code of the specified application by the other terminals.
[0117] In some embodiments, the above-mentioned file receiving unit can be specifically used to: receive an upload request sent by other terminals, the upload request is used to request uploading of a compiled file of a specified application; determine whether the terminal parameters of the other terminals meet preset terminal parameter conditions; when the terminal parameters of the other terminals meet the terminal parameter conditions, return an upload instruction to the other terminals; receive the compiled file corresponding to the specified application uploaded by the other terminals according to the upload instruction.
[0118] In other embodiments, the above-mentioned file receiving unit can also be specifically used for: when the terminal parameters of the other terminals do not meet the terminal parameter conditions, detecting whether the compilation environment of the other terminals meets the preset compilation environment conditions; when the compilation environment of the other terminals meets the compilation environment conditions, receiving the compilation file corresponding to the specified application uploaded by the other terminals.
[0119] In some embodiments, the file processing device 700 may further include: an identification generation module and an installation package generation module. The identification generation module is used to generate an installation package identification according to the terminal parameter conditions; the installation package generation module is used to generate a system installation package corresponding to the installation package identification.
[0120] In some embodiments, the file processing device 700 may further include: a request acquisition module and an installation package sending module. The request acquisition module is used to receive a download request sent by the electronic device, wherein the download request is used to request downloading of the system installation package; the installation package sending module is used to respond to the download request and send the system installation package to the electronic device.
[0121] See also Fig.11 , which shows a structural block diagram of a file processing device 800 provided in an embodiment of the present application, and the file processing device 800 includes: a system acquisition module 810 and a system installation module 820. The system acquisition module 810 is used to receive a system installation package, and the system installation package includes a compiled file corresponding to a specified application; the system installation module 820 is used to extract the compiled file from the system installation package when installing the system according to the system installation package.
[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0123] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0124] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0125] The present application also provides a file processing system, which includes an electronic device and a server. The server is connected to the electronic device for communication. For example, please refer to Figure 1, the server may be the first server 200. The server is used to obtain a compiled file corresponding to a specified application, wherein the compiled file is an executable file obtained by compiling the source code of the specified application; the server is also used to add the compiled file to a system installation package; the electronic device is used to receive the system installation package, and when installing the system according to the system installation package, extract the compiled file from the system installation package.
[0126] In summary, the file processing device provided in the embodiment of the present application is used to implement the corresponding file processing method in the aforementioned method embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0127] Please refer to Fig.12 , which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may be a terminal device such as a PC, a mobile terminal, etc. that can run an application. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more applications are configured to execute the method described in the aforementioned method embodiment.
[0128] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0129] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.
[0130] Understandably, Fig.12 The structure shown is only an example, and the electronic device 100 may also include Fig.12 More or fewer components as shown, or with Fig.12 The embodiment of the present application is not limited to this.
[0131] Please refer to Fig.13 , which shows a structural block diagram of a server provided in an embodiment of the present application. The server 600 may be a traditional server, a cloud server, etc. The server 600 in the present application may include one or more of the following components: a processor 610, a memory 620, and one or more application programs, wherein the one or more application programs may be stored in the memory 620 and configured to be executed by one or more processors 610, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0132] The processor 610 may include one or more processing cores. The processor 610 uses various interfaces and lines to connect the various parts of the entire server 600, and executes various functions and processes data of the server 600 by running or executing instructions, programs, code sets or instruction sets stored in the memory 620, and calling data stored in the memory 620. Optionally, the processor 610 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 610 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 610, but may be implemented separately through a communication chip.
[0133] The memory 620 may include a random access memory (RAM) or a read-only memory (ROM). The memory 620 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the server 600 during use.
[0134] Understandably, Fig.13 The structure shown is only an example, and the server 600 may also include Fig.13 More or fewer components as shown, or with Fig.13 The embodiment of the present application is not limited to this.
[0135] Please refer to Fig.14 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0136] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A file processing method, characterized in that: Applied to a server, the method comprises: Obtaining installation parameter information corresponding to a specified application, wherein the installation parameter information is an evaluation parameter used to analyze whether it is necessary to precompile a specified application to be carried or carried in a current system installation package; the installation parameter information includes at least one of an application type, quantity, source code file size, usage duration, and usage frequency of the specified application; When the installation parameter information meets the preset installation parameter condition, receiving an upload request sent by other terminals, wherein the upload request is used to request uploading of a compiled file of a specified application; Determining whether the terminal parameters of the other terminals meet preset terminal parameter conditions, the terminal parameters including at least one of a device type, an operating system type, and an operating system version number of the other terminals; When the terminal parameters of the other terminal meet the terminal parameter conditions, returning an upload instruction to the other terminal; receiving a compiled file corresponding to the designated application uploaded by the other terminal according to the upload instruction, wherein the compiled file is an executable file obtained by compiling the source code of the designated application by the other terminal; The compiled file is added to the system installation package, so that when the electronic device installs the system according to the system installation package, the compiled file is extracted from the system installation package.
2. The method according to claim 1, characterized in that The installation parameter information includes the number of the specified application programs, and when the installation parameter information meets a preset installation parameter condition, obtaining a compiled file corresponding to the specified application program includes: When the number is greater than a first threshold, a compiled file corresponding to the specified application is obtained.
3. The method according to claim 1, characterized in that The installation parameter information includes a file size of a source code of the specified application program, and when the installation parameter information satisfies a preset installation parameter condition, obtaining a compiled file corresponding to the specified application program includes: When the file size is greater than a second threshold, a compiled file corresponding to the specified application is obtained.
4. The method according to any one of claims 1 to 3, characterized in that: The obtaining of the compiled file corresponding to the specified application includes: A compiled file corresponding to a specified application uploaded by other terminals is received, where the compiled file is an executable file obtained by compiling source code of the specified application by the other terminals.
5. The method according to claim 1, characterized in that The receiving of the compiled file corresponding to the specified application uploaded by other terminals also includes: When the terminal parameters of the other terminals do not meet the terminal parameter conditions, detecting whether the compilation environment of the other terminals meets the preset compilation environment conditions; When the compilation environment of the other terminal meets the compilation environment condition, a compilation file corresponding to the designated application uploaded by the other terminal is received.
6. The method according to claim 5, characterized in that After adding the compiled file to the system installation package, the method further includes: Generate an installation package identifier according to the terminal parameter conditions; Generate a system installation package corresponding to the installation package identifier.
7. The method according to any one of claims 1 to 3, characterized in that: After adding the compiled file to the system installation package, the method further includes: receiving a download request sent by the electronic device, wherein the download request is used to request downloading of the system installation package; In response to the download request, the system installation package is sent to the electronic device.
8. A file processing method, characterized in that: Applied to electronic equipment, the method comprises: Receive a system installation package, wherein the system installation package includes a compiled file corresponding to a specified application, wherein the compiled file corresponding to the specified application is an upload request sent by a server to other terminals when the installation parameter information corresponding to the specified application meets a preset installation parameter condition, wherein the upload request is used to request uploading of the compiled file of the specified application; determine whether the terminal parameters of the other terminals meet the preset terminal parameter conditions, wherein the terminal parameters include at least one of the device type, operating system type, and operating system version number of the other terminals; when the terminal parameters of the other terminals meet the terminal parameter conditions, return an upload instruction to the other terminals; receive the compiled file corresponding to the specified application uploaded by the other terminals according to the upload instruction and then send it, wherein the installation parameter information is an evaluation parameter used to analyze whether it is necessary to pre-compile the specified application to be carried or carried in the current system installation package; the installation parameter information includes at least one of the application type, quantity, source code file size, usage duration, and usage frequency of the specified application; When the system is installed according to the system installation package, the compiled file is extracted from the system installation package.
9. A file processing device, characterized in that: Applied to a server, the device comprises: a file acquisition module, for acquiring installation parameter information corresponding to a specified application, wherein the installation parameter information is an evaluation parameter for analyzing whether it is necessary to pre-compile a specified application to be carried or carried in a current system installation package; the installation parameter information includes at least one of the application type, quantity, file size of the source code, usage duration, and usage frequency of the specified application; when the installation parameter information meets a preset installation parameter condition, receiving an upload request sent by other terminals, wherein the upload request is used to request uploading of a compiled file of the specified application; determining whether the terminal parameters of the other terminals meet a preset terminal parameter condition, wherein the terminal parameters include at least one of the device type, operating system type, and operating system version number of the other terminals; when the terminal parameters of the other terminals meet the terminal parameter condition, returning an upload instruction to the other terminals; receiving a compiled file corresponding to the specified application uploaded by the other terminals according to the upload instruction, wherein the compiled file is an executable file obtained by the other terminals compiling the source code of the specified application; The file adding module is used to add the compiled file to the system installation package, so that when the electronic device installs the system according to the system installation package, the compiled file is extracted from the system installation package.
10. A file processing device, characterized in that: Applied to electronic equipment, the device comprises: A system acquisition module, for receiving a system installation package, wherein the system installation package includes a compiled file corresponding to a specified application, wherein the compiled file corresponding to the specified application is an upload request sent by a server to other terminals when the installation parameter information corresponding to the specified application meets a preset installation parameter condition, wherein the upload request is used to request uploading of the compiled file of the specified application; determining whether the terminal parameters of the other terminals meet the preset terminal parameter conditions, wherein the terminal parameters include at least one of the device type, operating system type and operating system version number of the other terminals; when the terminal parameters of the other terminals meet the terminal parameter conditions, returning an upload instruction to the other terminals; receiving the compiled file corresponding to the specified application uploaded by the other terminals according to the upload instruction and then sending it, wherein the installation parameter information is an evaluation parameter for analyzing whether it is necessary to pre-compile the specified application to be carried or carried in the current system installation package; the installation parameter information includes at least one of the application type, quantity, source code file size, usage duration and usage frequency of the specified application; The system installation module is used to extract the compiled file from the system installation package when installing the system according to the system installation package.
11. A server, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method according to any one of claims 1-7.
12. An electronic device, characterized in that: include: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more applications configured to perform the method of claim 8.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, and the program code can be called by a processor to execute the method according to any one of claims 1 to 7, or to execute the method according to claim 8.
Citation Information
Patent Citations
Method for transplanting application procedure and terminal equipment
CN106445662A
Software version generation method and apparatus
WO2017148057A1