Application starting method and device and application compiling method and device

By configured the startup parameters of cross -platform code in advance and injecting the installation package in advance, the problem of slow and efficient application startup was solved, and the rapid and efficient application startup was achieved, and the user experience was improved.

CN119356757APending Publication Date: 2025-01-24JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411505543.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The cold start speed of hybrid development applications is slow, mainly because native code and cross-platform code are isolated, and startup parameters need to be passed through a dedicated platform channel and coded.

Method used

By configuring the startup parameters of the cross-platform code in advance during the compilation process and injecting these parameters into the installation package, the required startup parameters are obtained directly from the installation package when the application is started, avoiding the startup between the native code side and the cross-platform code side. Parameter passing.

Benefits of technology

It effectively improves the cold start speed of applications, achieves fast and efficient application startup, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119356757A_ABST
    Figure CN119356757A_ABST
Patent Text Reader

Abstract

The invention discloses an application starting method and device and an application compiling method and device, and relates to the technical field of computers. A specific embodiment of the method comprises the steps of starting a native code of an application in response to a received application starting request sent by a requester; the application is developed by adopting a system native development framework and a cross-platform development framework in a mixed manner, the application comprises a native code and a cross-platform code, and the cross-platform code is a code which provides a newly added function for the native code and has a cross-platform capability; calling a cross-platform code of the application, and obtaining a starting parameter from a pre-compiled installation package of the application through a code entry of the cross-platform code; and starting a cross-platform code of the application according to the starting parameter, and returning starting results of the native code and the cross-platform code to the requester. According to the implementation mode, rapid application starting is achieved, starting parameters needed by cross-platform codes are directly obtained during starting based on the starting parameters configured in advance in the compiling link, and the starting speed of the application is effectively increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an application startup method, a compilation method and a device. Background Art

[0002] In the development of application programs, cross-platform development based on cross-platform development frameworks is gaining more and more attention. However, since cross-platform development technology appeared relatively late, some native development technologies have matured. For natively developed applications, it is impossible to redevelop them using cross-platform technology. Therefore, it is a good choice to introduce cross-platform development technology into existing native applications for hybrid development.

[0003] In the process of implementing the present invention, the inventors found that the prior art has the following problems:

[0004] For applications developed using hybrid development, the cold start speed is relatively slow, mainly because the native code and the cross-platform code developed using cross-platform development technology are isolated. When the application starts, the startup parameters of the cross-platform code need to be passed to the cross-platform code end through a dedicated platform channel, and the startup parameters need to be encoded and decoded before and after the transmission. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides an application startup method and device, which realizes fast and efficient application startup. Based on the startup parameters of the cross-platform code configured in advance in the compilation stage, the startup parameters required by the cross-platform code can be directly obtained at startup, avoiding the transmission of startup parameters between the native code end and the cross-platform code end during the startup process, and effectively improving the cold start speed of the application.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for starting an application is provided, comprising:

[0007] In response to receiving an application start request sent by a requester, start the native code of the application; wherein the application is developed by hybrid development of a system native development framework and a cross-platform development framework, the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities;

[0008] Calling the cross-platform code of the application, and obtaining startup parameters from a pre-compiled installation package of the application through a code entry of the cross-platform code;

[0009] The cross-platform code of the application is started according to the start-up parameter, and the start-up results of the native code and the cross-platform code are returned to the requesting party.

[0010] Optionally, the native code and cross-platform code of the application are deployed in a native development framework and a cross-platform development framework respectively, and the native code and the cross-platform code are isolated; before starting the native code of the application, the method also includes: searching for the installation package of the application from the server and downloading the installation package locally.

[0011] Optionally, before starting the cross-platform code of the application according to the startup parameters, the method further includes: performing type and format verification on the startup parameters according to preset parameter rules, and determining whether the verification passes.

[0012] According to a second aspect of an embodiment of the present invention, there is provided a method for compiling an application, comprising:

[0013] In response to receiving an application compilation request, obtaining an application to be compiled and startup parameters corresponding to the cross-platform code of the application; wherein the application is developed by hybrid development of a system native development framework and a cross-platform development framework, the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities;

[0014] Injecting the startup parameters into the environment variables of the cross-platform code, and compiling to generate a package file;

[0015] The installation package of the application is compiled and generated according to the package file and the native code of the application, so that startup parameters are obtained from the environment variables of the package file of the installation package when the application is started.

