WO2023005715A1 - 快应用处理方法、电子设备与快应用系统 - Google Patents
快应用处理方法、电子设备与快应用系统 Download PDFInfo
- Publication number
- WO2023005715A1 WO2023005715A1 PCT/CN2022/106303 CN2022106303W WO2023005715A1 WO 2023005715 A1 WO2023005715 A1 WO 2023005715A1 CN 2022106303 W CN2022106303 W CN 2022106303W WO 2023005715 A1 WO2023005715 A1 WO 2023005715A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- target
- quick
- server
- application
- terminal device
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 19
- 238000007781 pre-processing Methods 0.000 claims abstract description 111
- 238000000034 method Methods 0.000 claims abstract description 105
- 230000004044 response Effects 0.000 claims abstract description 10
- 238000004590 computer program Methods 0.000 claims description 25
- 230000006854 communication Effects 0.000 abstract description 53
- 238000004891 communication Methods 0.000 abstract description 52
- 230000008569 process Effects 0.000 description 44
- 238000012545 processing Methods 0.000 description 40
- 230000006870 function Effects 0.000 description 30
- 238000007726 management method Methods 0.000 description 18
- 238000011161 development Methods 0.000 description 14
- 238000010295 mobile communication Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 11
- 238000005516 engineering process Methods 0.000 description 9
- 238000009877 rendering Methods 0.000 description 8
- 230000005236 sound signal Effects 0.000 description 7
- 238000012552 review Methods 0.000 description 5
- 229920001621 AMOLED Polymers 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 3
- 230000001360 synchronised effect Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 235000012054 meals Nutrition 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 239000002096 quantum dot Substances 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000012384 transportation and delivery Methods 0.000 description 2
- 235000000832 Ayote Nutrition 0.000 description 1
- 240000007124 Brassica oleracea Species 0.000 description 1
- 235000003899 Brassica oleracea var acephala Nutrition 0.000 description 1
- 235000011301 Brassica oleracea var capitata Nutrition 0.000 description 1
- 235000001169 Brassica oleracea var oleracea Nutrition 0.000 description 1
- 235000009854 Cucurbita moschata Nutrition 0.000 description 1
- 240000001980 Cucurbita pepo Species 0.000 description 1
- 235000009804 Cucurbita pepo subsp pepo Nutrition 0.000 description 1
- 241000287828 Gallus gallus Species 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 238000012550 audit Methods 0.000 description 1
- 230000003416 augmentation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000007175 bidirectional communication Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 235000021152 breakfast Nutrition 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 238000010411 cooking Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000003862 health status Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 230000036316 preload Effects 0.000 description 1
- 235000015136 pumpkin Nutrition 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 238000005070 sampling Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44568—Immediately runnable code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- the present application relates to the technical field of communications, and in particular to a quick application processing method, electronic equipment and a quick application system.
- Quick App is a new application form launched by the Quick App Alliance formed by domestic mainstream manufacturers, which has the advantages of free installation and click-to-use; terminal devices can download the application from the server when they need to start a quick application package, and then run the application package directly to open the application interface.
- the Quick App Alliance provides a subpackage solution.
- the application program of the application is packaged into a base package and multiple sub-packages, that is, an application package may include a base package and multiple sub-packages.
- an application package may include a base package and multiple sub-packages.
- the present application provides a quick application processing method, an electronic device, and a quick application system, which are used to increase the page display speed of the quick application, thereby improving user experience.
- the embodiment of the present application provides a quick application processing method, which is applied to a terminal device, and the method includes:
- the preprocessing data including the execution result of the target script file, the target script file being the script file corresponding to the target page in the target quick application;
- the script file of the target page in the target quick app is run in advance on the server, and the terminal device can obtain the script corresponding to the target page from the server after receiving the user's page opening operation for the target quick app According to the execution result of the file, the home page of the target quick app is displayed, which can reduce the page display process in the terminal device, thereby improving the page display speed of the quick app.
- the execution result includes a first instruction and a second instruction
- the first instruction is an execution result corresponding to an executed script instruction in the target script file
- the second instruction is a script instruction to be executed in the target script file
- the generating and displaying the target page according to the preprocessing data includes:
- the script instructions that need to be executed by the terminal device are retained in the execution result, and when the terminal device generates the target page based on the execution result, it can find the script instruction (ie, the second instruction) to be executed in time according to the execution result, so that During the process of generating the target page, the second command can be executed through the script engine while drawing the page according to the first command, which can improve the display speed of the target page.
- the script instruction ie, the second instruction
- the input parameters in the second instruction include device parameters of the terminal device and/or running data provided by a third-party server corresponding to the target quick app.
- the second instruction includes a to-be-executed flag, and when the terminal device detects the to-be-executed flag, the script engine executes the Second instruction.
- the second instruction includes a to-be-executed flag
- the terminal device can quickly detect the second instruction according to the to-be-executed flag, thereby improving the processing speed.
- the request for the preprocessed data is sent to the server. This saves communication resources.
- the target page is a home page of the target quick app. This saves communication resources of the terminal device.
- the method further includes:
- the preprocessed data does not exist in the server, generate and display the home page of the target quick app according to the application package of the target quick app.
- the terminal device after receiving the page opening operation, the terminal device further downloads the application package corresponding to the target quick application from the server.
- the terminal device can obtain the application package of the target quick app in time, generate the home page of the target quick app according to the application package, and display the home page of the target quick app as soon as possible;
- the terminal device can also pre-acquire script files of other non-homepage pages for preloading, so that the display speed of the non-homepage pages of the target quick application can be improved.
- the terminal device determines whether the preprocessed data exists in the server according to the preprocessing result of the quick application list, and the preprocessing result of the quick application list is the obtained by the terminal device from the server;
- the preprocessing result of the quick app list includes the preprocessing result of at least one quick app, and the preprocessing result of each quick app is used to indicate whether the execution result of the script file corresponding to the home page of the quick app exists in the server.
- the terminal device can know in advance whether the preprocessed data of the target quick application exists in the server through the preprocessing result of the quick application list, without sending a query request to the server to know whether the preprocessed data of the target quick application exists in the server. This increases processing speed.
- the preprocessing data request is sent to the server.
- the terminal device can download the preprocessed data of the target quick app from the server only when the target quick app is started for the first time; when the quick app is not started for the first time, it can extract the preprocessed data of the target quick app from the cache No more requests to the server, which saves communication resources.
- the preprocessed data further includes public resource files in the application package of the target quick app.
- the terminal device can obtain the public resource file from the preprocessed data as soon as possible, and generate and display the target page based on the execution result of the script file of the target page and the public resource file, thereby improving the page display speed of the target page.
- the embodiment of the present application provides a quick application processing method, which is applied to a server, and the method includes:
- the preprocessing data corresponding to the preprocessing data request is returned to the terminal device, the preprocessing data includes an execution result of a target script file, and the target script file is a script file corresponding to the target page.
- the server can execute the target script file of the target quick application in advance, and provide the execution result of the target script file to the terminal device; in this way, the terminal device can display the homepage of the target quick application according to the execution result, In this way, the page display processing process in the terminal device can be reduced, thereby improving the page display speed of the quick application.
- the execution result includes a first instruction and a second instruction
- the first instruction is an execution result corresponding to an executed script instruction in the target script file
- the second instruction is a script instruction to be executed in the target script file.
- the server keeps the script instructions that need to be run by the terminal device in the execution result, so that the terminal device can find the script instruction to be executed (ie, the second instruction) in time when generating the target page based on the execution result, so as to generate
- the second command can be executed through the script engine while drawing the page according to the first command, so that the display speed of the target page can be improved.
- the input parameters in the second instruction include device parameters of the terminal device and/or running data provided by a third-party server corresponding to the target quick app.
- the second instruction includes a to-be-executed flag, and the to-be-executed flag is used to indicate that the second instruction is to be executed.
- the method before receiving the preprocessing data request corresponding to the target quick application sent by the terminal device, the method further includes:
- the script engine executes the target script file to obtain the execution result of the target script file.
- the server can generate the execution result of the target script file in advance, so as to provide the target script file to the terminal device.
- the method further includes:
- the target page is a home page of the target quick app. This saves processing resources and storage resources of the server.
- the method further includes:
- the preprocessing result of the quick application list includes the preprocessing result of at least one quick application, and the preprocessing result of each quick application is used to indicate whether the Describes the execution result of the script file corresponding to the home page of the quick app.
- the server can provide the terminal device with the preprocessing result of the quick application list, so that the terminal device can know whether there is preprocessing data of the target quick application in the server through the preprocessing result of the quick application list in advance, without sending a query to the server. Request to know whether the preprocessed data of the target quick application exists in the server, so as to improve the processing speed.
- the preprocessed data further includes public resource files in the application package of the target quick app.
- the embodiment of the present application provides a quick application processing device, which is applied to a terminal device, and the device includes:
- the input module is used to receive the page opening operation for the target quick app
- the communication module is used to send a preprocessing data request to the server in response to the page opening operation; and receive the preprocessing data returned by the server, the preprocessing data includes the execution result of the target script file, and the target script file is The script file corresponding to the target page in the target quick application;
- a processing module configured to generate the target page according to the pre-processed data
- a display module configured to display the target page.
- the execution result includes a first instruction and a second instruction
- the first instruction is an execution result corresponding to an executed script instruction in the target script file
- the second instruction is a script instruction to be executed in the target script file
- the processing module is specifically used for:
- the target page is generated according to the first instruction and the third instruction.
- the input parameters in the second instruction include device parameters of the terminal device and/or running data provided by a third-party server corresponding to the target quick app.
- the second instruction includes a to-be-executed flag
- the processing module is specifically configured to: execute the detected to-be-executed flag through a script engine when the to-be-executed flag is detected. Execute the second instruction corresponding to the flag.
- the communication module is specifically configured to: send the preprocessing data request to the server when the preprocessing data exists in the server.
- the target page is a home page of the target quick app.
- the communication module is further configured to:
- the processing module is specifically configured to: generate the home page of the target quick app according to the application package of the target quick app when the pre-processed data does not exist in the server.
- the processing module determines whether the preprocessed data exists in the server according to the preprocessing result of the quick application list, and the preprocessing result of the quick application list is obtained from the obtained by the above server;
- the preprocessing result of the quick app list includes the preprocessing result of at least one quick app, and the preprocessing result of each quick app is used to indicate whether the execution result of the script file corresponding to the home page of the quick app exists in the server.
- the communication module is specifically configured to: send the preprocessing data request to the server when the target quick app is started for the first time.
- the embodiment of the present application provides a quick application processing method applied to a server, and the device includes:
- the communication module is configured to receive the preprocessing data request corresponding to the target quick application sent by the terminal device;
- a processing module configured to determine the pre-processed data corresponding to the pre-processed data request
- the communication module is further configured to: return the preprocessed data to the terminal device, the preprocessed data includes an execution result of a target script file, and the target script file is a script file corresponding to the target page.
- the execution result includes a first instruction and a second instruction
- the first instruction is an execution result corresponding to an executed script instruction in the target script file
- the second instruction is a script instruction to be executed in the target script file.
- the input parameters in the second instruction include device parameters of the terminal device and/or running data provided by a third-party server corresponding to the target quick app.
- the second instruction includes a to-be-executed flag, and the to-be-executed flag is used to indicate that the second instruction is to be executed.
- the processing module is further configured to:
- the communication module Before the communication module receives the preprocessing data request corresponding to the target quick application sent by the terminal device, determine the target script file according to the application package of the target quick application;
- the script engine executes the target script file to obtain the execution result of the target script file.
- the communication module is further configured to:
- the target page is a home page of the target quick app.
- the communication module is further configured to:
- the preprocessing result of the quick application list includes the preprocessing result of at least one quick application, and the preprocessing result of each quick application is used to indicate whether the Describes the execution result of the script file corresponding to the home page of the quick app.
- the embodiment of the present application provides a quick application system, including: a terminal device and a server, wherein:
- the terminal device is configured to: send a preprocessing data request to the server in response to a page opening operation for the target quick application;
- the server is configured to: receive the preprocessing data request corresponding to the target quick application sent by the terminal device; and return the preprocessing data corresponding to the preprocessing data request to the terminal device, and the preprocessing data includes the target script file
- the execution result of the target script file is a script file corresponding to the target page
- the terminal device is further configured to: receive the pre-processing data returned by the server, and generate and display the target page according to the pre-processing data.
- an embodiment of the present application provides an electronic device, including: a memory and a processor, the memory is used to store a computer program; and the processor is used to execute the method described in the first aspect or the second aspect when calling the computer program.
- an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.
- the embodiment of the present application provides a computer program product, which enables the terminal device to execute the method described in the first aspect or the second aspect when the computer program product is run on the terminal device.
- an embodiment of the present application provides a chip system, including a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory, so as to implement the above-mentioned first or second aspect.
- the chip system may be a single chip, or a chip module composed of multiple chips.
- FIG. 1 is a schematic diagram of the system architecture of the quick application system provided by the embodiment of the present application.
- FIG. 2 is a schematic diagram of the quick application processing process provided by the embodiment of the present application.
- Fig. 3 is a schematic flow chart of the pretreatment process provided by the embodiment of the present application.
- Fig. 4 is a schematic diagram of the quick application interface provided by the embodiment of the present application.
- FIG. 5 is a schematic flowchart of a quick application display process provided by the embodiment of the present application.
- FIG. 6 is a schematic flowchart of another quick application display process provided by the embodiment of the present application.
- FIG. 7 is a schematic structural diagram of a quick application processing device provided in an embodiment of the present application.
- FIG. 8 is a schematic structural diagram of a terminal device provided in an embodiment of the present application.
- FIG. 9 is a schematic structural diagram of a server provided by an embodiment of the present application.
- FIG. 1 is a schematic diagram of the system architecture of the quick application system provided by the embodiment of the present application.
- the quick application system may include a development device 100 , a server (including an application market server 200 and a quick application server 300 ) and a terminal device 400 . in:
- the development device 100 may be an electronic device equipped with an integrated development environment (integrated development environment, IDE), such as a notebook computer and a desktop computer.
- IDE integrated development environment
- the IDE is an application program for providing a program development environment, including tools such as a code editor, a compiler, a debugger, and a graphical user interface.
- the quick app developer can write the source code of the quick app through the IDE on the development device 100.
- the development device 100 can generate the application package of the quick app according to the source code, and
- the application package is uploaded to the server for users to download and use.
- the file format of the application package of the quick application is the format of the quick application application package (runable application package, RPK). Therefore, the application package of the quick application is also called the RPK package.
- the server can receive and store the RPK package uploaded by the development device 100 , and provide the terminal device 400 with a download service of the RPK package.
- the terminal device 400 may be an electronic device capable of supporting fast application running, such as a smart phone and a tablet computer.
- a smart phone is taken as an example for illustration.
- the user can download the RPK package of the quick app from the server through the terminal device 400 to open the quick app.
- the RPK package downloaded by the terminal device 400 from the server may be a whole package including all pages and resources of the quick application, or may be a subpackage including some pages and resources. That is, the RPK package stored on the server can be a whole package without the subpackage function, or a subpackage formed by using the subpackage function.
- the RPK package may include the following files: a manifest file (manifest.json) for describing project configuration information, an application code entry file app.ux, and multiple ux files describing pages/custom components.
- a manifest file for describing project configuration information
- app.ux an application code entry file app.ux
- multiple ux files describing pages/custom components.
- Quick app developers can configure subpackages rules in manifest.json when developing quick apps. When unpacking, they can split the project into multiple subpackages according to the subpackages rules.
- these subpackages may include a basic package and multiple page subpackages, the basic package includes some common pages and resources, and the page subpackages are divided according to the above subpackages rules.
- the quick app first loads the base package and the subpackages where the page is located, and the rest of the subpackages can be automatically preloaded in the background.
- the package body of Quick App A is relatively large. According to the specifications recommended by the Quick App Alliance, it is divided into three packages.
- the home page and public resource files are kept in the basic package, and the main interface is placed in the page sub-package In PackageA, pages other than the main interface are placed in the page subpackage PackageB.
- the directory file organization of the quick app A can be as follows:
- the main directory contains the home page files, the common resource files and component files (ie public resource files) are stored in the common directory, and the resource files and component files private to each page are stored in each page directory.
- the subpackage configuration rules in the manifest file are as follows:
- the home page may be located in the basic package or in the page sub-package. In this embodiment, the home page is located in the basic package as an example for illustration.
- the quick app developer can package the subpackages according to the resource paths configured in the subpackages configuration page when compiling the quick app project, and package directories other than the subpackages configuration path to in the base package.
- the unpacking process can also be performed on the server. That is, after receiving the RPK package uploaded by the development device 100, the server unpacks it according to the subpackages rules in the RPK package to obtain each subpackage.
- the server can be a server with both download service and unpacking functions, or it can include two servers as shown in Figure 1: one is an application market server 200 that provides RPK package download services, and the other is an application market server 200 that provides unpacking services.
- the server can be a single server, or a server cluster, that is, the above-mentioned server, the application market server 200 and the quick application server 300 can all be a server cluster.
- the development device 100 can upload the entire package of the RPK developed by the quick application to the application market server 200 for review (step 1.1). After the application market server 200 passes the review, it can synchronize the entire package of the RPK to the quick application server 300 (step 1.2), after the quick application server 300 receives the entire RPK package, it can unpack the entire RPK package (step 1.3), divide the entire RPK package into multiple subpackages, and then subpackage the multiple RPKs Return to the application market server 200 (step 1.4).
- the terminal device 400 can download the RPK package from the application market server 200, and the application market server 200 returns the RPK package to the terminal device 400, wherein, if the RPK package does not support subcontracting, return RPK whole package; if the RPK package supports subpackage, RPK subpackage (including the basic package of the home page) can be returned.
- a quick app can be an independent application, or a card embedded in other applications.
- Users can start quick apps through scene portals such as quick app center, notification bar, negative screen, voice assistant, global search, browser, app market, and native apps embedded with quick apps.
- the quick app runs on the quick app engine, and when the user starts the quick app through these scene entries, the quick app engine will be invoked; the quick app engine will download the corresponding RPK package from the application market server 200 according to the quick app selected by the user.
- the quick application engine may include functional modules such as an application management module, a script engine, a rendering engine, and a layout engine.
- the quick application engine downloads the RPK package through the application management module.
- the quick app engine downloads the RPK package, it may also obtain the download address from the application market server 200, and then download the corresponding RPK package from the download server according to the download address.
- the download server can provide the accelerated loading function of the RPK package, specifically, it can be a content delivery network (content delivery network, CDN) server or the like.
- CDN content delivery network
- the quick app engine obtains the RPK package through the application management module, it can find the script file of the target page, and then execute the script file of the target page through the script engine; Text components, picture components, etc.), set the properties of these components, and calculate the relative positions of each component through the layout engine, and complete the layout and drawing process of the target page.
- the script file of the target page of the quick app can be run in advance on the quick app server 300, that is, after the quick app server 300 receives the entire package of the RPK, it can also update the RPK
- the entire package is preprocessed (step 1.3); when the user needs to open the target page of the quick app, the terminal device 400 can respond to the user's page opening operation and directly download the preprocessed data from the quick app server 300, that is, the script file of the target page Execute the result (step 2.1), and then display the target page according to the preprocessed data (step 2.2).
- a script engine may be deployed on the quick application server 300, and the quick application server 300 may execute the script file through the script engine to obtain an execution result of the first script file.
- the script file may be a JS (JavaScript) file, and correspondingly, the script engine may be a JS engine.
- V8 is a JavaScript runtime environment that can execute JS instructions
- Node.js is a JavaScript runtime environment based on the V8 engine, which can run on a server. Therefore, in this embodiment, the script engine deployed on the terminal device 400 may be a V8 engine, and the script engine deployed on the quick application server 300 may be Node.js.
- script files are not limited to JS files, and correspondingly, script engines are not limited to JS engines; in addition, JS engines are not limited to the above-mentioned V8 and Node.
- the deployed script engine is not particularly limited.
- the script file is a JS file and the script engine is a JS engine as an example for exemplary description.
- the terminal device 400 usually uses public resources when generating the target page.
- the preprocessed data obtained by the quick application server 300 from preprocessing the RPK package may include the execution result of the script file of the target page.
- the file is generated to display the target page, so that the page display speed of the target page can be improved.
- the target page can be any page of the quick app.
- the RPK package of the quick app can be downloaded from the application market server 200 at the same time (step 2.3). Display other pages (step 2.4).
- the quick app may not have pre-processed data.
- the terminal device 400 can also obtain the RPK package in time, and display the home page according to the RPK package.
- the quick app server 300 can also preprocess only the homepage to save processing resources and storage resources; correspondingly, the terminal device 400 can only Obtain the preprocessed data of the home page, which can also effectively save communication resources.
- the target page is also used as an example for illustration later.
- the terminal device 400 can download the execution result of the script file of the home page from the quick app server 300 and store it; The execution result of the script file does not need to be requested to the quick application server 300 again, so as to save communication resources and increase the display speed. If there is no special instruction in the following, the quick app is launched for the first time as an example for illustration.
- FIG 3 is a schematic flow chart of the preprocessing process provided by the embodiment of the present application. As shown in Figure 3, the preprocessing process may include the following steps:
- the development device submits the entire package of the RPK of the target quick application to the application market server.
- the quick app developer can develop the target quick app through the IDE on the development device according to the quick app specification, and compile and generate the RPK package of the target quick app (the entire RPK package is exemplified here). After the test verification is completed, the entire RPK package can be submitted to the application market server through the development device.
- the application market server After receiving the entire RPK package, the application market server checks the entire RPK package.
- the application market server After the application market server receives the entire RPK package, it can review the entire RPK package.
- the audit content includes but is not limited to content compliance checks and security checks.
- the application market server can send the entire RPK package to the quick app server; if the entire RPK package fails the review, the application market server can return a message of failure to the development device.
- the application market server sends the entire RPK package to the quick application server after the entire RPK package is approved.
- the quick application server After receiving the entire RPK package, the quick application server performs unpacking processing on the entire RPK package to obtain subpackages of the RPK if the entire RPK package supports unpacking.
- the quick app server can check whether the entire RPK package supports unpacking according to the manifest file in the entire RPK package.
- the entire RPK package can be unpacked according to the subpackages rule to obtain RPK subpackages.
- the quick application server determines the target script file corresponding to the home page in the entire package of the RPK, and executes the target script file through the script engine.
- the quick app server After receiving the entire RPK package, the quick app server performs preprocessing of the target script file in addition to unpacking.
- the quick app server can find the script file corresponding to the homepage of the target quick app from the RPK subpackage (that is, the target script file); if the whole RPK package does not support unpacking , you can find the target script file from the RPK package.
- the quick app server can find the entry file in the manifest file in the RPK package according to the quick app specification: the entry page of the router node.
- the content of its manifest file is as follows:
- the entry (entry file of the quick app) is defined as Main in the manifest file. Combined with the directory file of the aforementioned quick app A, you can find the script file of the home page of the quick app A.
- the file in the RPK of the home page of quick app A has been packaged and compiled into a JS file named index.js.
- the compiled result is, for example:
- the quick app server After the quick app server finds the above script file index.js, it can execute the file through the JS engine.
- the JS instructions related to the interface layout will be converted into a component tree, and the cascading style sheets (cascading style sheets, CSS) of the component tree Convert the style file to a specific value (for example, convert the .title style on the element to "background-color: xxx, height: xxx, width: xxx"); after the JS engine executes, the execution result is stored in the quick app on the server.
- the execution result of the target script file may be in JS object structure (JavaScript object notation, JSON) format or text format.
- the execution result of the target script file is, for example:
- the component relationship in the file forms the above-mentioned component tree
- the root node (component) in the above-mentioned component tree is div type
- the child node (component) is text text
- the attr tag defines the components.
- the style node defines the style of the component.
- Some JS instructions in the target script file may need to be executed on the terminal device, such as some device parameters related to the terminal device and running data provided by the third-party server corresponding to the target quick app, etc., which need to be obtained at runtime.
- the preprocessed data of the target quick application may include the execution result corresponding to the executed JS instruction in the target script file (herein referred to as the first instruction), and may also include the JS instruction to be executed in the target script file (herein referred to as for the second instruction).
- mark to be executed is not limited to the above "$ ⁇ ", and other marks may also be used, which is not particularly limited in this embodiment.
- the device parameters of the terminal device can include parameters such as device location, screen size, font size, and network.
- the target quick app can obtain some dynamic running data from a third-party server when it is running. For example, for a news quick app, its corresponding The third-party server of the website can provide running data such as news list and news content.
- the JS instructions related to the interface layout (such as the positional relationship between components) in the interface of the quick app, and the JS instructions corresponding to some unchanging display contents in the style files of each component can usually be used in the quick app It is directly executed on the server, and some variable display contents in the style files of each component usually need to be determined when running on the terminal device.
- Fig. 4 is a schematic diagram of the quick application interface provided by the embodiment of the present application.
- the quick application named "Recipe Daquan”
- the application name on the home page ie "Recipe Daquan”
- Today Recommendation bar search bar
- "Breakfast, Lunch and Dinner” column "Gourmet Topics” column
- "Hot Recommendations” column "This Week's Best Works” column
- the content specifically displayed in the Today’s Recommendation column, the “Hot Recommendations” column and the “This Week’s Best Works” column needs to be obtained from the third-party server corresponding to the quick app “Recipe Collection”, that is, these contents are variable.
- the recipe recommended in the today's recommendation column is "coffee toast”
- the recipe categories recommended in the "popular recommendation” column include "light” , "Next Meals”, “Sichuan Cuisine” and "Baking”
- the recipe displayed in the column of "This Week's Best Work” is "Roasted Chicken Drumstick”.
- the above-mentioned JS instructions related to these variable display contents can be executed on the terminal device, that is, the JS instructions corresponding to these contents can be set with flags to be executed.
- the font size displayed by the application name can be determined according to the font size set on the terminal device, and the size and font size of the content displayed in other columns can be determined according to the window display size of the application on the terminal device. For example, when the font size set on the terminal device is a standard size, the font size of the application name "Recipe Daquan" is shown in (a) in Figure 4; when the font size set on the terminal device is a large font, the application name " The font size of "Recipe Encyclopedia” is shown in (c) in Figure 4.
- the above JS instructions related to the display size of pictures and texts can be set with flags to be executed, and executed on the terminal device when the quick application "Recipe Collection" is opened on the terminal device.
- the quick app server When the quick app server preprocesses the RPK package, it can extract the public resource files in the RPK package, and combine the execution results of the target script file with the public resource files to obtain the preprocessed data, so that terminal devices can obtain the To the common resource file, the target page is generated and displayed based on the execution result of the script file of the target page and the common resource file.
- the quick app server returns the RPK subpackaging and preprocessing results of the target quick app to the app market server.
- the quick app server After the quick app server completes the unpacking process, it can return each RPK subpackage obtained by unpacking to the application market server.
- the terminal device can open the quick app center, and the user can select the target quick app from the quick app list provided by the quick app center to open it.
- the terminal device opens the quick app center, it will interact with the application market server to obtain the list of quick apps.
- the quick application server can also return the preprocessing result of the target quick application to the application market server, so that the application market server can pre-process the preprocessing results of each quick application in the quick application center (herein referred to as quick Application list preprocessing result) is synchronized to the terminal device.
- the terminal device When the terminal device opens the target quick app, it can determine whether the preprocessing data of the target quick app exists in the quick app server according to the preprocessing result of the quick app list (that is, the home page of the target quick app The execution result of the script file), if it does not exist, you do not need to request the execution result from the quick app server to save communication resources.
- the preprocessing result of the quick app list that is, the home page of the target quick app
- the execution result of the script file if it does not exist, you do not need to request the execution result from the quick app server to save communication resources.
- the preprocessing result of the target quick app can indicate whether the target quick app has the execution result of the target script file, which can be indicated by a flag bit in the message, where the quick app server can subpackage the RPK and the target quick app
- the preprocessing result is returned to the application market server in the same message, or returned to the application market server through different messages.
- the preprocessing results of the quick application list can include the preprocessing results of all the quick applications in the application market server, and can also be set in a form similar to the whitelist and blacklist, including only the quick application list with preprocessed data, or only including There is no list of quick apps with preprocessed data.
- This embodiment does not specifically limit the specific implementation form of the preprocessing result of the quick application list.
- the application market server synchronizes the preprocessing result of the quick application list to the terminal device.
- the application market server can synchronize the preprocessing results of each quick application in the quick application center to the terminal device each time the terminal device opens the quick application center;
- Terminal devices can store and update the preprocessing results of the quick app list.
- the following describes the process related to displaying the home page.
- Fig. 5 is a schematic flowchart of a quick application display process provided by the embodiment of the present application. As shown in Fig. 5, the process may include the following steps:
- the terminal device receives a user's start operation on the target quick application.
- the user can start the target quick application through various scene entries of the above-mentioned quick application, wherein the starting operation can be a manual operation (such as a click operation) or a voice input operation.
- the starting operation can be a manual operation (such as a click operation) or a voice input operation.
- the terminal device After receiving the user's start operation for the target quick app, the terminal device can respond to the operation and download the preprocessed data of the target quick app from the quick app server.
- the terminal device After receiving the user's start operation for the target quick app, the terminal device can respond to the operation and download the preprocessed data of the target quick app from the quick app server.
- the terminal device After receiving the user's start operation for the target quick app, the terminal device can first preprocess the data according to the quick application list. As a result, it is judged whether the preprocessed data of the target quick app exists in the quick app server. If it is determined that the preprocessed data of the target quick app exists in the quick app server, the preprocessed data is downloaded from the quick app server. The server requests preprocessed data.
- the terminal device in the case where there is pre-processed data of the target quick app in the quick app server, the terminal device can execute the following process A (including steps S220-S260); in the case that there is no pre-processed data of the target quick application in the quick application server, the terminal device may execute process B (including steps S250-S270).
- the terminal device sends a preprocessed data request to the quick app server when there is preprocessed data of the target quick app in the quick app server.
- the terminal device After the terminal device receives the user's start operation for the target quick app, if it determines that the pre-processed data of the target quick app exists in the quick app server, it can send a request for the pre-processed data corresponding to the target quick app to the quick app server. Request the preprocessed data of the target quick app.
- the preprocessing data request may include the identification of the target quick application, such as the package name of the target quick application and other information that can uniquely identify the target quick application.
- the quick application server returns the preprocessed data to the terminal device.
- the quick app server After receiving the preprocessing data request sent by the terminal device, the quick app server can search for the preprocessing data corresponding to the target quick app according to the identifier of the target quick app in the preprocessing data request, and then send it to the terminal device.
- the terminal device generates and displays the homepage of the target quick application according to the preprocessed data.
- the quick app engine in the terminal device can call the rendering engine to render the first instruction in the preprocessed data (that is, the script file that has been executed in the script file corresponding to the home page of the target quick app)
- the execution result corresponding to the JS instruction is converted to the native view (that is, the component of the Android layer) for drawing; during the drawing process, if the second instruction in the preprocessed data (that is, the script file corresponding to the home page of the target quick app is to be executed JS command), you can call the JS engine to execute the second command, and then continue to draw the native view according to the execution result of the second command (referred to as the third command here), and finally render it into a native interface (that is, the target quick app homepage), displayed to the user.
- the native view that is, the component of the Android layer
- the terminal device may detect the to-be-executed flag in the preprocessed data, and if the to-be-executed flag is detected, the JS instruction corresponding to the detected to-be-executed flag is the second instruction.
- the quick app engine can also first check whether there are second instructions in the pre-processed data. If so, it can first call the JS engine to execute these second instructions, and then call the rendering The engine draws and renders native views and generates native interfaces.
- the terminal device sends an RPK package download request to the application market server.
- the terminal device may also send the RPK package download request corresponding to the target quick application to the application market server when responding to the operation.
- the terminal device can obtain the RPK package of the target quick app in time, generate the home page of the target quick app according to the RPK package, and display the home page of the target quick app as soon as possible;
- the terminal device can also pre-acquire script files of other non-homepage pages for preloading, so that the display speed of the non-homepage pages of the target quick application can be improved.
- the RPK package download request may include the identifier of the target quick app, such as the package name of the target quick app.
- the application market server returns the RPK package of the target quick application to the terminal device.
- the application market server can search for the RPK package corresponding to the target quick application according to the target quick application ID in the RPK package download request, and then send it to the terminal device.
- the application market server can return the entire RPK package to the terminal device; when the RPK package of the target quick application supports subcontracting, the application market server can return Return the RPK packet.
- the application market server When the application market server returns the RPK subpackage to the terminal device, it can first send the subpackage of the homepage, and then send the subpackage of other non-homepage pages, so that the terminal device can receive the subpackage of the homepage as soon as possible, so that the quick app If there is no preprocessed data of the target quick app in the server, generate the home page of the target quick app as soon as possible according to the RPK package.
- the terminal device generates and displays the home page of the target quick application according to the RPK package when there is no preprocessed data of the target quick application in the quick application server.
- the terminal device can first judge whether there is preprocessed data of the target quick app in the quick app server according to the preprocessing result of the quick app list. If the target quick app does not exist in the quick app server After receiving the preprocessed data, the terminal device can generate a homepage displaying the target quick app according to the RPK package. That is, the quick app engine in the terminal device can first call the JS engine to execute the JS file of the home page; then call the rendering engine to draw and render the native view based on the execution result of the JS file, and generate and display the home page of the target quick app.
- the following uses an example in which the first quick app has preprocessed data and the second quick app does not have preprocessed data to illustrate a quick app display process.
- Fig. 6 is a schematic flowchart of another quick application display process provided by the embodiment of the present application. As shown in Fig. 6, the process may include the following steps:
- the terminal device receives a user's start operation on the first quick application.
- This step is similar to the above-mentioned step S210, and for specific description, please refer to the description of the above-mentioned step S210, which will not be repeated here.
- the terminal device determines that the preprocessed data of the first quick app exists in the quick app server, and sends a preprocessed data request to the quick app server.
- the terminal device After receiving the start operation of the first quick app, the terminal device can respond to the operation and judge whether there is pre-processed data of the first quick app in the quick app server according to the pre-processing result of the quick app list.
- the terminal device can determine that the preprocessed data of the first quick app exists in the quick app server according to the preprocessing result of the quick app list, then the terminal device can send the first quick app to the quick app server. Apply the corresponding preprocessed data request to request the preprocessed data of the first fast application.
- the quick app server returns the preprocessed data to the terminal device.
- the quick app server After receiving the preprocessing data request sent by the terminal device, the quick app server can search for the corresponding preprocessing data according to the preprocessing data request, and then send it to the terminal device.
- the terminal device generates and displays the homepage of the first fast application according to the preprocessed data.
- the terminal device After the terminal device receives the pre-processed data sent by the quick app server, it can draw and render the page according to the pre-processed data, and display it after obtaining the home page of the first quick app.
- the specific page display process is similar to step S240 and will not be repeated here.
- the terminal device sends a first RPK package download request corresponding to the first fast application to the application market server.
- the terminal device may also send the first RPK package download request corresponding to the first fast application to the application market server to download the first RPK package corresponding to the first fast application when responding to the operation.
- One RPK package may also send the first RPK package download request corresponding to the first fast application to the application market server to download the first RPK package corresponding to the first fast application when responding to the operation.
- the application market server returns the first RPK packet to the terminal device.
- This step is similar to the above-mentioned step S260, and for a specific description, reference may be made to the description of the above-mentioned step S260, which will not be repeated here.
- the terminal device receives the user's operation of opening the first page, generates and displays the first page according to the first RPK package.
- the terminal device After the terminal device opens the homepage of the first quick application, the user can click on the entry of other pages on the homepage to open other pages (the first page is exemplified here).
- the quick app engine in the terminal device can call the JS engine to execute the JS file of the first page; then call the rendering engine to draw and render the native view according to the execution result of the JS file, and generate the second page. displayed after one page.
- the terminal device may also pre-execute the JS files of other pages (such as the first page) that can be opened on the home page before receiving the first page opening operation, and after receiving the first page opening operation, then The drawing and display of the first page can be performed directly based on the execution result of the JS file of the first page, so that the page display speed of the first page can be improved.
- other pages such as the first page
- the terminal device receives a user's start operation for the second quick application.
- Multiple quick apps can be opened on the terminal device, and the user can start the second quick app through the scene entry of the quick app.
- the terminal device After receiving the start operation of the second quick application, the terminal device can respond to the operation and judge whether there is preprocessed data of the second quick application in the quick application server according to the preprocessing result of the quick application list. It is assumed here that the second quick app does not have preprocessed data, that is, the terminal device can determine that there is no preprocessed data of the second quick app in the quick app server according to the preprocessing result of the quick app list, then the terminal device does not need to request the quick app server The preprocessed data of the second fastest application, and then display the homepage according to the RPK package.
- the terminal device sends a second RPK package download request corresponding to the second fastest application to the application market server.
- the terminal device may also send the second RPK package download request corresponding to the second fast application to the application market server to download the second fast application corresponding to the second fast application.
- Two RPK packages Two RPK packages.
- the application market server returns the second RPK packet to the terminal device.
- This step is similar to the above-mentioned step S260, and for a specific description, reference may be made to the description of the above-mentioned step S260, which will not be repeated here.
- the terminal device determines that there is no preprocessed data of the second quick application in the quick application server, and generates and displays the homepage of the second quick application according to the second RPK package.
- the terminal device can determine that there is no pre-processed data of the target quick app in the quick app server. At this time, the terminal device can receive the second RPK After the package is packaged, generate a home page displaying the second fastest application according to the second RPK package. That is, the quick application engine in the terminal device can first call the JS engine to execute the JS file of the home page in the second RPK package; then call the rendering engine to draw and render the native view according to the execution result of the JS file, generate the home page of the second quick app and display it .
- the terminal device receives the second page opening operation of the user, generates and displays the second page according to the second RPK package.
- the terminal device After the terminal device opens the homepage of the second fastest application, if the user triggers the second page on the homepage, the terminal device can call the JS engine to execute the JS file of the second page after receiving the second page opening operation from the user; and then call The rendering engine draws and renders the native view according to the execution result of the JS file, and displays it after generating the second page.
- the specific page display process is similar to step S307, and will not be repeated here.
- the script file of the homepage of the target quick app can be run in advance on the quick app server, and the terminal device can obtain the target quick app from the quick app server According to the execution result of the script file corresponding to the home page of the quick app, the home page of the target quick app is displayed, which can effectively improve the page display speed of the quick app.
- the embodiment of the present application provides a fast application processing device.
- the embodiment of the device corresponds to the embodiment of the method described above.
- the details in the present invention will be described one by one, but it should be clear that the device in this embodiment can correspondingly implement all the content in the foregoing method embodiments.
- Fig. 7 is a schematic structural diagram of the fast application processing device provided in the embodiment of the present application. As shown in Fig. 7, the device provided in the present embodiment includes:
- a display module 210 an input module 220 , a processing module 230 and a communication module 240 .
- the quick application processing device may include more or fewer modules than shown in the figure.
- the illustrated modules can be implemented in hardware, software or a combination of software and hardware.
- the display module 210 is used to support the electronic device to perform the interface display operation in the above embodiments and/or other processes used in the technology described herein.
- the display module can be a touch screen or other hardware or a combination of hardware and software.
- the input module 220 is used to receive the user's input on the display interface of the electronic device, such as touch input, voice input, gesture input, etc., and the input module is used to support the electronic device to perform the steps of receiving the user's call answering operation in the above embodiments and/or Or other procedures for the techniques described herein.
- the input module can be a touch screen or other hardware or a combination of hardware and software.
- the processing module 230 is configured to support the electronic device to execute the quick application processing operation in the above embodiments and/or other processes for the technology described herein.
- the communication module 240 is used to support the electronic device to perform operations related to the communication process between other electronic devices in the above embodiments and/or other processes for the technology described herein.
- the electronic device may be the terminal device or the server in the foregoing embodiments.
- the device provided in this embodiment can execute the above-mentioned method embodiment, and its implementation principle and technical effect are similar, and details are not repeated here.
- FIG. 8 is a schematic structural diagram of the terminal device provided in the embodiment of the present application.
- the terminal device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and user An identification module (subscriber identification module, SIM) card interface 195 and the like.
- SIM subscriber identification module
- 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, bone conduction sensor 180M, etc.
- the structure shown in the embodiment of the present application does not constitute a specific limitation on the terminal device.
- the terminal device may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
- the illustrated components can be realized in hardware, software or a combination of software and hardware.
- the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (sgraphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) wait.
- application processor application processor
- AP application processor
- modem processor graphics processing unit
- ISP image signal processor
- controller memory
- video codec digital signal processor
- DSP digital signal processor
- baseband processor baseband processor
- neural network processor neural-network processing unit, NPU
- the controller may be the nerve center and command center of the terminal device.
- the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
- a memory may also be provided in the processor 110 for storing instructions and data.
- the memory in processor 110 is a cache memory.
- the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
- the processor 110 may run the software code/module of the quick application processing method provided by the embodiment of the present application, generate and display the quick application page, and increase the page display speed of the quick application.
- processor 110 may include one or more interfaces.
- the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
- I2C integrated circuit
- I2S integrated circuit built-in audio
- PCM pulse code modulation
- PCM pulse code modulation
- UART universal asynchronous transmitter
- MIPI mobile industry processor interface
- GPIO general-purpose input and output
- subscriber identity module subscriber identity module
- SIM subscriber identity module
- USB universal serial bus
- the I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (serail clock line, SCL).
- the I2S interface can be used for audio communication.
- the PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal.
- the UART interface is a universal serial data bus for asynchronous communication; the bus can be a bidirectional communication bus, which converts the data to be transmitted between serial communication and parallel communication.
- 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 (camera serial interface, CSI), a display serial interface (display serial interface, DSI) and the like.
- the GPIO interface can be configured by software, and the GPIO interface can be configured as a control signal or as a data signal.
- the USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
- the USB interface 130 can be used to connect a charger to charge the terminal device, and can also be used to transmit data between the terminal device and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other terminal devices, such as AR devices.
- the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation on the terminal device.
- the terminal device may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
- the charging management module 140 is configured to receive a charging input from a charger.
- the charger may be a wireless charger or a wired charger.
- the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
- the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device. While the charging management module 140 is charging the battery 142 , it can also supply power to the terminal device through the power management module 141 .
- the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
- the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for 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 times, and battery health status (leakage, impedance).
- the power management module 141 may also be disposed in the processor 110 .
- the power management module 141 and the charging management module 140 may also be set in the same device.
- the wireless communication function of the terminal device can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
- Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
- Each antenna in an end device can be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
- Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
- the antenna may be used in conjunction with a tuning switch.
- the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on terminal equipment.
- the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
- the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
- the mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves through the antenna 1 for radiation.
- at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
- at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
- a modem processor may include a modulator and a demodulator.
- the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
- the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
- the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
- the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 .
- the modem processor may be a stand-alone device.
- the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
- the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system, etc. (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
- the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
- the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
- the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
- the antenna 1 of the terminal device 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 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 (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division synchronous code division multiple access (time division-synchronous code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN , NFC, FM, and/or IR technology, etc.
- GSM global system for mobile communications
- general packet radio service general packet radio service
- CDMA code division multiple access
- CDMA broadband Code division multiple access
- WCDMA wideband code division multiple access
- time division synchronous code division multiple access time division-synchronous code division multiple access
- LTE long term evolution
- BT GNSS
- WLAN NFC
- the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GNSS), a Beidou navigation satellite system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
- GPS global positioning system
- GNSS global navigation satellite system
- BDS Beidou navigation satellite system
- QZSS quasi-zenith satellite system
- SBAS satellite based augmentation systems
- the terminal device realizes the display function through the GPU, the display screen 194, and the application processor.
- the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
- Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
- the display screen 194 is used to display images, videos and the like.
- 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 (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Mini LED, Micro LED, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
- the terminal device may include 1 or N display screens 194, where N is a positive integer greater than 1.
- the terminal device can realize the shooting function through ISP, camera 193 , video codec, GPU, display screen 194 and application processor.
- the ISP is used for processing the data fed back by the camera 193 .
- Camera 193 is used to capture still images or video.
- Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals.
- Video codecs are used to compress or decompress digital video.
- the NPU is a neural-network (NN) computing processor.
- NPU neural-network
- Applications such as intelligent cognition of terminal equipment can be realized through NPU, such as: image recognition, face recognition, speech recognition, text understanding, etc.
- the internal memory 121 may be used to store computer-executable program codes including instructions.
- the processor 110 executes various functional applications and data processing of the terminal device by executing instructions stored in the internal memory 121 .
- the internal memory 121 may include an area for storing programs and an area for storing data.
- the storage program area can store an operating system and at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
- the storage data area can store data (such as audio data, phone book, etc.) created during the use of the terminal device.
- 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 magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
- the internal memory 121 can store the software code/module of the quick application processing method provided in the embodiment of the present application.
- the processor 110 runs the software code/module, it can execute the flow of the quick application processing method, and display The quick app page.
- the external memory interface 120 can be used to connect an external memory, such as a Micro SD card, to expand the storage capacity of the terminal device.
- the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
- the software code/module of the quick application processing method provided in the embodiment of the present application may also be stored in an external memory, and the processor 110 may run the software code/module through the external memory interface 120 to execute the flow of the quick application processing method, as shown The quick app page.
- the terminal device can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
- 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 signal.
- the audio module 170 may also be used to encode and decode audio signals.
- the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
- Speaker 170A also called “horn” is used to convert audio electrical signals into sound signals.
- Receiver 170B also called “earpiece”, is used to convert audio electrical signals into sound signals.
- the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
- the earphone interface 170D is used for connecting wired earphones.
- the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
- CTIA cellular telecommunication
- the keys 190 include a power key, a volume key and the like.
- the key 190 may be a mechanical key. It can also be a touch button.
- the terminal device can receive key input and generate key signal input related to user settings and function control of the terminal device.
- the motor 191 can generate a vibrating reminder.
- the motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
- the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
- the SIM card interface 195 is used for connecting a SIM card.
- the SIM card can be connected and separated from the terminal device by being inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 .
- the terminal device can support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
- SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc.
- the terminal device provided in this embodiment can execute the foregoing method embodiment, and its implementation principle and technical effect are similar, and details are not repeated here.
- FIG. 9 is a schematic structural diagram of the server provided in the embodiment of the present application.
- the server provided in the present embodiment may include: a memory 310, a processor 320 and Communication module 330 and other components.
- the memory 310 can be used to store computer programs and modules, and the processor 320 can execute the methods performed by the server in the above method embodiments by running the computer programs and modules stored in the memory 310 .
- the memory 310 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.); The data created by the use of the server (such as audio data, phone book, etc.) and the like.
- the memory 310 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
- the processor 320 is the control center of the server. It uses various interfaces and lines to connect various parts of the entire server. By running or executing software programs and/or modules stored in the memory 310, and calling data stored in the memory 310, execution Various functions and processing data of the server, so as to monitor the server as a whole.
- the processor 320 may include one or more processing units.
- the communication module 330 can provide applications on the server including wireless local area network (Wireless Local Area Networks, WLAN) (such as Wi-Fi network), Bluetooth, Zigbee, mobile communication network, global navigation satellite system (global navigation satellite system, GNSS), Communication solutions such as frequency modulation (FM), NFC and infrared technology (infrared, IR).
- the communication module 330 may be one or more devices integrating at least one communication processing module.
- the communication module 330 may include an antenna, and may receive electromagnetic waves through the antenna, frequency-modulate and filter the electromagnetic wave signals, and send the processed signals to the processor.
- the communication module 330 can also receive the signal to be sent from the processor 320, frequency-modulate and amplify it, and convert it into electromagnetic wave and radiate it through the antenna.
- the server can communicate with the terminal device through the communication module 330 .
- FIG. 9 is only an example of a server, and does not constitute a limitation on the server, and may include more or less components than those shown in the figure, or combine some components, or arrange different components.
- the server can be a server with download service and unpacking function at the same time, and can also include two: an application market server providing RPK package download service, and a quick application server providing unpacking function.
- the server can be a single server or a server cluster, that is, the above-mentioned server, application market server, and quick application server that both have download service and unpacking functions can all be server clusters.
- the terminal device provided in this embodiment can execute the foregoing method embodiment, and its implementation principle and technical effect are similar, and details are not repeated here.
- the embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the foregoing method embodiment is implemented.
- An embodiment of the present application further provides a computer program product, which, when the computer program product is run on an electronic device, enables the electronic device to implement the method described in the foregoing method embodiments.
- the embodiment of the present application also provides a chip system, including a processor, the processor is coupled to the memory, and the processor executes the computer program stored in the memory, so as to implement the method described in the above method embodiment.
- the chip system may be a single chip, or a chip module composed of multiple chips.
- all or part of them may be implemented by software, hardware, firmware or any combination thereof.
- software When implemented using software, it may 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.
- the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
- the computer instructions may be stored in or transmitted via a computer-readable storage medium.
- the computer instructions may be transmitted from one web site, computer, server, or data center to another web site, computer, server or data center for transmission.
- the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
- the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)), etc.
- the processes can be completed by computer programs to instruct related hardware.
- the programs can be stored in computer-readable storage media.
- When the programs are executed may include the processes of the foregoing method embodiments.
- the aforementioned storage medium may include: ROM or random access memory RAM, magnetic disk or optical disk, and other media capable of storing program codes.
- the disclosed device/device and method can be implemented in other ways.
- the device/device embodiments described above are only illustrative.
- the division of the modules or units is only a logical function division.
- the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
- plural means two or more than two.
- At least one of the following or similar expressions refer to any combination of these items, including any combination of single items or plural items.
- at least one of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c can be single or multiple.
- the term “if” may be construed, depending on the context, as “when” or “once” or “in response to determining” or “in response to detecting “.
- the phrases “if determined” or “if [the described condition or event is detected]” may be construed, depending on the context, to mean “once determined” or “in response to the determination” or “once detected [the described condition or event] ]” or “in response to detection of [described condition or event]”.
- references to "one embodiment” or “some embodiments” or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
- appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Stored Programmes (AREA)
Abstract
本申请提供一种快应用处理方法、电子设备与快应用系统,涉及通信技术领域,其中,该方法包括:终端设备响应于针对目标快应用的页面打开操作,向服务器发送预处理数据请求;服务器接收到预处理数据请求后,向终端设备返回该预处理数据请求对应的预处理数据;终端设备接收到预处理数据后,根据该预处理数据生成并显示目标页面。其中,预处理数据中包括目标脚本文件的执行结果,目标脚本文件为目标页面对应的脚本文件。本申请提供的技术方案提升快应用的页面展示速度,进而提升用户体验。
Description
本申请要求于2021年07月30日提交国家知识产权局、申请号为202110873293.4、申请名称为“快应用处理方法、电子设备与快应用系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及通信技术领域,尤其涉及一种快应用处理方法、电子设备与快应用系统。
快应用是由国内主流厂商所组成的快应用联盟推出的一种新的应用形态,具有免安装和即点即用的优点;终端设备可以在需要启动某个快应用时,再从服务器下载应用程序包,然后直接运行应用程序包,打开应用界面。
考虑到有些快应用的应用程序包体积较大,用户在使用时又不会使用全部的页面,为了提升快应用页面的打开速度,快应用联盟提供了分包方案,通过分包方案可以将快应用的应用程序打包成一个基础包和多个分包,即应用程序包中可以包括一个基础包和多个分包。当快应用的体积比较大时,可以使用快应用的分包加载功能,先下载基础包和页面所在的分包,然后运行下载的基础包和分包展示对应的页面。
但是,目前从用户点击快应用到最终呈现出对应的页面,这个过程所需要的时间仍然比较长。
发明内容
有鉴于此,本申请提供一种快应用处理方法、电子设备与快应用系统,用于提升快应用的页面展示速度,进而提升用户体验。
为了实现上述目的,第一方面,本申请实施例提供一种快应用处理方法,应用于终端设备,所述方法包括:
响应于针对目标快应用的页面打开操作,向服务器发送预处理数据请求;
接收所述服务器返回的预处理数据,所述预处理数据中包括目标脚本文件的执行结果,所述目标脚本文件为所述目标快应用中目标页面对应的脚本文件;
根据所述预处理数据生成并显示所述目标页面。
本实施例提供的快应用处理方法,目标快应用中目标页面的脚本文件在服务器上提前运行,终端设备接收到用户针对目标快应用的页面打开操作后,可以从服务器中获取目标页面对应的脚本文件的执行结果,根据该执行结果显示目标快应用的首页,这样可以减少终端设备中的页面展示处理过程,从而可以提升快应用的页面展示速度。
在第一方面的一种可能的实施方式中,所述执行结果中包括第一指令和第二指令,所述第一指令为所述目标脚本文件中已执行的脚本指令对应的执行结果,所述第二指令为所述目标脚本文件中待执行的脚本指令;
所述根据所述预处理数据生成并显示所述目标页面,包括:
通过脚本引擎执行所述第二指令,得到第三指令;
根据所述第一指令和所述第三指令生成并显示所述目标页面。
上述实施方式中,需要终端设备运行的脚本指令保留在执行结果中,终端设备在基于执行结果生成目标页面时,可以根据该执行结果及时发现待执行的脚本指令(即第二指令),从而在生成目标页面的过程中可以边根据第一指令绘制页面边通过脚本引擎执行第二指令,这样可以提高目标页面的展示速度。
在第一方面的一种可能的实施方式中,所述第二指令中的输入参数包括所述终端设备的设备参数和/或所述目标快应用对应的第三方服务器提供的运行数据。
在第一方面的一种可能的实施方式中,所述第二指令中包括待执行标记,所述终端设备在检测到所述待执行标记时,通过脚本引擎执行检测到的待执行标记对应的第二指令。
上述实施方式中,第二指令中包括待执行标记,终端设备根据待执行标记可以快速检测到第二指令,从而可以提高处理速度。
在第一方面的一种可能的实施方式中,在所述服务器中存在所述预处理数据的情况下,向所述服务器发送所述预处理数据请求。这样可以节省通信资源。
在第一方面的一种可能的实施方式中,所述目标页面为所述目标快应用的首页。这样可以节省终端设备的通信资源。
在第一方面的一种可能的实施方式中,所述方法还包括:
向所述服务器发送所述目标快应用对应的应用程序包下载请求;
接收所述服务器返回的所述目标快应用的应用程序包;
在所述服务器中不存在所述预处理数据的情况下,根据所述目标快应用的应用程序包生成并显示所述目标快应用的首页。
上述实施方式中,终端设备在接收到页面打开操作后,还从服务器下载目标快应用对应的应用程序包。这样如果服务器中不存在目标快应用的预处理数据,终端设备则可以及时获取到目标快应用的应用程序包,根据该应用程序包生成目标快应用的首页,尽快显示出目标快应用的首页;而且,终端设备也可以预先获取到其他非首页页面的脚本文件进行预加载,从而就可以提升目标快应用的非首页页面的展示速度。
在第一方面的一种可能的实施方式中,所述终端设备是根据快应用列表预处理结果确定所述服务器中是否存在所述预处理数据的,所述快应用列表预处理结果是所述终端设备从所述服务器获取的;
所述快应用列表预处理结果中包括至少一个快应用的预处理结果,每个快应用的预处理结果用于指示所述服务器中是否存在所述快应用的首页对应的脚本文件的执行结果。
上述实施方式中,终端设备可以预先通过快应用列表预处理结果获知服务器中是否存在目标快应用的预处理数据,而无需向服务器发送咨询请求来获知服务器中是否存在目标快应用的预处理数据,这样可以提升处理速度。
在第一方面的一种可能的实施方式中,在首次启动所述目标快应用的情况下,向所述服务器发送所述预处理数据请求。
上述实施方式中,终端设备可以只在首次启动目标快应用时,从服务器中下载目标快应用的预处理数据;在非首次启动快应用时,可以从缓存中提取目标快应用的预处理数据,不再向服务器请求,这样可以节省通信资源。
在第一方面的一种可能的实施方式中,所述预处理数据中还包括所述目标快应用的应 用程序包中的公共资源文件。这样终端设备可以从预处理数据中尽快获取到公共资源文件,基于目标页面的脚本文件的执行结果和公共资源文件生成显示目标页面,从而可以提升目标页面的页面展示速度。
第二方面,本申请实施例提供一种快应用处理方法,应用于服务器,所述方法包括:
接收终端设备发送的目标快应用对应的预处理数据请求;
向所述终端设备返回所述预处理数据请求对应的预处理数据,所述预处理数据中包括目标脚本文件的执行结果,所述目标脚本文件为所述目标页面对应的脚本文件。
本实施例提供的快应用处理方法,服务器可以提前执行目标快应用的目标脚本文件,向终端设备提供该目标脚本文件的执行结果;这样终端设备就可以根据该执行结果显示目标快应用的首页,从而就可以减少终端设备中的页面展示处理过程,进而可以提升快应用的页面展示速度。
在第二方面的一种可能的实施方式中,所述执行结果中包括第一指令和第二指令,所述第一指令为所述目标脚本文件中已执行的脚本指令对应的执行结果,所述第二指令为所述目标脚本文件中待执行的脚本指令。
上述实施方式中,服务器将需要终端设备运行的脚本指令保留在执行结果中,这样终端设备可以在基于执行结果生成目标页面时,及时发现待执行的脚本指令(即第二指令),从而在生成目标页面的过程中可以边根据第一指令绘制页面边通过脚本引擎执行第二指令,因而可以提高目标页面的展示速度。
在第二方面的一种可能的实施方式中,所述第二指令中的输入参数包括所述终端设备的设备参数和/或所述目标快应用对应的第三方服务器提供的运行数据。
在第二方面的一种可能的实施方式中,所述第二指令中包括待执行标记,所述待执行标记用于指示所述第二指令待执行。
上述实施方式中,通过在第二指令中设置待执行标记,可以方便终端设备快速检测到第二指令,从而可以提高处理速度。
在第二方面的一种可能的实施方式中,在所述接收终端设备发送的目标快应用对应的预处理数据请求之前,所述方法还包括:
根据所述目标快应用的应用程序包确定所述目标脚本文件;
通过脚本引擎执行所述目标脚本文件,得到所述目标脚本文件的执行结果。
通过上述实施方式,服务器可以预先生成目标脚本文件的执行结果,从而可以向终端设备提供该目标脚本文件。
在第二方面的一种可能的实施方式中,所述方法还包括:
接收所述终端设备发送的应用程序包下载请求;
向所述终端设备返回所述应用程序包下载请求对应的应用程序包。
在第二方面的一种可能的实施方式中,所述目标页面为所述目标快应用的首页。这样可以节省服务器的处理资源和存储资源。
在第二方面的一种可能的实施方式中,所述方法还包括:
向所述终端设备发送快应用列表预处理结果,所述快应用列表预处理结果中包括至少一个快应用的预处理结果,每个快应用的预处理结果用于指示所述服务器中是否存在所述快应用的首页对应的脚本文件的执行结果。
上述实施方式中,服务器可以向终端设备提供快应用列表预处理结果,这样终端设备就可以预先通过快应用列表预处理结果获知服务器中是否存在目标快应用的预处理数据,而无需向服务器发送咨询请求来获知服务器中是否存在目标快应用的预处理数据,从而可以提升处理速度。
在第二方面的一种可能的实施方式中,所述预处理数据中还包括所述目标快应用的应用程序包中的公共资源文件。
第三方面,本申请实施例提供一种快应用处理装置,应用于终端设备,所述装置包括:
输入模块,用于接收针对目标快应用的页面打开操作;
通信模块,用于响应于页面打开操作,向服务器发送预处理数据请求;并接收所述服务器返回的预处理数据,所述预处理数据中包括目标脚本文件的执行结果,所述目标脚本文件为所述目标快应用中目标页面对应的脚本文件;
处理模块,用于根据所述预处理数据生成所述目标页面;
显示模块,用于显示所述目标页面。
在第三方面的一种可能的实施方式中,所述执行结果中包括第一指令和第二指令,所述第一指令为所述目标脚本文件中已执行的脚本指令对应的执行结果,所述第二指令为所述目标脚本文件中待执行的脚本指令;
所述处理模块具体用于:
通过脚本引擎执行所述第二指令,得到第三指令;
根据所述第一指令和所述第三指令生成所述目标页面。
在第三方面的一种可能的实施方式中,所述第二指令中的输入参数包括所述终端设备的设备参数和/或所述目标快应用对应的第三方服务器提供的运行数据。
在第三方面的一种可能的实施方式中,所述第二指令中包括待执行标记,所述处理模块具体用于:在检测到所述待执行标记时,通过脚本引擎执行检测到的待执行标记对应的第二指令。
在第三方面的一种可能的实施方式中,所述通信模块具体用于:在所述服务器中存在所述预处理数据的情况下,向所述服务器发送所述预处理数据请求。
在第三方面的一种可能的实施方式中,所述目标页面为所述目标快应用的首页。
在第三方面的一种可能的实施方式中,所述通信模块还用于:
向所述服务器发送所述目标快应用对应的应用程序包下载请求;
接收所述服务器返回的所述目标快应用的应用程序包;
所述处理模块具体用于:在所述服务器中不存在所述预处理数据的情况下,根据所述目标快应用的应用程序包生成所述目标快应用的首页。
在第三方面的一种可能的实施方式中,所述处理模块是根据快应用列表预处理结果确定所述服务器中是否存在所述预处理数据的,所述快应用列表预处理结果是从所述服务器获取的;
所述快应用列表预处理结果中包括至少一个快应用的预处理结果,每个快应用的预处理结果用于指示所述服务器中是否存在所述快应用的首页对应的脚本文件的执行结果。
在第三方面的一种可能的实施方式中,所述通信模块具体用于:在首次启动所述目标快应用的情况下,向所述服务器发送所述预处理数据请求。
第四方面,本申请实施例提供一种快应用处理方法,应用于服务器,所述装置包括:
通信模块,用于接收终端设备发送的目标快应用对应的预处理数据请求;
处理模块,用于确定所述预处理数据请求对应的预处理数据;
所述通信模块还用于:向所述终端设备返回所述预处理数据,所述预处理数据中包括目标脚本文件的执行结果,所述目标脚本文件为所述目标页面对应的脚本文件。
在第四方面的一种可能的实施方式中,所述执行结果中包括第一指令和第二指令,所述第一指令为所述目标脚本文件中已执行的脚本指令对应的执行结果,所述第二指令为所述目标脚本文件中待执行的脚本指令。
在第四方面的一种可能的实施方式中,所述第二指令中的输入参数包括所述终端设备的设备参数和/或所述目标快应用对应的第三方服务器提供的运行数据。
在第四方面的一种可能的实施方式中,所述第二指令中包括待执行标记,所述待执行标记用于指示所述第二指令待执行。
在第四方面的一种可能的实施方式中,所述处理模块还用于:
在所述通信模块接收终端设备发送的目标快应用对应的预处理数据请求之前,根据所述目标快应用的应用程序包确定所述目标脚本文件;
通过脚本引擎执行所述目标脚本文件,得到所述目标脚本文件的执行结果。
在第四方面的一种可能的实施方式中,所述通信模块还用于:
接收所述终端设备发送的应用程序包下载请求;
向所述终端设备返回所述应用程序包下载请求对应的应用程序包。
在第四方面的一种可能的实施方式中,所述目标页面为所述目标快应用的首页。
在第四方面的一种可能的实施方式中,所述通信模块还用于:
向所述终端设备发送快应用列表预处理结果,所述快应用列表预处理结果中包括至少一个快应用的预处理结果,每个快应用的预处理结果用于指示所述服务器中是否存在所述快应用的首页对应的脚本文件的执行结果。
第五方面,本申请实施例提供一种快应用系统,包括:终端设备和服务器,其中:
所述终端设备用于:响应于针对目标快应用的页面打开操作,向服务器发送预处理数据请求;
所述服务器用于:接收终端设备发送的目标快应用对应的预处理数据请求;并向所述终端设备返回所述预处理数据请求对应的预处理数据,所述预处理数据中包括目标脚本文件的执行结果,所述目标脚本文件为所述目标页面对应的脚本文件;
所述终端设备还用于:接收所述服务器返回的预处理数据,并根据所述预处理数据生成并显示所述目标页面。
第六方面,本申请实施例提供一种电子设备,包括:存储器和处理器,存储器用于存储计算机程序;处理器用于在调用计算机程序时执行上述第一方面或第二方面所述的方法。
第七方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述第一方面或第二方面所述的方法。
第八方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面或第二方面所述的方法。
第九方面,本申请实施例提供一种芯片系统,包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现上述第一方面或第二方面所述的方法。其中,所述芯片系统可以为单个芯片,或者多个芯片组成的芯片模组。
可以理解的是,上述第四方面至第九方面的有益效果可以参见上述第一方面和第二方面中的相关描述,在此不再赘述。
图1为本申请实施例提供的快应用系统的系统架构示意图;
图2为本申请实施例提供的快应用处理过程示意图;
图3为本申请实施例提供的预处理过程的流程示意图;
图4为本申请实施例提供的快应用界面示意图;
图5为本申请实施例提供的一种快应用展示过程的流程示意图;
图6为本申请实施例提供的另一种快应用展示过程的流程示意图;
图7为本申请实施例提供的快应用处理装置的结构示意图;
图8为本申请实施例提供的终端设备的结构示意图;
图9为本申请实施例提供的服务器的结构示意图。
下面结合本申请实施例中的附图对本申请实施例进行描述。本申请实施例的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
首先介绍本申请实施例涉及的系统架构。请参阅图1,图1为本申请实施例提供的快应用系统的系统架构示意图。如图1所示,快应用系统可以包括开发设备100、服务器(包括应用市场服务器200和快应用服务器300)和终端设备400。其中:
开发设备100可以为笔记本电脑、台式电脑等配置有集成开发环境(integrated development environment,IDE)的电子设备,图1中以台式电脑为例进行示例性说明。其中,IDE是用于提供程序开发环境的应用程序,包括代码编辑器、编译器、调试器和图形用户界面等工具。快应用开发者可以通过开发设备100上的IDE编写快应用的源代码,在快应用开发者完成快应用的源代码编写后,开发设备100可以根据源代码生成快应用的应用程序包,并将应用程序包上传到服务器中,供用户进行下载使用。其中,快应用的应用程序包的文件格式为快应用应用程序包(runable application package,RPK)格式,因此,快应用的应用程序包亦称为RPK包。
服务器可以接收并存储开发设备100上传的RPK包,以及为终端设备400提供RPK包的下载服务。
终端设备400可以为智能手机、平板电脑等可支持快应用运行的电子设备,图1中以智能手机为例进行示例性说明。用户可以通过终端设备400从服务器下载快应用的RPK包,以打开快应用。
其中,终端设备400从服务器下载的RPK包可以是包含快应用全部的页面和资源的整包,也可以是包含部分页面和资源的分包。即服务器上存储的RPK包可以是未采用分包功能的整包,也可以是采用分包功能而形成的分包。
具体地,RPK包可以包括如下文件:用于描述项目配置信息的manifest文件 (manifest.json),应用程序代码入口文件app.ux和多个描述页面/自定义组件的ux文件。快应用开发者在开发快应用时,可以在manifest.json中配置subpackages规则,在拆包时,可以根据该subpackages规则将项目拆分成多个分包。
其中,这些分包可以包括一个基础包和多个页面分包,基础包包含一些公共的页面和资源等内容,页面分包根据上述subpackages规则进行划分。在运行时,快应用优先加载基础包和页面所在的分包,其余分包可以自动在后台进行预加载。
下面举例说明,例如,快应用A的包体比较大,按照快应用联盟的规范建议,将其分为3个包,将首页及公共资源文件保留在基础包中,将主界面放置在页面分包PackageA中,将主界面以外的页面放置在页面分包PackageB中。该快应用A的目录文件组织可以如下所示:
其中,Main目录下为首页文件,Common目录下为公用的资源文件和组件文件(即公共资源文件),每个页面目录下存放各自页面私有的资源文件和组件文件。
manifest文件(即manifest.json)中的分包配置规则如下:
其中,“name”表示页面分包的名称;“resource”表示页面分包的资源目录,拆包时会把该目录下的所有资源都打包到这个页面分包中。首页可以位于基础包中,也可以位于页面分包中,本实施例中以首页位于基础包中为例进行示例性说明。
对于拆包过程,如果开发设备100上的IDE支持分包功能,则快应用开发者可以在编译快应用项目时,按照subpackages配置的资源路径打包页面分包,将subpackages配置路径以外的目录打包到基础包中。
考虑到有些IDE版本可能不支持分包功能,为了方便快应用开发者开发快应用,拆包过程也可以在服务器中进行。即服务器收到开发设备100上传的RPK包后,按照RPK包中的subpackages规则进行拆包,得到各个分包。
在实际应用中,服务器可以是一个同时具备下载服务和拆包功能的服务器,也可以如图1中所示的包括两个:一个为提供RPK包下载服务的应用市场服务器200,一个为提供拆包功能的快应用服务器300。本实施例中后续以拆包过程在服务器中进行,服务器包括应用市场服务器200和快应用服务器300为例进行示例性说明。
可以理解的是,服务器可以是单独的服务器,也可以是服务器集群,即上述同时具备下载服务和拆包功能的服务器、应用市场服务器200和快应用服务器300均可以是服务器集群。
如图2所示,开发设备100可以将快应用开发的RPK整包上传到应用市场服务器200进行审核(步骤1.1),应用市场服务器200审核通过后,可以将RPK整包同步到快应用服务器300(步骤1.2),快应用服务器300收到RPK整包后,可以对RPK整包进行拆包处理(步骤1.3),将RPK整包拆分为多个分包后,再将多个RPK分包返回给应用市场服务器200(步骤1.4)。
当用户需要打开快应用的目标页面时,终端设备400可以从应用市场服务器200下载RPK包,应用市场服务器200向终端设备400返回RPK包,其中,在RPK包不支持分包的情况下,返回RPK整包;在RPK包支持分包的情况下,可以返回RPK分包(包括首页的基础包)。
具体地,快应用可以是一个独立的应用,也可以是一个嵌入在其他应用中的卡片。用户可以通过快应用中心、通知栏、负一屏、语音助手、全局搜索、浏览器、应用市场、嵌入了快应用的原生应用等场景入口启动快应用。快应用运行于快应用引擎上,当用户通过这些场景入口启动快应用时,会唤起快应用引擎;快应用引擎则根据用户选择的快应用到应用市场服务器200下载对应的RPK包。
具体地,快应用引擎可以包括应用管理模块、脚本引擎、渲染引擎和布局引擎等功能模块,快应用引擎通过应用管理模块下载RPK包。快应用引擎在下载RPK包时,也可以是从应用市场服务器200获取到下载地址,然后根据下载地址从下载服务器下载对应的RPK包。其中,下载服务器能够提供RPK包的加速加载功能,具体可以是内容分发网络(content delivery network,CDN)服务器等。为了便于说明,本实施例后续以快应用引擎从应用市场服务器200下载RPK包为例进行示例性说明。
快应用引擎通过应用管理模块获取到RPK包后,可以找到目标页面的脚本文件,然后 通过脚本引擎执行目标页面的脚本文件;再通过渲染引擎将脚本文件的执行结果转换为安卓层的组件(如文本组件、图片组件等),设置这些组件的属性,并通过布局引擎计算出各个组件的相对位置,完成目标页面的布局和绘制过程。
为了提升快应用的页面展示速度,本实施例中,可以将快应用的目标页面的脚本文件在快应用服务器300上提前运行,即快应用服务器300在收到RPK整包后,还可以对RPK整包进行预处理(步骤1.3);当用户需要打开快应用的目标页面时,终端设备400可以响应用户的页面打开操作,从快应用服务器300直接下载预处理数据,即目标页面的脚本文件的执行结果(步骤2.1),然后根据该预处理数据显示目标页面(步骤2.2)。
其中,快应用服务器300上可以部署脚本引擎,快应用服务器300可以通过脚本引擎执行脚本文件,得到首脚本文件的执行结果。
脚本文件可以是JS(JavaScript)文件,对应的,脚本引擎可以是JS引擎。V8是一个可以执行JS指令的JavaScript运行环境,Node.js是一个基于V8引擎的JavaScript运行环境,其可以在服务器运行。因此,本实施例中,在终端设备400上部署的脚本引擎可以是V8引擎,在快应用服务器300上部署的脚本引擎可以是Node.js。
可以理解的是,脚本文件不限于JS文件,对应的,脚本引擎不限于JS引擎;另外,JS引擎也不限于上述V8和Node.js,本实施例对终端设备400和快应用服务器300上具体部署的脚本引擎不做特别限定。为了便于理解,本实施例中后续以脚本文件为JS文件,脚本引擎为JS引擎为例进行示例性说明。
终端设备400在生成目标页面时,通常会用到公共资源,基于此,本实施例中,快应用服务器300对RPK包进行预处理得到的预处理数据既可以包括目标页面的脚本文件的执行结果,还可以包括RPK包中的公共资源文件,这样终端设备400无需再次发消息请求公共资源文件,通过预处理数据就可以快速获取到公共资源文件,基于目标页面的脚本文件的执行结果和公共资源文件生成显示目标页面,从而可以提升目标页面的页面展示速度。
目标页面可以是快应用的任意页面。在展示快应用的首页时,可以同时从应用市场服务器200下载该快应用的RPK包(步骤2.3),在展示了首页后,若用户点击了其他页面,终端设备400则可以及时根据该RPK包显示其他页面(步骤2.4)。另外,快应用可能不存在预处理数据,此种情况下,终端设备400也可以及时获取到RPK包,根据RPK包展示首页。
对于快应用中首页之外的其他非首页页面,在无分包的情况下,启动快应用时已下载了快应用的RPK整包,在打开非首页页面时则无需再次下载,且可以在展示首页后预加载非首页页面的脚本文件。在有分包的情况下,在加载首页的过程中也可以预加载非首页页面的分包。即非首页页面可以预加载,因此,考虑到这种情况,本实施例中,快应用服务器300也可以只针对首页进行预处理,以节省处理资源和存储资源;对应的,终端设备400可以只获取首页的预处理数据,这样也可以有效节省通信资源。本实施例中后续也以目标页面为首页为例进行示例性说明。
可以理解的是,在首次启动快应用时,终端设备400可以从快应用服务器300中下载首页的脚本文件的执行结果并进行存储;在非首次启动快应用时,则可以从缓存中提取首页的脚本文件的执行结果,无需再次向快应用服务器300请求,以节省通信资源,并提升展示速度。后续若无特别说明,均以首次启动快应用为例进行示例性说明。
下面分别对上述快应用处理方法中与预处理相关的过程和与首页展示相关的过程进行详细介绍。
图3为本申请实施例提供的预处理过程的流程示意图,如图3所示,预处理过程可以包括如下步骤:
S110、开发设备向应用市场服务器提交目标快应用的RPK整包。
具体地,快应用开发者可以按照快应用规范,通过开发设备上的IDE开发目标快应用,编译生成目标快应用的RPK包(此处示例性的为RPK整包)。在测试验证完毕之后,可以通过开发设备将RPK整包提交到应用市场服务器。
S120、应用市场服务器接收到RPK整包后,对RPK整包进行审核。
应用市场服务器接收到RPK整包后,可以对RPK整包进行审核,审核内容包括但不限于内容合规性检查和安全检查等。
RPK整包如果审核通过,应用市场服务器则可以向快应用服务器发送该RPK整包;RPK整包如果审核不通过,应用市场服务器则可以向开发设备返回审核不通过的消息。
S130、应用市场服务器在RPK整包审核通过后,向快应用服务器发送该RPK整包。
S140、快应用服务器接收到RPK整包后,在该RPK整包支持拆包的情况下,对RPK整包进行拆包处理,得到RPK分包。
具体地,快应用服务器接收到RPK整包后,可以根据RPK整包中的manifest文件检查该RPK整包是否支持拆包。
如果manifest文件中配置了subpackages规则,即该RPK整包支持拆包,则可以根据该subpackages规则对RPK整包进行拆包处理,得到RPK分包。
如果manifest文件中未配置subpackages规则,即该RPK整包不支持拆包,则可以不进行拆包处理。
S150、快应用服务器确定RPK整包中首页对应的目标脚本文件,通过脚本引擎执行目标脚本文件。
快应用服务器接收到RPK整包后,在执行拆包处理之外,还执行目标脚本文件的预处理过程。
其中,快应用服务器在RPK整包支持拆包的情况下,可以从RPK分包中找到目标快应用的首页对应的脚本文件(即目标脚本文件);在RPK整包不支持拆包的情况下,可以从RPK整包中找到目标脚本文件。
具体地,快应用服务器可以根据快应用规范在RPK包中找到manifest文件中的入口文件:router节点的entry页面。以目标快应用为上述快应用A为例,其manifest文件内容如下:
其中,manifest文件中定义了entry(快应用的入口文件)为Main,结合前述的快应用A的目录文件,可以查找到快应用A的首页的脚本文件。
快应用A的首页在RPK中的文件已被打包编译为JS文件,文件名为index.js,编译结果例如为:
快应用服务器找到上述脚本文件index.js后,则可以通过JS引擎执行该文件,执行时会将界面布局相关的JS指令转换为组件树,将组件树的层叠样式表(cascading style sheets,CSS)样式文件,转为为具体的值(例如将元素上的.title样式,转换为“background-color:xxx,height:xxx,width:xxx”);JS引擎执行完后将执行结果存储在快应用服务器上。
其中,目标脚本文件的执行结果可以是JS对象结构(JavaScript object notation,JSON)格式或文本格式等。目标脚本文件的执行结果例如为:
其中,JS引擎执行目标脚本文件后,将该文件中的组件关系形成上述的组件树,上述组件树中根节点(组件)为div类型,子节点(组件)为text文本,attr标签定义了组件所包含的属性,style节点定义了组件的样式。
目标脚本文件中有些JS指令可能需要在终端设备上执行,例如一些涉及终端设备的设备参数和目标快应用对应的第三方服务器提供的运行数据等需要在运行时获取的数据,对于这些指令,可以在目标脚本文件的执行结果中设置待执行标记,例如上述执行结果中用“${}”表示待执行的JS指令。即目标快应用的预处理数据中可以包括目标脚本文件中已执行的JS指令对应的执行结果(此处称为第一指令),还可以包括目标脚本文件中待执行的 JS指令(此处称为第二指令)。
可以理解的是,待执行标记不限于上述“${}”,也可以采用其他标记,本实施例对此不做特别限定。
其中,终端设备的设备参数可以包括设备位置、屏幕大小、字体大小和网络等参数,目标快应用在运行时可以从第三方服务器获取一些动态的运行数据,例如,新闻类的快应用,其对应的第三方服务器可以提供新闻列表和新闻内容等运行数据。
如上述目标脚本文件的执行结果中所示的,JS指令${$data.color},在执行时需要根据第三方服务器返回的颜色数据确定根节点所对应的组件的背景颜色;JS指令${$configuration.deviceInfo.windowLogicWidth},在执行时需要根据终端设备的窗口逻辑宽度确定;JS指令${$configuration.deviceInfo.uiMode='dark'?'yellow':'red'}在执行时,需要根据终端设备的显示模式确定子节点所对应的组件的背景颜色是黄色还是红色;JS指令${60*$configuration.deviceInfo.fontScale+'dp'},在执行时需要根据终端设备的字体大小确定子节点所对应的组件的字体大小。
在实际应用中,快应用的界面中与界面布局(例如各组件之间的位置关系)相关的JS指令、各组件的样式文件中一些不变的显示内容所对应的JS指令通常可以在快应用服务器上直接执行,各组件的样式文件中一些可变的显示内容通常需要在终端设备上运行时确定。
图4为本申请实施例提供的快应用界面示意图,如图4中的(a)所示,名称为“菜谱大全”的快应用,其首页中的应用名称(即“菜谱大全”)、今日推荐栏、搜索栏、“早中晚餐”栏、“美食专题”栏、“热门推荐”栏、“本周佳作”栏、导航栏之间的位置关系,“热门推荐”栏中各菜谱分类之间的位置关系,导航栏中各功能菜单之间的位置关系,各功能菜单对应的图标和文本内容,各文本的字体颜色和字体类型,以及各个栏的背景颜色,这些显示内容对应的JS指令可以在快应用服务器上预先执行。
今日推荐栏、“热门推荐”栏和“本周佳作”栏中具体显示的内容,这些内容需要从快应用“菜谱大全”对应的第三方服务器中获取,即这些内容是可变的。例如,某天打开快应用“菜谱大全”后,参见图4中的(a),今日推荐栏中推荐的菜谱是“咖啡吐司”,“热门推荐”栏中推荐的菜谱分类包括“清淡”、“下饭菜”、“川菜”和“烘焙”,“本周佳作”栏中显示的菜谱为“烤鸡腿”。另外一天打开快应用“菜谱大全”后,参见图4中的(b),今日推荐栏中推荐的菜谱是“南瓜饼”,“热门推荐”栏中推荐的菜谱分类包括“下饭菜”、“素菜”、“家常菜”和“粥”,“本周佳作”栏中显示的菜谱为“辣白菜”。
对应的,上述这些可变的显示内容相关的JS指令可以在终端设备上执行,即这些内容对应的JS指令可以设置待执行标记。
应用名称显示的字体大小可以根据终端设备上设置的字体大小确定,其他各栏中显示内容的尺寸和字体大小可以根据终端设备上该应用的窗口显示大小确定。例如,终端设备上设置的字体大小为标准大小时,应用名称“菜谱大全”的字体大小如图4中的(a)所示;终端设备上设置的字体大小为大号字体时,应用名称“菜谱大全”的字体大小如图4中的(c)所示。
又例如,终端设备全屏显示时,快应用“菜谱大全”的首页中各图片和文本的显示大 小如图4中的(a)所示;终端设备非全屏显示时(此处示例性的处于单手操作模式),快应用“菜谱大全”的首页中各图片和文本的显示大小如图4中的(d)所示。
对应的,上述这些与图片和文本的显示大小相关的JS指令可以设置待执行标记,当终端设备打开快应用“菜谱大全”时,在终端设备上执行。
快应用服务器在对RPK包进行预处理时,可以将RPK包中的公共资源文件提取出来,将目标脚本文件的执行结果和公共资源文件合并在一起得到预处理数据,以使终端设备可以及时获取到公共资源文件,基于目标页面的脚本文件的执行结果和公共资源文件生成显示目标页面。
S160、快应用服务器向应用市场服务器返回目标快应用的RPK分包和预处理结果。
快应用服务器完成拆包处理后,可以向应用市场服务器返回拆包得到的各个RPK分包。
终端设备可以打开快应用中心,用户可以在快应用中心提供的快应用列表中选择目标快应用打开。终端设备在打开快应用中心时,会与应用市场服务器进行交互,以获取快应用列表。基于此,本实施例中,快应用服务器也可以向应用市场服务器返回目标快应用的预处理结果,这样应用市场服务器可以预先将快应用中心中各快应用的预处理结果(此处称为快应用列表预处理结果)同步到终端设备,终端设备在打开目标快应用时,则可以根据快应用列表预处理结果确定快应用服务器中是否存在目标快应用的预处理数据(即目标快应用的首页的脚本文件的执行结果),在不存在的情况下,则可以不向快应用服务器请求该执行结果,以节省通信资源。
具体地,目标快应用的预处理结果可以指示目标快应用是否存在目标脚本文件的执行结果,其可以通过消息中的一个标志位指示,其中,快应用服务器可以将RPK分包和目标快应用的预处理结果携带在同一消息中返回给应用市场服务器,也可以通过不同的消息返回给应用市场服务器。
其中,快应用列表预处理结果中可以包括应用市场服务器中所有快应用的预处理结果,也可以设置成类似白名单和黑名单的形式,只包括存在预处理数据的快应用列表,或只包括不存在预处理数据的快应用列表。对于快应用列表预处理结果的具体实现形式本实施例不做特别限定。
S170、应用市场服务器向终端设备同步快应用列表预处理结果。
具体地,应用市场服务器可以在终端设备每次打开快应用中心时,向终端设备同步快应用中心中各个快应用的预处理结果;并可以在接收到新的预处理结果时,向终端设备同步该预处理结果。终端设备可以存储并更新快应用列表预处理结果。
下面介绍与首页展示相关的过程。
图5为本申请实施例提供的一种快应用展示过程的流程示意图,如图5所示,该过程可以包括如下步骤:
S210、终端设备接收用户针对目标快应用的启动操作。
具体地,用户可以通过上述快应用的各种场景入口启动目标快应用,其中,启动操作可以是手动操作(例如点击操作),也可以是语音输入操作。
终端设备接收到用户针对目标快应用的启动操作后,就可以响应该操作,从快应用服务器下载目标快应用的预处理数据。考虑到快应用服务器中可能不存在目标快应用的预处 理数据,为了节省通信资源,本实施例中,终端设备在接收到用户针对目标快应用的启动操作后,可以先根据快应用列表预处理结果判断快应用服务器中是否存在目标快应用的预处理数据,在确定快应用服务器中存在目标快应用的预处理数据的情况下,再从快应用服务器下载预处理数据,否则可以不向快应用服务器请求预处理数据。
具体地,如图5所示,在快应用服务器中存在目标快应用的预处理数据的情况下,终端设备在接收到用户针对目标快应用的启动操作后,可以执行下述流程A(包括步骤S220~S260);在快应用服务器中不存在目标快应用的预处理数据的情况下,终端设备可以执行流程B(包括步骤S250~S270)。
S220、终端设备在快应用服务器中存在目标快应用的预处理数据的情况下,向快应用服务器发送预处理数据请求。
具体地,终端设备接收到用户针对目标快应用的启动操作后,如果确定快应用服务器中存在目标快应用的预处理数据,则可以向快应用服务器发送目标快应用对应的预处理数据请求,以请求目标快应用的预处理数据。
其中,该预处理数据请求中可以包括目标快应用的标识,例如目标快应用的包名等可以唯一标识目标快应用的信息。
S230、快应用服务器向终端设备返回预处理数据。
快应用服务器接收到终端设备发送的预处理数据请求后,可以根据预处理数据请求中目标快应用的标识,查找该标识对应的预处理数据,然后发送给终端设备。
S240、终端设备根据预处理数据生成并显示目标快应用的首页。
终端设备接收到快应用服务器发送的预处理数据后,终端设备中的快应用引擎则可以调用渲染引擎将预处理数据中的第一指令(即目标快应用的首页对应的脚本文件中已执行的JS指令对应的执行结果)转换为原生视图(即安卓层的组件)进行绘制;在绘制的过程中,如果发现预处理数据中的第二指令(即目标快应用的首页对应的脚本文件中待执行的JS指令),则可以调用JS引擎执行该第二指令,然后根据该第二指令的执行结果(此处称为第三指令)继续绘制原生视图,最后渲染成原生界面(即目标快应用的首页),显示给用户。
其中,终端设备可以检测预处理数据中的待执行标记,如果检测到待执行标记,则该检测到的待执行标记对应的JS指令即为第二指令。
可以理解的是,终端设备在接收到预处理数据后,快应用引擎也可以先查看预处理数据中是否有第二指令,如果有,则可以先调用JS引擎执行这些第二指令,然后调用渲染引擎绘制渲染原生视图,生成原生界面。
S250、终端设备向应用市场服务器发送RPK包下载请求。
本实施例中,终端设备在接收到用户针对目标快应用的启动操作后,在响应该操作时,还可以向应用市场服务器发送目标快应用对应的RPK包下载请求。这样如果快应用服务器中不存在目标快应用的预处理数据,终端设备则可以及时获取到目标快应用的RPK包,根据该RPK包生成目标快应用的首页,尽快显示出目标快应用的首页;而且,终端设备也可以预先获取到其他非首页页面的脚本文件进行预加载,从而就可以提升目标快应用的非首页页面的展示速度。
其中,RPK包下载请求中可以包括目标快应用的标识,例如目标快应用的包名。
S260、应用市场服务器向终端设备返回目标快应用的RPK包。
应用市场服务器接收到终端设备发送的RPK包下载请求后,可以根据RPK包下载请求中目标快应用的标识,查找该标识对应的RPK包,然后发送给终端设备。
其中,当目标快应用的RPK包不支持分包的情况下,应用市场服务器可以向终端设备返回RPK整包;当目标快应用的RPK包支持分包的情况下,应用市场服务器可以向终端设备返回RPK分包。
应用市场服务器在向终端设备返回RPK分包时,可以先发送首页所在的分包,然后发送其他非首页页面所在的分包,以使终端设备尽快接收到首页所在的分包,从而在快应用服务器中不存在目标快应用的预处理数据的情况下,尽快根据RPK包生成目标快应用的首页。
S270、终端设备在快应用服务器中不存在目标快应用的预处理数据的情况下,根据RPK包生成并显示目标快应用的首页。
如前所述,终端设备在接收到用户的启动操作后,可以先根据快应用列表预处理结果判断快应用服务器中是否存在目标快应用的预处理数据,如果快应用服务器中不存在目标快应用的预处理数据,终端设备则可以在接收到RPK包后,根据RPK包生成显示目标快应用的首页。即终端设备中的快应用引擎可以先调用JS引擎执行首页的JS文件;再调用渲染引擎,根据JS文件的执行结果绘制渲染原生视图,生成目标快应用的首页后进行显示。
下面以第一快应用存在预处理数据,第二快应用不存在预处理数据为例,示例性说明一种快应用展示过程。
图6为本申请实施例提供的另一种快应用展示过程的流程示意图,如图6所示,该过程可以包括如下步骤:
S301、终端设备接收用户针对第一快应用的启动操作。
该步骤与上述步骤S210类似,具体说明可参考上述步骤S210的描述,在此不再赘述。
S302、终端设备确定快应用服务器中存在第一快应用的预处理数据,向快应用服务器发送预处理数据请求。
终端设备接收到第一快应用的启动操作后,可以响应该操作,根据快应用列表预处理结果判断快应用服务器中是否存在第一快应用的预处理数据。此处假设第一快应用存在预处理数据,即终端设备根据快应用列表预处理结果可以确定快应用服务器中存在第一快应用的预处理数据,则终端设备可以向快应用服务器发送第一快应用对应的预处理数据请求,以请求第一快应用的预处理数据。
S303、快应用服务器向终端设备返回预处理数据。
快应用服务器接收到终端设备发送的预处理数据请求后,可以根据预处理数据请求查找对应的预处理数据,然后发送给终端设备。
S304、终端设备根据预处理数据生成并显示第一快应用的首页。
终端设备接收到快应用服务器发送的预处理数据后,则可以根据预处理数据进行页面的绘制和渲染,得到第一快应用的首页后进行显示。具体的页面显示过程与步骤S240类似,此处不再赘述。
S305、终端设备向应用市场服务器发送第一快应用对应的第一RPK包下载请求。
终端设备在接收到用户针对第一快应用的启动操作后,在响应该操作时,还可以向应 用市场服务器发送第一快应用对应的第一RPK包下载请求,下载第一快应用对应的第一RPK包。
S306、应用市场服务器向终端设备返回第一RPK包。
该步骤与上述步骤S260类似,具体说明可参考上述步骤S260的描述,在此不再赘述。
S307、终端设备接收用户的第一页面打开操作,根据第一RPK包生成并显示第一页面。
终端设备打开第一快应用的首页后,用户可以点击首页上其他页面的入口,打开其他页面(此处示例性的为第一页面)。终端设备接收到用户的第一页面打开操作后,终端设备中的快应用引擎可以调用JS引擎执行第一页面的JS文件;然后调用渲染引擎,根据JS文件的执行结果绘制渲染原生视图,生成第一页面后进行显示。
可以理解的是,终端设备也可以在接收到第一页面打开操作前,预先执行可以在首页上打开的其他页面(例如第一页面)的JS文件,当接收到第一页面打开操作后,则可以直接基于第一页面的JS文件的执行结果进行第一页面的绘制和显示,从而就可以提升第一页面的页面展示速度。
S308、终端设备接收用户针对第二快应用的启动操作。
终端设备上可以开启多个快应用,用户可以通过快应用的场景入口启动第二快应用。
终端设备接收到第二快应用的启动操作后,可以响应该操作,根据快应用列表预处理结果判断快应用服务器中是否存在第二快应用的预处理数据。此处假设第二快应用不存在预处理数据,即终端设备根据快应用列表预处理结果可以确定快应用服务器中不存在第二快应用的预处理数据,则终端设备无需再向快应用服务器请求第二快应用的预处理数据,后续根据RPK包显示首页。
S309、终端设备向应用市场服务器发送第二快应用对应的第二RPK包下载请求。
终端设备在接收到用户针对第二快应用的启动操作后,在响应该操作时,还可以向应用市场服务器发送第二快应用对应的第二RPK包下载请求,下载第二快应用对应的第二RPK包。
S310、应用市场服务器向终端设备返回第二RPK包。
该步骤与上述步骤S260类似,具体说明可参考上述步骤S260的描述,在此不再赘述。
S311、终端设备确定快应用服务器中不存在第二快应用的预处理数据,根据第二RPK包生成并显示第二快应用的首页。
如前所述,终端设备在接收到用户针对第二快应用的启动操作后,可以确定出快应用服务器中不存在目标快应用的预处理数据,此时,终端设备可以在接收到第二RPK包后,根据第二RPK包生成显示第二快应用的首页。即终端设备中的快应用引擎可以先调用JS引擎执行第二RPK包中首页的JS文件;再调用渲染引擎,根据JS文件的执行结果绘制渲染原生视图,生成第二快应用的首页后进行显示。
S312、终端设备接收用户的第二页面打开操作,根据第二RPK包生成并显示第二页面。
终端设备打开第二快应用的首页后,用户如果在首页上触发第二页面,终端设备则可以在接收到用户的第二页面打开操作后,调用JS引擎执行第二页面的JS文件;然后调用渲染引擎,根据JS文件的执行结果绘制渲染原生视图,生成第二页面后进行显示。具体的 页面显示过程与步骤S307类似,此处不再赘述。
本领域技术人员可以理解,以上实施例是示例性的,并非用于限定本申请。在可能的情况下,以上步骤中的一个或者几个步骤的执行顺序可以进行调整,也可以进行选择性组合,得到一个或多个其他实施例。本领域技术人员可以根据需要从上述步骤中任意进行选择组合,凡是未脱离本申请方案实质的,都落入本申请的保护范围。
本实施例提供的快应用处理方法,目标快应用的首页的脚本文件可以在快应用服务器上提前运行,当终端设备接收到用户针对目标快应用的启动操作后,可以从快应用服务器中获取目标快应用的首页对应的脚本文件的执行结果,根据该执行结果显示目标快应用的首页,从而可以有效的提升快应用的页面展示速度。
基于同一构思,作为对上述方法的实现,本申请实施例提供了一种快应用处理装置,该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的装置能够对应实现前述方法实施例中的全部内容。
图7为本申请实施例提供的快应用处理装置的结构示意图,如图7所示,本实施例提供的装置包括:
显示模块210、输入模块220、处理模块230和通信模块240。
可以理解的是,本申请实施例示意的结构并不构成对快应用处理装置的具体限定。在本申请另一些实施例中,快应用处理装置可以包括比图示更多或更少的模块。图示的模块可以以硬件,软件或软件和硬件的组合实现。
其中,显示模块210用于支持电子设备执行上述实施例中的界面显示操作和/或用于本文所描述的技术的其它过程。显示模块可以是触摸屏或其他硬件或硬件与软件的综合体。
输入模块220用于接收用户在电子设备的显示界面上的输入,如触摸输入、语音输入、手势输入等,输入模块用于支持电子设备执行上述实施例中接收用户的接听通话操作的步骤和/或用于本文所描述的技术的其它过程。输入模块可以是触摸屏或其他硬件或硬件与软件的综合体。
处理模块230用于支持电子设备执行上述实施例中的快应用处理操作和/或用于本文所描述的技术的其它过程。
通信模块240用于支持电子设备执行上述实施例中与其他电子设备之间的通信过程相关的操作和/或用于本文所描述的技术的其它过程。
其中,该电子设备可以是上述实施例中的终端设备或服务器。
本实施例提供的装置可以执行上述方法实施例,其实现原理与技术效果类似,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能 单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
基于同一构思,本申请实施例还提供一种终端设备,请参阅图8,图8为本申请实施例提供的终端设备的结构示意图。
终端设备可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对终端设备的具体限定。在本申请另一些实施例中,终端设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(sraphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是终端设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
处理器110可以运行本申请实施例提供的快应用处理方法的软件代码/模块,生成并显示快应用的页面,提升快应用的页面展示速度。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(serail clock line,SCL)。I2S接口可以用于音频通信。PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。UART接口是一种通用串行数据总线,用于异步通信;该总线可以为双向通信总线,它将要传输的数据在串行通信与并行通信之间转换。MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件;MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。GPIO接口可以通过软件配置,GPIO接口可以被配置为控制信号,也可被配置为数据信号。USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为终端设备充电,也可以用于终端设备与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他终端设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对终端设备的结构限定。在本申请另一些实施例中,终端设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过终端设备的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为终端设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
终端设备的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。终端设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在终端设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在终端设备上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近场通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,终端设备的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得终端设备可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分同步码分多址(time division-synchronous code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GNSS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。
终端设备通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Mini LED,Micro LED,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端设备可以包括1个或N个显示屏194,N为大于1的正整数。
终端设备可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。摄像头193用于捕获静态图像或视频。数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。视 频编解码器用于对数字视频压缩或解压缩。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现终端设备的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行终端设备的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,以及至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端设备使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
本申请实施例中,内部存储器121可以存储本申请实施例提供的快应用处理方法的软件代码/模块,当处理器110运行所述软件代码/模块时,可以执行快应用处理方法的流程,显示快应用的页面。
外部存储器接口120可以用于连接外部存储器,例如Micro SD卡,实现扩展终端设备的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
本申请实施例提供的快应用处理方法的软件代码/模块也可以存储在外部存储器中,处理器110可以通过外部存储器接口120运行所述软件代码/模块,以执行快应用处理方法的流程,显示快应用的页面。
终端设备可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动终端设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。终端设备可以接收按键输入,产生与终端设备的用户设置以及功能控制有关的键信号输入。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和终端设备的接触和分离。终端设备可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡, Micro SIM卡,SIM卡等。
本实施例提供的终端设备可以执行上述方法实施例,其实现原理与技术效果类似,此处不再赘述。
基于同一构思,本申请实施例还提供一种服务器,图9为本申请实施例提供的服务器的结构示意图,如图9所示,本实施例提供的服务器可以包括:存储器310、处理器320和通信模块330等部件。
其中,存储器310可用于存储计算机程序以及模块,处理器320通过运行存储在存储器310的计算机程序以及模块可以执行上述方法实施例中服务器所执行的方法。存储器310可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据服务器的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器310可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
处理器320是服务器的控制中心,利用各种接口和线路连接整个服务器的各个部分,通过运行或执行存储在存储器310内的软件程序和/或模块,以及调用存储在存储器310内的数据,执行服务器的各种功能和处理数据,从而对服务器进行整体监控。可选的,处理器320可包括一个或多个处理单元。
通信模块330可以提供应用在服务器上的包括无线局域网(Wireless Local Area Networks,WLAN)(如Wi-Fi网络)、蓝牙、Zigbee、移动通信网络、全球导航卫星系统(global navigation satellite system,GNSS)、调频(frequency modulation,FM)、NFC和红外技术(infrared,IR)等通信的解决方案。通信模块330可以是集成至少一个通信处理模块的一个或多个器件。该通信模块330可以包括天线,可以通过天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器。通信模块330还可以从处理器320接收待发送的信号,对其进行调频、放大,经天线转为电磁波辐射出去。服务器可以通过该通信模块330与终端设备进行通信。
本领域技术人员可以理解,图9仅仅是服务器的举例,并不构成对服务器的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
其中,服务器可以是一个同时具备下载服务和拆包功能的服务器,也可以包括两个:一个为提供RPK包下载服务的应用市场服务器,一个为提供拆包功能的快应用服务器。
服务器可以是单独的服务器,也可以是服务器集群,即上述同时具备下载服务和拆包功能的服务器、应用市场服务器和快应用服务器均可以是服务器集群。
本实施例提供的终端设备可以执行上述方法实施例,其实现原理与技术效果类似,此处不再赘述。
本申请实施例还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述方法实施例所述的方法。
本申请实施例还提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行时实现上述方法实施例所述的方法。
本申请实施例还提供一种芯片系统,包括处理器,所述处理器与存储器耦合,所述处 理器执行存储器中存储的计算机程序,以实现上述方法实施例所述的方法。其中,所述芯片系统可以为单个芯片,或者多个芯片组成的芯片模组。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如软盘、硬盘或磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质可以包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
在本申请中出现的对步骤进行的命名或者编号,并不意味着必须按照命名或者编号所指示的时间/逻辑先后顺序执行方法流程中的步骤,已经命名或者编号的流程步骤可以根据要实现的技术目的变更执行次序,只要能达到相同或者相类似的技术效果即可。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
在本申请所提供的实施例中,应该理解到,所揭露的装置/设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
应当理解,在本申请说明书和所附权利要求书的描述中,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或模块的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或模块,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或模块。
在本申请的描述中,除非另有说明,“/”表示前后关联的对象是一种“或”的关系,例如,A/B可以表示A或B;本申请中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。
并且,在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。“以下至少一项”或其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例 如,a,b,或c中的至少一项,可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。
Claims (24)
- 一种快应用处理方法,应用于终端设备,其特征在于,所述方法包括:响应于针对目标快应用的页面打开操作,向服务器发送预处理数据请求;接收所述服务器返回的预处理数据,所述预处理数据中包括目标脚本文件的执行结果,所述目标脚本文件为所述目标快应用中目标页面对应的脚本文件;根据所述预处理数据生成并显示所述目标页面。
- 根据权利要求1所述的方法,其特征在于,所述执行结果中包括第一指令和第二指令,所述第一指令为所述目标脚本文件中已执行的脚本指令对应的执行结果,所述第二指令为所述目标脚本文件中待执行的脚本指令;所述根据所述预处理数据生成并显示所述目标页面,包括:通过脚本引擎执行所述第二指令,得到第三指令;根据所述第一指令和所述第三指令生成并显示所述目标页面。
- 根据权利要求2所述的方法,其特征在于,所述第二指令中的输入参数包括所述终端设备的设备参数和/或所述目标快应用对应的第三方服务器提供的运行数据。
- 根据权利要求2或3所述的方法,其特征在于,所述第二指令中包括待执行标记,所述终端设备在检测到所述待执行标记时,通过脚本引擎执行检测到的待执行标记对应的第二指令。
- 根据权利要求1-4任一项所述的方法,其特征在于,在所述服务器中存在所述预处理数据的情况下,向所述服务器发送所述预处理数据请求。
- 根据权利要求1-5任一项所述的方法,其特征在于,所述目标页面为所述目标快应用的首页。
- 根据权利要求6所述的方法,其特征在于,所述方法还包括:向所述服务器发送所述目标快应用对应的应用程序包下载请求;接收所述服务器返回的所述目标快应用的应用程序包;在所述服务器中不存在所述预处理数据的情况下,根据所述目标快应用的应用程序包生成并显示所述目标快应用的首页。
- 根据权利要求7所述的方法,其特征在于,所述终端设备是根据快应用列表预处理结果确定所述服务器中是否存在所述预处理数据的,所述快应用列表预处理结果是所述终端设备从所述服务器获取的;所述快应用列表预处理结果中包括至少一个快应用的预处理结果,每个快应用的预处理结果用于指示所述服务器中是否存在所述快应用的首页对应的脚本文件的执行结果。
- 根据权利要求6-8任一项所述的方法,其特征在于,在首次启动所述目标快应用的情况下,向所述服务器发送所述预处理数据请求。
- 根据权利要求1-9任一项所述的方法,其特征在于,所述预处理数据中还包括所述目标快应用的应用程序包中的公共资源文件。
- 一种快应用处理方法,应用于服务器,其特征在于,所述方法包括:接收终端设备发送的目标快应用对应的预处理数据请求;向所述终端设备返回所述预处理数据请求对应的预处理数据,所述预处理数据中包括目标脚本文件的执行结果,所述目标脚本文件为所述目标页面对应的脚本文件。
- 根据权利要求11所述的方法,其特征在于,所述执行结果中包括第一指令和第二指令,所述第一指令为所述目标脚本文件中已执行的脚本指令对应的执行结果,所述第二指令为所述目标脚本文件中待执行的脚本指令。
- 根据权利要求12所述的方法,其特征在于,所述第二指令中的输入参数包括所述终端设备的设备参数和/或所述目标快应用对应的第三方服务器提供的运行数据。
- 根据权利要求12或13所述的方法,其特征在于,所述第二指令中包括待执行标记,所述待执行标记用于指示所述第二指令待执行。
- 根据权利要求11-14任一项所述的方法,其特征在于,在所述接收终端设备发送的目标快应用对应的预处理数据请求之前,所述方法还包括:根据所述目标快应用的应用程序包确定所述目标脚本文件;通过脚本引擎执行所述目标脚本文件,得到所述目标脚本文件的执行结果。
- 根据权利要求11-15任一项所述的方法,其特征在于,所述方法还包括:接收所述终端设备发送的应用程序包下载请求;向所述终端设备返回所述应用程序包下载请求对应的应用程序包。
- 根据权利要求11-16任一项所述的方法,其特征在于,所述目标页面为所述目标快应用的首页。
- 根据权利要求17所述的方法,其特征在于,所述方法还包括:向所述终端设备发送快应用列表预处理结果,所述快应用列表预处理结果中包括至少一个快应用的预处理结果,每个快应用的预处理结果用于指示所述服务器中是否存在所述快应用的首页对应的脚本文件的执行结果。
- 根据权利要求11-18任一项所述的方法,其特征在于,所述预处理数据中还包括所述目标快应用的应用程序包中的公共资源文件。
- 一种快应用系统,其特征在于,包括:终端设备和服务器,其中:所述终端设备用于:响应于针对目标快应用的页面打开操作,向服务器发送预处理数据请求;所述服务器用于:接收终端设备发送的目标快应用对应的预处理数据请求;并向所述终端设备返回所述预处理数据请求对应的预处理数据,所述预处理数据中包括目标脚本文件的执行结果,所述目标脚本文件为所述目标页面对应的脚本文件;所述终端设备还用于:接收所述服务器返回的预处理数据,并根据所述预处理数据生成并显示所述目标页面。
- 一种电子设备,其特征在于,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在调用所述计算机程序时执行如权利要求1-19任一项所述的方法。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-19任一项所述的方法。
- 一种计算机程序产品,其特征在于,当计算机程序产品在电子设备上运行时,使得电子设备执行如权利要求1-19任一项所述的方法。
- 一种芯片系统,其特征在于,所述芯片系统包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现如权利要求1-19任一项所述的方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US18/292,672 US20240338227A1 (en) | 2021-07-30 | 2022-07-18 | Quick Application Processing Method, Electronic Device, and Quick Application System |
EP22848320.2A EP4354286A4 (en) | 2021-07-30 | 2022-07-18 | FAST APPLICATION PROCESSING METHOD, ELECTRONIC DEVICE AND FAST APPLICATION SYSTEM |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110873293.4 | 2021-07-30 | ||
CN202110873293.4A CN115686659A (zh) | 2021-07-30 | 2021-07-30 | 快应用处理方法、电子设备与快应用系统 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023005715A1 true WO2023005715A1 (zh) | 2023-02-02 |
Family
ID=85059438
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/106303 WO2023005715A1 (zh) | 2021-07-30 | 2022-07-18 | 快应用处理方法、电子设备与快应用系统 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20240338227A1 (zh) |
EP (1) | EP4354286A4 (zh) |
CN (1) | CN115686659A (zh) |
WO (1) | WO2023005715A1 (zh) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117827228B (zh) * | 2023-02-15 | 2024-10-18 | 华为技术有限公司 | 快应用部署方法及相关设备 |
CN117130688B (zh) * | 2023-09-06 | 2024-05-24 | 南京荣耀软件技术有限公司 | 快应用卡片加载方法、电子设备及存储介质 |
CN117666993B (zh) * | 2023-10-20 | 2024-11-08 | 南京荣耀软件技术有限公司 | 基于快应用卡片显示地图的方法、设备、服务器及系统 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110442811A (zh) * | 2019-08-14 | 2019-11-12 | 广州虎牙科技有限公司 | 一种页面的处理方法、装置、计算机设备和存储介质 |
CN111052072A (zh) * | 2018-03-28 | 2020-04-21 | 华为技术有限公司 | 一种免安装应用程序下载方法及装置 |
CN112114808A (zh) * | 2020-09-29 | 2020-12-22 | 深圳市欢太科技有限公司 | 页面渲染方法、装置、电子设备 |
CN112650540A (zh) * | 2019-09-26 | 2021-04-13 | 华为技术有限公司 | 一种启动快应用的方法及相关装置 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109388453B (zh) * | 2018-09-07 | 2020-05-12 | Oppo广东移动通信有限公司 | 应用页面的展示方法、装置、存储介质和电子设备 |
-
2021
- 2021-07-30 CN CN202110873293.4A patent/CN115686659A/zh active Pending
-
2022
- 2022-07-18 WO PCT/CN2022/106303 patent/WO2023005715A1/zh active Application Filing
- 2022-07-18 EP EP22848320.2A patent/EP4354286A4/en active Pending
- 2022-07-18 US US18/292,672 patent/US20240338227A1/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111052072A (zh) * | 2018-03-28 | 2020-04-21 | 华为技术有限公司 | 一种免安装应用程序下载方法及装置 |
CN110442811A (zh) * | 2019-08-14 | 2019-11-12 | 广州虎牙科技有限公司 | 一种页面的处理方法、装置、计算机设备和存储介质 |
CN112650540A (zh) * | 2019-09-26 | 2021-04-13 | 华为技术有限公司 | 一种启动快应用的方法及相关装置 |
CN112114808A (zh) * | 2020-09-29 | 2020-12-22 | 深圳市欢太科技有限公司 | 页面渲染方法、装置、电子设备 |
Non-Patent Citations (1)
Title |
---|
See also references of EP4354286A4 |
Also Published As
Publication number | Publication date |
---|---|
EP4354286A1 (en) | 2024-04-17 |
US20240338227A1 (en) | 2024-10-10 |
CN115686659A (zh) | 2023-02-03 |
EP4354286A4 (en) | 2024-08-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023005715A1 (zh) | 快应用处理方法、电子设备与快应用系统 | |
WO2020108356A1 (zh) | 一种应用显示方法及电子设备 | |
WO2021023220A1 (zh) | 一种内容接续方法、系统及电子设备 | |
WO2021027630A1 (zh) | 补丁方法、相关装置及系统 | |
CN113961157B (zh) | 显示交互系统、显示方法及设备 | |
WO2021159746A1 (zh) | 文件共享方法、系统及相关设备 | |
WO2021017894A1 (zh) | 一种使用远程sim模块的方法及电子设备 | |
WO2022078295A1 (zh) | 一种设备推荐方法及电子设备 | |
CN112130788A (zh) | 一种内容分享方法及其装置 | |
WO2022179275A1 (zh) | 终端应用控制的方法、终端设备及芯片系统 | |
WO2022166619A1 (zh) | 二维码识别方法及相关装置 | |
WO2020134892A1 (zh) | 一种媒体文件裁剪的方法、电子设备和服务器 | |
WO2021104259A1 (zh) | 一种快应用与原生应用间数据共享的方法及终端 | |
WO2020233556A1 (zh) | 一种通话内容处理方法和电子设备 | |
WO2022156535A1 (zh) | 分布式应用的处理方法和装置 | |
WO2024037032A1 (zh) | 账号登录的方法及电子设备 | |
WO2021042991A1 (zh) | 一种非侵入式交互方法及电子设备 | |
WO2022253158A1 (zh) | 一种用户隐私保护方法及装置 | |
WO2022228065A1 (zh) | 功能跳转方法及电子设备 | |
WO2022033432A1 (zh) | 内容推荐方法、电子设备和服务器 | |
WO2021057390A1 (zh) | 一种启动快应用的方法及相关装置 | |
WO2023029916A1 (zh) | 批注展示方法、装置、终端设备及可读存储介质 | |
WO2022111664A1 (zh) | 打补丁的方法、相关设备及系统 | |
WO2022062902A1 (zh) | 一种文件传输方法和电子设备 | |
CN115268710A (zh) | 应用程序的登录方法、相关装置和系统 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22848320 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2022848320 Country of ref document: EP |
|
ENP | Entry into the national phase |
Ref document number: 2022848320 Country of ref document: EP Effective date: 20240111 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |