Application program installation package generation method, application program installation method and related equipment

By generating statically linked application installation packages on the server side, using differential content and basic version components to independently compile, the problems of large size and low download efficiency of application installation packages on the MCU platform are solved, and flexible installation and uninstallation are achieved, which improves the User experience and development convenience.

CN119271220APending Publication Date: 2025-01-07HUAWEI TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202310829393.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-06
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing technology is difficult to implement flexible installation and uninstallation of applications on the MCU platform, and the static link relationship is complex, resulting in large size of the installation package, low download efficiency and poor user experience.

Method used

The statically linked application installation package is generated through the server, and the different content is used to compile independently with the basic version components to generate multiple versions of the installation packages, which supports terminal devices to select the appropriate version based on the storage space capacity, so as to achieve flexible installation and uninstallation of applications.

Benefits of technology

Reduce the dependence of the application loading process, maintain the consistency of static link relationships, reduce the volume of installation packages, improve download and installation efficiency, improve user experience, and simplify the developer development process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271220A_ABST
    Figure CN119271220A_ABST
Patent Text Reader

Abstract

The invention discloses an application program installation package generation method, an application program installation method and related equipment, under the condition of a static link, a server can compile archive mirror images of a plurality of versions of an application program at a plurality of preset positions based on a source engineering component and an application program source component; the terminal equipment can apply for the archiving mirror image of the corresponding version from the server based on the existing storage space state, and download, check, install, unload and the like of the archiving mirror image are completed. Therefore, the terminal equipment can independently load the application program, the static link relation of the application program is consistent with that of the source project, the original static link relation of the source project is not influenced, in addition, as the source component of the application program and the source project component jointly participate in static link, the existing code segment and data segment of the source project can be reused, and the application program can be conveniently loaded. Therefore, the application program archiving mirror image can only contain the content different from the source project, the size of the application program archiving mirror image is reduced, the downloading and installing efficiency is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an application installation package generation method, an application installation method and related equipment. Background Art

[0002] With the popularization of smart terminal devices and the continuous development of Internet technology, various types of terminal devices such as smart wearable devices, smart home devices, and IoT devices have become indispensable products in people's daily lives. In order to meet the growing needs of users, the types and number of applications (Application, APP) adapted to these terminal devices are also increasing.

[0003] However, for some applications, users cannot flexibly install, uninstall, and perform other operations on the terminal device, which brings a poor experience to users. Summary of the invention

[0004] The embodiments of the present application provide an application installation package generation method, an application installation method and related devices, which can support users to flexibly install, uninstall and other operations on applications on terminal devices, thereby improving user experience.

[0005] In a first aspect, an embodiment of the present application provides a method for generating an application installation package, the method comprising: a server identifying difference content, the difference content being content that differs before and after a source component of an application is incorporated into a basic version component, the basic version component being a source file of an operating system on a terminal device and a source file of a service developed based on the operating system; the server adding redirection information to the difference content, the redirection information being used to indicate that a link address range of the difference content is a first link address range, the first link address range and a second link address range do not conflict, the second link address range is a link address range of the basic version component, the first link address range is a storage address range on the terminal device, the second link address range is another storage address range on the terminal device, the storage address range is an address range of a memory used to run executable program code; the server generates a first image, and intercepts a first content in the first image to generate an installation package for the application, the first content being the difference content after being compiled and statically linked, and the first image is generated after the server compiles and statically links the basic version component and the difference content.

[0006] The storage address range on the terminal device may be an address range of a memory on the terminal device for running an executable program code, the memory for running the executable program code may be a ROM, RAM, PSRAM or other memory, an image of a basic version component is running on the terminal device, the second link address range may be an address range of an image of a basic version component running on the terminal device, and the first image may be, for example Fig. 7A The image built after static linking shown (including the base version image and the difference content image of the application), the first content can be the difference content image of the application. Since the difference content image of the application in this application is completely isolated from the base version image, it can be understood that the first link address range and the second link address range do not conflict, that is, when the application is installed on the terminal device, the original base version image will not be destroyed.

[0007] By implementing the method provided in the first aspect, under the condition of static linking, the server can generate an application installation package that can be loaded and installed independently on the terminal device, reducing the dependence of the application loading process on the running framework, jump table, etc. In this case, the static link relationship of the application is consistent with the source project, and will not affect the original static link relationship of the source project. In addition, since the application source component and the source project component (i.e., the basic version component) jointly participate in the static link, the application can reuse the existing code segments and data segments of the source project. Therefore, the application installation package can only contain the difference content with the source project, so that the volume of the application installation package can be reduced, so that less redundant information is sent to the user terminal device, the efficiency of application download and installation will be improved, and the user experience will be further improved. Moreover, for external developers (such as application developers), they only need to provide application source components to participate in the application ecological expansion of terminal products, which is more convenient and reduces development costs.

[0008] In a possible implementation, the first link address range includes N preset link address ranges, where N is a positive integer greater than 1, and the server generates a first image, specifically including: the server compiles the basic version components and the difference content N times, and statically links to generate N versions of the first image corresponding to the N preset link address ranges; the server intercepts the first content in the first image to generate an installation package for the application, specifically including: the server intercepts the first content in the N versions of the first image to generate N versions of the installation package for the application.

[0009] In this way, the server can generate installation packages of multiple versions of the application so that the application installation packages of corresponding versions can be flexibly allocated to the terminal device according to the current device space capacity information of the terminal device.

[0010] In one possible implementation, the installation packages of N versions of an application include an installation package of an application corresponding to an idle storage address range on a terminal device, and the method further includes: the server sends the installation package of the application corresponding to an idle storage address range to the terminal device based on the idle storage address range on the terminal device.

[0011] In this way, when the terminal device needs to install an application, the server can obtain the installation package of the application corresponding to the free storage address range based on the free storage address range on the terminal device. In this way, when the terminal device installs and runs the application, it will not affect the source project or other applications.

[0012] In a possible implementation manner, the idle storage address range on the terminal device is sent by the terminal device to the server.

[0013] In this way, the server can obtain the current device capacity information of the terminal device through the idle storage address range sent by the terminal device, so as to further determine which version of the application installation package is allocated to the terminal device.

[0014] In a possible implementation, the N preset link address ranges are of equal size.

[0015] In this way, the server can arrange and manage each application installation package in a grid format, preset N equal-sized link address ranges, and pre-generate N versions of application installation packages. When the terminal device requests to download the installation package, the corresponding version installation package can be directly sent to improve download efficiency.

[0016] In a possible implementation, the first link address range is a link address range. Before the server adds redirection information to the difference content, the method also includes: the server receives a first message sent by the terminal device, the first message includes a first link address range, and the first link address range is an idle storage address range on the terminal device; the server adds redirection information to the difference content, specifically including: the server adds redirection information to the difference content based on the first link address range.

[0017] The first message may be Fig.10 Message 1 is shown.

[0018] In this way, the server can determine the redirection information, that is, the link address range of the difference content, based on the first message sent by the terminal device, and then generate the application installation package. The above-mentioned first link address range can be determined according to the size of the application installation package. Therefore, greater space utilization of the terminal device can be achieved.

[0019] In a possible implementation, the method further includes: the server sending an installation package of the application to the terminal device based on the first link address range.

[0020] In this way, when the terminal device installs and runs the application, it will not affect the source project or other applications.

[0021] In a possible implementation, the difference content is the entirety of the difference file, or the difference code in the difference file.

[0022] In a possible implementation, the source component of the application exists in any one of the following forms: in the form of a source file; or in the form of code snippets dispersed in a basic version component.

[0023] Among them, when the source component of the application exists in the form of a source file, the difference content can be the entire difference file; when the source component of the application exists in the form of code fragments scattered in the basic version component, the difference content can be the difference code in the difference file.

[0024] In a possible implementation, the installation package of the application includes an init segment, and the init segment is used to complete the initialization and registration of the application.

[0025] In this way, when an initialization action needs to be performed, the data can be copied from the init segment of the application installation package to the running segment in the form of data copying to complete the initialization action.

[0026] In a second aspect, an embodiment of the present application provides an application installation method, which is applied to a terminal device, the method comprising: the terminal device receives an installation package of an application sent by a server; wherein the installation package of the application is generated based on the first content in the first image, the first content is the difference content after being compiled and statically linked, the difference content is the content that differs before and after the source component of the application is incorporated into the basic version component, the basic version component is the source file of the operating system on the terminal device and the source file of the service developed based on the operating system, the first image is generated by the server after compiling and statically linking the basic version component and the difference content, the link address range of the difference content is the first link address range, the first link address range and the second link address range do not conflict, the second link address range is the link address range of the basic version component, the first link address range is a storage address range on the terminal device, the second link address range is another storage address range on the terminal device, and the storage address range is the address range of the memory used to run executable program code; the terminal device installs the application in the first link address range based on the installation package of the application.