[0016] Optionally, before obtaining the startup parameters corresponding to the cross-platform code of the application, the method also includes determining the startup parameters based on the cross-platform code of the application, and storing the startup parameters in a specified parameter file; injecting the startup parameters into the environment variables of the cross-platform code, including: calling the parameter file, parsing the parameter file, and injecting the parsed startup parameters into the environment variables of the cross-platform code.

[0017] Optionally, the parameter file also includes compilation parameters of the native code; compiling and generating the installation package of the application according to the package file and the native code of the application includes: parsing the compilation parameters from the parameter file; passing the package file and the compilation parameters to the native code of the application for compilation, so as to generate the installation package of the application.

[0018] Optionally, parsing the compilation parameters from the parameter file includes: parsing the application compilation request to obtain a parameter identifier of the compilation parameter to be obtained; based on the parameter identifier, parsing and querying a target parameter that matches the parameter identifier from the parameter file containing the compilation parameters and startup parameters; and using the target parameter as the compilation parameter.

[0019] According to a third aspect of an embodiment of the present invention, there is provided a device for starting an application, including:

[0020] A first startup module, configured to start the native code of the application in response to receiving an application startup request sent by a requester; wherein the application is developed by hybrid development of a system native development framework and a cross-platform development framework, and the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities;

[0021] A parameter acquisition module, used to call the cross-platform code of the application and obtain startup parameters from the pre-compiled installation package of the application through the code entry of the cross-platform code;

[0022] The second startup module is used to start the cross-platform code of the application according to the startup parameters, and return the startup results of the native code and the cross-platform code to the requesting party.

[0023] According to a fourth aspect of an embodiment of the present invention, there is provided a compiling device for an application, including:

[0024] An application and parameter acquisition module, configured to, in response to receiving an application compilation request, acquire an application to be compiled and startup parameters corresponding to the cross-platform code of the application; wherein the application is developed by hybrid development using a system native development framework and a cross-platform development framework, the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities;

[0025] A package file generation module, used for injecting the startup parameters into the environment variables of the cross-platform code, and compiling to generate a package file;

[0026] The installation package generation module is used to compile and generate the installation package of the application according to the package file and the native code of the application, so that when the application is started, the startup parameters are obtained from the environment variables of the package file of the installation package.

[0027] According to a fifth aspect of an embodiment of the present invention, there is provided an electronic starting device for application, comprising:

[0028] one or more processors;

[0029] a storage device for storing one or more programs,

[0030] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0031] According to a sixth aspect of an embodiment of the present invention, there is provided a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method provided in the first aspect of the embodiment of the present invention.

[0032] An embodiment of the invention has the following advantages or beneficial effects: starting the native code of the application in response to receiving an application start request sent by the requester; wherein the application is developed by hybrid development of the system native development framework and the cross-platform development framework, and the application includes native code and cross-platform code, and the cross-platform code is the code that provides new functions for the native code and has cross-platform capabilities; calling the cross-platform code of the application, and obtaining the start-up parameters from the pre-compiled application installation package through the code entry of the cross-platform code; starting the cross-platform code of the application according to the start-up parameters, and returning the start-up results of the native code and the cross-platform code to the requester. The technical solution realizes a fast and efficient application start-up method, and the start-up parameters of the cross-platform code configured in advance in the compilation stage can directly obtain the start-up parameters required by the cross-platform code at the time of startup, avoiding the transmission of the start-up parameters between the native code end and the cross-platform code end during the startup process, and effectively improving the cold start speed of the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0034] Figure 1 is a schematic diagram of the main process of the method for starting an application according to an embodiment of the present invention;

[0035] Figure 2 is a schematic diagram of the principle of a method for starting an application according to an embodiment of the present invention;

[0036] Figure 3 is a schematic diagram of the main process of a method for compiling an application according to an embodiment of the present invention;

[0037] Figure 4 It is a flowchart of the compilation process of an embodiment of the present invention;

[0038] Figure 5 It is a complete flowchart of a method for starting and compiling an application according to an embodiment of the present invention;

[0039] Figure 6 is a schematic diagram of main modules of a device for starting an application according to an embodiment of the present invention;

[0040] Figure 7 is a schematic diagram of main modules of a compiling device for an application according to an embodiment of the present invention;

[0041] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0042] Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0043] It should be noted that the acquisition, storage and application of user personal information involved in the technical solution of the present disclosure are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0044] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0045] For applications developed using hybrid development, the cold start speed is relatively slow, mainly because the native code and the cross-platform code that uses cross-platform development technology are isolated. When the application starts, the startup parameters of the cross-platform code need to be passed to the cross-platform code end through a dedicated platform channel, and the startup parameters need to be encoded and decoded before and after the transmission, which cannot meet actual needs well.

