# US 2022/0035610 A1 · Method for compilation optimization of hosted app, electronic device and readable storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0035610 A1
- Document ID: US20220035610A1
- Status: Published application
- Kind: A1
- Application number: 17/348,334
- Filed: 2021-06-15
- Published: 2022-02-03
- Earliest claimed: 2020-07-30
- Assignees: Baidu Online Network Technology (Beijing) Co., Ltd.
- Applicants: Baidu Online Network Technology (Beijing) Co., Ltd.
- Inventors: Du CHEN; Yuekeng LIU; Fang ZHAN; Hongtao ZHANG; Yuzhen CHEN
- Web page: https://patentgrep.com/patent/US20220035610A1

## CPC

- G06F 8/443: {Optimisation}
- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 9/44536: {Selecting among different versions}
- G06F 9/45504: {Abstract machines for program code execution, e.g. Java virtual machine [JVM], interpreters or emulators}
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

The technical solutions relate to the technical field of compilation of applications, and particularly to the technical field of mini programs. A developer tool constructs a first compilation result of the hosted APP before compilation optimization and a second compilation result of the hosted APP after the compilation optimization respectively based on a source code of the hosted APP, and uploads them to a management platform. The management platform sends the corresponding compilation results according to environment data of the hosted APP running environment provided by the host APP, so that the host APP uses the hosted APP running environment provided by the host APP to run the obtained compilation result.

## Claims

### Claim 1

A method for compilation optimization of a hosted APP, comprising:
obtaining environment data of a hosted APP running environment provided by a host APP, in response to receiving from the host APP a request to obtain the hosted APP;
querying in compilation results of the hosted APP uploaded by a developer tool, according to the environment data of the hosted APP running environment provided by the host APP, to obtain a compilation result runnable by the host APP, wherein the compilation results of the hosted APP comprise a first compilation result before compilation optimization and a second compilation result after the compilation optimization; and
sending to the host APP the compilation result runnable by the host APP obtained, so that the host APP runs the compilation result by using the hosted APP running environment provided by the host APP.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the second compilation result comprises a plurality of compilation results.

### Claim 3 (depends on 1)

The method according to claim 1, further comprising:
before querying in compilation results of the hosted APP uploaded by the developer tool, according to the environment data of the hosted APP running environment provided by the host APP, to obtain the compilation result runnable by the host APP,
obtaining the compilation results of the hosted APP uploaded by the developer tool;
examining each of the compilation results of the hosted APP; and
marking a runnable environment for a compilation result whose examination result is “pass”, according to the examination results of the compilation results.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the examining each of the compilation results of the hosted APP comprises:
examining the first compilation result and the second compilation result respectively, to obtain an examination result of the first compilation result and an examination result of the second compilation result respectively;
if the examination result of the first compilation result is “pass”, not adjusting the examination result of the second compilation result; and
if the examination result of the first compilation result is “fail to pass”, adjusting the examination result of the second compilation result as “failing to pass”.

### Claim 5 (depends on 1)

The method according to claim 1, wherein the environment data of the hosted APP running environment provided by the host APP comprises at least one of:
version data of the host APP; or
version data of the hosted APP running environment provided by the host APP.

### Claim 6

A method for compilation optimization of a hosted APP, comprising:
obtaining source code of a hosted APP;
constructing compilation results of the hosted APP according to the source code of the hosted APP, wherein the compilation results of the hosted APP comprise a first compilation result before compilation optimization and a second compilation result after the compilation optimization; and
uploading the compilation results of the hosted APP to a management platform.

### Claim 7 (depends on 6)

The method according to claim 6, wherein the second compilation result comprises a plurality of compilation results.

### Claim 8 (depends on 6)

The method according to claim 6, wherein the uploading the compilation results of the hosted APP to the management platform comprises:
generating respective version data of the compilation results according to the compilation results of the hosted APP, wherein the respective version data of the compilation results include version data of the first compilation result, the lowest version data of the hosted APP running environment on which the first compilation result depends, version data of the second compilation result, and the lowest version data of the hosted APP running environment on which the second compilation result depends; and
uploading the compilation results and the respective version data of the compilation results to the management platform.

### Claim 9 (depends on 8)

The method according to claim 8, wherein the generating respective version data of the compilation results according to the compilation results of the hosted APP comprises:
generating sequentially the respective version data of the compilation results according to a uniform compilation version generating rule of the hosted APP; or
generating sequentially the respective version data of the compilation results according to a current-time compilation version generating rule of the hosted APP.

### Claim 10 (depends on 6)

The method according to claim 6, wherein the environment data of the hosted APP running environment provided by the host APP comprises at least one of:
version data of the host APP; or
version data of the hosted APP running environment provided by the host APP.