[0027] By implementing the method provided in the second aspect, the terminal device can download an application installation package that can be independently loaded and installed on the terminal device on the server, and the terminal device can install the application on the ROM / RAM / PSRAM and other storage devices of the terminal device as needed, and can support users to download, install and uninstall the application in any order. In addition, since the application source component and the source project component (i.e., the basic version component) jointly participate in static linking, the application can access any function, data, etc. in the source project at will, and does not require any intermediate jump mechanism, GOT table, etc., and does not rely on hardware such as MMU to realize the jump. Moreover, it is possible to realize that the application reuses the source project to the greatest extent, such as calling similar functions, or accessing the same static variables, and the location of the access object is located in the source project mirror, so there is no need for the application to repeat the compilation, and the volume of the application installation package is also reduced as much as possible. In addition, there is no need to introduce an interpreter, virtual machine, etc. that supports the operation of the application on the terminal device. The running position of the installed application is in the same performance storage device as the source project, and its running performance is consistent with the code segment in the macro kernel. It only needs to complete the initialization when it is first executed (for example, the initialization is completed by the application management module on the terminal device), and the fluency of the application can be improved.

[0028] In a possible implementation, the method further includes: the terminal device sends a first message to the server, the first message includes a first link address range, and the first link address range is an idle storage address range on the terminal device.

[0029] The first message may be Fig.12 Message 1 is shown.

[0030] In a possible implementation, the difference content is the entirety of the difference file, or the difference code in the difference file.

[0031] In a possible implementation, the source component of the application exists in any one of the following forms: in the form of a source file; or in the form of code snippets dispersed in a basic version component.

[0032] In a possible implementation, the installation package of the application includes an init segment, and the init segment is used to complete the initialization and registration of the application.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in any possible implementation of the first aspect or the second aspect above.

[0034] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed on an electronic device, the electronic device executes the method described in any possible implementation of the first aspect or the second aspect.

[0035] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the method described in any possible implementation of the first aspect or the second aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a schematic diagram of an MCU platform loading an application based on an interpreter provided in an embodiment of the present application;

[0037] Figure 2 is a schematic diagram of a communication system provided in an embodiment of the present application;

[0038] Figure 3 This is a schematic diagram of a scenario for generating and downloading an application installation package provided in an embodiment of the present application;

[0039] Figure 4 It is a flowchart of a method for generating an application installation package provided in an embodiment of the present application;

[0040] Figure 5 It is a schematic diagram of a compilation and linking process of an application source component provided by an embodiment of the present application;

[0041] Figure 6 It is a schematic diagram of a difference file and difference content generated after a perception application source component is merged into a base version image provided by an embodiment of the present application;

[0042] Fig. 7A It is a schematic diagram of generating an archive image of a certain version of an application based on a basic version component and an application source component provided by an embodiment of the present application;

[0043] Figure 7BIt is a schematic diagram of generating multiple versions of archive images of application A at different preset locations (i.e., preset compilation address spaces) based on a specified basic version image provided by an embodiment of the present application;

[0044] Figure 8 It is a schematic diagram of a process of a server 100 generating multiple versions of installation packages of multiple different application programs and a process of a terminal device 200 downloading corresponding versions of installation packages of multiple different application programs provided in an embodiment of the present application;

[0045] Fig. 9 It is a flowchart of an application installation method provided in an embodiment of the present application;

[0046] Fig.10 It is a flowchart of another method for generating an application installation package provided in an embodiment of the present application;

[0047] Fig.11 It is a schematic diagram of a process of generating different application installation packages by a server 100 and a process of downloading multiple application installation packages by a terminal device 200 provided in an embodiment of the present application;

[0048] Fig.12 It is a flowchart of another application installation method provided in an embodiment of the present application;

[0049] Fig.13 is a structural diagram of a server 100 provided in an embodiment of the present application;

[0050] Fig.14 is a schematic diagram of the structure of a terminal device 200 provided in an embodiment of the present application;

[0051] Fig.15 It is a structural diagram of an MCU in a terminal device 200 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0053] It should be understood that the terms "first", "second", etc. in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.

[0054] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0055] At present, common wearable devices on the market (such as smart watches, sports watches, heart rate belts, etc.), Internet of Things devices (IoT), and data coprocessors (such as smart sensor hubs) in complex electronic devices such as mobile phones, robotic arms, and smart cars often contain a multi-chip framework of one or more microcontroller units (MCUs). The introduction of MCUs has played an important role in improving device endurance, reducing the burden on the main core processor, and achieving low power consumption.

[0056] Different from powerful and resource-rich chips (such as those in mobile phones), MCUs usually only contain a central processing unit (CPU), necessary built-in storage and basic peripherals (such as general purpose input and output interfaces GPIO, serial ports, timers, etc.). These limited hardware resources are integrated on a single chip. Due to resource and performance limitations, MCU platform operation usually has the following characteristics:

[0057] 1. When running bare metal programs or real-time operating systems (RTOS), it is difficult to support complex dynamic loading and memory mapping capabilities without introducing additional framework mechanisms.

[0058] 2. The system image is directly burned on a non-volatile memory, such as a read-only memory (ROM). The chip takes instructions from the ROM and executes them without loading them separately. In addition, the ROM has a limited number of erase and write times and a long erase and write time, and cannot adapt to high-frequency data modification actions.

[0059] 3. The system images of MCU products are mostly statically linked monolithic kernel architectures, which do not distinguish between kernel state and user state, and there is a strong coupling relationship between components.

[0060] Among them, static linking means merging all modules (including library files and program codes) into one executable file during compilation, and all modules are loaded when the executable file is started.

[0061] Based on the above MCU platform operation characteristics, when MCU products need to update system functions, add new applications, etc., the common solution in the industry is to compile a new version and update the MCU image through full upgrade or differential upgrade. For the same version, the applications carried by the MCU image are often fixed and cannot support users to dynamically install or uninstall them.

[0062] In order to expand the application ecology of MCU products, in recent years, wearable product manufacturers have introduced virtual operating environments or interpreters of various languages ​​in high-end MCU chips to enable the MCU platform to run applications in interpreted languages ​​such as JavaScript (JS) and Python. Newly installed applications can be loaded into dynamic memory areas such as random-access memory (RAM) and pseudo-static random access memory (PSRAM), and run based on the interpreter.

[0063] like Figure 1 As shown, taking JS application as an example, the JS interpreter is generally compiled together with the kernel, and based on the kernel capabilities, it provides JS application with functions such as syntax parsing, variable management, memory management, type conversion, and exception capture.

[0064] Taking the running of JS applications on the MCU platform as an example, first of all, realizing a virtual operating environment or interpreter architecture on the MCU platform requires not only a large amount of ROM resources and RAM resources, but also high performance requirements for the chip. Most low-cost MCU chips cannot meet the above conditions in terms of storage space and computing power, especially the dynamic memory resources such as RAM / PSRAM where the application runs are extremely scarce (for example, some MCU processors commonly used in some smart watches only contain 2.5Mb of PSRAM space), and the cost of expanding RAM space far exceeds the cost of expanding ROM space. Secondly, when running JS applications, the CPU cannot directly fetch instructions, and needs to go through complex actions such as JS interpreter translation and memory allocation. Its operating efficiency is much lower than that of applications that can be run directly on ROM. At the same time, it also requires greater memory consumption. In order to avoid stuck phenomena when the application is running, there will be higher requirements for MCU chip performance.

[0065] It is easy to see that although implementing a virtual operating environment or interpreter architecture on the MCU platform can achieve flexible loading of applications, it has high requirements for memory resources, performance, etc. Currently, only some high-end sports watches and bracelets on the market can support the dynamic installation of JS applications. This capability is difficult to delegate to low-end chips.

[0066] On the basis of full static linking, some researchers want to try to compile the application into a component that is independent of the main project (also called source project / main program / native image) to achieve independent loading of the application. However, when the full static linking project is generated, the compiler and linker will relocate the symbols during compilation and linking, and convert the reference relationship of the symbols into absolute addresses. Therefore, in the final executable file, all the code, data and other symbols are mapped to a unique fixed physical address. In this way, there will be a strong coupling relationship between the components. Similarly, there will be a coupling relationship between the applications compiled with the macro kernel. The call to the macro kernel function in the application must follow the static link relationship. How to remove the above dependencies is the main problem that this research direction wants to solve.

[0067] There is a solution that dynamically downloads and runs applications based on the Global Offset Table (GOT). This solution relies on the compiler's -fpic capability to compile the application into position-independent code, and download the GOT table and independently compiled application to the terminal device. In addition, the application needs to be parsed, and the initialization information of the application is sent to the application manager of the terminal device through an external tool. The application manager then completes the initialization of the application (such as space resource allocation, data initialization, etc.), jumps, etc. The application manager also needs to modify the address of the table entry referenced in the GOT table to the actual address based on the initialization information of the application. It can be seen that the entire implementation process of this solution is relatively complicated and relies on compiler capabilities and external tools. At the same time, since the application is compiled independently, the common functions will be compiled repeatedly, which may cause the application installation package to be larger or the GOT table to expand.