[0046] In order to solve the above-mentioned problems existing in the prior art, the present invention proposes a method for starting an application. For a hybrid developed application, when an application start request is received, the native code of the application is started, and then the cross-platform code with cross-platform capabilities that provides new functions for the native code is called, and the startup parameters are obtained from the pre-compiled application installation package, and then the cross-platform code is started, thereby realizing a fast and efficient application startup method. Based on the startup parameters of the cross-platform code configured in advance in the compilation stage, the startup parameters required by the cross-platform code can be directly obtained at startup, thereby avoiding the transmission of startup parameters between the native code end and the cross-platform code end during the startup process, and effectively improving the cold start speed of the application.

[0047] In the introduction to the embodiments of the present invention, the terms and their meanings are as follows:

[0048] Flutter: An open source cross-platform development framework, mainly used for mobile application development. It uses the Dart programming language and provides a rich set of UI components and tools to help developers quickly build high-quality, beautiful and smooth mobile applications.

[0049] aar: a compressed format that contains the source code and resources of the Android Library package;

[0050] APK: It is an application package file format used by the Android operating system to distribute and install mobile applications and middleware.

[0051] Figure 1 is a schematic diagram of the main process of the method for starting an application according to an embodiment of the present invention, such as Figure 1 As shown, the method for starting an application in an embodiment of the present invention includes the following steps S101 to S103.

[0052] Step S101, in response to receiving an application start request sent by a requesting party, start the native code of the application; wherein the application is developed by hybrid use of a system native development framework and a cross-platform development framework, the application includes native code and cross-platform code, the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities.

[0053] Specifically, cross-platform development technology uses an open source cross-platform development framework to achieve the purpose of a set of cross-platform code running on multiple platforms. It has the advantages of rapid development, high performance, flexibility and scalability, such as Flutter, and the cross-platform development framework supports the integration of cross-platform code into mature native applications for hybrid development. In the existing application development scenario, considering that the application APP developed on the native side will iterate and upgrade the version as the business is updated, in order to provide users with rich functions and good experience. In view of the advantages of cross-platform development technology such as good performance and high development efficiency, the functions that need to be updated are implemented using cross-platform development technology and introduced into native applications, which has become a recommended application development solution.

[0054] In a scenario where an application is developed in a hybrid manner using a native development framework and a cross-platform development framework, after receiving a startup request from a user, the application calls the native code of the application and executes the relevant startup process of the native code. Specifically, the native code can be started by creating an application process and initializing it. It should be noted that the startup mentioned in the embodiments of the present invention refers to a cold start.

[0055] Step S102: calling the cross-platform code of the application, and obtaining startup parameters from the pre-compiled installation package of the application through the code entry of the cross-platform code.

[0056] According to one embodiment of the present invention, the native code and cross-platform code of the application are deployed in a native development framework and a cross-platform development framework respectively, and the native code and the cross-platform code are isolated; before starting the native code of the application, the method also includes: searching for the installation package of the application from the server and downloading the installation package locally.

[0057] Specifically, considering that the hybrid development application of the embodiment of the present invention includes native code and cross-platform code, for the cold start of the application, in addition to starting the native code, it is also necessary to start the cross-platform code, and the start of the cross-platform code requires obtaining necessary start parameters, such as the start channel, compilation type, and start environment, etc. For hybrid development applications, since its native code is deployed in the native development framework, and the cross-platform code is deployed in the cross-platform development framework, the codes in the two different development frameworks are isolated and cannot be directly called, so in the prior art, a platform channel dedicated to data interaction is usually allocated, and the cross-platform code end initiates the call of the platform channel. After receiving the request, the native end encodes the relevant start parameters, and transmits the encoded start parameters back to the cross-platform code end in the form of return values. The cross-platform code end decodes the received parameters and obtains the start parameters, so as to start the cross-platform code using the start parameters. Such a start parameter acquisition process usually takes tens to hundreds of milliseconds, slowing down the start time of the application.

[0058] In addition, the application mentioned in the embodiment of the present invention is mainly started on the terminal device, and the application installation package is usually developed and released by the developer on the server side, so before starting the native code of the application, it is necessary to ensure that the application installation package is available on the terminal device. Specifically, it is possible to check whether there is an application installation package locally. If not, it is necessary to search for the application installation package from the server side and download the found installation package to the local terminal device.