### Claim 11

An electronic device, comprising:
at least one processor; and
a memory communicatively connected with the at least one processor; wherein,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to carry out a method for compilation optimization of a hosted APP, which comprises:
obtaining environment data of a hosted APP running environment provided by a host APP, in response to receiving from the host APP a request to obtain the hosted APP;
querying in compilation results of the hosted APP uploaded by a developer tool, according to the environment data of the hosted APP running environment provided by the host APP, to obtain a compilation result runnable by the host APP, wherein the compilation results of the hosted APP comprise a first compilation result before compilation optimization and a second compilation result after the compilation optimization; and
sending to the host APP the compilation result runnable by the host APP obtained, so that the host APP runs the compilation result by using the hosted APP running environment provided by the host APP.

### Claim 12 (depends on 11)

The electronic device according to claim 11, wherein the method further comprises:
before querying in compilation results of the hosted APP uploaded by the developer tool, according to the environment data of the hosted APP running environment provided by the host APP, to obtain the compilation result runnable by the host APP,
obtaining the compilation results of the hosted APP uploaded by the developer tool;
examining each of the compilation results of the hosted APP; and
marking a runnable environment for a compilation result whose examination result is “pass”, according to the examination results of the compilation results.

### Claim 13 (depends on 12)

The electronic device according to claim 12, wherein the examining each of the compilation results of the hosted APP comprises:
examining the first compilation result and the second compilation result respectively, to obtain an examination result of the first compilation result and an examination result of the second compilation result respectively;
if the examination result of the first compilation result is “pass”, not adjusting the examination result of the second compilation result; and
if the examination result of the first compilation result is “fail to pass”, adjusting the examination result of the second compilation result as “failing to pass”.

### Claim 14 (depends on 11)

The electronic device according to claim 11, wherein the environment data of the hosted APP running environment provided by the host APP comprises at least one of:
version data of the host APP; or
version data of the hosted APP running environment provided by the host APP.

### Claim 15

An electronic device, comprising:
at least one processor; and
a memory communicatively connected with the at least one processor; wherein,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to carry out a method for compilation optimization of a hosted APP, which comprises:
obtaining source code of a hosted APP;
constructing compilation results of the hosted APP according to the source code of the hosted APP, wherein the compilation results of the hosted APP comprise a first compilation result before compilation optimization and a second compilation result after the compilation optimization; and
uploading the compilation results of the hosted APP to a management platform.

### Claim 16 (depends on 15)

The electronic device according to claim 15, wherein the uploading the compilation results of the hosted APP to the management platform comprises:
generating respective version data of the compilation results according to the compilation results of the hosted APP, wherein the respective version data of the compilation results include version data of the first compilation result, the lowest version data of the hosted APP running environment on which the first compilation result depends, version data of the second compilation result, and the lowest version data of the hosted APP running environment on which the second compilation result depends; and
uploading the compilation results and the respective version data of the compilation results to the management platform.

### Claim 17 (depends on 16)

The electronic device according to claim 16, wherein the generating respective version data of the compilation results according to the compilation results of the hosted APP comprises:
generating sequentially the respective version data of the compilation results according to a uniform compilation version generating rule of the hosted APP; or
generating sequentially the respective version data of the compilation results according to a current-time compilation version generating rule of the hosted APP.

### Claim 18 (depends on 15)

The electronic device according to claim 15, wherein the environment data of the hosted APP running environment provided by the host APP comprises at least one of:
version data of the host APP; or
version data of the hosted APP running environment provided by the host APP

### Claim 19

A non-transitory computer-readable storage medium storing computer instructions, which, when executed by a computer, cause the computer to carry out a method for compilation optimization of a hosted APP, which comprises:
obtaining environment data of a hosted APP running environment provided by a host APP, in response to receiving from the host APP a request to obtain the hosted APP;
querying in compilation results of the hosted APP uploaded by a developer tool, according to the environment data of the hosted APP running environment provided by the host APP, to obtain a compilation result runnable by the host APP, wherein the compilation results of the hosted APP comprise a first compilation result before compilation optimization and a second compilation result after the compilation optimization; and
sending to the host APP the compilation result runnable by the host APP obtained, so that the host APP runs the compilation result by using the hosted APP running environment provided by the host APP.

### Claim 20

A non-transitory computer-readable storage medium storing computer instructions, which, when executed by a computer, cause the computer to carry out a method for compilation optimization of a hosted APP, which comprises:
obtaining source code of a hosted APP;
constructing compilation results of the hosted APP according to the source code of the hosted APP, wherein the compilation results of the hosted APP comprise a first compilation result before compilation optimization and a second compilation result after the compilation optimization; and
uploading the compilation results of the hosted APP to a management platform.