[0068] Another solution is to divide the memory into accessible area memory and inaccessible area memory based on the memory protection unit (MPU) and the memory management unit (MMU), and divide the inaccessible area memory into multiple memory blocks, and then divide the application to be loaded into the front-end program and the back-end program, load the front-end program into the accessible area memory, and when running the back-end program, dynamically load part of the back-end program into the inaccessible area memory, and replace part of the space in the inaccessible area memory, so as to reduce the application's dependence on space resources. However, this solution requires that the chip include an MMU hardware module, and this solution does not involve how to solve the problem of static link decoupling of the application and the native image.

[0069] There is also a scheme that supports dynamic loading of applications on the SoC (System on Chip) chip that does not rely on MMU. This scheme requires that the native image include an application loading module and a clearing module for initialization of the application. However, the premise for the implementation of this scheme is that there is no dependency between the application and the main program in the compilation phase. In fact, the native image includes key code segments such as the kernel and the C library, and the conditions that the application does not rely on the above code segments at all are relatively harsh. In addition, this scheme passes the shared function set to the application through the loading module, and solves the function call relationship of the application to the native image based on redirection, but the actual effect of the above-mentioned shared function set is similar to the actual effect of the above-mentioned GOT table, and there may also be a problem that the installation package of the application is larger or the shared function set expands with the application call. Moreover, since the shared function set is a non-standard mechanism, each application needs to have the ability to parse, redirect and jump.

[0070] It is easy to see that the above-mentioned solutions based on the GOT table or shared function set need to rely on the compiler capabilities, parse the compiled image file for initializing the application, calculate the offset value of the address, redirect, etc. Not only is the implementation process complicated, but the access from the application to the kernel requires a jump, and the performance is low; in addition, since the application is compiled independently, its repeated compilation or more calls to public functions may cause the application installation package to be larger or the GOT table to expand, and the GOT table between different applications cannot be reused. The above-mentioned solution based on MPU and MMU can realize dynamic loading during the execution of the application, but the solution does not involve how to solve the problem of static link decoupling between the application and the native image. It is only applicable to the replacement of part of the application data in the native image, and requires hardware support.

[0071] Based on the above problems, the embodiment of the present application provides a method for generating an application installation package. Under the condition of static linking, the server can compile multiple versions of archive images (also called archived application installation packages, archived application packages, application images) of the application based on the basic version components (also called source project components) and the application source components at multiple preset locations. The terminal device can apply to the server for the archive image of the corresponding version based on the existing storage space status and the information of the basic version components, and complete the functions of downloading, verifying, installing and uninstalling the archive image. In this way, the terminal device can load the application independently, and the static link relationship of the application is consistent with the source project, without affecting the original static link relationship of the source project. In addition, since the application source component and the source project component jointly participate in the static linking, the existing code segments and data segments of the source project can be reused, so the application archive image can only contain the difference content with the source project. In this way, the size of the application archive image is small, which can improve the download and installation efficiency and improve the user experience.

[0072] It should be noted that the basic version component (also referred to as the source engineering component) mentioned in the embodiment of the present application may refer to the source files of the operating system of the terminal device and the source files corresponding to some system services, system applications, etc. developed on the operating system; the native image (also referred to as the basic version image or basic image or original image) may refer to the image generated by the basic version component through compilation and linking.

[0073] It should be noted that the applications mentioned in the embodiments of the present application may include two types. One is an application that directly fetches instructions and runs on the processor of the terminal device (for example, on the MCU chip). This application can be called a local application (Native Application); the other is an application that is incrementally developed based on the native image. This application can be called a third-party application. By implementing the method provided in the embodiments of the present application, the application can be loaded as an independent software unit, and the static link relationship of the native image will not be affected after loading.

[0074] In actual applications, an application can be composed of multiple components. Each component can be understood as a basic building block of the application. A component can define the functions of one or some aspects of the application.

[0075] Below, a communication system provided by an embodiment of the present application is first introduced.

[0076] Figure 2 A communication system provided by an embodiment of the present application is exemplified.

[0077] like Figure 2 As shown, the communication system may include: a server 100 and a terminal device 200.

[0078] Among them, the server 100 (also known as the application market server) can be used to generate multiple versions of application installation packages based on the basic version components and the application source components; it can also be used to communicate with the terminal device 200 (for example, pushing a certain version of the application installation package to the terminal device 200, receiving messages sent by the terminal device 200, etc.); and so on.

[0079] The server 100 may be a traditional server or a cloud server. The embodiment of the present application does not limit the specific type of the server 100.

[0080] Among them, the terminal device 200 can be used for downloading, verifying, installing, uninstalling, etc. of the application installation package; it can also be used to communicate with the server 100 (for example, sending messages to the server 100, receiving messages sent by the server 100, etc.); and so on.

[0081] The terminal device 200 may be of various types, and the embodiments of the present application do not limit the specific types of the terminal device 200. For example, the terminal device 200 may be a wearable device (such as a smart watch, etc.), a smart home device (such as a smart screen, a smart water heater, a smart lamp, a smart air conditioner, etc.), a car device (such as a smart car microcontroller unit), an Internet of Things device, a mobile phone, an augmented reality (AR) device, a virtual reality (VR) device, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, etc.

[0082] In the embodiment of the present application, the method provided in the embodiment of the present application is illustrated by taking the terminal device 200 as a terminal device with MCU as the computing core as an example.

[0083] In an embodiment of the present application, the server 100 may include an MCU application building module, wherein the MCU application building module can be used to generate multiple versions of application installation packages based on the basic version component and the application source component, and can also be used to perceive the difference files, difference contents, etc. generated after the application source component is merged into the basic version component; it can also be used to add redirection symbols (also called redirection information or redirection tags) to the application source component at the desired granularity (for example, function level, file level, component level, etc.); and so on.

[0084] In an embodiment of the present application, in order to facilitate the management of applications, the terminal device 200 may include an application management module, which may be included in the native image. The application management module can be used to apply for the corresponding version of the application installation package from the server 100 based on the existing storage space status of the terminal device 200 and the information of the basic version components, and complete the registration, downloading, verification, installation, uninstallation and management of the application.

[0085] It should be understood that the embodiments of the present application do not limit the number of servers and terminal devices included in the communication system.

[0086] For example, Figure 3As shown, the server 100 can generate multiple versions of application installation packages (e.g., different versions of application A installation packages, different versions of application B installation packages, different versions of application C installation packages, etc.) at multiple preset locations through the MCU application building module based on the basic version components and the application source components (e.g., application A source component, application B source component, application C source component, etc.). Terminal devices of different users (e.g., terminal device of user 1, terminal device of user 2, terminal device of user n, etc.) can apply to the server 100 for downloading the corresponding version of the application installation package (e.g., the terminal device of user 1 downloads version 1 of application B installation package, the terminal device of user 2 downloads version 2 of application B installation package, the terminal device of user n downloads version 4 of application A installation package, etc.) through the application management module on their terminal devices.

[0087] Figure 4 The specific process of a method for generating an application installation package provided in an embodiment of the present application is exemplified.

[0088] like Figure 4 As shown, the method can be applied to the server 100. It should be noted that the method is not limited to the server 100, and can also be applied to other devices, such as terminal devices, developer's development devices, etc., which are not limited in the present embodiment of the application. The specific steps of the method are described in detail below:

[0089] S401. The server 100 obtains a basic version component and an application source component.

[0090] The basic version components may refer to the source files of the operating system of the terminal device and the source files corresponding to some system services and system applications developed on the operating system. The basic version components may be uploaded to the server 100 by the developer through the development device, or may be pre-stored by the server 100. The embodiment of the present application does not limit the way in which the server 100 obtains the basic version components.

[0091] The application source component may refer to an application component in the form of compiled middleware before static link redirection is completed during the compilation process. Developers can upload the application source component to the server 100 through a development device. On the server 100, the application can be archived and managed in the form of a source component, and the server 100 can build a corresponding application image based on the specified basic version component.

[0092] The application source component mentioned in the embodiments of the present application may be a file in a certain format, for example, including but not limited to .c files, .i files, .s files, .o files; or it may be a code fragment scattered in the source project.

[0093] exist Figure 4 , Figure 8 , Fig. 9 In the illustrated embodiment, an example is given in which the application source component is a file in a certain format.

[0094] In the follow-up Fig.10 , Fig.11 , Fig.12 In the illustrated embodiment, the application source components are code fragments dispersed in the source project as an example for explanation, which will not be expanded here.

[0095] See also Figure 5 , taking the application source component being a .c file as an example, the compilation and linking process of the application source component is explained.