[0059] The embodiment of the present invention configures the startup parameters of the cross-platform code in advance in the compilation process, and adds the startup parameters to the installation package generated by the compilation. When the cross-platform code receives the application startup request, it directly obtains the necessary startup parameters from the installation package of the application through the code entry main method. In this way, there is no need to call the platform channel for real-time encoding, decoding and transmission of the startup parameters, which greatly shortens the cold start time of the application.

[0060] Step S103: start the cross-platform code of the application according to the start-up parameters, and return the start-up results of the native code and the cross-platform code to the requesting party.

[0061] Specifically, the cross-platform code startup parameters obtained above are used to execute the cross-platform code of the application to perform specific initialization and other startup work, and the startup result of the cross-platform code is returned to the requester in the form of a return value. Similarly, the startup result will also be returned to the requester in the startup process of the native code mentioned above, so that the requester can understand whether the cold start of the application has been completed. Of course, it is also possible that the default state is a successful startup. If the cross-platform code or the native code has a startup exception, the exception will be returned to the requester. If the requester does not receive abnormal startup information within a certain preset time, it means that the application has been successfully started.

[0062] According to an embodiment of the present invention, before starting the cross-platform code of the application according to the startup parameters, the method further includes: performing type and format verification on the startup parameters according to preset parameter rules, and determining whether the verification passes.

[0063] Specifically, in order to improve the reliability of application startup, before starting the cross-platform code of the application according to the startup parameters, the startup parameters obtained are verified. Usually, the type and format of the parameter value of the startup parameter can be determined based on previous experience, so verification rules are added to the startup parameters in advance, and the type and format of the parameter value of the startup parameter are clearly defined in the rules. In this way, before starting the cross-platform code, the type and format of the acquired startup parameters are verified, and after the verification passes, the cross-platform code of the application is started. If the verification fails, the verification result is sent to the background staff, so that the staff can troubleshoot the problem and solve it in time, and start the cross-platform code as soon as possible.

[0064] Figure 2 This is a schematic diagram of the principle of the application startup method of the embodiment of the present invention. In response to receiving an application startup request of a hybrid development application, the native code of the application is first called to execute the relevant startup process of the native code. Specifically, the native code can be started by creating an application process and initializing it; then the cross-platform code of the application is called, and the startup parameters are obtained from the environment variables of the package file of the installation package of the application through the code entry main method. The startup parameters are used to initialize the cross-platform code and other startup work to complete the cold start of the hybrid development application.

[0065] The startup of the above application is mainly based on passing the startup parameters in advance to the compilation stage of the application. Figure 3 is a schematic diagram of the main process of the method for compiling an application according to an embodiment of the present invention, such as Figure 3 As shown, the method for starting an application in an embodiment of the present invention includes the following steps S301 to S303.

[0066] Step S301, in response to receiving an application compilation request, obtaining an application to be compiled and startup parameters corresponding to the cross-platform code of the application; wherein the application is developed using a hybrid of a system native development framework and a cross-platform development framework, the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities.

[0067] Specifically, the embodiments of the present invention are mainly aimed at applications that are developed by hybrid development of the system native development framework and the cross-platform development framework. When the developer completes the native code and the cross-platform code, the code is debugged first. After the code debugging is passed, an application compilation request of the application is sent to the compilation system of the server. The compilation system obtains the startup parameters required for starting the application to be compiled and the cross-platform code of the application based on the received application compilation request.

[0068] Step S302: inject the startup parameters into the environment variables of the cross-platform code, compile and generate a package file.

[0069] Specifically, in the compilation phase of the cross-platform code, the obtained startup parameters are injected into the environment variables of the cross-platform code through the injection command, and the cross-platform code is compiled to generate a package file, which is equivalent to configuring the startup parameters in the compilation file in advance. For example, if the native development framework is Android and the cross-platform development framework is Flutter, for the Flutter cross-platform code, the dart-define command is used to inject the startup parameters into the environment variables and compile to generate an aar package file.

[0070] According to one embodiment of the present invention, before obtaining the startup parameters corresponding to the cross-platform code of the application, the method also includes: determining the startup parameters according to the cross-platform code of the application, and storing the startup parameters in a specified parameter file; injecting the startup parameters into the environment variables of the cross-platform code, including: calling the parameter file, parsing the parameter file, and injecting the parsed startup parameters into the environment variables of the cross-platform code.