[0096] First, the preprocessor can precompile the .c file (including removing comments, processing preprocessing files starting with #, etc.) to generate a .i file.

[0097] Then, the compiler can compile the .i file (including lexical analysis, syntax analysis, semantic analysis, generation of intermediate code, generation of assembly code, etc.) to generate a .s file (i.e., assembly file).

[0098] Next, the assembler can translate the .s file to generate a .o file (i.e., the target file that can be redirected). The main work of the assembler can include translating the assembly code into corresponding binary instructions with reference to the instruction set, and generating some important information required for the subsequent linking process, which is assembled into the target file in the form of sections.

[0099] Finally, the linker can assemble the code segments and data segments in each target file (i.e., .o file) generated by the assembler into the code segments and data segments of an executable file (e.g., .bin file). The main tasks of the linker may include merging segment tables (i.e., integrating the segment information in multiple redirectable target files into one file), adjusting segment offsets (the size of the segment table changes after merging, so the address also needs to be appropriately offset), merging symbol tables (i.e., integrating the symbols in multiple redirectable target files into one file), and symbol redirection (the linker associates each symbol definition with a preset address, and then modifies all references to these symbols so that they point to this storage location, thereby completing the redirection).

[0100] S402: The server 100 generates archive images of multiple versions of the application based on the basic version components and the application source components.

[0101] Combine the following Figure 6 and Fig. 7A The following is an exemplary description of a process in which the server 100 generates an archive image of a certain version of an application based on a basic version component and an application source component:

[0102] See also Figure 6 The server 100 may include a patch building framework module, which may include a compilation tool chain, a probe, an incremental building module, and a difference perception module. The compilation tool chain may be used to compile and link the basic version components and the application source components; the probe may be used to perceive the content of the input compilation tool chain; the incremental building module may be used to merge the application source components into the basic version image, and perform incremental compilation after the application source components are merged into the basic version image; the difference perception module may be used to perceive the difference files and difference contents generated after the application source components are merged into the basic version image.

[0103] In some examples, the patch building framework module may be included in the aforementioned MCU application building module.

[0104] First, the server 100 can perform a basic construction on the basic version component to obtain the intermediate products of the compilation and linking process to facilitate subsequent incremental compilation. The basic construction can refer to the process of the server 100 compiling and linking the basic version component. The basic version component can generate a basic version image through the basic construction.

[0105] Then, the server 100 may perform an incremental build, wherein the incremental build may include the server 100 merging the application source component into the basic version component, the server 100 identifying the difference content (which may refer to the difference file or the specific difference content in the difference file), and the server 100 compiling and linking the difference content. The application source component may generate an archive image of the application through the incremental build.

[0106] It should be noted that during the incremental build process, the server 100 may compile only the difference content (i.e., incremental compilation), or may compile the application source component and the base version component as a whole (i.e., full compilation), which is not limited in the present embodiment. In the present embodiment, incremental compilation is only used as an example, which should not constitute a limitation on the present application.

[0107] It should be noted that in the embodiments of the present application, since the application source component can exist in the form of a file in a certain format (for example, in the form of a source code file) or in the form of code fragments scattered in the source project, difference perception can be selectively performed based on the existence form of the application source component (also referred to as the fine-grained distribution).

[0108] For example, if the application source component exists in the form of a file in a certain format, then the difference perception process only needs to perceive the file difference without further perceiving the content difference. The entire file of the application source component is the content difference. In this case, Figure 6 The original file shown in is an empty file, and the difference file is the entire file of the application source component.

[0109] For another example, if the application source components exist in the form of code fragments scattered in the source project, then the difference perception process needs to perceive not only file differences, but also content differences (such as differences in functions, strings, etc.) through the difference content recognition module. Figure 6 The original file shown in is the file before the application source component is merged into the base version image, and the difference file is the file that is different from the original file after the application source component is merged into the base version image. Among them, the difference content identification module may include but is not limited to the Abstract Syntax Tree (AST) syntax parsing module.

[0110] It should be noted that before compiling the difference content, the server 100 can perform relevant processing on the difference content (for example, adding a suffix to the difference content, etc.) to prevent compilation conflicts. The process of preventing compilation conflicts includes but is not limited to adding String extraction, function prototype extraction, Static member identification, and compilation symbol marking. The specific execution process can refer to relevant technical materials and will not be repeated here.

[0111] In an embodiment of the present application, before compiling the difference content, the server 100 can specify a preset compilation address (or link address) space and add a compilation redirection symbol (used to indicate the compilation address space of the difference content) to the difference content. After adding the compilation redirection symbol, the compilation process can be triggered. After the compilation process is completed, the link process can be triggered. The linker can read these compilation redirection symbols so that the difference content can be redirected to the preset compilation address space.

[0112] Among them, the preset compilation address space (also referred to as the compilation address range) may refer to ROM address space, RAM address space, PSRAM address space, etc., which may depend on the MCU platform resources, and the embodiments of the present application do not limit this.

[0113] It should be noted that the above-mentioned preset compilation address can be a logical address, which can be mapped to the address of ROM / RAM / PSRAM, etc. on the user's terminal device; the above-mentioned preset compilation address can also be a physical address, such as the address of ROM / RAM / PSRAM, etc. on the user's terminal device.

[0114] In an embodiment of the present application, the difference content with the compilation redirection symbol added can prohibit kernel initialization and compiler optimization, and instead switch to manual initialization (that is, the difference content can include an initialization function, which completes the self-initialization of the application by accessing the execution address function) so that it can be loaded as an independent software unit.

[0115] In the embodiment of the present application, the difference between the application source component and the base version image is fully identified and a compilation redirection symbol is added to generate a patch. After being incorporated into the base version component, the server 100 can compile the patch and statically link it with the base version image. In the binary file generated after the static link is completed, Fig. 7A As shown in the example, the differential content image of the application can be completely isolated from the base version image, while the static link relationship of the base version image is not changed (ie, no critical binary difference is generated).

[0116] Above Fig. 7A The differential content image of the application shown in the example is an archive image of a certain version of the application generated by the server 100. The differential content image of the application includes an initialization function (also called an init segment) corresponding to the application. Fig. 7A In the image constructed after static linking as shown in the example, the server 100 can intercept the difference content image of the application in the image to generate an installation package of a certain version of the application.

[0117] In the embodiment of the present application, since the difference content of the application and the base version image are statically linked together, the application can directly access / call functions, data, etc. in the base version image without intermediate jumps.

[0118] See also Figure 7B In order to facilitate the management of applications, the basic version image may include an application management module, which can be used to register, install, uninstall, and manage applications.

[0119] Continue reading Figure 7BTaking application A as an example, in order to realize flexible installation and uninstallation of the application, the server 100 can generate multiple versions of archive images of application A (also referred to as installation packages of application A) at different preset locations (i.e., preset compilation address spaces) based on the specified basic version image, for example, application A version 1 installation package, application A version 2 installation package, application A version 3 installation package, application A version 4 installation package, application A version 5 installation package, etc. The user can select the matching version of the application installation package to download and install the application based on the current device space capacity information of the terminal device.

[0120] Continue reading Figure 7B Since different applications have different sections, their initialization actions will also be different. Therefore, in the embodiment of the present application, the archive image of the application needs to include the initialization function of the application, that is, the initialization function of the application needs to be fixed at a certain location where the application is loaded, for example, fixed at the starting address of the compilation address preset for each version. In this way, when the initialization action needs to be performed, the data can be copied from the init section of the application installation package to the running section in the form of data copying to complete the initialization action.

[0121] It is easy to understand that the archive images of different versions of the application have the same size, but the corresponding compilation address ranges are different.

[0122] It should be noted that the embodiment of the present application does not limit the type of the compilation tool chain, for example, the compilation tool chain can be an IAR compilation tool chain, etc. Taking the case where the compilation tool chain is IAR when generating the installation package of application A, and the source component of application A exists in the form of a source code file as an example, in the configuration file (ILINKConfigurationFile, ICF) of the compilation link script ILINK linker, the .data, .text, .rodata, .init and other sections in the source component set of application A can be redirected to the specified compilation address space range in the file dimension.

[0123] Figure 8 It is a schematic diagram of the process of the server 100 generating multiple versions of installation packages of multiple different applications provided by the present application and the process of the terminal device 200 downloading the corresponding versions of the installation packages of multiple different applications.

[0124] See also Figure 8 The server 100 can generate multiple versions of installation packages for multiple different applications, taking the generation of an installation package for application A, an installation package for application B, and an installation package for application C as an example.

[0125] Server 100 can generate multiple versions of application A installation packages (for example, version 1 application A installation package, version 2 application A installation package, version 3 application A installation package, version 4 application A installation package, version 5 application A installation package, etc.) based on the basic version component, application A source component, and multiple preset compilation address ranges.

[0126] exist Figure 8 In the embodiment shown, the server 100 arranges and manages the application installation packages in a gridded form, that is, the compilation address areas corresponding to the installation packages of each version of the application are all of equal size, and the compilation address areas corresponding to the installation packages of adjacent versions of the application are all equidistant. It is easy to understand that by sequentially changing the specified compilation address range, the same application can be generated into multiple versions of installation packages, and these multiple versions of installation packages correspond to different grid positions (for example, the grid position corresponding to the installation package of application A of version 1 is Figure 8 The grid position of version 1 in the grid position and the grid position of version 2 of the application A installation package are Figure 8 The grid position corresponding to the version 2 grid position and the version 3 application A installation package in is Figure 8 The grid position of version 3 and version 4 of application A installation package is Figure 8 The grid position corresponding to the version 4 grid position and the version 5 application A installation package in is Figure 8 Version 5 grid bits in, etc.).

[0127] It is easy to understand that the grid bits corresponding to each version of the application installation package correspond to different compilation address ranges. For example, the compilation address range corresponding to the grid bits of version 1 is 0x10-0x20, the compilation address range corresponding to the grid bits of version 2 is 0x30-0x40, the compilation address range corresponding to the grid bits of version 3 is 0x50-0x60, the compilation address range corresponding to the grid bits of version 5 is 0x70-0x80, the compilation address range corresponding to the grid bits of version 5 is 0x90-0x100, and so on. It should be noted that the above compilation address ranges are only examples and should not constitute a limitation on this application.

[0128] Similarly, server 100 can also generate multiple versions of application B installation packages based on the basic version components, application B source components, and multiple preset compilation address ranges (for example, version 1 application B installation package, version 2 application B installation package, version 3 application B installation package, version 4 application B installation package, version 5 application B installation package, etc.).

[0129] Similarly, server 100 can also generate multiple versions of application C installation packages based on the basic version components, application C source components, and multiple preset compilation address ranges (for example, version 1 application C installation package, version 2 application C installation package, version 3 application C installation package, version 4 application C installation package, version 5 application C installation package, etc.).

[0130] Easy to understand, Figure 8 In the illustrated embodiment, the compilation address ranges corresponding to the grid positions of version 1, version 2, version 3, version 4, version 5, etc. corresponding to the installation package of application B and the compilation address ranges corresponding to the grid positions of version 1, version 2, version 3, version 4, version 5, etc. corresponding to the installation package of application C are the same as the compilation address ranges corresponding to the grid positions of version 1, version 2, version 3, version 4, version 5, etc. corresponding to the installation package of application A. For example, if the compilation address range corresponding to the grid position of version 1 of the installation package of application A is 0x10-0x20, then the compilation address ranges corresponding to the grid position of version 1 of the installation package of application B and the compilation address ranges corresponding to the grid position of version 1 of the installation package of application C are also 0x10-0x20.

[0131] It is easy to see that in Figure 8 In the embodiment shown, since the address space range corresponding to each application installation package is of equal size, there may be a possibility of wasting space. For example, if the preset compilation address range size is 1M, and the size of the application installation package is less than 1M, it will cause space waste.

[0132] It is easy to understand that the above-mentioned multiple preset compilation address ranges do not conflict with the compilation address range of the basic version component, that is, the above-mentioned multiple preset compilation address ranges can be the compilation address range other than the compilation address range of the basic version component on the terminal device.

[0133] It should be noted that the above Figure 8 The preset compilation address management method (grid management method) in the embodiment shown is only exemplary and should not constitute a limitation on the present application. In some other embodiments of the present application, the preset compilation address management method may also be other, which is not limited in the embodiment of the present application.

[0134] S403 . The server 100 receives a message 1 sent by the terminal device 200 . The message is used to instruct the terminal device 200 to obtain an archived image of a certain version of the application.

[0135] When the terminal device 200 needs to download and install one or more applications, it can request the server 100 to download the application installation package (that is, request the server 100 to obtain the archived image of a certain version of the application). For example, the server 100 can receive a message 1 sent by the terminal device 200, which is used to instruct the terminal device 200 to obtain the archived image of a certain version of the application.

[0136] In some examples, the above-mentioned message 1 may be an application installation policy sent by the terminal device 200 to the server 100. The message 1 may include identification information of the application to be installed, and may also include the current device space capacity information of the terminal device 200. Among them, the current device space capacity information of the terminal device 200 may be the address range information corresponding to the currently free storage space of the terminal device 200. For example, taking ROM as an example, assuming that the address range corresponding to the current free storage space of ROM is 0x10-0x20, then the current device space capacity information of the terminal device 200 may be 0x10-0x20.

[0137] In some examples, when the terminal device 200 needs to install multiple applications, the message 1 may also include information about the installation order of the multiple applications. In this way, the server 100 may determine which version of the application installation package needs to be sent to the terminal device 200 based on the installation order.

[0138] In actual applications, for an operating system, there can be many versions, so the version of the operating system installed on each terminal device may be different. Therefore, in order to adapt to each terminal device, the server 100 can generate application installation packages corresponding to different versions of basic version components based on different versions of basic version components and application source components. In this case, the above message 1 can also include relevant information of the basic version components currently installed on the terminal device 200 (such as version information, etc.), so that the server 100 can determine which version of the basic version component corresponding to the application installation package is to be sent to the terminal device 200 based on the relevant information.

[0139] S404. The server 100 sends the archived image of the corresponding version of the application to the terminal device 200.

[0140] Specifically, after determining the archived image of the corresponding version of the application to be obtained by the terminal device 200 based on the above message 1, the server 100 can send the archived image (also called installation package) of the corresponding version of the application to the terminal device 200.

[0141] For example, continue to see Figure 8, assuming that user 1's terminal device needs to install application A, application B, and application C, and the order of installation is application C, application A, and application B. The free address ranges on user 1's terminal device include 0x10-0x20, 0x30-0x40, 0x50-0x60, etc. Figure 8 In the example, the address range of 0x10-0x20 corresponds to the application installation package of version 1, the address range of 0x30-0x40 corresponds to the application installation package of version 2, and the address range of 0x50-0x60 corresponds to the application installation package of version 3. Therefore, according to the order of application installation of the terminal device of user 1, it can be seen that the address range of 0x10-0x20 corresponds to the application installation package of version 1 C, the address range of 0x30-0x40 corresponds to the application installation package of version 2 A, and the address range of 0x50-0x60 corresponds to the application installation package of version 3 B. Further, the server 100 can send the application installation package of version 1 C, the application installation package of version 2 A, and the application installation package of version 3 B to the terminal device of user 1. In this way, after receiving the above installation packages, the terminal device of user 1 can install the corresponding application in the corresponding address space, complete the registration and initialization actions of the application, etc.

[0142] For example, see Figure 8 , Assume that the address ranges 0x10-0x20, 0x30-0x40, and 0x70-0x80 on the terminal device of user 2 are all occupied. For example, application X with version X is installed at 0x10-0x20, application XX with version XX is installed at 0x30-0x40, and application XXX with version XXX is installed at 0x70-0x80. Assume that application A needs to be installed on the terminal device of user 2, and the free address range is 0x50-0x60. Figure 8 In the example, the address range of 0x50-0x60 corresponds to the version 3 installation package of application A. Therefore, server 100 can send the version 3 installation package of application A to the terminal device of user 2. In this way, after receiving the version 3 installation package of application A, the terminal device of user 2 can install application A in the corresponding address space and complete the registration and initialization of application A. Similarly, suppose that application B needs to be installed on the terminal device of user 2, and the free address range is 0x90-0x100. Figure 8In the figure, the address range of 0x90-0x100 corresponds to the version 5 installation package of application B. Therefore, server 100 can send the version 5 installation package of application B to the terminal device of user 2. In this way, after the terminal device of user 2 receives the above version 5 installation package of application B, it can install application B in the corresponding address space and complete the registration and initialization actions of application B.

[0143] That is, the user can request the server 100 to download a matching version of the application installation package based on the current device space capacity information of the terminal device, and install the application on the terminal device based on the installation package.

[0144] In actual applications, the server 100 may also add key information such as protocols and security checks to the archived image of the application, thereby generating a transferable application installation package.

[0145] In some examples, the application installation package may include the loading location information of the application on the terminal device 200 (i.e., the loading address range information), so that the terminal device 200 can know where to load the application after downloading the application installation package.

[0146] In some examples, the terminal device 200 can also arrange and manage the application installation packages in a grid format similar to the server 100. After the terminal device 200 downloads a certain application installation package, it can directly load the application to the frontmost position of the current idle address range. Similarly, each time an application installation package is downloaded, the application can be loaded to the frontmost position of the current idle address range. For example, continue to refer to Figure 8 Taking the terminal device of user 1 as an example, before downloading the installation package of application C of version 1, the frontmost position of the current free address range is the position where application C of version 1 is loaded. Therefore, after downloading the installation package of application C of version 1, application C can be directly loaded to this position. When downloading the installation package of application A of version 2 later, the frontmost position of the current free address range becomes the position where application A of version 2 is loaded. Therefore, after downloading the installation package of application A of version 2, application A can be directly loaded to this position.

[0147] By implementing the above Figure 4The method provided by the illustrated embodiment, under the condition of static linking, the server 100 can generate an application installation package that can be independently loaded and installed on the terminal device, reducing the dependence of the application loading process on the running framework, jump table, etc. In this case, the static link relationship of the application is consistent with the source project, and will not affect the original static link relationship of the source project. In addition, since the application source component and the source project component (i.e., the basic version component) jointly participate in the static linking, the application can reuse the existing code segments and data segments of the source project. Therefore, the application installation package can only contain the difference content with the source project. In this way, the size of the application installation package can be reduced, so that less redundant information is sent to the user terminal device, the efficiency of application download and installation will be improved, and the user experience will be further improved. Moreover, for external developers (such as application developers), they only need to provide application source components to participate in the application ecological expansion of terminal products, which is more convenient and reduces development costs.

[0148] In some examples, the above Figure 4 The method provided by the illustrated embodiment can also be applied to the scenario where the application source components exist in the form of code fragments scattered in the source project. In this case, the difference perception process not only needs to perceive the file difference, but also needs to further perceive the content difference (such as the difference of function, string, etc.) through the difference content recognition module.

[0149] In the aforementioned Figure 4 and Figure 8 Based on the embodiment shown, Fig. 9 The specific process of an application installation method provided in an embodiment of the present application is exemplified.

[0150] like Fig. 9 As shown, the method can be applied to the terminal device 200. The specific steps of the method are described in detail below:

[0151] S901. The terminal device 200 sends a message 1 to the server 100. The message is used to instruct the terminal device 200 to obtain an archived image of a certain version of an application.

[0152] Specifically, when the terminal device 200 needs to download and install one or more applications, the terminal device 200 can request the server 100 to download the application installation package (i.e., request the server 100 to obtain an archived image of a certain version of the application). For example, the terminal device 200 can send a message 1 to the server 100 through the application management module, and the message is used to instruct the terminal device 200 to obtain an archived image of a certain version of the application.

[0153] In some examples, the above-mentioned message 1 may be an application installation policy sent by the terminal device 200 to the server 100, and the message 1 may include identification information of the application to be installed, and may also include the current device space capacity information of the terminal device 200. Among them, the current device space capacity information of the terminal device 200 may include address range information corresponding to the currently idle storage space of the terminal device 200. For example, taking ROM as an example, assuming that the address range corresponding to the currently idle storage space of ROM is 0x10-0x20, then the current device space capacity information of the terminal device 200 may be 0x10-0x20.

[0154] In some examples, when the terminal device 200 needs to install multiple applications, the message 1 may also include information about the installation order of the multiple applications. In this way, the server 100 may determine which version of the application installation package needs to be sent to the terminal device 200 based on the installation order.

[0155] S902. The terminal device 200 receives the archived image of the corresponding version of the application sent by the server 100, and installs the application based on the archived image of the corresponding version of the application.

[0156] Specifically, after the server 100 determines the archived image of the corresponding version of the application to be obtained by the terminal device 200 based on the above message 1, the server 100 can send the archived image (also called an installation package) of the corresponding version of the application to the terminal device 200. After receiving the archived image of the corresponding version of the application sent by the server 100, the terminal device 200 can install the application in the corresponding address space based on the archived image of the corresponding version of the application.

[0157] It is easy to understand that after installing one or more applications, the terminal device 200 can also support the user to uninstall the one or more applications in any order without affecting the source project.

[0158] By implementing Fig. 9According to the method provided by the illustrated embodiment, the terminal device 200 can download an application installation package on the server 100 that can be independently loaded and installed on the terminal device 200. The terminal device 200 can install the application on the ROM / RAM / PSRAM and other storage devices of the terminal device 200 as needed, and can support users to download, install and uninstall the application in any order. In addition, since the application source component and the source project component (i.e., the basic version component) jointly participate in the static link, the application can freely access any function, data, etc. in the source project, and does not require any intermediate jump mechanism, GOT table, etc., and does not rely on hardware such as MMU to achieve the jump. Moreover, it is possible to achieve maximum reuse of the source project by the application, such as calling similar functions, or accessing the same static variables. The location of the accessed object is located in the source project image, so there is no need for repeated compilation of the application, and at the same time, the size of the application installation package is reduced as much as possible. In addition, there is no need to introduce an interpreter, virtual machine, etc. to support the operation of the application on the terminal device 200. The running location of the installed application is in the same performance storage device as the source project, and its running performance is consistent with the code segment in the macro kernel. It only needs to be initialized during the first execution (for example, initialization is completed through the application management module on the terminal device 200), and the fluency of the application can be improved.

[0159] Fig.10 The specific process of another application installation package generation method provided in an embodiment of the present application is exemplified.

[0160] like Fig.10 As shown, the method can be applied to the server 100. It should be noted that the method is not limited to the server 100, and can also be applied to other devices, such as terminal devices, developer's development devices, etc., which is not limited in the embodiment of the present application.

[0161] Below Fig.10 , Fig.11 , Fig.12 In the scenario of the embodiment shown, the application source component is scattered in one or more source files of the source project (i.e., the basic version component) in the form of source code fragments. The requirements corresponding to this scenario may include but are not limited to the following two: (1) The application depends on the implementation of certain functions in the source project that are not exposed to the outside world (such as Static functions). In order to avoid version changes caused by changes to the source project, the application needs to be split into scattered code fragments to be scattered in the source files where the corresponding functions are located; (2) The application hopes to separate features from the source project and load them independently as an application or external module.

[0162] The specific steps of this method are described in detail below:

[0163] S1001. The server 100 receives a message 1 sent by a terminal device 200. The message 1 includes compilation address information and identification information of an application B.

[0164] Specifically, when the terminal device 200 needs to install a certain application, for example, when it needs to install application B, the terminal device 200 can send message 1 to the server 100, and the message 1 may include compilation address information and identification information of application B. After receiving the message 1, the server 100 can execute subsequent steps based on the message 1 to generate an installation package for application B.

[0165] The above-mentioned compilation address (or link address) information may be the location information (the corresponding address range information when loading application B) of the terminal device 200. For example, the terminal device 200 needs to install application B in a certain free storage space, and the address range corresponding to the storage space is 0x10-0x20, then the above-mentioned compilation address information may be 0x10-0x20.

[0166] It is easy to understand that, under normal circumstances, before the terminal device 200 downloads an application installation package from the application market, it can obtain the size of the application installation package. Therefore, the terminal device 200 can determine the address allocation strategy based on the size of the application installation package, that is, determine how large an address range needs to be allocated to the application installation package, thereby determining the above-mentioned compilation address information.

[0167] In actual applications, for an operating system, there can be many versions, so the version of the operating system installed on each terminal device may be different. Therefore, in order to adapt to each terminal device, the server 100 can generate application installation packages corresponding to different versions of basic version components based on different versions of basic version components and application source components. In this case, the above message 1 can also include relevant information of the basic version components currently installed on the terminal device 200 (such as version information, etc.), so that the server 100 can determine which version of the basic version component corresponding to the application installation package needs to be generated based on the relevant information.

[0168] S1002. The server 100 generates an installation package of application B based on the basic version component, the source component of application B, and the compilation address information.

[0169] Combine the following Fig.11 The following is an exemplary description of a process in which the server 100 generates an installation package of the application B based on the basic version component, the source component of the application B, and the compilation address:

[0170] First, the server 100 can perform a basic construction on the basic version component. The basic construction may refer to the process of the server 100 compiling and linking the basic version component. The basic version component can generate a basic version image through the basic construction. In the embodiment of the present application, the basic version component may refer to all source files of the source project of the application B source component before it is merged into the basic version component (that is, all source files of the source project of the application B source component before it is scattered in one or more source files of the source project in the form of source code fragments).

[0171] Then, the server 100 may perform an incremental build, wherein the incremental build may include the server 100 merging the application B source component into the basic version component, the server 100 identifying the difference content, and the server 100 compiling and linking the difference files containing the difference content.

[0172] In the embodiment of the present application, the server 100 merging the application B source component into the basic version component may mean that the server 100 distributes the application B source component in one or more source files of the source project in the form of source code fragments.

[0173] In an embodiment of the present application, the above-mentioned difference file can be a source file in which there are differences in the source project between the source component of application B after it is merged into the basic version component and the source component of application B before it is merged into the basic version component.

[0174] In some examples, the difference file may include one or more source files in the source project that contain source code fragments of application B. In other examples, the difference file may also include one or more source files that affect the base version component after the source component of application B is merged into the base version component.

[0175] See also Fig.11 For example, ac files, bc files, cc files, etc. may be all source files of the source project after the source component of application B is merged into the basic version component, wherein the black part of the file may refer to the code fragments of application B scattered in the file, and the white part is the original code in the source project.

[0176] In the embodiment of the present application, in addition to obtaining the difference file, the server 100 also needs to further identify and extract the difference content in the difference file. There are many tools for identifying and extracting the difference content, such as using an abstract syntax tree AST to identify code differences, etc. The embodiment of the present application does not limit the type of tools used for identifying and extracting the difference content.

[0177] Next, after identifying and extracting the difference content in the difference file, the server 100 can add precise redirection symbols (used to indicate the compilation address space of the difference content) to the difference content based on the compilation address information sent by the terminal device 200. After adding the redirection symbols, the compilation process can be triggered. After the compilation process is completed, the linking process can be triggered. The linker can read these compilation redirection symbols so that the difference content can be redirected to the compilation address space area corresponding to the above-mentioned compilation address information, so that the source component content of application B originally mixed in the source project code can be separated into an independent compilation address space area. Further, the server 100 can generate an installation package for application B.

[0178] It is easy to understand that the installation package of application B includes the source component content of application B separated from the source project code.

[0179] In actual applications, the installation package of application B may also include key information such as protocols and security checks to facilitate transmission.

[0180] In some examples, the above-mentioned basic construction process, the process of integrating the application B source component into the basic version component, and the process of identifying the difference content can be performed before the above-mentioned step S1001.

[0181] S1003. The server 100 sends the installation package of application B to the terminal device 200.

[0182] Specifically, after generating the installation package of application B, the server 100 may send the installation package of application B to the terminal device 200 .

[0183] It can be seen that Fig.10 The method provided in the embodiment shown in the figure has the aforementioned Figure 4 The characteristics and advantages of the embodiment shown are compared with the aforementioned Figure 4 In the embodiment shown, Fig.10 In the illustrated embodiment, the form of the application source component is replaced with code fragments scattered in the source project. The redirection of the application source component is more flexible, the application scenarios of the solution are more extensive, and the application can also call more capabilities and content of the source project. In other words, not only independent applications, but also features and components in the source project can be split and loaded in this way to achieve dynamic download, installation, and uninstallation. In addition, Fig.10 In the embodiment shown, since the terminal device 200 implements a close arrangement management for the application programs, compared with the aforementioned Figure 4 The embodiment shown changes the form of application management, which can achieve greater space utilization on the terminal device 200 side, but may increase the time it takes for users to obtain applications, and is not a pure profit solution.

[0184] In some examples, the above Fig.10 The method provided by the illustrated embodiment is also applicable to the scenario where the application source component exists in the form of a file in a certain format. In this case, the difference perception process only needs to perceive the file difference without further perceiving the content difference, and the entire file of the application source component is the content difference.

[0185] In the aforementioned Fig.10 and Fig.11 Based on the embodiment shown, Fig.12 The specific process of another application installation method provided in an embodiment of the present application is exemplified.

[0186] like Fig.12 As shown, the method can be applied to the terminal device 200. The specific steps of the method are described in detail below:

[0187] S1201. The terminal device 200 sends a message 1 to the server 100. The message 1 includes compilation address information and identification information of the application B.

[0188] Specifically, when the terminal device 200 needs to download and install a certain application, it can request the server 100 to download the application installation package. For example, when the terminal device 200 needs to download and install application B, the terminal device 200 can send a message 1 to the server 100 through the application management module. The message 1 includes the compilation address information and the identification information of application B. In this way, after receiving the message 1, the server 100 can generate the installation package of application B based on the message 1.

[0189] The above-mentioned compilation address information may be the location information (the corresponding address range information when loading application B) of the terminal device 200. For example, the terminal device 200 needs to install application B in a certain free storage space, and the address space range corresponding to the storage space is 0x10-0x20, then the above-mentioned compilation address information may be 0x10-0x20.

[0190] It is easy to understand that, under normal circumstances, before the terminal device 200 downloads an application installation package from the application market, it can obtain the size of the application installation package. Therefore, the terminal device 200 can determine the address allocation strategy based on the size of the application installation package, that is, determine how large an address range needs to be allocated to the application installation package, thereby determining the above-mentioned compilation address information.

[0191] The specific process of the server 100 generating the installation package of the application B can refer to the aforementioned Fig.10 The contents of the illustrated embodiment will not be repeated here.

[0192] S1202. The terminal device 200 receives the application B installation package sent by the server 100, and installs the application B based on the application B installation package.

[0193] Specifically, after generating the installation package of application B, the server 100 may send the installation package of application B to the terminal device 200. After receiving the installation package of application B sent by the server 100, the terminal device 200 may generate an installation package of application B in the address space corresponding to the compilation address information (for example, Fig.11 Application B is installed on the terminal device of user 1 in the address space corresponding to the dotted box).

[0194] It is easy to understand that after installing one or more applications, the terminal device 200 can also support the user to uninstall the one or more applications in any order without affecting the source project.

[0195] By implementing the above Fig.12 The method provided in the embodiment shown can not only realize the dynamic download, installation and uninstallation of applications, but also implement close arrangement management of applications (for example, Fig.11 There is no free space between the loading position of the application A installation package and the loading position of the application B installation package on the terminal device of user 1), thereby improving the space utilization of the terminal device 200.

[0196] It should be noted that the above Figure 4 , Figure 8 , Fig. 9 , Fig.10 , Fig.11 , Fig.12 The embodiments shown are merely specific exemplary application scenarios. The method provided in the present application can be implemented in a variety of application scenarios. The programming languages ​​used (such as C, C++, Python, JavaScript, etc.), the forms of application source components (such as source code files, source code expansion files, redirectable files, code fragments scattered in the source project, etc.), the compilation tool chains used, the terminal device application installation address management method, etc., should not constitute limitations on the present application.

[0197] It should be noted that, in this application, the example in which the application installation package includes content that is different from the source project, but does not include content that is not different from the source project is taken, but it is not limited to this. In some other embodiments of the present application, the application installation package may also include both content that is different from the source project and content that is not different from the source project.

[0198] The structure of a server 100 provided in an embodiment of the present application is introduced below.

[0199] Fig.13 The structure of a server 100 provided in an embodiment of the present application is exemplified.

[0200] like Fig.13 As shown, the server 100 may include: one or more processors 1301, a memory 1302, a communication interface 1303, a transmitter 1305, a receiver 1306, a coupler 1307, and an antenna 1308. These components may be connected via a bus 1304 or other means. Fig.13 Take bus connection as an example.

[0201] The communication interface 1303 can be used for the server 100 to communicate with other devices, such as the terminal device 200, etc., for communication. Specifically, the communication interface 1303 can be a 3G communication interface, a 4G communication interface, a 5G communication interface, or a communication interface of a future new air interface. Not limited to a wireless communication interface, the server 100 can also be configured with a wired communication interface 1303, such as a local access network (LAN) interface. The transmitter 1305 can be used to transmit and process the signal output by the processor 1301. The receiver 1306 can be used to receive and process the mobile communication signal received by the antenna 1308.

[0202] In some examples of the present application, the transmitter 1305 and the receiver 1306 can be regarded as a wireless modem. In the server 100, the number of the transmitter 1305 and the receiver 1306 can be one or more. The antenna 1308 can be used to convert the electromagnetic energy in the transmission line into electromagnetic waves in the free space, or convert the electromagnetic waves in the free space into electromagnetic energy in the transmission line. The coupler 1307 is used to divide the mobile communication signal received by the antenna 1308 into multiple paths and distribute them to multiple receivers 1306.

[0203] The memory 1302 is coupled to the processor 1301 and is used to store various software programs and / or multiple sets of instructions. Specifically, the memory 1302 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage devices, flash memory devices or other non-volatile solid-state storage devices. The memory 1302 may store a network communication program, which may be used to communicate with one or more additional devices, one or more terminal devices, or one or more network devices.

[0204] In some examples of the present application, the memory 1302 may be used to store an implementation program of the application installation package generation method and the application installation method on the server 100 side provided by one or more embodiments of the present application.

[0205] The processor 1301 may be used to read and execute computer-readable instructions. Specifically, the processor 1301 may be used to call a program stored in the memory 1302, such as an application installation package generation method and an application installation method implementation program on the server 100 provided in one or more embodiments of the present application, and execute instructions contained in the program.

[0206] In some examples of the embodiments of the present application, the server 100 may include a functional unit (also referred to as a functional module) of an MCU application building module (not shown in the figure). In practical applications, the functional unit and Fig.13 The physical units (also referred to as physical modules) of the server 100 shown may be split / combined into multiple units or modules for implementation, but the basic functions contained therein may be consistent.

[0207] It should be noted that Fig.13 The server 100 shown is only one implementation of the embodiment of the present application. In actual applications, the server 100 may also include more or fewer components, which is not limited here.

[0208] For more details about the functions and working principles of the server 100, please refer to the relevant contents in the above embodiments, which will not be repeated here.

[0209] The following is a schematic diagram of the structure of a terminal device 200 provided in an embodiment of the present application.

[0210] Fig.14 The structure of a terminal device 200 provided in an embodiment of the present application is exemplified.

[0211] like Fig.14As shown, the terminal device 200 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0212] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 200. In other embodiments of the present application, the terminal device 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0213] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0214] The controller may be the nerve center and command center of the terminal device 200. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0215] In some examples of the embodiments of the present application, the processor of the terminal device 200 may include an MCU, and the terminal device 200 uses the MCU as the computing core. The terminal device 200 may include an application management module (not shown in the figure) as a functional unit (also referred to as a functional module). In actual applications, the functional unit and the core physical unit of the terminal device 200 (also referred to as a core physical module), such as the MCU, may be split / merged into multiple units or modules to implement, but the basic functions they contain may be consistent.

[0216] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0217] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0218] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the terminal device 200.

[0219] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.

[0220] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0221] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.

[0222] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the terminal device 200. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the terminal device 200.

[0223] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0224] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device 200, and can also be used to transmit data between the terminal device 200 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices, such as AR devices, etc.

[0225] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal device 200. In other embodiments of the present application, the terminal device 200 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0226] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 200. While the charging management module 140 is charging the battery 142, it may also power the terminal device 200 through the power management module 141.

[0227] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0228] The wireless communication function of the terminal device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0229] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 200 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0230] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 200. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0231] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0232] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 200. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0233] In some embodiments, the antenna 1 of the terminal device 200 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the terminal device 200 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0234] The terminal device 200 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0235] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 200 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0236] The terminal device 200 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0237] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, etc. of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0238] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the terminal device 200 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0239] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 200 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0240] Video codecs are used to compress or decompress digital videos. The terminal device 200 may support one or more video codecs. Thus, the terminal device 200 may play or record videos in multiple coding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0241] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 200 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0242] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 200. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0243] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the terminal device 200 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0244] In some examples of the present application, the internal memory 121 may be used to store the implementation program of the application installation package generation method and the application installation method on the terminal device 200 side provided by one or more embodiments of the present application. The processor 110 (e.g., MCU) may be used to read and execute computer-readable instructions. Specifically, the processor 110 (e.g., MCU) may be used to call a program stored in the internal memory 121, such as the implementation program of the application installation package generation method and the application installation method on the terminal device 200 side provided by one or more embodiments of the present application, and execute the instructions contained in the program.