[0071] Specifically, considering that application development is usually carried out according to development plans and task nodes, the time point for determining the startup parameters of the cross-platform code is different from the time point for compiling the cross-platform code. Of course, the time point for determining the startup parameters is generally earlier than the time point for compiling. Therefore, after determining the startup-related parameters, such as the startup channel, compilation type, and startup environment, based on the cross-platform code of the application, the startup parameters can be stored in the application's exclusive parameter file according to the storage rules of the parameter file. When an application compilation request is received, it indicates that the startup parameters need to be obtained. At this time, the parameter file is pulled, and the parameters stored in the parameter file are parsed according to the storage rules of the parameter file to obtain the startup parameters, and finally the startup parameters are injected into the environment variables of the cross-platform code.

[0072] Step S303: compile and generate an installation package of the application according to the package file and the native code of the application, so that startup parameters are obtained from the environment variables of the package file of the installation package when the application is started.

[0073] Specifically, based on the package file generated above, combined with the native code of the application, compile according to the native compilation process to generate an installation package of the application. Taking the above-mentioned Android and Flutter hybrid development as an example, based on Flutter's aar package file and native code, generate an APK installation package of the application.

[0074] Furthermore, based on the package file generated by injecting the startup parameters into the environment variables of the cross-platform code in advance, and the installation package of the application generated by compiling the package file, when the cross-platform code receives the startup request, the required startup channel, compilation type, startup environment and other startup parameters can be directly obtained from the environment variables of the package file of the application installation package through the code entry main of the cross-platform code. For example, for an application developed in a hybrid manner using native Android and the cross-platform development framework Flutter, when starting the cross-platform code, the specific fromEnvironment method code can be directly used to obtain the startup parameters of the cross-platform code, eliminating the time-consuming call to the platform channel.

[0075] According to one embodiment of the present invention, the parameter file also includes compilation parameters of the native code; compiling and generating the installation package of the application according to the package file and the native code of the application includes: parsing the compilation parameters from the parameter file; passing the package file and the compilation parameters to the native code of the application for compilation, so as to generate the installation package of the application.

[0076] Specifically, the application includes cross-platform code and native code. In the compilation process, in addition to the compilation of the cross-platform code, the compilation of the native code is also required. Considering that this case reduces the cold start time of the application by storing the startup parameters of the cross-platform code in the parameter file in advance, the parameters required for compiling the native code, that is, the compilation parameters, can also be stored in the parameter file using the current resources, and stored in the parameter file according to the storage rules of the parameter file. For example, according to the key-value rule, the parameter name of each compilation parameter is used as the key, and the corresponding parameter value is stored as the value in the parameter file. When the compilation request of the native code is received, the various compilation parameters of the native code are parsed from the parameter file according to the key-value rule. Finally, the package file compiled by the cross-platform code and the compilation parameters of the native code parsed from the parameter file are passed to the native code of the application for compilation to generate the installation package of the application.

[0077] Figure 4 It is a flow chart of the compilation link of an embodiment of the present invention. This figure takes an application developed by mixing native Android and the cross-platform development framework Flutter as an example. According to the native code and the cross-platform code, the compilation parameters of the native code and the startup parameters of the cross-platform code are determined, and these two types of parameters are stored in the parameter file. The parameter file is generally in JSON format. When the application compilation request is received, the parameter file is pulled and the file is parsed. The startup parameters obtained by parsing are injected into the environment variables of the Flutter cross-platform code in the format of configuration information, and the compilation is performed to generate an aar package file. The compilation parameters are then parsed from the parameter file, and the compilation parameters are also passed to the Android native code of the application in the format of configuration information together with the aar package file for compilation, and finally the APK installation package of the application is generated, completing the entire compilation link of the application. With the help of the compilation link, the embodiment of the present invention injects the startup parameters into the compiled package file in advance, so that the startup parameters can be directly obtained when the application starts.

[0078] According to another embodiment of the present invention, parsing the compilation parameters from the parameter file includes: parsing the application compilation request to obtain a parameter identifier of the compilation parameter to be obtained; according to the parameter identifier, parsing and querying the target parameter that matches the parameter identifier from the parameter file containing the compilation parameters and startup parameters; and using the target parameter as the compilation parameter.

[0079] Specifically, through the above-mentioned process of obtaining the startup parameters and the compilation parameters, it can be known that the startup parameters and the compilation parameters are stored in the parameter file. Generally, the corresponding parameter values ​​can be obtained from the parameter file through the parameter name. Considering that the parameter file stores not only the startup parameters and the compilation parameters, in order to improve the acquisition speed of the compilation parameters, all the compilation parameters can be assigned parameter identifiers that are easy to query in advance. The parameters with the parameter identifier are the compilation parameters. For example, B1 is set as the parameter identifier of the compilation parameter 1, and B2 is set as the parameter identifier of the compilation parameter 2. Then, before storing the compilation parameters in the parameter file, all the parameter names of the compilation parameters are converted into parameter identifiers, and the parameter identifiers and parameter values ​​are stored in the parameter file. Then, when issuing an application compilation request, the parameter identifier of the compilation parameter required by the compilation request will be attached. The system receives the compilation request, obtains the parameter identifier of the compilation parameter by parsing the compilation request, and uses the parameter identifier to query the parameter value corresponding to the parameter name matching the parameter identifier from the parameter file to obtain the target parameter, which is the compilation parameter.