[0245] The terminal device 200 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0246] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0247] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal device 200 can listen to music or listen to a hands-free call through the speaker 170A.

[0248] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 200 receives a call or voice message, the voice can be received by placing the receiver 170B close to the ear.

[0249] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 200 can be provided with at least one microphone 170C. In other embodiments, the terminal device 200 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal device 200 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the sound source, realize directional recording function, etc.

[0250] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0251] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The terminal device 200 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the terminal device 200 detects the touch operation intensity according to the pressure sensor 180A. The terminal device 200 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0252] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the terminal device 200, which is different from the position of the display screen 194.

[0253] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal device 200 may receive key input and generate key signal input related to user settings and function control of the terminal device 200.

[0254] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0255] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power changes, messages, missed calls, notifications, etc.

[0256] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the terminal device 200 by inserting the SIM card interface 195 or pulling it out from the SIM card interface 195. The terminal device 200 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 200 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the terminal device 200 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 200 and cannot be separated from the terminal device 200.

[0257] It should be understood that Fig.14 The terminal device 200 shown is only an example, and the terminal device 200 may have more Fig.14 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components. Fig.14 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.

[0258] The terminal device 200 in the present application may be a device with an MCU as a computing core. The MCU of the terminal device 200 is specifically introduced below.

[0259] Fig.15 The structure of the MCU in the terminal device 200 is exemplarily shown.

[0260] like Fig.15As shown, the MCU may include a central processing unit CPU, peripheral units and basic functional units. The peripheral unit may include a memory (such as ROM, RAM, etc.), an input / output interface, and a register. The basic functional unit may include a timer / counter, an interrupt system, and a serial interface. The MCU can be used to implement functions including timing, connecting external channels as an input / output interface, implementing external interrupt control, and providing a communication interface. The CPU, each device in the peripheral unit, and each device in the basic functional unit can be coupled through a bus.

[0261] The memory may be used to store computer programs and data. The embodiment of the present application does not limit the type of memory. For example, in addition to ROM and RAM, a pseudo static random access memory (PSRAM) and the like may also be integrated on the MCU.

[0262] The CPU may include components such as a controller and an arithmetic unit. The CPU can be used to read binary instructions from the memory and execute them. That is, the MCU can implement on-chip instruction fetching and execution.

[0263] The input / output interface may include the aforementioned Fig.14 The USB interface 130 shown. Not limited to the USB interface 130, the input / output interface integrated on the MCU may also include one or more of the following: an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and the like.

[0264] Registers can be used to temporarily store data and operation structures involved in calculations.

[0265] Timers / Counters can be used to measure the time it takes for an event to occur or to measure the time difference between two events.

[0266] The interrupt system can be used to achieve real-time control, automatic fault handling, and data transmission between the CPU and peripheral devices.