[0080] It can be understood that the parameter identifier of the embodiment of the present invention can also be a unified parameter identifier for parameters of the same category. For example, if B is defined as the parameter identifier of the compilation parameter, then before storing the compilation parameter in the parameter file, the identifier of B is added to the front of the parameter name of all the compilation parameters. For example, the parameter name after adding the identifier of B to parameter 1 is B-parameter 1, and the parameter name after adding the identifier to parameter 2 is B-parameter 2. Based on the identifier of the parameter category, the parameter identifier of the compilation parameter required by the compilation request will be attached when the application compilation request is issued. The system receives the compilation request, obtains the parameter identifier of the compilation parameter by parsing the compilation request, uses the parameter identifier to query the parameter file for the candidate parameter with the same prefix as the parameter identifier, and then selects the target parameter with the same parameter name as the compilation parameter from the candidate parameters, so as to obtain the compilation parameter.

[0081] In addition, parameter identifiers can also be used for the storage of the above startup parameters, which can improve the speed of parsing the startup parameters from the parameter file. Similar to the above, corresponding parameter identifiers can be assigned to each startup parameter, and the parameter identifiers can be used to replace the parameter names and stored in the parameter file, and the startup parameters can be directly parsed from the parameter file according to the parameter identifiers. A unified parameter identifier can also be assigned to the startup parameters, and the parameter identifier prefix is ​​added to the parameter name, so as to quickly find the parameters of the startup parameter category from the parameter file.

[0082] Figure 5It is a complete flow chart of the method for starting and compiling an application of an embodiment of the present invention. In the compilation link of the development stage, the hybrid development application determines the relevant startup parameters according to the cross-platform code of the application, injects the startup parameters into the environment variables of the cross-platform code, and compiles to generate a package file of the cross-platform code, and then compiles and generates the installation package of the application according to the package file and the native code of the application, that is, injects the startup parameters in the process of compiling and generating the installation package of the application. The system receives an application startup request of the hybrid development application, calls the native code of the application, and starts the native code through initialization and other processes; then calls the cross-platform code of the application, directly obtains the startup parameters from the pre-compiled installation package through the code entry main method of the cross-platform code, and verifies the type and format of the startup parameters. If it fails, the verification result is reported to the staff. The cross-platform code is quickly started using the startup parameters that have passed the verification, so as to realize fast and efficient startup of the application.

[0083] In an application scenario of hybrid development, an embodiment of the present invention starts the native code of the application when an application start request is received, and then calls the cross-platform code that provides new functions for the native code and has cross-platform capabilities, obtains startup parameters from the pre-compiled application installation package, and then starts the cross-platform code, thereby realizing a fast and efficient application startup method. Based on the startup parameters of the cross-platform code configured in advance in the compilation phase, the startup parameters required by the cross-platform code can be directly obtained at startup, avoiding the transmission of startup parameters between the native code end and the cross-platform code end during the startup process, and effectively improving the cold start speed of the application.

[0084] Figure 6 Schematic diagram of the main modules of the application startup device according to the embodiment of the present invention. Figure 6 As shown, the application startup device 600 mainly includes a first startup module 601 , a parameter acquisition module 602 and a second startup module 603 .

[0085] The first startup module 601 is used to start the native code of the application in response to receiving the application startup request sent by the requester; wherein the application is developed by hybrid development of the system native development framework and the cross-platform development framework, and the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities;

[0086] The parameter acquisition module 602 is used to call the cross-platform code of the application and obtain the startup parameters from the pre-compiled installation package of the application through the code entry of the cross-platform code;

[0087] The second starting module 603 is used to start the cross-platform code of the application according to the starting parameters, and return the starting results of the native code and the cross-platform code to the requesting party.

[0088] According to one embodiment of the present invention, the native code and cross-platform code of the application are deployed in the native development framework and the cross-platform development framework respectively, and the native code and the cross-platform code are isolated; the application startup device 600 also includes an installation package download module (not shown in the figure), which is used to: before starting the native code of the application, search for the installation package of the application from the server and download the installation package to the local.