[0267] The serial interface may be an expansion interface using a serial communication method, which may be used to implement sequential transmission of data bit by bit.

[0268] Understandably, Fig.14 The processor 110, internal memory 121, and USB interface 130 shown may be integrated on one chip to implement the functions of an MCU.

[0269] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.

[0270] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

[0271] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for generating an application installation package, characterized in that: The method comprises: The server identifies the difference content, where the difference content is the content that is different before and after the source component of the application is incorporated into the basic version component, where the basic version component is the source file of the operating system on the terminal device and the source file of the service developed based on the operating system; The server adds redirection information to the difference content, the redirection information is used to indicate that the link address range of the difference content is a first link address range, the first link address range and the second link address range do not conflict, the second link address range is a link address range of the basic version component, the first link address range is a storage address range on the terminal device, the second link address range is another storage address range on the terminal device, and the storage address range is an address range of a memory used to run executable program code; The server generates a first image and intercepts the first content in the first image to generate an installation package of the application, wherein the first content is the difference content after being compiled and statically linked, and the first image is generated by the server after compiling and statically linking the basic version component and the difference content.

2. The method according to claim 1, characterized in that The first link address range includes N preset link address ranges, where N is a positive integer greater than 1. The server generates a first image, specifically including: The server compiles the basic version component and the difference content N times, and statically links to generate N versions of the first image corresponding to the N preset link address ranges; The server intercepts the first content in the first image to generate an installation package for the application, specifically including: The server intercepts the first content in the N versions of the first images to generate installation packages of the N versions of the application.

3. The method according to claim 2, characterized in that The installation packages of the N versions of the application include an installation package of the application corresponding to an idle storage address range on the terminal device, and the method further includes: The server sends the installation package of the application corresponding to the free storage address range to the terminal device based on the free storage address range on the terminal device.

4. The method according to claim 3, characterized in that The idle storage address range on the terminal device is sent by the terminal device to the server.

5. The method according to any one of claims 2 to 4, characterized in that: The N preset link address ranges are of equal size.

6. The method according to claim 1, characterized in that The first link address range is a link address range, and before the server adds redirection information to the difference content, the method further includes: The server receives a first message sent by the terminal device, where the first message includes the first link address range, and the first link address range is an idle storage address range on the terminal device; The server adds redirection information to the difference content, specifically including: The server adds the redirection information to the difference content based on the first link address range.

7. The method according to claim 6, characterized in that The method further comprises: The server sends the installation package of the application to the terminal device based on the first link address range.

8. The method according to any one of claims 1 to 7, characterized in that: The difference content is the entirety of the difference file, or the difference code in the difference file.

9. The method according to any one of claims 1 to 8, characterized in that: The source component of the application program may exist in any one of the following forms: in the form of a source file; or in the form of code snippets dispersed in the basic version component.

10. The method according to any one of claims 1 to 8, characterized in that: The installation package of the application includes an init segment, and the init segment is used to complete the initialization and registration of the application.

11. An application installation method, applied to a terminal device, characterized in that: The method comprises: The terminal device receives an installation package of an application sent by a server; wherein the installation package of the application is generated based on first content in a first image, the first content is difference content after being compiled and statically linked, the difference content is content that is different before and after a source component of the application is incorporated into a basic version component, the basic version component is a source file of an operating system on the terminal device and a source file of a service developed based on the operating system, the first image is generated by the server after compiling and statically linking the basic version component and the difference content, the link address range of the difference content is a first link address range, the first link address range and the second link address range do not conflict, the second link address range is a link address range of the basic version component, the first link address range is a storage address range on the terminal device, the second link address range is another storage address range on the terminal device, and the storage address range is an address range of a memory used to run executable program code; The terminal device installs the application in the first link address range based on the installation package of the application.

12. The method according to claim 11, characterized in that The method further comprises: The terminal device sends a first message to the server, wherein the first message includes the first link address range, and the first link address range is an idle storage address range on the terminal device.

13. The method according to claim 11 or 12, characterized in that: The difference content is the entirety of the difference file, or the difference code in the difference file.

14. The method according to any one of claims 11 to 13, characterized in that: The source component of the application program may exist in any one of the following forms: in the form of a source file; or in the form of code snippets dispersed in the basic version component.

15. The method according to any one of claims 11 to 14, characterized in that: The installation package of the application includes an init segment, and the init segment is used to complete the initialization and registration of the application.

16. An electronic device, characterized in that: The electronic device includes one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1-10 or 11-15.

17. A computer storage medium, characterized in that: The computer storage medium stores a computer program, which includes program instructions. When the program instructions are executed on an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 10 or 11 to 15.

Citation Information

Cited By

  • Verification method and device, electronic equipment and readable storage medium

    CN119494299A

  • Application installation package generation method, application installation method, and related device

    EP4711916A1

  • Application installation package generation method, application installation method, and related device

    WO2025007796A1