[0089] According to another embodiment of the present invention, the application startup device 600 also includes a parameter verification module (not shown in the figure), which is used to: before starting the cross-platform code of the application according to the startup parameters, perform type and format verification on the startup parameters according to preset parameter rules, and determine whether the verification passes.

[0090] Figure 7 FIG. 1 is a schematic diagram of the main modules of the compiling device for the application according to the embodiment of the present invention. Figure 7 As shown, the application compiling device 700 mainly includes an application and parameter acquisition module 701 , a package file generation module 702 and an installation package generation module 703 .

[0091] The application and parameter acquisition module 701 is used to obtain the application to be compiled and the startup parameters corresponding to the cross-platform code of the application in response to receiving the application compilation request; wherein the application is developed by hybrid development of the system native development framework and the cross-platform development framework, and the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities;

[0092] A package file generation module 702 is used to inject the startup parameters into the environment variables of the cross-platform code, and compile to generate a package file;

[0093] The installation package generation module 703 is used to compile and generate the installation package of the application according to the package file and the native code of the application, so as to obtain startup parameters from the environment variables of the package file of the installation package when the application is started.

[0094] According to one embodiment of the present invention, the compilation device 700 of the application also includes a startup parameter processing module (not shown in the figure), which is used to: before obtaining the startup parameters corresponding to the cross-platform code of the application, determine the startup parameters according to the cross-platform code of the application, and store the startup parameters into a specified parameter file; the package file generation module 702 is also used to: call the parameter file, parse the parameter file, and inject the parsed startup parameters into the environment variables of the cross-platform code.

[0095] According to another embodiment of the present invention, the parameter file also includes compilation parameters of the native code; the installation package generation module 703 is further used to: parse the compilation parameters from the parameter file; pass the package file and the compilation parameters to the native code of the application for compilation, and generate the installation package of the application.

[0096] According to another embodiment of the present invention, the installation package generation module 703 is further used to: parse the application compilation request to obtain the parameter identifier of the compilation parameter to be obtained; according to the parameter identifier, parse and query the target parameter matching the parameter identifier from the parameter file containing the compilation parameter and the startup parameter; and use the target parameter as the compilation parameter.

[0097] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention can be applied.

[0098] like Figure 8 As shown, the system architecture 800 may include terminal devices 801, 802, 803, a network 804 and a server 805. The network 804 is used to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 605. The network 804 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0099] The user can use the terminal devices 801, 802, 803 to interact with the server 805 through the network 804 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 801, 802, 803.

[0100] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0101] Terminal devices 801, 802, and 803 can start the native code of the application in response to receiving an application start request sent by the requesting party; wherein the application is developed using a hybrid of the system native development framework and the cross-platform development framework, and the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities; the cross-platform code of the application is called, and the start-up parameters are obtained from the pre-compiled installation package of the application through the code entry of the cross-platform code; according to the start-up parameters, the cross-platform code of the application is started, and the start-up results of the native code and the cross-platform code are returned to the requesting party for processing, and the processing results (such as the start-up results, etc. - just an example) are fed back to the terminal user.

[0102] It should be noted that the application startup method provided in the embodiment of the present invention is generally executed by the terminal devices 801 , 802 , 803 , and accordingly, the application startup device is generally set in the terminal devices 801 , 802 , 803 .

[0103] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0104] Reference below Fig. 9 , Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0105] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 704.

[0106] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.

[0107] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.

[0108] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination thereof.

[0109] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0110] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, it may be described as follows: a processor includes: a first startup module, a parameter acquisition module and a second startup module.

[0111] Among them, the names of these modules do not constitute a limitation of the modules themselves in certain cases. For example, the parameter acquisition module can also be described as "a module used to call the cross-platform code of the application, and obtain the startup parameters from the pre-compiled installation package of the application through the code entry of the cross-platform code."

[0112] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiment; or it may exist independently and not be assembled into the device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the device, the device includes: in response to receiving an application startup request sent by a requester, starting the native code of the application; wherein the application is developed by mixing the system native development framework and the cross-platform development framework, the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities; calling the cross-platform code of the application, and obtaining startup parameters from the pre-compiled installation package of the application through the code entry of the cross-platform code; starting the cross-platform code of the application according to the startup parameters, and returning the startup results of the native code and the cross-platform code to the requester.

[0113] The technical solution according to the embodiment of the present invention has the following advantages or beneficial effects: by responding to an application startup request sent by a requesting party, the native code of the application is started; wherein the application is developed by hybrid development of the system native development framework and the cross-platform development framework, the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities; the cross-platform code of the application is called, and the startup parameters are obtained from the pre-compiled application installation package through the code entry of the cross-platform code; according to the startup parameters, the cross-platform code of the application is started, and the startup results of the native code and the cross-platform code are returned to the requesting party. The technical solution realizes a fast and efficient application startup method, based on the startup parameters of the cross-platform code configured in advance in the compilation stage, the startup parameters required by the cross-platform code can be directly obtained at startup, avoiding the transmission of startup parameters between the native code end and the cross-platform code end during the startup process, effectively improving the cold start speed of the application, and thereby improving the user experience.

[0114] The specific implementation methods described herein do not constitute limitations on the scope of protection of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A method for starting an application, characterized in that: include: In response to receiving an application start request sent by a requester, start the native code of the application; wherein the application is developed by hybrid development of a system native development framework and a cross-platform development framework, the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities; Calling the cross-platform code of the application, and obtaining startup parameters from a pre-compiled installation package of the application through a code entry of the cross-platform code; The cross-platform code of the application is started according to the start-up parameter, and the start-up results of the native code and the cross-platform code are returned to the requesting party.

2. The method according to claim 1, characterized in that The native code and the cross-platform code of the application are deployed in the native development framework and the cross-platform development framework respectively, and the native code and the cross-platform code are isolated; Before starting the native code of the application, the method further includes: Search the server for the installation package of the application and download the installation package to the local computer.

3. The method according to claim 1, characterized in that: Before starting the cross-platform code of the application according to the startup parameter, the method further includes: According to the preset parameter rules, the startup parameters are checked for type and format, and it is determined that the check passes.

4. A method for compiling an application, characterized in that: include: In response to receiving an application compilation request, obtaining an application to be compiled and startup parameters corresponding to the cross-platform code of the application; wherein the application is developed by hybrid development of a system native development framework and a cross-platform development framework, the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities; Injecting the startup parameters into the environment variables of the cross-platform code, and compiling to generate a package file; The installation package of the application is compiled and generated according to the package file and the native code of the application, so that startup parameters are obtained from the environment variables of the package file of the installation package when the application is started.

5. The method according to claim 4, characterized in that Before obtaining the startup parameters corresponding to the cross-platform code of the application, the method further includes: Determine startup parameters according to the cross-platform code of the application, and store the startup parameters in a specified parameter file; Injecting the startup parameter into the environment variable of the cross-platform code includes: The parameter file is retrieved and parsed, and the startup parameters obtained by parsing are injected into the environment variables of the cross-platform code.

6. The method according to claim 5, characterized in that The parameter file also includes compilation parameters of the native code; Compiling and generating an installation package of the application according to the package file and the native code of the application includes: Parse and obtain compilation parameters from the parameter file; The package file and the compilation parameters are passed to the native code of the application for compilation to generate an installation package of the application.

7. The method according to claim 6, characterized in that The compilation parameters are parsed from the parameter file, including: Parsing the application compilation request to obtain a parameter identifier of a compilation parameter to be obtained; According to the parameter identifier, parsing and querying the parameter file containing the compilation parameters and the startup parameters to obtain the target parameter matching the parameter identifier; The target parameter is used as the compilation parameter.

8. A device for starting an application, characterized in that: include: A first startup module, configured to start the native code of the application in response to receiving an application startup request sent by a requester; wherein the application is developed by hybrid development of a system native development framework and a cross-platform development framework, and the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities; A parameter acquisition module, used to call the cross-platform code of the application and obtain startup parameters from the pre-compiled installation package of the application through the code entry of the cross-platform code; The second startup module is used to start the cross-platform code of the application according to the startup parameters, and return the startup results of the native code and the cross-platform code to the requesting party.

9. A compiling device for an application, characterized in that: include: An application and parameter acquisition module, configured to, in response to receiving an application compilation request, acquire an application to be compiled and startup parameters corresponding to the cross-platform code of the application; wherein the application is developed by hybrid development using a system native development framework and a cross-platform development framework, the application includes native code and cross-platform code, and the cross-platform code is a code that provides new functions for the native code and has cross-platform capabilities; A package file generation module, used for injecting the startup parameters into the environment variables of the cross-platform code, and compiling to generate a package file; The installation package generation module is used to compile and generate the installation package of the application according to the package file and the native code of the application, so that when the application is started, the startup parameters are obtained from the environment variables of the package file of the installation package.

10. A mobile electronic device terminal, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 3.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.