WO2021057390A1 - 一种启动快应用的方法及相关装置 - Google Patents

一种启动快应用的方法及相关装置 Download PDF

Info

Publication number
WO2021057390A1
WO2021057390A1 PCT/CN2020/112300 CN2020112300W WO2021057390A1 WO 2021057390 A1 WO2021057390 A1 WO 2021057390A1 CN 2020112300 W CN2020112300 W CN 2020112300W WO 2021057390 A1 WO2021057390 A1 WO 2021057390A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
electronic device
script
acceleration
quick
Prior art date
Application number
PCT/CN2020/112300
Other languages
English (en)
French (fr)
Inventor
郁利涛
吴勇辉
孙斐
李国强
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP20868733.5A priority Critical patent/EP4024208B1/en
Priority to US17/763,842 priority patent/US20220292141A1/en
Publication of WO2021057390A1 publication Critical patent/WO2021057390A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/046Interoperability with other network applications or services

Definitions

  • This application relates to the field of electronic technology, and in particular to a method and related devices for starting a quick application.
  • Quick application is an application that does not need to be installed in advance and is downloaded immediately when the user uses it. You need to download an application package before using it for the first time. After clicking the quick app to the first screen (the initial interface displayed when the application is started) rendering is complete, you need to download the application package and request the data required for the first screen display (for example, news applications need to request a news list from a third-party server, etc.) data). Since the uniform resource locator (URL) corresponding to the data required for the first screen display of the quick app needs to be parsed from the application package, it takes a long time to start the quick app for the first time.
  • URL uniform resource locator
  • a list of URLs corresponding to the data required for the first screen display during the quick application startup process is generally pre-stored in the application server.
  • the engine After the engine running the fast application is started, the engine obtains a list of URLs corresponding to all the fast applications from the application server.
  • the engine After the user clicks on a quick application for the first time, while the mobile phone downloads the application package, the engine can obtain the data required by the quick application from the third-party server according to the URL corresponding to the quick application, so as to reduce the time to start the quick application.
  • This method of pre-stored URL list requires manual maintenance, which easily leads to the problem of incorrect URLs obtained.
  • the present application provides a method and related device for starting a quick application, which can improve the efficiency of starting a quick application.
  • an embodiment of the present application provides a method for starting a quick application.
  • the method includes: the electronic device sends a first request to an application server, the first request is used to instruct the application server to send one or more fast application acceleration scripts to the electronic device; the electronic device receives the application server The sent acceleration scripts of the one or more fast applications; the first operation for the target fast application is detected, and in response to the first operation, the electronic device sends a second request to the application server, the first Two requests are used to request the application package of the target fast application, the acceleration script of the target fast application is included in the acceleration script of the one or more fast applications; in response to the first operation, the electronic device runs all The acceleration script of the target fast application obtains a first uniform resource locator URL, and obtains first data from a third-party server according to the first URL; the electronic device receives the target fast application sent by the application server The electronic device runs the application package of the target fast application to obtain the second URL; when the first URL is the same as the second URL, the electronic device generate
  • the method before the electronic device sends the first request to the application server, the method further includes: the electronic device receives instant messaging information including the one or more quick applications.
  • the method before the electronic device sends the first request to the application server, the method further includes: the electronic device detects a user operation acting on the icon of the one or more quick applications.
  • the method before the electronic device sends the first request to the application server, the method further includes: the electronic device receives the input quick application name information, the quick application name information and the one or Multiple fast applications have a corresponding relationship.
  • the method further includes: when the first URL and the second URL are not the same, the electronic device obtains second data from the third-party server according to the second URL; The electronic device generates and displays the first screen of the target quick application according to the second data.
  • the method further includes: when the first URL is the same as the second URL, the electronic device sends to the application server information indicating that the acceleration script of the target fast application hits successfully; when When the first URL and the second URL are not the same, the electronic device sends to the application server information indicating that the acceleration script of the target fast application fails to hit.
  • the electronic device runs the acceleration script of the target fast application to obtain the first uniform resource locator URL, which includes: the electronic device obtains device data according to the acceleration script of the target fast application, and The device data includes one or more of the media access control MAC address, engine version number, Internet Protocol IP address, operating system version, address information, network type, and manufacturer brand of the electronic device; The electronic device obtains the first URL according to the acceleration script of the target fast application and the device data.
  • an embodiment of the present application provides a method for starting a quick application.
  • the method includes: an application server receives an application package of a fast application; the application server generates an acceleration script of the fast application according to the application package; the application server receives a first request sent by a first electronic device, and the first request A request is used to instruct the application server to send the acceleration script of the fast application to the first electronic device; the application server sends the acceleration script of the fast application to the first electronic device according to the first request .
  • the method further includes: the application server receives a hit result of the acceleration script of the fast application sent by one or more second electronic devices; and the application server calculates the hit result according to the hit result.
  • the hit rate of the accelerated script of the fast application before the application server sends the accelerated script of the fast application to the first electronic device according to the first request, the method further includes: the application server determines the The hit rate of the accelerated script of the quick application is not less than the preset value.
  • the application server generating the acceleration script of the quick application according to the application package includes: parsing the application package to obtain the first source code corresponding to the display of the quick application homepage; and parsing the The first source code is used to obtain the abstract syntax tree; the statistical upload code is injected into one or more nodes of the abstract syntax tree to obtain the second source code; the processed application package is obtained according to the second source code; The processed application package obtains the critical path indicated by the statistical upload code; the third source code is selected from the first source code according to the critical path; the acceleration of the fast application is obtained according to the third source code script.
  • an embodiment of the present application provides a method for starting a quick application.
  • the method includes: the integrated development platform receives the first source code of the fast application input by the user; the integrated development platform generates the application package of the fast application according to the first source code of the fast application; The first source code of the fast application generates the acceleration script of the fast application; the integrated development platform sends the application package of the fast application and the acceleration script of the fast application to the application server.
  • the integrated development platform generating the acceleration script of the quick application according to the first source code of the quick application includes: selecting from the first source code corresponding to the display on the home page of the quick application Second source code; parse the second source code to obtain an abstract syntax tree; inject statistical upload code at one or more nodes of the abstract syntax tree to obtain the third source code; obtain according to the third source code The processed application package; run the processed application package to obtain the critical path indicated by the statistical upload code; select the fourth source code from the first source code according to the critical path; according to the fourth source The code obtains the acceleration script of the fast application.
  • an embodiment of the present application provides an electronic device.
  • the electronic device includes one or more processors and a memory; the memory is coupled with the one or more processors, the memory is used to store program codes, and the one or more processors call the program codes So that the electronic device performs the following operations: sending a first request to the application server, where the first request is used to instruct the application server to send one or more fast application acceleration scripts to the electronic device; and receiving the application server sent The acceleration script of the one or more fast applications; the first operation for the target fast application is detected, and in response to the first operation, a second request is sent to the application server, the second request is used to request In the application package of the target fast application, the acceleration script of the target fast application is included in the acceleration script of the one or more fast applications; in response to the first operation, run the acceleration script of the target fast application to obtain A first uniform resource locator URL, and obtain first data from a third-party server according to the first URL; receive the application package of the target fast application sent by the application server; run
  • the one or more processors invoke the program code to cause the electronic device to further perform the following operations: receiving instant messaging information including the one or more fast applications.
  • the one or more processors invoke the program code to cause the electronic device to also perform the following operation: detecting a user operation acting on the icon of the one or more quick applications.
  • the one or more processors call the program code so that the electronic device further performs the following operations: receiving input quick application name information, the quick application name information and the one or Multiple fast applications have a corresponding relationship.
  • the one or more processors call the program code to cause the electronic device to further perform the following operations: when the first URL and the second URL are not the same, according to the first URL Second, the URL obtains second data from the third-party server; and generates and displays the first screen of the target quick application according to the second data.
  • the one or more processors call the program code to cause the electronic device to further perform the following operations: when the first URL is the same as the second URL, send an instruction to the application server Information indicating that the acceleration script of the target fast application hits successfully; when the first URL and the second URL are not the same, information indicating that the acceleration script of the target fast application fails to hit the application server is sent to the application server.
  • the one or more processors call the program code to cause the electronic device to further perform the following operations: obtain device data according to the acceleration script of the target fast application, and the device data includes the One or more of the media access control MAC address, engine version number, Internet Protocol IP address, operating system version, address information, network type, manufacturer brand of the electronic device; fast application according to the target The acceleration script of and the device data to obtain the first URL.
  • an application server wherein the application server includes one or more processors and memories; the memory is coupled with the one or more processors, and the memory is used to store program codes,
  • the one or more processors call the program code to cause the application server to perform the following operations: receive an application package of a fast application; generate an acceleration script of the fast application according to the application package; receive a transmission from the first electronic device The first request is used to instruct the application server to send the acceleration script of the fast application to the first electronic device; send the fast application to the first electronic device according to the first request The accelerated script of the application.
  • the one or more processors call the program code so that the application server further performs the following operations: receiving a hit of the quick application acceleration script sent by one or more second electronic devices Result; Calculate the hit rate of the accelerated script of the fast application according to the hit result; determine that the hit rate of the accelerated script of the fast application is not less than a preset value.
  • the one or more processors invoke the program code to cause the application server to perform the following operations: parse the application package to obtain the first source code corresponding to the display on the homepage of the quick application; Parse the first source code to obtain an abstract syntax tree; inject statistical upload code at one or more nodes of the abstract syntax tree to obtain a second source code; obtain a processed application package according to the second source code Run the processed application package to obtain the critical path indicated by the statistical upload code; select the third source code from the first source code according to the critical path; obtain the fast source code according to the third source code The accelerated script of the application.
  • an embodiment of the present application provides an integrated development platform, wherein the integrated development platform includes one or more processors and memories; the memory is coupled with the one or more processors, so The memory is used to store program code, and the one or more processors call the program code to cause the integrated development platform to perform the following operations: receive the first source code of the fast application input by the user; The first source code generates the application package of the fast application; generates the acceleration script of the fast application according to the first source code of the fast application; sends the application package of the fast application and the acceleration of the fast application to the application server script.
  • the one or more processors call the program code to cause the integrated development platform to further perform the following operations: select the first source code corresponding to the first page displayed on the quick application homepage from the first source code. Two source code; parsing the second source code to obtain an abstract syntax tree; injecting statistical upload code at one or more nodes of the abstract syntax tree to obtain a third source code; processing according to the third source code After the application package; run the processed application package to obtain the critical path indicated by the statistical upload code; select the fourth source code from the first source code according to the critical path; according to the fourth source code Obtain the accelerated script of the fast application.
  • an embodiment of the present application provides a computer program product containing instructions, characterized in that, when the computer program product runs on an electronic device, the electronic device is caused to execute the above-mentioned first to third aspects.
  • an embodiment of the present application provides a computer-readable storage medium, including instructions, characterized in that, when the instructions are executed on an electronic device, the electronic device is caused to perform operations as described in the first to third aspects.
  • the electronic device requests one or more acceleration scripts of the fast application from the application server; the first operation for the target fast application is detected, and in response to the first operation, the electronic device requests the target from the application server
  • the application package of the fast application, the acceleration script of the target fast application is included in the acceleration script of the one or more fast applications; in response to the first operation, the electronic device runs the acceleration script of the target fast application to obtain the first URL, And obtain the first data according to the first URL; the electronic device can generate and display the first screen of the target quick application according to the first data. In this way, the data required for the first screen display of the quick application can be obtained in advance through the acceleration script, and the efficiency of starting the quick application can be improved.
  • FIG. 1A is a schematic diagram of an application system provided by an embodiment of the present application.
  • FIG. 1B is a flowchart of the first startup of a quick application provided by an embodiment of the present application
  • FIG. 1C is a schematic diagram of a search interface of a quick application provided by an embodiment of the present application.
  • FIG. 1D is a schematic diagram of a user interface for displaying an application list provided by an embodiment of the present application
  • FIG. 2A is a schematic structural diagram of an electronic device 10 provided by an embodiment of the present application.
  • FIG. 2B is a schematic structural diagram of an electronic device 20 provided by an embodiment of the present application.
  • 2C is a software structure block diagram of an electronic device 10 provided by an embodiment of the present application.
  • FIG. 2D is a software structure block diagram of an application server 200 provided by an embodiment of the present application.
  • 2E is a software structure block diagram of a development device 100 provided by an embodiment of the present application.
  • Fig. 3A is a flowchart of a method for starting a quick application provided by an embodiment of the present application
  • 3B is a schematic diagram of a quick application startup process and an execution process of an accelerated script provided by an embodiment of the present application;
  • 4A is a schematic diagram of a chat interface of an instant messaging application provided by an embodiment of the present application.
  • 4B is a schematic diagram of another quick application search interface in an application store provided by an embodiment of the present application.
  • 4C is a schematic diagram of a detail page of a quick application provided by an embodiment of the present application.
  • 5A is a software structure block diagram of an accelerated script generation module provided by an embodiment of the present application.
  • Fig. 5B is a software structure block diagram of another accelerated script generation module provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes, and cannot be understood as implying or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with “first” and “second” may explicitly or implicitly include one or more of these features.
  • the user interface (UI) in the embodiments of the present application is a medium interface for interaction and information exchange between an application or an operating system and a user, and it realizes the conversion between the internal form of information and the form acceptable to the user.
  • the user interface of the application is the source code written in a specific computer language such as java, extensible markup language (XML), etc.
  • the interface source code is parsed and rendered on the electronic device 300 device, and finally presented as identifiable by the user Content, such as pictures, text, buttons and other controls.
  • Controls are the basic elements of the user interface. Typical controls include buttons, widgets, toolbars, menu bars, text boxes, and scroll bars. scrollbar), pictures and text.
  • the attributes and content of the controls in the interface are defined by tags or nodes.
  • XML specifies the controls contained in the interface through nodes such as ⁇ Textview>, ⁇ ImgView>, and ⁇ VideoView>.
  • a node corresponds to a control or attribute in the interface. After the node is parsed and rendered, it is presented as user-visible content.
  • applications such as hybrid applications, usually include web pages in their interfaces.
  • a webpage also called a page, can be understood as a special control embedded in the application program interface.
  • the webpage is source code written in a specific computer language, such as hypertext markup language (HTML), cascading style Tables (cascading style sheets, CSS), java scripts (JavaScript, JS), etc.
  • web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to the browser.
  • the specific content contained in a web page is also defined by tags or nodes in the source code of the web page. For example, HTML defines the elements and attributes of the web page through ⁇ p>, ⁇ img>, ⁇ video>, and ⁇ canvas>.
  • GUI graphical user interface
  • IDE Integrated development environment
  • IDE is an application software that assists program developers to develop software. Inside the development tool, it can assist in writing source code text, compiling and packaging it into a usable program, and some can also design graphical interfaces.
  • IDE usually includes programming language editor, automatic build tool, debugger, etc. Some IDEs include a compiler/interpreter, some do not. These IDEs can compile code by calling third-party compilers.
  • the IDE will also include a version control system and some tools that can design a graphical user interface. Many modern IDEs that support object-oriented also include category browsers, object viewers, object structure diagrams, and so on.
  • the fast application is usually developed in a specific IDE.
  • the IDE may be the IDE of Huawei fast application.
  • the engine is the core component of the development program or system on the electronic platform. Using the engine, developers can quickly establish and lay the functions required by the program, or use it to assist the operation of the program.
  • an engine is a supporting part of a program or a set of systems. Common program engines include game engines, search engines, antivirus engines, etc. In the embodiment of the present application, the fast application needs to be interpreted and executed by a special engine.
  • FIG. 1A is a schematic diagram of an application system provided by an embodiment of the present application.
  • the application system 10 may include a development device 100, an application server 200, a smart terminal 300, and a third-party server 400. among them:
  • the development device 100 may be an electronic device equipped with an IDE, such as a notebook computer, a desktop computer, and the like.
  • a desktop computer is taken as an example in FIG. 1A.
  • Program developers can use the development device 100 to write the source code of the fast application. After the source code of the fast application is written, the development device 100 may generate application packages of the fast application according to the source code, and upload these application packages to the application server 200 for users to download and use.
  • the application package is a collection of files that can be decompressed by itself, and the files needed to run the fast application can be parsed.
  • the application server 200 can receive and store the application package of the quick application uploaded by the development device 100, and provide a download service of the quick application package for the smart terminal 300. Specifically, the application server 200 may receive a download request sent by the smart terminal 300, and the download request includes the identifier of the fast application. The application server 200 sends the application package of the fast application to the smart terminal 300 according to the identifier of the fast application.
  • the smart terminal 300 may be an electronic device capable of supporting fast application operation, such as a smart phone or a tablet computer.
  • a smart phone is taken as an example.
  • the user can download the application package of the quick application from the application server 200 through the smart terminal 300.
  • the third-party server 400 can provide data required by the quick application during runtime, for example, can provide data such as news list and news content for the news quick application.
  • the smart terminal 300 parses out the URL corresponding to the data required for the first screen display of the application, and requests the data from the third-party server 400 according to the URL.
  • the first startup process of the quick application can refer to the flowchart shown in FIG. 1B.
  • the process includes the following steps:
  • FIG. 1C a schematic diagram of a search interface of a quick application provided by an embodiment of the present application.
  • the user interface 31 exemplarily shown in FIG. 1C, the user interface 31 includes an input box 300 and a keyboard 306.
  • the smart terminal 300 may send a request to the application server 200, the request containing the name input by the user, and the request is used to instruct the application server 200 to send to the smart terminal 300 application information of an applet matching the input name.
  • the application server 200 sends the application information of the applet matching the name input by the user to the smart terminal 300.
  • the application server 200 determines the applet that matches the name input by the user according to the name input by the user, and then sends the application information of the applet that matches the name input by the user to the smart terminal 300.
  • the smart terminal 300 After receiving the application information sent by the application server 200, the smart terminal 300 displays an application list according to the application information.
  • the user interface for displaying the application list may refer to the user interface 32 exemplarily shown in FIG. 1D.
  • the user interface 32 includes two list options, an option 320 and an option 322.
  • the application server 200 sends the application package of the "news network” fast application to the smart terminal 300.
  • the application server 200 stores the application package of the "news network” fast application.
  • the application package of the "news net” fast application is sent by the development device 100 to the application server 200.
  • the smart terminal 300 After receiving the application package sent by the application server 200, the smart terminal 300 initializes the quick application, and parses the URL of the data required for the first screen display of the quick application from the application package.
  • the smart terminal 300 requests the third-party server 400 to download the data required for the first screen display of the quick application according to the URL.
  • the engine of KuaiApp in the WeChat application determines that there is no data corresponding to the URL locally.
  • the third-party server 400 sends the data to the smart terminal 300.
  • the smart terminal 300 After receiving the data sent by the third-party server 400, the smart terminal 300 renders, generates and displays the first screen of the "News Network” fast application according to the data.
  • the smart terminal 300 needs to download the application package of the "news network” fast application, and then download the data required for the first screen display from the third-party server 400 according to the URL parsed from the application package, resulting in the first startup
  • the fast application of "News Network” takes a long time.
  • the smart terminal 300 in response to the click operation, the smart terminal 300 also requests the application server for acceleration scripts of two quick applications in the application list.
  • the acceleration script can parse out the URL corresponding to the data required for the first screen display of the quick application corresponding to the acceleration script.
  • the smart terminal 300 requests the application server 200 to download the application package of the quick application corresponding to the option 320.
  • the smart terminal executes the acceleration script and sends the third party to the third party according to the parsed URL
  • the server 400 requests the required data to be displayed on the first screen. After the application package is downloaded, the smart terminal 300 initializes the quick application.
  • the engine can send the downloaded data to the quick application, so that the quick application can render and generate according to the downloaded data And display the first screen. In this way, the time to download the data required for the first screen display can be saved, and the efficiency of launching fast applications can be improved.
  • the smart terminal 300 may be an electronic device.
  • the electronic device 10 involved in the embodiment of the present application will be introduced below. Please refer to FIG. 2A.
  • FIG. 2A is a schematic structural diagram of an electronic device 10 according to an embodiment of the present application.
  • the electronic device 10 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, buttons 190, motor 191, indicator 192, camera 193, display 194, And subscriber identification module (subscriber identification module, SIM) card interface 195 and so on.
  • 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 sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the electronic device 10 shown in FIG. 2A is only an example, and the electronic device 10 may have more or fewer components than those shown in FIG. 2A, two or more components may be combined, or Can have different component configurations.
  • the various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and 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 processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 10.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that the processor 110 has just used or used cyclically. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface can 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 receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, And/or universal serial bus (USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous transmitter receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, which includes a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may couple the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through an I2C bus interface to implement the touch function of the electronic device 10.
  • the I2S interface can be used for audio communication.
  • the processor 110 may include multiple sets of I2S buses.
  • the processor 110 may be coupled with the audio module 170 through an I2S bus to implement communication between the processor 110 and the audio module 170.
  • the PCM interface can also be used for audio communication to sample, quantize and encode analog signals.
  • the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface.
  • the UART interface is a universal serial data bus used for asynchronous communication.
  • the bus can be a two-way communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 110 and the wireless communication module 160.
  • the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to realize the Bluetooth function.
  • the MIPI interface can be used to connect the processor 110 with the display screen 194, the camera 193 and other peripheral devices.
  • the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and so on.
  • the processor 110 and the display screen 194 communicate through a DSI interface to implement the display function of the electronic device 10.
  • the GPIO interface can be configured through software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 110 with the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and so on.
  • the USB interface 130 is an interface that complies with the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, and so on.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 10, and can also be used to transfer data between the electronic device 10 and peripheral devices.
  • the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely a schematic description, and does not constitute a structural limitation of the electronic device 10.
  • the electronic device 10 may also adopt different interface connection modes in the above-mentioned embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110.
  • the power management module 141 receives input from the battery 142 and/or the charge management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
  • the wireless communication function of the electronic device 10 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 10 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 10.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the wireless communication module 160 can provide applications on the electronic device 10 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • infrared technology infrared, IR
  • 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 may also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the electronic device 10 may establish a communication connection with the application server 200 and the third-party server 400 through the wireless communication module 160.
  • the antenna 1 of the electronic device 10 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 10 can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC , FM, and/or IR technology, etc.
  • the electronic device 10 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, connected to the display 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which 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 use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 10 may include one or N display screens 194, and N is a positive integer greater than one.
  • the electronic device 10 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • the camera 193 is used to capture still images or videos.
  • the electronic device 10 may include one or N cameras 193, and N is a positive integer greater than one.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 10 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the electronic device 10 may support one or more video codecs. In this way, the electronic device 10 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, and so on.
  • NPU is a neural-network (NN) computing processor.
  • applications such as intelligent cognition of the electronic device 10 can be realized, such as image recognition, face recognition, voice recognition, text understanding, and so on.
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 10.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the electronic device 10 by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the electronic device 10.
  • 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, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • the electronic device 10 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. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 10 can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the electronic device 10 answers a call or voice message, it can receive the voice by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the electronic device 10 may be provided with at least one microphone 170C.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA, CTIA
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the electronic device 10 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 10 may also calculate the touched position based on the detection signal of the pressure sensor 180A.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 10. In some embodiments, the angular velocity of the electronic device 10 around three axes (ie, x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyro sensor 180B can be used for image stabilization. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the air pressure sensor 180C is used to measure air pressure.
  • the electronic device 10 calculates the altitude based on the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
  • the magnetic sensor 180D includes a Hall sensor.
  • the electronic device 10 can use the magnetic sensor 180D to detect the opening and closing of the flip holster.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 10 in various directions (generally three axes). When the electronic device 10 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and be used in applications such as horizontal and vertical screen switching, pedometers and so on.
  • the electronic device 10 can measure the distance by infrared or laser.
  • the proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.
  • the light emitting diode may be an infrared light emitting diode.
  • the electronic device 10 emits infrared light to the outside through the light emitting diode.
  • the electronic device 10 uses a photodiode to detect infrared reflected light from nearby objects.
  • the electronic device 10 can use the proximity light sensor 180G to detect that the user holds the electronic device 10 close to the ear to talk, so as to automatically turn off the screen to save power.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 10 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 10 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photographs, fingerprint answering calls, and so on.
  • the temperature sensor 180J is used to detect temperature.
  • the electronic device 10 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be disposed on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the touch event type may be a single click event, a double click event, a long press event, a force touch event, a drag event, and so on.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 10, which is different from the position of the display screen 194.
  • the bone conduction sensor 180M can acquire vibration signals.
  • the bone conduction sensor 180M can obtain the vibration signal of the vibrating bone mass of the human voice.
  • the bone conduction sensor 180M can also contact the human pulse and receive the blood pressure pulse signal.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button. It can also be a touch button.
  • the electronic device 10 can receive key input, and generate key signal input related to user settings and function control of the electronic device 10.
  • the motor 191 can generate vibration prompts.
  • the motor 191 can be used for incoming call vibration notification, and can also be used for touch vibration feedback.
  • touch operations for different applications can correspond to different vibration feedback effects.
  • the indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, or to indicate messages, missed calls, notifications, and so on.
  • the SIM card interface 195 is used to connect to the SIM card.
  • the SIM card can be inserted into the SIM card interface 195 or pulled out from the SIM card interface 195 to achieve contact and separation with the electronic device 10.
  • the electronic device 10 may support one or N SIM card interfaces, and N is a positive integer greater than one.
  • the SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc.
  • the electronic device 10 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 10 and cannot be separated from the electronic device 10.
  • the development device 100 may be an electronic device.
  • the electronic device 20 involved in the embodiment of the present application will be introduced below. Please refer to FIG. 2B.
  • FIG. 2B is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application.
  • the electronic device 20 may be a desktop computer, a notebook computer, or other devices.
  • the electronic device 20 may include a processor 102, a memory 103, a wireless communication processing module 104, a power switch 105, an input module 106, and an output module 107. These components can be connected via a bus. among them:
  • the processor 102 can be used to read and execute computer readable instructions.
  • the processor 102 may mainly include a controller, an arithmetic unit, and a register.
  • the controller is mainly responsible for the instruction decoding, and sends out control signals for the operation corresponding to the instruction.
  • the arithmetic unit is mainly responsible for performing fixed-point or floating-point arithmetic operations, shift operations and logic operations, etc., and can also perform address operations and conversions.
  • the register is mainly responsible for storing the register operands and intermediate operation results temporarily stored during the execution of the instruction.
  • the hardware architecture of the processor 102 may be an application specific integrated circuit (ASIC) architecture, a MIPS architecture, an ARM architecture, or an NP architecture, and so on.
  • ASIC application specific integrated circuit
  • the processor 102 may be used to generate the application package of the fast application according to the source code of the fast application written by the developer.
  • the processor 102 may also be used to parse the signal received by the wireless communication processing module 104 and generate a signal that the wireless communication processing module 104 sends out.
  • the memory 103 is coupled with the processor 102, and is used to store various software programs and/or multiple sets of instructions.
  • the memory 103 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
  • the memory 103 may store an operating system, such as an embedded operating system such as windows and Android.
  • the memory 103 may also store a communication program, which may be used to communicate with the application server 200 or an additional device.
  • the wireless communication processing module 104 can provide applications on the electronic device 20, including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), BLE broadcasting, and global navigation satellite systems (global navigation satellite systems). Satellite system, GNSS), frequency modulation (FM), 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 electronic device 20 may establish a wireless communication connection with other devices through the wireless communication processing module 104, and communicate with other devices through one or more wireless communication technologies in Bluetooth or WLAN. In some embodiments, the electronic device 20 may send the application package of the fast application to the application server 200 through the wireless communication module 104.
  • the wireless communication processing module 104 may also include a cellular mobile communication processing module (not shown).
  • the cellular mobile communication processing module can communicate with other devices (such as servers) through cellular mobile communication technology.
  • the power switch 105 can be used to control the power supply to the large-screen device 200.
  • the input module 106 may be used to receive instructions input by the user.
  • the input module 106 may include one or more items such as a mouse, a keyboard, a touch pad, a touch screen, and a microphone.
  • the output module 107 can be used to output information.
  • the electronic device 20 includes one or more display screens, and the display screens can be used to display images, videos, and the like.
  • the display screen includes a display panel.
  • the display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the output module 107 may also include one or more items such as a speaker and a
  • FIG. 2B does not constitute a specific limitation on the electronic device 20.
  • the electronic device 20 may include more or fewer components than shown, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the software system of the electronic device 10 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
  • the embodiment of the present application takes an Android system with a layered architecture as an example to illustrate the software structure of the electronic device 10 by way of example.
  • FIG. 2C is a software structure block diagram of an electronic device 10 provided by an embodiment of the present application.
  • the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
  • the application layer can include a series of application packages. As shown in Figure 2C, the application package may include applications such as Quick Application Center, WeChat, Gallery, Music, Video, and SMS.
  • applications such as Quick Application Center, WeChat, Gallery, Music, Video, and SMS.
  • the fast application center can provide the functions required for the operation of the fast application.
  • the fast application center can be an application, and the fast application center can also be integrated as a function in other applications that can provide fast applications, such as WeChat, application store, Google, and so on.
  • the fast application center may include a prefetch module, an operation module, and a statistics upload module.
  • the prefetch module can obtain the first URL of the data required for the first screen display of the quick application according to the acceleration script sent by the application server 200, and obtain the first screen display from the third-party server 400 according to the first URL.
  • the required data The running module can run the quick application.
  • the running module can initialize the quick application according to the application package sent by the application server 200, and parse the second URL of the data required for the first screen display of the quick application.
  • the running module obtains the data required for the first screen display from the prefetching module.
  • the statistical upload module can feed back the hit status of the acceleration script to the application server 200 according to the first URL and the second URL. If the first URL is the same as the second URL, the application server 200 will be fed back to the application server 200 that the acceleration script of the fast application hits successfully. If the first URL and the second URL are not the same, then the fast application’s acceleration script hits failed to be fed back to the application server 200 .
  • the quick application center may not include the statistics upload module.
  • the application framework layer provides application programming interface (application programming interface, API) and programming framework for application layer applications.
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and so on.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data, and make these data accessible to applications.
  • the data may include videos, images, audios, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device 10. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager allows the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, text messages are prompted in the status bar, prompt sounds, smart terminals vibrate, and indicator lights flash.
  • Android Runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function functions that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, G.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the software architecture of the electronic device shown in FIG. 2C is only an implementation manner of the embodiment of the present application. In practical applications, the electronic device may also include more or fewer software modules, which is not limited here.
  • the smart terminal 300 may further include a display module based on the software structure shown in FIG. 2C, and the display module is used to display a corresponding user interface according to the operation of each software module.
  • the user interface displayed by the display module can refer to the user interface shown in FIG. 1C, FIG. 1D, and FIG. 4A-FIG. 4C.
  • the display module may be specifically implemented as the display screen 194 in FIG. 2A.
  • FIG. 2D is a software structure block diagram of an application server 200 provided by an embodiment of the present application.
  • the application server 200 may include an application package storage module, an accelerated script generation module, an accelerated script storage module, a data statistics module, and a distribution module.
  • the application package storage module may be used to store the application package sent by the development device 100 to the application server 200.
  • the acceleration script generation module may generate an acceleration script corresponding to the application package according to the application package in the application package storage module. Specifically, one application package corresponds to one acceleration script.
  • the acceleration script storage module may be used to store the acceleration script generated by the acceleration script generation module.
  • the application package and acceleration script of a quick application may contain the same application identifier.
  • the data statistics module can be used to calculate the hit rate of accelerated scripts.
  • the data statistics module can include an analysis module and a data storage module.
  • the data storage module can store the hit result of the acceleration script sent by the smart terminal 300.
  • the analysis module can calculate the hit rate of an accelerated script based on the hit result.
  • the issuing module may be used to receive a request sent by the smart terminal 300, and in response to the request, send an application package or an accelerated script of the fast application to the smart terminal 300.
  • the issuing module may select the application package to be sent from the application package storage module according to the application identifier in the request, or select the acceleration script to be sent from the acceleration script storage module according to the application identifier in the request. .
  • the issuing module may receive the hit rate of an accelerated script sent by the data statistics module, compare the hit rate with a preset value, and determine whether to send the accelerated script to the smart terminal 300.
  • the preset value may be 90%, or other data, which is only an example here. If the hit rate is not less than the preset value, the issuing module sends an acceleration script to the smart terminal 300. If the hit rate is less than the preset value, the issuing module does not send the acceleration script to the smart terminal 300.
  • the application server 200 may not include a data statistics module. In some embodiments, the application server 200 may not include an accelerated script generation module. In this case, the application server 200 may receive and store the acceleration script sent by the development device 100.
  • FIG. 2E is a software structure block diagram of a development device 100 provided by an embodiment of the present application.
  • the development device 100 may include a packaging module, an accelerated script generation module, and an upload module.
  • the packaging module may receive the source program (or called source code) of the fast application written by the user, and generate the application package of the fast application according to the source code.
  • the acceleration script generation module can generate the acceleration script corresponding to the quick application according to the source program of the quick application written by the user.
  • a quick application corresponds to an acceleration script.
  • the upload module may send the generated application package and acceleration script to the application server 200.
  • the development device 100 may not include an accelerated script generation module.
  • the application server 200 includes an accelerated script generation module.
  • the development device 100, the application server 200, the smart terminal 300, and the third-party server 400 introduced in the above content the method for starting an application provided by the embodiment of the present application will be described in detail below in conjunction with other drawings.
  • the quick application is started for the first time, that is, the smart terminal 300 does not store the application package of the quick application.
  • FIG. 3A is a flowchart of a method for starting a quick application according to an embodiment of the present application. The method includes the following steps:
  • the display interface of the smart terminal 300 can refer to the user interface 31 shown in FIG. 1C.
  • the application server 200 After the application server 200 receives the first request sent by the smart terminal 300, the application server 200 sends to the smart terminal 300 the application information and acceleration script of the quick application that conform to the name input by the user according to the first request.
  • the application server 200 and the smart terminal 300 have a pre-established connection relationship.
  • a Huawei mobile phone may pre-establish a connection relationship with a Huawei application server.
  • the application server 200 determines a quick application that matches the name input by the user according to the name input by the user, and then sends the application information and acceleration script of the quick application that match the name input by the user to the smart terminal 300.
  • the name of the applet that matches the name input by the user may be the same as the input name, or include all or part of the characters in the input name.
  • the application information may include the name, icon, introduction information, etc. of the quick application.
  • the name entered by the user is "news.com”
  • the small programs that match the name entered by the user determined by the application server 200 are "news.com” and "news center”.
  • the applet that conforms to the name input by the user may also include an applet of the same type as the applet corresponding to the name input by the user. For example, if the name entered by the user is "video network”, the applet that matches the name entered by the user can include “video network”, and can also include "xx player” and "Korean drama center” of the same type as “video network” ”And other fast video applications.
  • the acceleration script storage module of the application server 200 prestores multiple acceleration scripts for fast applications.
  • the issuing module of the application server 200 can select the acceleration scripts of the "news network” and the "news center” from the multiple acceleration scripts according to the determined identifications of the fast application "news network” and "news center".
  • the size of the acceleration script is generally relatively small, for example, 8 kilobytes (KB), 10 KB, and so on.
  • the delivery module of the application server 200 determines that the hit rate of the acceleration script of the "news network” is not less than a preset value. Similarly, the hit rate of "News Center” can be confirmed in the same way. In this way, the correct rate of accelerated scripts can be improved.
  • the data statistics module of the application server 200 may calculate the hit rate of an accelerated script.
  • the data statistics module can receive the hit results fed back by multiple smart terminals 300. Specifically, if the first URL obtained according to the acceleration script is the same as the second URL obtained according to the application package, it indicates that the acceleration script can obtain the correct URL for displaying the required data on the first screen of the quick application, and it is determined that the acceleration script hits successfully . If the first URL and the second URL are not the same, it indicates that the URL of the data required for the first screen display of the quick application obtained by the acceleration script is wrong, and it is determined that the acceleration script has failed to hit.
  • the statistics upload module of the smart terminal 300 can send the hit result of the acceleration script to the application server 200 in real time. For example, after performing step S309 of this embodiment, the smart terminal 300 may send the hit result of the accelerated script of the "news network" to the application server 200 this time.
  • the data storage module stores 1000 hit results of the acceleration script of "News Network". Among them, there are 968 successful hits, then The hit rate obtained by the analysis module based on these hit results is 96.8%. If the preset value is 90%, the issuing module determines that the hit rate is greater than the preset value, and the issuing module sends the acceleration script of the "news network" to the smart terminal 300.
  • the data statistics module may calculate the hit rate of an accelerated script of the "news network" every preset time period.
  • the issuing module of the application server 200 determines that the size of the accelerated script of the "news network" is not greater than a preset Threshold.
  • the preset threshold may be 15KB, 20KB, and so on. In this way, it can be ensured that the size of the accelerated script sent is small and the download speed is faster.
  • the smart terminal 300 After receiving the application information and the acceleration script sent by the application server 200, the smart terminal 300 displays an application list according to the application information, and stores the acceleration script.
  • the user interface 32 For the user interface displaying the application list of the quick application, refer to the user interface 32 exemplarily shown in FIG. 1D.
  • the user interface 32 includes two list options, an option 320 and an option 322.
  • the smart terminal 300 stores the acceleration script in a cache, and in this way, the acceleration script can be quickly read.
  • the second request may include the logo of "news network”.
  • the running module of the quick application center of the smart terminal 300 sends a second request to the application server 200.
  • the application server 200 After the application server 200 receives the second request sent by the smart terminal 300, the application server 200 sends the application package of "News Network" to the smart terminal 300 according to the second request.
  • the application package storage module of the application server 200 pre-stores multiple fast application application packages.
  • the issuing module of the application server 200 may select the application package of the "news network” from the multiple application packages according to the identifier of the "news network" in the second request.
  • the smart terminal 300 In response to the click operation, the smart terminal 300 also runs the acceleration script of the "news network" to obtain the first URL of the data required for the first screen of the quick application to be displayed.
  • the smart terminal 300 can obtain the media access control address (MAC address), engine version number, and internet protocol address (IP address) of the smart terminal 300 according to the accelerated script of the "news network”. , Operating system version, address information where the smart terminal 300 is located (for example, HANGZHOU, GUANGZHOU, etc.), the current network type of the smart terminal 300 (for example, 3G, 4G, WIFI, etc.), and the manufacturer brand of the smart terminal 300 (For example, Huawei), and then generate the first URL according to the acquired information.
  • MAC address media access control address
  • IP address internet protocol address
  • the smart terminal 300 sends a third request to the third-party server 400 according to the first URL, where the third request is used to request to download the data required for the first screen display of the quick application.
  • the prefetch module of the quick application center of the smart terminal 300 can run the acceleration script of the "news network", and send the third request to the third-party server 400 according to the first URL.
  • the third-party server 400 After the third-party server 400 receives the third request sent by the smart terminal 300, the third-party server 400 sends to the smart terminal 300 data required for the first screen display of the “news network” according to the third request.
  • the prefetch module of the quick application center of the smart terminal 300 can store the data required for the first screen display of the "news network" sent by the third-party server 400.
  • the storage module of the smart terminal 300 stores the data, and the prefetch module can record the storage path of the data.
  • the smart terminal 300 After the smart terminal 300 receives the application package of "News Network" sent by the application server 200, the smart terminal 300 initializes the application package and obtains the second URL of the data required for the first screen display of the quick application.
  • the operating module of the quick application center of the smart terminal 300 may initialize the application package.
  • the smart terminal 300 renders, generates and displays the first screen of the "News Network" fast application according to the data requested by the first URL.
  • the running module obtains the downloaded data or the storage path of the data from the prefetching module, and then renders and displays the first screen according to the downloaded data.
  • the quick application startup process and the execution process of the accelerated script can refer to the schematic diagram shown in FIG. 3B.
  • the smart terminal when the first URL is different from the second URL, the smart terminal obtains new data from the third-party server according to the second URL, and then renders and displays the first screen of the quick app based on the new data. .
  • the smart terminal 300 can render and display the first screen based on the data downloaded by the first URL that is parsed by the accelerated script of the "news network" fast application. It is possible to download the required data on the first screen of the quick application while downloading the application package and initializing the application package, saving the startup time of the quick application and improving the efficiency of starting the quick application.
  • the user may also select two or more quick application options.
  • the smart terminal 300 in response to the click operation, the smart terminal 300 requests to download the quick application application packages corresponding to these options, and run The acceleration scripts corresponding to these application packages are then displayed on the first screen of these quick applications in the manner described above.
  • the smart terminal 300 may display the first screen of a quick application in each of the multiple display areas.
  • the implementation process of the method for starting the application provided by the embodiment of the present application in the scenario where the user searches for the fast application is introduced. It should be noted that the method for starting an application in the embodiment of the present application can also be applied in other usage scenarios. Some other scenarios are introduced below.
  • FIG. 4A is a schematic diagram of a chat interface of an instant messaging application provided by an embodiment of the present application.
  • the user interface 41 includes a display area 400 and an input area 402.
  • the display area 400 is used to display the chat history between the user who uses the smart terminal 300 and the chat partner (ie, Lisa).
  • the input area 402 is used to input chat messages, for example, text, voice, emoticons, and so on.
  • the prefetching module of the smart terminal 300 may send a request to the application server 200 to obtain the accelerated script of the "news network".
  • the prefetch module determines that the smart terminal does not store the acceleration script of the "news network" locally. In this way, the problem of wasted time caused by repeated acquisition of acceleration scripts can be avoided.
  • the prefetching module of the smart terminal 300 runs the acceleration script, and sends a request to the application server 200 according to the obtained third URL to obtain the first information of the "news network”.
  • the screen displays the required data.
  • the running module of the smart terminal 300 sends a request to the application server 200 to obtain the application package of the "news network”.
  • the running module initializes the application package to obtain the fourth URL of the data required for the first screen display. In the case that the third URL and the fourth URL are the same, the running module obtains the downloaded data from the prefetching module, and then renders, generates and displays the first screen of the "news network” fast application based on the downloaded data.
  • the smart terminal 300 when receiving the quick application message, the smart terminal 300 obtains the acceleration script of the "news network” quick application.
  • the smart terminal 300 obtains the application package of the "news network” quick application, and at the same time, obtains the data required for the first screen display of the quick application in advance according to the acceleration script, which can save the startup time of the quick application. Improve the efficiency of launching fast apps.
  • the prefetching module of the smart terminal 300 may send a request to the application server 200 to obtain the accelerated script of the "news network”.
  • the smart terminal 300 prefetches the accelerated script to run the accelerated script, and sends a request to the application server 200 according to the obtained third URL to obtain the first screen display of "News Network”. The data.
  • the data required for the first screen display of the quick application can be obtained in advance through the acceleration script before the application package is downloaded.
  • the downloaded data can be used to perform the first screen display of the quick application. Rendering saves the startup time of fast apps and improves the efficiency of launching fast apps.
  • FIG. 4B is a schematic diagram of another quick application search interface in an application store provided by an embodiment of the present application.
  • the user interface 42 may display multiple quick application icons.
  • the user interface 42 displays the icon 411 of the "news network” quick application, the icon 413 of the “news center” quick application, and the “Notes”.
  • FIG. 4C is a schematic diagram of a detail page of a quick application provided by an embodiment of the present application.
  • the user interface 43 is used to display detailed information about the "News Center" fast application, such as: icon, name, download times, application introduction, comments, related recommendations, and so on.
  • the prefetch module of the smart terminal 300 may send a request to the application server 200 to obtain the application information of the "news network” and the acceleration script.
  • the prefetch module determines that the smart terminal does not store the acceleration script of the "news network" locally. In this way, the problem of wasted time caused by repeated acquisition of acceleration scripts can be avoided.
  • the pre-fetching module of the smart terminal 300 runs the acceleration script, and sends a request to the application server 200 according to the obtained fifth URL to obtain the first screen of "News Net” Display the required data.
  • the running module of the smart terminal 300 sends a request to the application server 200 to obtain the application package of the "news network”.
  • the running module initializes the application package to obtain the sixth URL of the data required for the first screen display. In the case that the fifth URL and the sixth URL are the same, the running module obtains the downloaded data from the prefetching module, and then renders and displays the first screen of the "News Network" fast application based on the downloaded data.
  • the smart terminal 300 obtains the acceleration script of the "news network” quick application.
  • the smart terminal 300 obtains the application package of the "news network” fast application, and at the same time, obtains the data required for the first screen display of the fast application in advance according to the acceleration script, which can save the startup time of the fast application and improve the startup Fast application efficiency.
  • the prefetch module of the smart terminal 300 may send a request to the application server 200 to obtain the accelerated script of the "news network” fast application.
  • the smart terminal 300 prefetches the acceleration script and sends a request to the application server 200 according to the obtained fifth URL to obtain the first screen display of the "news network” fast application.
  • the required data In this way, the data required for the first screen display of the quick application can be obtained in advance through the acceleration script before the application package is downloaded. In the subsequent initialization process of the application package, the downloaded data can be used to perform the first screen display of the quick application. Rendering saves the startup time of fast apps and improves the efficiency of launching fast apps.
  • the smart terminal 300 may include a low-power camera, and the smart terminal 300 may determine to request an acceleration script from the application server 200 according to gesture information recognized by the low-power camera.
  • the smart terminal 300 may pre-download some quick application acceleration scripts according to the user's behavior habits, quick application usage records, user portraits, and other information.
  • the smart terminal 300 obtains the data required for the first screen display of the quick apps in advance through the acceleration script, which saves the startup time of the quick apps and improves the efficiency of starting the quick apps.
  • the data required for the first screen display of the quick application can be obtained in advance through the acceleration script, which saves the startup time of the quick application and improves the efficiency of starting the quick application.
  • the above describes the implementation process of the method for starting a quick application provided by the embodiment of the present application.
  • the following will further introduce how the acceleration script generation module generates acceleration scripts based on application packages.
  • the accelerated script generation module can refer to the software structure block diagram shown in FIG. 5A.
  • the accelerated script generation module includes a parsing module, a syntax analysis module, a code injection module, a trial run module, an analysis module, and a tailoring module.
  • the parsing module is used to analyze the application package to obtain the source code displayed on the homepage when the quick application starts.
  • the source code displayed on the home page is specified in the configuration file (for example, manifest.json) in the root directory of the application package.
  • manifest.json file router.entry represents the entrance of the application, and the js file in this entrance is the source code needed for the first screen display.
  • the syntax analysis module is used to parse the source code into an abstract syntax tree ((abstract syntax tree, AST), or syntax tree (syntax tree) for short) by means of syntax analysis.
  • syntactic analysis is a process of analyzing input text composed of word sequences (such as English word sequences) and determining its grammatical structure according to the formal rules used when writing the application. Grammatical analysis can be achieved through a grammatical analyzer.
  • the parser usually appears as a component of the compiler or interpreter. Its function is to check the grammar and build a data structure composed of input words (usually a hierarchical analysis tree, abstract syntax tree, etc.) Data structure).
  • Syntax analyzers usually use an independent lexical analyzer to separate individual "words" from the input character stream, and use the word stream as its input.
  • AST is an abstract representation of the grammatical structure of source code. It expresses the grammatical structure of the programming language in the form of a tree, and each node on the tree represents a structure in the source code.
  • the reason why the grammar is "abstract" is that the grammar here does not show every detail that appears in the real grammar. For example, nested parentheses are implied in the structure of the tree and are not presented in the form of nodes; and conditional jump statements like if-condition-then can be represented by nodes with two branches.
  • the code injection module is used to analyze the abstract syntax tree and inject statistical upload code at selected nodes of the abstract syntax tree.
  • the selected node can be a function entry, a logical bifurcation node, a variable getter and setter node, an in-app network resource request (that is, a request to display the required data on the first screen) node, etc.
  • the data output by the statistical upload code may include: the specific location of the code being run (for example, which line of the file it is in) and the time when the code is run.
  • the statistical upload code is used to determine the specific position in the source code of the executed code in the subcode to which the node belongs. After the statistical upload code is injected into the source code, the code injection module repackages the processed source code to obtain the processed application package. Then, the code injection module sends the processed application package to the trial run module.
  • hook technology may be used to intercept the getter and setter operations of variables.
  • hook technology is a way to intercept and change the native behavior of the program.
  • a call of the program can be hooked by a hook, the logic predefined in the hook is executed before the program is about to execute this call, and the native behavior of the program is selected to be executed or not executed after the predefined logic is executed.
  • hook technology to intercept variable getter and setter operations, it can be sensed when the variable is used (for example, to get the value of the variable and modify the value of the variable) to determine the variable Can it be streamlined.
  • the trial run module is used to run the processed application package to obtain the specific location in the source code of the executed code in the subcode where the node belongs to which the uploaded code is fed back by statistics. After that, the trial run module sends the run results and processed application packages to the analysis module.
  • the analysis module is used to determine the critical path from the application initialization to the in-app network request from the processed application package according to the running result fed back by the trial running module. Specifically, the location information fed back by the running module reflects whether each line of code of the sub-code to which the node belongs has a record of being executed. Based on these records, it is possible to determine which code is the critical path.
  • fetch (url) is the network resource request node in the application.
  • the key path that can be obtained is as follows:
  • the code that is not executed can be called a non-critical path.
  • the non-critical path may have the following situations.
  • foo_method2() Functions that have not been executed, such as foo_method2() and unused_method().
  • the specific foo_method2() is not executed before fetch(url) is executed, unused_method() is executed before fetch(url), but after its execution, the execution result is not used in the subsequent code.
  • the cutting module can select the corresponding code from the source code according to the critical path sent by the analysis module, and then package the selected code to obtain an accelerated script.
  • the acceleration script is used to parse out the URL of the data required for the first screen display of the quick application.
  • the cropping module may also obfuscate and compress the selected code, so as to make the size of the accelerated script smaller.
  • the accelerated script generation module can refer to the software structure block diagram shown in FIG. 5B.
  • the accelerated script generation module includes a parsing module, a syntax analysis module, and a tailoring module.
  • the parsing module and the syntax analysis module can refer to the description in the above content, which will not be repeated here.
  • the cropping module is used to crop the abstract syntax tree based on prior knowledge by analyzing the abstract syntax tree, and then package the cropped code to obtain an accelerated script.
  • a priori knowledge refers to the code content that is known in advance to be deleted without affecting the normal execution of the application package to the request in the application.
  • prior knowledge can include: cascading style sheets (CSS), templates (ie layouts), application life cycle callbacks (such as onDestroy/onResume callbacks), and only those used in these life cycles Interface code, etc. Developers can preset prior knowledge.
  • the cropping module may also obfuscate and compress the cropped code, so as to make the size of the accelerated script smaller.
  • the accelerated script generation module is integrated in the development device 100.
  • the acceleration script generation module can generate the acceleration script using the source code of the fast application input by the user.
  • the accelerated script generation module includes a selection module, a syntax analysis module, a code injection module, a trial run module, an analysis module, and a tailoring module.
  • the selection module is used to select the source code of the quick application that is displayed on the homepage when the quick application is started from the source code of the quick application input by the user.
  • the accelerated script generation module includes a selection module, a syntax analysis module, and a trimming module.
  • the selection module is used to select the source code of the quick application that is displayed on the homepage when the quick application is started from the source code of the quick application input by the user.
  • the above embodiments are only used to illustrate the technical solutions of the present application, not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still compare the previous embodiments.
  • the recorded technical solutions are modified, or some of the technical features are equivalently replaced; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)

Abstract

一种启动快应用的方法及相关装置,该方法包括:电子设备向应用服务器(200)请求一个或多个快应用的加速脚本;检测到针对目标快应用的第一操作,响应于该第一操作,该电子设备向该应用服务器(200)请求该目标快应用的应用包,该目标快应用的加速脚本包含于该一个或多个快应用的加速脚本;响应于该第一操作,该电子设备运行该目标快应用的加速脚本,得到第一URL,并根据该第一URL获取第一数据;电子设备可以根据该第一数据生成并显示该目标快应用的首屏。上述方法可以通过加速脚本预先获取快应用的首屏显示所需的数据,提升启动快应用的效率。

Description

一种启动快应用的方法及相关装置
本申请要求于2019年9月26日提交中国国家知识产权局、申请号为201910919851.9、申请名称为“一种启动快应用的方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子技术领域,尤其涉及一种启动快应用的方法及相关装置。
背景技术
快应用,是一种无需提前安装,用户使用时即时下载的应用。在首次使用之前需要下载一个应用包。在点击快应用到首屏(应用开启时显示的初始界面)渲染完成过程中,需要下载应用包以及请求首屏显示所需的数据(例如,如新闻类应用需要向第三方服务器请求新闻列表等数据)。由于快应用首屏显示所需的数据对应的统一资源定位符(uniform resource locator,URL)需要从应用包解析得到,因此首次启动快应用的耗时较长。
现有技术中,为了减少首次启动快应用的时间,一般通过人工将快应用启动过程中首屏显示所需数据对应的URL的列表预存在应用服务器中。在运行快应用的引擎启动之后,引擎从应用服务器中获取所有快应用对应的URL的列表。用户首次点击了一个快应用之后,手机在下载应用包的同时,引擎可以根据该快应用对应的URL从第三方服务器中获取该快应用所需的数据,以减少启动该快应用的时间。这种预存URL列表的方式需要人工进行维护,容易导致获取到的URL有误的问题。
发明内容
本申请提供了一种启动快应用的方法及相关装置,可以提升启动快应用的效率。
第一方面,本申请实施例提供了一种启动快应用的方法。所述方法包括:电子设备向应用服务器发送第一请求,所述第一请求用于指示应用服务器向所述电子设备发送一个或多个快应用的加速脚本;所述电子设备接收所述应用服务器发送的所述一个或多个快应用的加速脚本;检测到针对目标快应用的第一操作,响应于所述第一操作,所述电子设备向所述应用服务器发送第二请求,所述第二请求用于请求所述目标快应用的应用包,所述目标快应用的加速脚本包含于所述一个或多个快应用的加速脚本;响应于所述第一操作,所述电子设备运行所述目标快应用的加速脚本,得到第一统一资源定位符URL,并根据所述第一URL从第三方服务器中获取第一数据;所述电子设备接收所述应用服务器发送的所述目标快应用的应用包;所述电子设备运行所述目标快应用的应用包,得到第二URL;当所述第一URL与所述第二URL相同时,所述电子设备根据所述第一数据生成并显示所述目标快应用的首屏。
在一些实施例中,在电子设备向应用服务器发送第一请求之前,所述方法还包括:所述电子设备接收到包含有所述一个或多个快应用的即时通信信息。
在一些实施例中,在所述电子设备向应用服务器发送第一请求之前,所述方法还包括: 所述电子设备检测到作用于所述一个或多个快应用的图标上的用户操作。
在一些实施例中,在所述电子设备向应用服务器发送第一请求之前,所述方法还包括:所述电子设备接收到输入的快应用名称信息,所述快应用名称信息与所述一个或多个快应用具有对应关系。
在一些实施例中,所述方法还包括:当所述第一URL与所述第二URL不相同时,所述电子设备根据所述第二URL从所述第三方服务器中获取第二数据;所述电子设备根据所述第二数据生成并显示所述目标快应用的首屏。
在一些实施例中,所述方法还包括:当所述第一URL与所述第二URL相同时,所述电子设备向应用服务器发送指示所述目标快应用的加速脚本命中成功的信息;当所述第一URL与所述第二URL不相同时,所述电子设备向应用服务器发送指示所述目标快应用的加速脚本命中失败的信息。
在一些实施例中,所述电子设备运行所述目标快应用的加速脚本,得到第一统一资源定位符URL,包括:所述电子设备根据所述目标快应用的加速脚本获取设备数据,所述设备数据包括所述电子设备的媒体存取控制MAC位址、引擎版本号、互联网协议IP地址、操作系统版本、所处的地址信息、网络类型、生厂商品牌中的一项或者多项;所述电子设备根据所述目标快应用的加速脚本和所述设备数据得到所述第一URL。
第二方面,本申请实施例提供了一种启动快应用的方法。所述方法包括:应用服务器接收快应用的应用包;所述应用服务器根据所述应用包生成所述快应用的加速脚本;所述应用服务器接收第一电子设备发送的第一请求,所述第一请求用于指示所述应用服务器向所述第一电子设备发送所述快应用的加速脚本;所述应用服务器根据所述第一请求向所述第一电子设备发送所述快应用的加速脚本。
在一些实施例中,所述方法还包括:所述应用服务器接收一个或多个第二电子设备发送的所述快应用的加速脚本的命中结果;所述应用服务器根据所述命中结果计算所述快应用的加速脚本的命中率;在所述应用服务器根据所述第一请求向所述第一电子设备发送所述快应用的加速脚本之前,所述方法还包括:所述应用服务器确定所述快应用的加速脚本的命中率不小于预设值。
在一些实施例中,所述应用服务器根据所述应用包生成所述快应用的加速脚本,包括:解析所述应用包,得到对应于所述快应用首页显示的第一源代码;解析所述第一源代码,得到抽象语法树;在所述抽象语法树的一个或多个节点处注入统计上传代码,得到第二源代码;根据所述第二源代码得到处理后的应用包;运行所述处理后的应用包,得到所述统计上传代码指示的关键路径;根据所述关键路径从第一源代码中选取出第三源代码;根据所述第三源代码得到所述快应用的加速脚本。
第三方面,本申请实施例提供了一种启动快应用的方法。所述方法包括:集成开发平台接收用户输入的快应用的第一源代码;所述集成开发平台根据所述快应用的第一源代码生成所述快应用的应用包;所述集成开发平台根据所述快应用的第一源代码生成所述快应用的加速脚本;所述集成开发平台向应用服务器发送所述快应用的应用包和所述快应用的加速脚本。
在一些实施例中,所述集成开发平台根据所述快应用的第一源代码生成所述快应用的 加速脚本,包括:从所述第一源代码中选取对应于所述快应用首页显示的第二源代码;解析所述第二源代码,得到抽象语法树;在所述抽象语法树的一个或多个节点处注入统计上传代码,得到第三源代码;根据所述第三源代码得到处理后的应用包;运行所述处理后的应用包,得到所述统计上传代码指示的关键路径;根据所述关键路径从第一源代码中选取出第四源代码;根据所述第四源代码得到所述快应用的加速脚本。
第四方面,本申请实施例提供了一种电子设备。所述电子设备包括一个或多个处理器、存储器;所述存储器与所述一个或多个处理器耦合,所述存储器用于存储程序代码,所述一个或多个处理器调用所述程序代码以使得所述电子设备执行以下操作:向应用服务器发送第一请求,所述第一请求用于指示应用服务器向所述电子设备发送一个或多个快应用的加速脚本;接收所述应用服务器发送的所述一个或多个快应用的加速脚本;检测到针对目标快应用的第一操作,响应于所述第一操作,向所述应用服务器发送第二请求,所述第二请求用于请求所述目标快应用的应用包,所述目标快应用的加速脚本包含于所述一个或多个快应用的加速脚本;响应于所述第一操作,运行所述目标快应用的加速脚本,得到第一统一资源定位符URL,并根据所述第一URL从第三方服务器中获取第一数据;接收所述应用服务器发送的所述目标快应用的应用包;运行所述目标快应用的应用包,得到第二URL;当所述第一URL与所述第二URL相同时,根据所述第一数据生成并显示所述目标快应用的首屏。
在一些实施例中,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:接收到包含有所述一个或多个快应用的即时通信信息。
在一些实施例中,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:检测到作用于所述一个或多个快应用的图标上的用户操作。
在一些实施例中,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:接收到输入的快应用名称信息,所述快应用名称信息与所述一个或多个快应用具有对应关系。
在一些实施例中,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:当所述第一URL与所述第二URL不相同时,根据所述第二URL从所述第三方服务器中获取第二数据;根据所述第二数据生成并显示所述目标快应用的首屏。
在一些实施例中,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:当所述第一URL与所述第二URL相同时,向应用服务器发送指示所述目标快应用的加速脚本命中成功的信息;当所述第一URL与所述第二URL不相同时,向应用服务器发送指示所述目标快应用的加速脚本命中失败的信息。
在一些实施例中,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:根据所述目标快应用的加速脚本获取设备数据,所述设备数据包括所述电子设备的媒体存取控制MAC位址、引擎版本号、互联网协议IP地址、操作系统版本、所处的地址信息、网络类型、生厂商品牌中的一项或者多项;根据所述目标快应用的加速脚本和所述设备数据得到所述第一URL。
第五方面,一种应用服务器,其特征在于,所述应用服务器包括一个或多个处理器、存储器;所述存储器与所述一个或多个处理器耦合,所述存储器用于存储程序代码,所述 一个或多个处理器调用所述程序代码以使得所述应用服务器执行以下操作:接收快应用的应用包;根据所述应用包生成所述快应用的加速脚本;接收第一电子设备发送的第一请求,所述第一请求用于指示所述应用服务器向所述第一电子设备发送所述快应用的加速脚本;根据所述第一请求向所述第一电子设备发送所述快应用的加速脚本。
在一些实施例中,所述一个或多个处理器调用所述程序代码以使得所述应用服务器还执行以下操作:接收一个或多个第二电子设备发送的所述快应用的加速脚本的命中结果;根据所述命中结果计算所述快应用的加速脚本的命中率;确定所述快应用的加速脚本的命中率不小于预设值。
在一些实施例中,所述一个或多个处理器调用所述程序代码以使得所述应用服务器执行以下操作:解析所述应用包,得到对应于所述快应用首页显示的第一源代码;解析所述第一源代码,得到抽象语法树;在所述抽象语法树的一个或多个节点处注入统计上传代码,得到第二源代码;根据所述第二源代码得到处理后的应用包;运行所述处理后的应用包,得到所述统计上传代码指示的关键路径;根据所述关键路径从第一源代码中选取出第三源代码;根据所述第三源代码得到所述快应用的加速脚本。
第六方面,本申请实施例提供了一种集成开发平台,其特征在于,所述集成开发平台包括一个或多个处理器、存储器;所述存储器与所述一个或多个处理器耦合,所述存储器用于存储程序代码,所述一个或多个处理器调用所述程序代码以使得所述集成开发平台执行以下操作:接收用户输入的快应用的第一源代码;根据所述快应用的第一源代码生成所述快应用的应用包;根据所述快应用的第一源代码生成所述快应用的加速脚本;向应用服务器发送所述快应用的应用包和所述快应用的加速脚本。
在一些实施例中,所述一个或多个处理器调用所述程序代码以使得所述集成开发平台还执行以下操作:从所述第一源代码中选取对应于所述快应用首页显示的第二源代码;解析所述第二源代码,得到抽象语法树;在所述抽象语法树的一个或多个节点处注入统计上传代码,得到第三源代码;根据所述第三源代码得到处理后的应用包;运行所述处理后的应用包,得到所述统计上传代码指示的关键路径;根据所述关键路径从第一源代码中选取出第四源代码;根据所述第四源代码得到所述快应用的加速脚本。
第七方面,本申请实施例提供了一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得上述电子设备执行如上述第一方面至第三方面中任一方面以及第一方面至第三方面中的任一可能的实现方式描述的方法。
第八方面,本申请实施例提供了一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行时,使得上述电子设备执行如上述第一方面至第三方面中任一方面以及第一方面至第三方面中的任一可能的实现方式描述的方法。
本申请实施例中,电子设备向应用服务器请求一个或多个快应用的加速脚本;检测到针对目标快应用的第一操作,响应于该第一操作,该电子设备向该应用服务器请求该目标快应用的应用包,该目标快应用的加速脚本包含于该一个或多个快应用的加速脚本;响应于该第一操作,该电子设备运行该目标快应用的加速脚本,得到第一URL,并根据该第一URL获取第一数据;电子设备可以根据该第一数据生成并显示该目标快应用的首屏。这种方式中,可以通过加速脚本预先获取快应用的首屏显示所需的数据,提升启动快应用的效 率。
附图说明
图1A是本申请实施例提供的一种应用系统的示意图;
图1B是本申请实施例提供的一种快应用首次启动的流程图;
图1C是本申请实施例提供的一种快应用的搜索界面的示意图;
图1D是本申请实施例提供的一种显示应用列表的用户界面的示意图;
图2A是本申请实施例提供的一种电子设备10的结构示意图;
图2B是本申请实施例提供的一种电子设备20的结构示意图;
图2C是本申请实施例提供的一种电子设备10的软件结构框图;
图2D是本申请实施例提供的一种应用服务器200的软件结构框图;
图2E是本申请实施例提供的一种开发设备100的软件结构框图;
图3A是本申请实施例提供的一种启动快应用的方法的流程图;
图3B是本申请实施例提供的一种快应用启动进程以及加速脚本的执行进程的示意图;
图4A是本申请实施例提供的一种即时通信应用的聊天界面的示意图;
图4B是本申请实施例提供的另一种应用商店中的快应用搜索界面的示意图;
图4C是本申请实施例提供的一种快应用的详情页的示意图;
图5A是本申请实施例提供的一种加速脚本生成模块的软件结构框图;
图5B是本申请实施例提供的另一种加速脚本生成模块的软件结构框图。
具体实施方式
下面将结合附图对本申请实施例中的技术方案进行清除、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。
首先,对本申请涉及到的一些概念进行具体的介绍。
本申请实施例中的用户界面(user interface,UI),是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。应用程序的用户界面是通过java、可扩展标记语言(extensible markup language,XML)等特定计算机语言编写的源代码,界面源代码在电子设备300设备上经过解析,渲染,最终呈现为用户可以识别的内容,比如图片、文字、按钮等控件。控件(control),是用户界面的基本元素,典型的控件有按钮(button)、小工具(widget)、工具栏(toolbar)、菜单栏(menu bar)、文本框(text box)、滚动条(scrollbar)、图片和文本。界面中的控件的属性和内容是通过标签或者节点来定义的,比如XML通过<Textview>、<ImgView>、<VideoView>等节 点来规定界面所包含的控件。一个节点对应界面中一个控件或属性,节点经过解析和渲染之后呈现为用户可视的内容。此外,很多应用程序,比如混合应用(hybrid application)的界面中通常还包含有网页。网页,也称为页面,可以理解为内嵌在应用程序界面中的一个特殊的控件,网页是通过特定计算机语言编写的源代码,例如超文本标记语言(hyper text markup language,HTML),层叠样式表(cascading style sheets,CSS),java脚本(JavaScript,JS)等,网页源代码可以由浏览器或与浏览器功能类似的网页显示组件加载和显示为用户可识别的内容。网页所包含的具体内容也是通过网页源代码中的标签或者节点来定义的,比如HTML通过<p>、<img>、<video>、<canvas>来定义网页的元素和属性。
用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的一个窗口、控件等界面元素。
集成开发环境(integrated development environment,IDE),是一种辅助程序开发人员开发软件的应用软件,在开发工具内部就可以辅助编写源代码文本、并编译打包成为可用的程序,有些还可以设计图形接口。IDE通常包括编程语言编辑器、自动构建工具、调试器等。有些IDE包含编译器/解释器,有些则不包含。这些IDE可以通过调用第三方编译器来实现代码的编译工作。可选的,IDE还会包含版本控制系统和一些可以设计图形用户界面的工具。许多支持面向对象的现代化IDE还包括了类别浏览器、对象查看器、对象结构图,等等。在本申请实施例中,快应用通常在特定的IDE中进行开发,例如,IDE可以为华为快应用的IDE。
引擎(engine),是电子平台上开发程序或系统的核心组件。利用引擎,开发者可迅速建立、铺设程序所需的功能,或利用其辅助程序的运转。一般而言,引擎是一个程序或一套系统的支持部分。常见的程序引擎有游戏引擎、搜索引擎、杀毒引擎等。在本申请实施例中,快应用需要通过专门的引擎解释执行。
接下来,对本申请实施例提供的应用系统进行介绍。请参见图1A,图1A是本申请实施例提供的一种应用系统的示意图。应用系统10可以包括开发设备100,应用服务器200,智能终端300以及第三方服务器400。其中:
开发设备100,可以为笔记本电脑、台式电脑等配置有IDE的电子设备,图1A中以台式电脑为例。程序开发人员可以借助开发设备100编写快应用的源代码。在快应用的源代码编写完成之后,开发设备100可以根据源代码生成快应用的应用包,并将这些应用包上传到应用服务器200中,供用户进行下载使用。其中,应用包是可自行解压缩文件的集合,可以解析出运行快应用所需的文件。
应用服务器200,可以接收并存储开发设备100上传的快应用的应用包,以及为智能终端300提供快应用包的下载服务。具体的,应用服务器200可以接收智能终端300发送的下载请求,该下载请求中包含快应用的标识。应用服务器200根据该快应用的标识向智能终端300发送该快应用的应用包。
智能终端300,可以为智能手机、平板电脑等可支持快应用运行的电子设备,图1A中以智能手机为例。用户可以通过智能终端300从应用服务器200中下载快应用的应用包。
第三方服务器400,可以为快应用提供运行时所需的数据,例如,可以为新闻类的快 应用提供新闻列表、新闻内容等数据。在快应用初始化的过程中,智能终端300解析出应用首屏显示所需的数据对应的URL,并根据该URL向第三方服务器400请求这些数据。
目前,快应用首次启动的流程可以参照图1B所示的流程图。该流程包括以下步骤:
参见图1C,本申请实施例提供的一种快应用的搜索界面的示意图。如图1C示例性所示的用户界面31所示,用户界面31中包括输入框300和键盘306。
S101、检测到用户点击键盘306中的搜索控件,响应于该点击操作,智能终端300向应用服务器200请求符合用户输入的名称的小程序的应用信息。
在一些实施例中,智能终端300可以向应用服务器200发送请求,该请求中包含用户输入的名称,该请求用于指示应用服务器200向智能终端300发送符合输入名称的小程序的应用信息。
S102、响应于该请求,应用服务器200向智能终端300发送符合用户输入的名称的小程序的应用信息。
具体的,应用服务器200根据用户输入的名称确定符合用户输入的名称的小程序,再向智能终端300发送符合用户输入的名称的小程序的应用信息。
S103、在接收到应用服务器200发送的应用信息之后,智能终端300根据应用信息显示应用列表。
显示该应用列表的用户界面可参照如图1D示例性所示的用户界面32所示。用户界面32中包括两个列表选项,选项320以及选项322。
S104、检测到用户点击选项320,响应于该点击操作,智能终端300向应用服务器200请求下载选项320对应的快应用的应用包。
S105、响应于该请求,应用服务器200向智能终端300发送“新闻网”快应用的应用包。
需要说明的是,在S106之前,应用服务器200中存储有“新闻网”快应用的应用包。该“新闻网”快应用的应用包是开发设备100向应用服务器200发送的。
S106、在接收应用服务器200发送的应用包之后,智能终端300初始化该快应用,从应用包中解析出该快应用首屏显示所需数据的URL。
S107、智能终端300根据该URL向第三方服务器400请求下载该快应用首屏显示所需的数据。
具体的,在执行S107之前,微信应用中快应用的引擎确定本地没有该URL对应的数据。
S108、响应于该请求,第三方服务器400向智能终端300发送该数据。
S109、在接收第三方服务器400发送的数据之后,智能终端300根据该数据渲染生成并显示“新闻网”快应用的首屏。
在上述场景中,智能终端300需要下载完“新闻网”快应用的应用包之后,再根据从应用包中解析得到的URL从第三方服务器400中下载首屏显示所需的数据,导致首次启动“新闻网”快应用的耗时较长。
在本申请实施例中,响应于该点击操作,智能终端300还向应用服务器请求该应用列表中的两个快应用的加速脚本。其中,该加速脚本可以解析出该加速脚本对应的快应用的 首屏显示所需数据对应的URL。在检测到用户点击选项320时,响应于该点击操作,智能终端300向应用服务器200请求下载选项320对应的快应用的应用包,同时,智能终端执行加速脚本,根据解析出的URL向第三方服务器400请求首屏显示所需数据。应用包下载完成之后,智能终端300初始化该快应用,在快应用请求首屏显示所需数据时,引擎可以将下载好的数据发送给快应用,这样,快应用可以根据下载好的数据渲染生成并显示首屏。通过这种方式,可以节省下载首屏显示所需的数据的时间,提升启动快应用的效率。
在本申请实施例中,智能终端300可以为一种电子设备,下面对本申请实施例涉及的电子设备10进行介绍。请参阅图2A,图2A是本申请实施例提供的电子设备10的结构示意图。
电子设备10可以包括:处理器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等。
应该理解的是,图2A所示电子设备10仅是一个范例,并且电子设备10可以具有比图2A中所示的更多的或者更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备10的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器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)和一根串行时钟线(derail clock line,SCL)。处理器110可以通过I2C接口耦合触摸传感器180K,使处理器110与触摸传感器180K通过I2C总线接口通信,实现电子设备10的触摸功能。
I2S接口可以用于音频通信。在一些实施例中,处理器110可以包含多组I2S总线。处理器110可以通过I2S总线与音频模块170耦合,实现处理器110与音频模块170之间的通信。
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块170与无线通信模块160可以通过PCM总线接口耦合。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器110与无线通信模块160。例如:处理器110通过UART接口与无线通信模块160中的蓝牙模块通信,实现蓝牙功能。
MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器110和显示屏194通过DSI接口通信,实现电子设备10的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器110与摄像头193,显示屏194,无线通信模块160,音频模块170,传感器模块180等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备10充电,也可以用于电子设备10与外围设备之间传输数据。
可以理解的是,本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备10的结构限定。在本申请另一些实施例中,电子设备10也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。
电子设备10的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备10中的每个天线可用于覆盖单 个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备10上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。
无线通信模块160可以提供应用在电子设备10上的包括无线局域网(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转为电磁波辐射出去。在本申请实施例中,电子设备10可以通过无线通信模块160与应用服务器200以及第三方服务器400建立通信连接。
在一些实施例中,电子设备10的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备10可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。
电子设备10通过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),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备10可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备10可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递 到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。
摄像头193用于捕获静态图像或视频。在一些实施例中,电子设备10可以包括1个或N个摄像头193,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备10在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备10可以支持一种或多种视频编解码器。这样,电子设备10可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器。通过NPU可以实现电子设备10的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备10的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备10的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备10使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备10可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备10可以通过扬声器170A收听音乐,或收听免提通话。
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备10接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。电子设备10可以设置至少一个麦克风170C。
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。当有触摸操作作用于显示屏194,电子设备 10根据压力传感器180A检测所述触摸操作强度。电子设备10也可以根据压力传感器180A的检测信号计算触摸的位置。
陀螺仪传感器180B可以用于确定电子设备10的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备10围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
气压传感器180C用于测量气压。在一些实施例中,电子设备10通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。
磁传感器180D包括霍尔传感器。电子设备10可以利用磁传感器180D检测翻盖皮套的开合。
加速度传感器180E可检测电子设备10在各个方向上(一般为三轴)加速度的大小。当电子设备10静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备10可以通过红外或激光测量距离。
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备10通过发光二极管向外发射红外光。电子设备10使用光电二极管检测来自附近物体的红外反射光。电子设备10可以利用接近光传感器180G检测用户手持电子设备10贴近耳朵通话,以便自动熄灭屏幕达到省电的目的。
环境光传感器180L用于感知环境光亮度。电子设备10可以根据感知的环境光亮度自适应调节显示屏194亮度。
指纹传感器180H用于采集指纹。电子设备10可以利用采集的指纹特性实现指纹解锁,访问应用锁,指纹拍照,指纹接听来电等。
温度传感器180J用于检测温度。在一些实施例中,电子设备10利用温度传感器180J检测的温度,执行温度处理策略。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。例如,触摸事件类型可以是单击事件、双击事件、长按事件、按压(force touch)事件、拖拽事件,等等。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备10的表面,与显示屏194所处的位置不同。
骨传导传感器180M可以获取振动信号。在一些实施例中,骨传导传感器180M可以获取人体声部振动骨块的振动信号。骨传导传感器180M也可以接触人体脉搏,接收血压跳动信号。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备10可以接收按键输入,产生与电子设备10的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振 动反馈效果。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备10的接触和分离。电子设备10可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。在一些实施例中,电子设备10采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备10中,不能和电子设备10分离。
本申请实施例中,开发设备100可以为一种电子设备,下面对本申请实施例涉及的电子设备20进行介绍。请参阅图2B,图2B是本申请实施例提供的电子设备20的结构示意图。举例而言,该电子设备20可以是台式电脑、笔记本电脑等设备。如图2B所示,电子设备20可包括处理器102、存储器103、无线通信处理模块104、电源开关105、输入模块106和输出模块107。这些部件可以通过总线连接。其中:
处理器102可用于读取和执行计算机可读指令。具体实现中,处理器102可主要包括控制器、运算器和寄存器。其中,控制器主要负责指令译码,并为指令对应的操作发出控制信号。运算器主要负责执行定点或浮点算数运算操作、移位操作以及逻辑操作等,也可以执行地址运算和转换。寄存器主要负责保存指令执行过程中临时存放的寄存器操作数和中间操作结果等。具体实现中,处理器102的硬件架构可以是专用集成电路(Application Specific Integrated Circuits,ASIC)架构、MIPS架构、ARM架构或者NP架构等等。
在一些实施例中,处理器102可以用于根据开发人员编写的快应用的源代码生成快应用的应用包。处理器102还可以用于解析无线通信处理模块104接收到的信号,以及生成无线通信处理模块104向外发送的信号。
存储器103与处理器102耦合,用于存储各种软件程序和/或多组指令。具体实现中,存储器103可包括高速随机存取的存储器,并且也可包括非易失性存储器,例如一个或多个磁盘存储设备、闪存设备或其他非易失性固态存储设备。存储器103可以存储操作系统,例如windows、Android等嵌入式操作系统。存储器103还可以存储通信程序,该通信程序可用于与应用服务器200,或附加设备进行通信。
无线通信处理模块104可以提供应用在电子设备20上的包括无线局域网(wireless local area networks,WLAN)(如Wi-Fi网络),蓝牙(bluetooth,BT),BLE广播,全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。电子设备20可以通过无线通信处理模块104与其他设备建立无线通信连接,通过蓝牙或WLAN中的一种或多种无线通信技术与其他设备进行通信。在一些实施例中,电子设备20可以通过无线通信模块104向应用服务器200发送快应用的应用包。
无线通信处理模块104还可以包括蜂窝移动通信处理模块(未示出)。蜂窝移动通信处理模块可以通过蜂窝移动通信技术与其他设备(如服务器)进行通信。
电源开关105可用于控制电源向大屏设备200的供电。
输入模块106可用于接收用户输入的指令,举例而言,该输入模块106可以包括鼠标、键盘、触摸板、触控屏、麦克风等一项或多项。
输出模块107可用于输出信息,举例而言,电子设备20中包括一块或者多块显示屏,显示屏可用于显示图像,视频等。显示屏包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。另外,输出模块107还可以包括扬声器、音箱等一项或者多项。
可以理解的是,图2B示意的结构并不构成对电子设备20的具体限定。在本申请另一些实施例中,电子设备20可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
电子设备10的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备10的软件结构。
图2C是本申请实施例提供的一种电子设备10的软件结构框图。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用层,应用框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用层可以包括一系列应用包。如图2C所示,应用包可以包括快应用中心,微信,图库,音乐,视频,短信息等应用。
其中,快应用中心可以为快应用提供运行所需的功能。快应用中心可以为一个应用,快应用中心还可以作为一项功能集成在其他可以提供快应用的应用中,例如:微信、应用商店、谷歌,等等。
具体的,快应用中心可以包括预取模块、运行模块和统计上传模块。在本申请实施例中,预取模块可以根据应用服务器200发送的加速脚本得到快应用首屏显示所需数据的第一URL,并根据该第一URL从第三方服务器400中获取该首屏显示所需的数据。运行模块可以运行快应用,在快应用首次开启的场景中,运行模块可以根据应用服务器200发送的应用包初始化该快应用,解析出该快应用首屏显示所需的数据的第二URL。在第一URL与第二URL相同的情况下,运行模块从预取模块中获取首屏显示所需的数据。统计上传模块,可以根据第一URL和第二URL向应用服务器200反馈加速脚本的命中情况。若第一URL与第二URL相同,则向应用服务器200反馈该快应用的加速脚本命中成功,若第一URL与第二URL不相同,则向应用服务器200反馈该快应用的加速脚本命中失败。在一些实施例中,快应用中心也可以不包括统计上传模块。
应用框架层为应用层的应用提供应用编程接口(application programming interface,API) 和编程框架。应用框架层包括一些预先定义的函数。
如图2C所示,应用框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备10的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,智能终端振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用层和应用框架层运行在虚拟机中。虚拟机将应用层和应用框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,G.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
需要说明的,图2C所示的电子设备的软件架构仅仅是本申请实施例的一种实现方式,实际应用中,电子设备还可以包括更多或更少的软件模块,这里不作限制。在本申请实施例中,智能终端300在如图2C所示的软件结构的基础上,还可以包括显示模块,该显示模 块用于根据各个软件模块的运行而显示对应的用户界面。该显示模块显示的用户界面可参照如图1C,图1D,图4A-图4C所示的用户界面。该显示模块具体可以实现为图2A中的显示屏194。
图2D是本申请实施例提供的一种应用服务器200的软件结构框图。该应用服务器200可以包括应用包存储模块、加速脚本生成模块、加速脚本存储模块、数据统计模块和下发模块。
其中,应用包存储模块可以用于存储开发设备100向应用服务器200发送的应用包。
加速脚本生成模块可以根据应用包存储模块中的应用包生成该应用包对应的加速脚本。具体的,一个应用包对应一个加速脚本。
加速脚本存储模块可以用于存储加速脚本生成模块生成的加速脚本。可选的,一个快应用的应用包和加速脚本可以包含有相同的应用标识。
数据统计模块,可以用于计算加速脚本的命中率。数据统计模块可以包含分析模块和数据存储模块。其中,数据存储模块可以存储智能终端300发送的加速脚本的命中结果。分析模块可以根据该命中结果计算一个加速脚本的命中率。
下发模块,可以用于接收智能终端300发送的请求,响应于该请求,向智能终端300发送快应用的应用包或者加速脚本。在一些实施例中,下发模块可以根据请求中的应用标识,从应用包存储模块中选取要发送的应用包,或者根据请求中的应用标识,从加速脚本存储模块中选取要发送的加速脚本。在一些实施例中,下发模块可以接收数据统计模块发送的一个加速脚本的命中率,比较该命中率和预设值,确定是否向智能终端300发送加速脚本。举例而言,该预设值可以为90%,还可以为其他数据,此处仅为示例。若命中率不小于该预设值,则下发模块向智能终端300发送加速脚本。若命中率小于该预设值,则下发模块不向智能终端300发送加速脚本。
在一些实施例中,应用服务器200也可以不包括数据统计模块。在一些实施例中,应用服务器200也可以不包括加速脚本生成模块。在这种情况下,应用服务器200可以接收并存储开发设备100发送的加速脚本。
图2E是本申请实施例提供的一种开发设备100的软件结构框图。其中,开发设备100可以包括打包模块、加速脚本生成模块和上传模块。具体的,打包模块可以接收用户编写的快应用的源程序(或称为源代码),并根据该源代码生成快应用的应用包。加速脚本生成模块可以根据用户编写的快应用的源程序生成该快应用对应的加速脚本。具体的,一个快应用对应一个加速脚本。上传模块可以向应用服务器200发送生成的应用包以及加速脚本。在一些实施例中,开发设备100可以不包括加速脚本生成模块。在这种情况下,应用服务器200中包括加速脚本生成模块。
下面基于上述内容中介绍的应用系统10、开发设备100、应用服务器200、智能终端300和第三方服务器400,结合其他附图对本申请实施例提供的启动应用的方法进行详细说明。需要说明的是,在本申请实施例中,该快应用是首次启动的,即,智能终端300中没 有存储该快应用的应用包。参见图3A,是本申请实施例提供的一种启动快应用的方法的流程图。该方法包括以下步骤:
S301、检测到用户点击键盘306中的搜索控件,响应于该点击操作,向应用服务器200发送第一请求,该第一请求用于请求下载符合用户输入的名称的快应用的应用信息和加速脚本。智能终端300的显示界面可参照图1C所示的用户界面31。
S302、在应用服务器200接收了智能终端300发送的第一请求之后,应用服务器200根据该第一请求向智能终端300发送符合用户输入的名称的快应用的应用信息和加速脚本。
应用服务器200与智能终端300预先建立有连接关系,例如华为手机可以预先与华为的应用服务器建立连接关系。具体的,应用服务器200根据用户输入的名称确定符合用户输入的名称的快应用,再向智能终端300发送符合用户输入的名称的快应用的应用信息和加速脚本。
在一些实施例中,符合用户输入的名称的小程序的名称可以与输入的名称相同,或者包含输入名称中的全部或者部分字符。该应用信息可以包括快应用的名称、图标、介绍信息,等等。示例性的,用户输入的名称为“新闻网”,则应用服务器200确定出的符合用户输入的名称的小程序为“新闻网”和“新闻中心”。
在又一种可能的实现方式中,符合用户输入的名称的小程序还可以包括与用户输入的名称所对应的小程序类型相同的小程序。举例而言,若用户输入的名称为“视频网”,则符合用户输入的名称的小程序可以包括“视频网”,还可以包括与“视频网”同类型的“xx播放器”“韩剧中心”等视频类快应用。
在一些实施例中,应用服务器200的加速脚本存储模块中预存有多个快应用的加速脚本。应用服务器200的下发模块可以根据确定出的快应用“新闻网”以及“新闻中心”的标识从该多个加速脚本中,选取出“新闻网”以及“新闻中心”的加速脚本。在本申请实施例中,加速脚本的大小一般比较小,例如,8千字节(KB)、10KB,等等。
在一些实施例中,应用服务器200的下发模块向智能终端300发送该“新闻网”的加速脚本之前,应用服务器200的下发模块确定“新闻网”的加速脚本的命中率不小于预设值。相似的,可以对“新闻中心”的命中率进行相同方式的确认。通过这种方式,可以提升加速脚本的正确率。
可选的,应用服务器200的数据统计模块可以对一个加速脚本的命中率进行计算。该数据统计模块可以接收多个智能终端300反馈的命中结果。具体的,若根据加速脚本得到的第一URL与根据应用包得到的第二URL相同,表明该加速脚本可以得出正确的快应用首屏显示所需数据的URL,则判定该加速脚本命中成功。若第一URL与第二URL不相同,表明该加速脚本得出的快应用首屏显示所需数据的URL有误,则判定加速脚本命中失败。智能终端300的统计上传模块可以实时发送加速脚本的命中结果给应用服务器200。举例而言,在执行了本实施例的步骤S309之后,本智能终端300可以向应用服务器200此次发送“新闻网”的加速脚本的命中结果。
以下对“新闻网”的加速脚本命中率的计算方式进行示例性的说明。在一定的预设时间(例如,10分钟、20分钟,等时间值)内,数据存储模块存储了1000次“新闻网”的加速脚本的命中结果,其中,命中成功的结果有968次,则分析模块根据这些命中结果的 得到的命中率为96.8%。若预设值为90%,则下发模块确定该命中率大于预设值,下发模块向智能终端300发送该“新闻网”的加速脚本。在一些实施例中,数据统计模块可以每隔预设时间段计算一个“新闻网”的加速脚本的命中率。
在另一些实施例中,应用服务器200的下发模块向智能终端300发送该“新闻网”的加速脚本之前,应用服务器200的下发模块确定“新闻网”的加速脚本的大小不大于预设阈值。例如,该预设阈值可以为15KB、20KB,等等。通过这种方式,可以确保发送的加速脚本的大小较小,下载速度较快。
S303、在接收到应用服务器200发送的应用信息以及加速脚本之后,智能终端300根据应用信息显示应用列表,并存储加速脚本。
显示该快应用的应用列表的用户界面可参照如图1D示例性所示的用户界面32所示。用户界面32中包括两个列表选项,选项320以及选项322。在一些实施例中,智能终端300存储加速脚本的方式可以是缓存,通过这种方式,可以快速读取到加速脚本。
S304、检测到用户点击选项320,响应于该点击操作,智能终端300向应用服务器200发送第二请求,该第二请求用于请求下载选项320对应的快应用(即,“新闻网”)的应用包。
其中,该第二请求中可以包含“新闻网”的标识。可选的,响应于该点击操作,智能终端300的快应用中心的运行模块向应用服务器200发送第二请求。
S305、在应用服务器200接收了智能终端300发送的第二请求之后,应用服务器200根据该第二请求向智能终端300发送“新闻网”的应用包。
其中,应用服务器200的应用包存储模块中预存有多个快应用的应用包。应用服务器200的下发模块可以根据第二请求中的“新闻网”的标识,从该多个应用包中,选取出“新闻网”的应用包。
S306、响应于该点击操作,智能终端300还运行“新闻网”的加速脚本,得到该快应用首屏显示所需的数据的第一URL。
在一些实施例中,智能终端300可以根据“新闻网”的加速脚本获取智能终端300的媒体存取控制位址(Media Access Control Address,MAC地址)、引擎版本号、互联网协议地址(IP地址)、操作系统版本、智能终端300所处的地址信息(例如,HANGZHOU、GUANGZHOU等信息)、智能终端300当前的网络类型(例如,3G,4G,WIFI,等等),智能终端300的生厂商品牌(例如,华为)中的一项或者多项,再根据获取到的信息生成该第一URL。
S307、智能终端300根据该第一URL向第三方服务器400发送第三请求,该第三请求用于请求下载该快应用首屏显示所需的数据。
可选的,智能终端300的快应用中心的预取模块可以运行该“新闻网”的加速脚本,并根据该第一URL向向第三方服务器400发送该第三请求。
S308、在第三方服务器400接收了智能终端300发送的第三请求之后,第三方服务器400根据该第三请求向智能终端300发送“新闻网”首屏显示所需的数据。
可选的,智能终端300的快应用中心的预取模块可以存储该第三方服务器400发送的“新闻网”首屏显示所需的数据。或者,智能终端300的存储模块存储该数据,该预取模 块可以记录该数据的存储路径。
S309、在智能终端300接收了应用服务器200发送的“新闻网”的应用包之后,智能终端300初始化该应用包,得到该快应用首屏显示所需的数据的第二URL。
可选的,智能终端300的快应用中心的运行模块可以初始化该应用包。
S310、在第一URL与第二URL相同的情况下,则智能终端300根据第一URL请求得到的数据渲染生成并显示“新闻网”快应用的首屏。
可选的,在第一URL与第二URL相同的情况下,运行模块从预取模块中获取已下载的数据或者该数据的存储路径,再根据该已下载的数据渲染生成并显示首屏。示例性的,快应用启动进程以及加速脚本的执行进程可以参照图3B所示的示意图。
在一些实施例中,在第一URL与第二URL不相同的情况,智能终端根据第二URL从该第三方服务器中获取新的数据,再根据新的数据渲染生成并显示快应用的首屏。
通过这种方式,智能终端300可以根据“新闻网”快应用的加速脚本解析出的第一URL下载的数据,渲染生成并显示首屏。可以在下载应用包以及初始化应用包的同时,下载快应用的首屏显示所需的数据,节省快应用的启动时间,提升启动快应用的效率。
在一些实施例中,用户也可以选择两个或两个以上的快应用选项,在这种情况下,响应于该点击操作,智能终端300请求下载这些选项对应的快应用的应用包,并且运行这些应用包对应的加速脚本,再按照上述介绍的方式显示这些快应用的首屏。例如,分屏场景,智能终端300可以在多个显示区域中的每个显示区域分别显示一个快应用的首屏。
以上实施例中介绍了在用户搜索快应用的场景中,本申请实施例提供的启动应用的方式的实施过程。需要说明的是,本申请实施例中的启动应用的方法还可以应用在其他使用场景中。以下对一些其他的场景进行介绍。
参见图4A,是本申请实施例提供的一种即时通信应用的聊天界面的示意图。如图4A所示,用户界面41中包括显示区域400以及输入区域402。其中,显示区域400用于显示使用本智能终端300的用户与聊天对象(即,Lisa)的聊天记录。输入区域402用于输入聊天消息,例如,文字、语音、表情等。
当智能终端300接收到聊天对象发送的快应用信息404时,智能终端300的预取模块可以向应用服务器200发送请求,以获取“新闻网”的加速脚本。可选的,在智能终端300的预取模块向应用服务器200发送请求之前,预取模块判定智能终端本地没有存储该“新闻网”的加速脚本。通过这种方式,可以避免重复获取加速脚本而造成的时间浪费的问题。
当检测到用户点击快应用信息404时,响应于该点击操作,智能终端300的预取模块运行该加速脚本,根据得到的第三URL向应用服务器200发送请求,以获取“新闻网”的首屏显示所需的数据。另外,响应于该点击操作,智能终端300的运行模块向应用服务器200发送请求,以获取“新闻网”的应用包。在接收到应用服务器200发送的应用包之后,运行模块初始化该应用包,得到首屏显示所需的数据的第四URL。在第三URL和第四URL相同的情况下,运行模块从预取模块中获取已下载的数据,再根据该已下载的数据渲染生成并显示“新闻网”快应用的首屏。
通过这种方式,当接收到快应用消息时,智能终端300获取“新闻网”快应用的加速 脚本。当用户点击该快应用消息时,智能终端300获取“新闻网”快应用的应用包,同时,根据该加速脚本预先获取快应用的首屏显示所需的数据,可以节省快应用的启动时间,提升启动快应用的效率。
在另一些实施例中,当接收到聊天对象发送的快应用信息404时,智能终端300的预取模块可以向应用服务器200发送请求,以获取“新闻网”的加速脚本。另外,在接收到应用服务器200发送的加速脚本之后,智能终端300预取模块运行该加速脚本,根据得到的第三URL向应用服务器200发送请求,以获取“新闻网”的首屏显示所需的数据。
通过这种方式,可以在应用包下载之前,通过加速脚本预先获取快应用的首屏显示所需的数据,在后续应用包初始化的过程中,可以利用已下载好的数据进行快应用首屏的渲染,节省快应用的启动时间,提升启动快应用的效率。
参见图4B,是本申请实施例提供的另一种应用商店中的快应用搜索界面的示意图。
如图4B所示,用户界面42可以显示多个快应用的图标,示例性的,用户界面42中显示了“新闻网”快应用的图标411,“新闻中心”快应用的图标413和“记事本”快应用的图标415。
当检测到用户点击图标411时,响应于该点击操作,智能终端300从显示用户界面42切换为显示用户界面43。参见图4C,是本申请实施例提供的一种快应用的详情页的示意图。其中,用户界面43用于显示有关于“新闻中心”快应用的详情信息,例如:图标、名称、下载次数、应用介绍、评论、相关推荐,等等。
具体的,响应于该点击操作,智能终端300的预取模块可以向应用服务器200发送请求,以获取“新闻网”的应用信息以及加速脚本。可选的,在智能终端300的预取模块向应用服务器200发送请求之前,预取模块判定智能终端本地没有存储该“新闻网”的加速脚本。通过这种方式,可以避免重复获取加速脚本而造成的时间浪费的问题。
当检测到用户点击打开控件417时,响应于该点击操作,智能终端300的预取模块运行该加速脚本,根据得到的第五URL向应用服务器200发送请求,以获取“新闻网”的首屏显示所需的数据。另外,响应于该点击操作,智能终端300的运行模块向应用服务器200发送请求,以获取“新闻网”的应用包。在接收到应用服务器200发送的应用包之后,运行模块初始化该应用包,得到首屏显示所需的数据的第六URL。在第五URL和第六URL相同的情况下,运行模块从预取模块中获取已下载的数据,再根据该已下载的数据渲染生成并显示“新闻网”快应用的首屏。
通过这种方式,当用户查看快应用的详情消息时,智能终端300获取“新闻网”快应用的加速脚本。当用户点击打开控件时,智能终端300获取“新闻网”快应用的应用包,同时,根据该加速脚本预先获取快应用的首屏显示所需的数据,可以节省快应用的启动时间,提升启动快应用的效率。
在另一些实施例中,当检测到用户点击图标411时,智能终端300的预取模块可以向应用服务器200发送请求,以获取“新闻网”快应用的加速脚本。另外,在接收到应用服务器200发送的加速脚本之后,智能终端300预取模块运行该加速脚本,根据得到的第五URL向应用服务器200发送请求,以获取“新闻网”快应用的首屏显示所需的数据。通过 这种方式,可以在应用包下载之前,通过加速脚本预先获取快应用的首屏显示所需的数据,在后续应用包初始化的过程中,可以利用已下载好的数据进行快应用首屏的渲染,节省快应用的启动时间,提升启动快应用的效率。
需要说明的是,除以上介绍的三个应用场景,本申请实施例提供的启动应用的方法还可以适用于其他场景。举例而言,智能终端300中可以包括低功耗摄像头,智能终端300可以根据该低功耗摄像头识别到的手势信息来确定向应用服务器200请求加速脚本。
在另一些实施例中,在检测到用户开启一个可以运行快应用的应用时,智能终端300可以根据用户的行为习惯、快应用使用记录、用户画像等信息预先下载一些快应用的加速脚本。在用户后续触发这些快应用启动时,智能终端300通过加速脚本预先获取到快应用的首屏显示所需的数据,节省快应用的启动时间,提升启动快应用的效率。
在这些场景中,可以通过加速脚本预先获取到快应用的首屏显示所需的数据,节省快应用的启动时间,提升启动快应用的效率。
以上介绍了本申请实施例提供的启动快应用的方法的实施流程。以下将进一步介绍加速脚本生成模块根据应用包生成加速脚本的方式。
第一种方式,加速脚本生成模块可以参照图5A所示的软件结构框图。其中,该加速脚本生成模块包括解析模块、语法分析模块、代码注入模块、试运行模块、分析模块和裁剪模块。
具体的,解析模块用于解析应用包,得到快应用启动时有关于首页显示的源代码。举例而言,在快应用的场景下,有关于首页显示的源代码在应用包根目录下的配置文件(例如,manifest.json)里指明的。在manifest.json文件中,router.entry即代表应用的入口,在这个入口里的js文件,即首屏显示需要的源代码。
语法分析模块,用于采用语法分析的方式将该源代码解析为抽象语法树((abstract syntax tree,AST),或简称语法树(syntax tree))。其中,语法分析(syntactic analysis,或称为parsing)是根据的应用编写时使用的形式规则对由单词序列(如英语单词序列)构成的输入文本进行分析并确定其语法结构的一种过程。语法分析可以通过语法分析器来实现。语法分析器(parser)通常是作为编译器或解释器的组件出现的,它的作用是进行语法检查、并构建由输入的单词组成的数据结构(一般是语法分析树、抽象语法树等层次化的数据结构)。语法分析器通常使用一个独立的词法分析器从输入字符流中分离出一个个的“单词”,并将单词流作为其输入。
其中,AST是源代码语法结构的一种抽象表示。它以树状的形式表现编程语言的语法结构,树上的每个节点都表示源代码中的一种结构。之所以说语法是“抽象”的,是因为这里的语法并不会表示出真实语法中出现的每个细节。比如,嵌套括号被隐含在树的结构中,并没有以节点的形式呈现;而类似于if-condition-then这样的条件跳转语句,可以使用带有两个分支的节点来表示。
代码注入模块,用于通过分析抽象语法树,并在抽象语法树的选取出的节点处注入统计上传代码。其中,该选取出的节点可以为函数入口、逻辑分叉节点、变量的获得(getter)和设置(setter)节点和应用内网络资源请求(即,请求首屏显示所需数据)节点,等等节 点的一个或多个。举例而言,该统计上传代码输出的数据可以包括:被运行到的代码的具体位置(例如,处在哪个文件第几行)以及被运行到的时刻。该统计上传代码用于确定节点所属的子代码中已执行的代码在源代码中的具体位置。在源代码中注入统计上传代码之后,代码注入模块将处理后的源代码重新打包,以得到处理后的应用包。接着,代码注入模块将处理后的应用包发送给试运行模块。
可选的,本申请实施例中,可以使用钩子技术拦截变量的获得(getter)和设置(setter)操作。其中,钩子技术是一种拦截并改变程序原生行为的方式。可以通过钩子钩住程序的一个调用,在程序将要执行此一个调用前先执行钩子中预定义的逻辑,并在执行完预定义逻辑后选择执行或不执行程序的原生行为。通过钩子技术拦截变量的获得(getter)和设置(setter)操作,可以在该变量被用到(比如,获取该变量的值及修改该变量的值)的时候能够被感知到,以确定该变量是否可以被精简。试运行模块,用于运行处理后的应用包,得到统计上传代码反馈的自身所在节点所属的子代码中已执行的代码在源代码中的具体位置。之后,试运行模块将运行结果和处理后的应用包发送给分析模块。
分析模块,用于根据试运行模块反馈的运行结果,从处理后的应用包中确定从应用初始化到进行应用内网络请求的关键路径。具体的,运行模块反馈的位置信息反映了节点所属的子代码的每一行代码是否有被执行到的记录,根据这些记录,可以确定哪些代码是关键路径。
下面一段代码进行示例性的说明。其中,fetch(url)是应用内网络资源请求节点。
源代码:
Figure PCTCN2020112300-appb-000001
Figure PCTCN2020112300-appb-000002
根据运行模块反馈的位置信息,可以得到的关键路径如下:
Figure PCTCN2020112300-appb-000003
其中,未执行到的代码可以称为非关键路径。本申请实施例中,非关键路径可以存在以下几种情况。
1、未被执行到的函数,如foo_method2()以及unused_method()。具体的foo_method2()在执行到fetch(url)之前未被执行,unused_method()在fetch(url)之前执行,但其执行后,后续的代码中并未使用执行结果。
2、未被执行到的语句,如,整个else分支中的语句。
3、在精简以上代码基础上,未被引用的变量,例如unused变量。举例而言,可以利用Intellij Idea等IDE工具检查出一个变量未被任何函数使用。
裁剪模块,可以根据分析模块发送的关键路径从源代码中选取出对应的代码,再对选取出的代码进行打包得到加速脚本。该加速脚本用于解析出快应用首屏显示所需的数据的 URL。在一些实施例中,在打包之前,裁剪模块还可以对选取出的代码进行混淆、压缩,以使得加速脚本的大小更小。
第二种方式,加速脚本生成模块可以参照图5B所示的软件结构框图。其中,该加速脚本生成模块包括解析模块、语法分析模块和裁剪模块。
其中,该解析模块和语法分析模块可参照上述内容中的描述,此处不再赘述。
裁剪模块,用于通过分析抽象语法树的方式,根据先验知识对抽象语法树进行裁剪,再将裁剪后的代码进行打包以得到加速脚本。其中,先验知识指的是预先知晓的删除以后不影响应用包正常执行到应用内请求的代码内容。举例而言,先验知识可以包括:层叠样式表(cascading style sheets,CSS)、模板(即布局)、应用的生命周期回调(如onDestroy/onResume时的回调)以及仅在这些生命周期用到的接口代码,等等。开发人员可以对先验知识进行预设。在一些实施例中,在打包之前,裁剪模块还可以对裁剪后的代码进行混淆、压缩,以使得加速脚本的大小更小。
在一些实施例中,加速脚本生成模块集成在开发设备100中。加速脚本生成模块可以利用用户输入的快应用的源代码生成加速脚本。
第一种方式,该加速脚本生成模块包括选取模块、语法分析模块、代码注入模块、试运行模块、分析模块和裁剪模块。该选取模块用于从用户输入的快应用的源代码中选取快应用启动时有关于首页显示的源代码。剩余的其他模块可参照上述图5A对应的实施例中介绍的内容中的描述,此处不再赘述。
第二种方式,加速脚本生成模块包括选取模块、语法分析模块和裁剪模块。该选取模块用于从用户输入的快应用的源代码中选取快应用启动时有关于首页显示的源代码。剩余的其他模块可参照上述图5B对应的实施例中介绍的内容中的描述,此处不再赘述。以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (26)

  1. 一种启动快应用的方法,其特征在于,所述方法包括:
    电子设备向应用服务器发送第一请求,所述第一请求用于指示应用服务器向所述电子设备发送一个或多个快应用的加速脚本;
    所述电子设备接收所述应用服务器发送的所述一个或多个快应用的加速脚本;
    检测到针对目标快应用的第一操作,响应于所述第一操作,所述电子设备向所述应用服务器发送第二请求,所述第二请求用于请求所述目标快应用的应用包,所述目标快应用的加速脚本包含于所述一个或多个快应用的加速脚本;
    响应于所述第一操作,所述电子设备运行所述目标快应用的加速脚本,得到第一统一资源定位符URL,并根据所述第一URL从第三方服务器中获取第一数据;
    所述电子设备接收所述应用服务器发送的所述目标快应用的应用包;
    所述电子设备运行所述目标快应用的应用包,得到第二URL;
    当所述第一URL与所述第二URL相同时,所述电子设备根据所述第一数据生成并显示所述目标快应用的首屏。
  2. 根据所述权利要求1所述的方法,其特征在于,在电子设备向应用服务器发送第一请求之前,所述方法还包括:
    所述电子设备接收到包含有所述一个或多个快应用的即时通信信息。
  3. 根据所述权利要求1所述的方法,其特征在于,在所述电子设备向应用服务器发送第一请求之前,所述方法还包括:
    所述电子设备检测到作用于所述一个或多个快应用的图标上的用户操作。
  4. 根据所述权利要求1所述的方法,其特征在于,在所述电子设备向应用服务器发送第一请求之前,所述方法还包括:
    所述电子设备接收到输入的快应用名称信息,所述快应用名称信息与所述一个或多个快应用具有对应关系。
  5. 根据权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:
    当所述第一URL与所述第二URL不相同时,所述电子设备根据所述第二URL从所述第三方服务器中获取第二数据;
    所述电子设备根据所述第二数据生成并显示所述目标快应用的首屏。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    当所述第一URL与所述第二URL相同时,所述电子设备向应用服务器发送指示所述目标快应用的加速脚本命中成功的信息;
    当所述第一URL与所述第二URL不相同时,所述电子设备向应用服务器发送指示所 述目标快应用的加速脚本命中失败的信息。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述电子设备运行所述目标快应用的加速脚本,得到第一统一资源定位符URL,包括:
    所述电子设备根据所述目标快应用的加速脚本获取设备数据,所述设备数据包括所述电子设备的媒体存取控制MAC位址、引擎版本号、互联网协议IP地址、操作系统版本、所处的地址信息、网络类型、生厂商品牌中的一项或者多项;
    所述电子设备根据所述目标快应用的加速脚本和所述设备数据得到所述第一URL。
  8. 一种启动快应用的方法,其特征在于,所述方法包括:
    应用服务器接收快应用的应用包;
    所述应用服务器根据所述应用包生成所述快应用的加速脚本;
    所述应用服务器接收第一电子设备发送的第一请求,所述第一请求用于指示所述应用服务器向所述第一电子设备发送所述快应用的加速脚本;
    所述应用服务器根据所述第一请求向所述第一电子设备发送所述快应用的加速脚本。
  9. 根据权利要求8所述方法,其特征在于,所述方法还包括:
    所述应用服务器接收一个或多个第二电子设备发送的所述快应用的加速脚本的命中结果;
    所述应用服务器根据所述命中结果计算所述快应用的加速脚本的命中率;
    在所述应用服务器根据所述第一请求向所述第一电子设备发送所述快应用的加速脚本之前,所述方法还包括:
    所述应用服务器确定所述快应用的加速脚本的命中率不小于预设值。
  10. 根据权利要求8或9所述的方法,其特征在于,所述应用服务器根据所述应用包生成所述快应用的加速脚本,包括:
    解析所述应用包,得到对应于所述快应用首页显示的第一源代码;
    解析所述第一源代码,得到抽象语法树;
    在所述抽象语法树的一个或多个节点处注入统计上传代码,得到第二源代码;
    根据所述第二源代码得到处理后的应用包;
    运行所述处理后的应用包,得到所述统计上传代码指示的关键路径;
    根据所述关键路径从第一源代码中选取出第三源代码;
    根据所述第三源代码得到所述快应用的加速脚本。
  11. 一种启动快应用的方法,其特征在于,所述方法包括:
    集成开发平台接收用户输入的快应用的第一源代码;
    所述集成开发平台根据所述快应用的第一源代码生成所述快应用的应用包;
    所述集成开发平台根据所述快应用的第一源代码生成所述快应用的加速脚本;
    所述集成开发平台向应用服务器发送所述快应用的应用包和所述快应用的加速脚本。
  12. 根据权利要求11所述的方法,其特征在于,所述集成开发平台根据所述快应用的第一源代码生成所述快应用的加速脚本,包括:
    从所述第一源代码中选取对应于所述快应用首页显示的第二源代码;
    解析所述第二源代码,得到抽象语法树;
    在所述抽象语法树的一个或多个节点处注入统计上传代码,得到第三源代码;
    根据所述第三源代码得到处理后的应用包;
    运行所述处理后的应用包,得到所述统计上传代码指示的关键路径;
    根据所述关键路径从第一源代码中选取出第四源代码;
    根据所述第四源代码得到所述快应用的加速脚本。
  13. 一种电子设备,其特征在于,所述电子设备包括一个或多个处理器、存储器;
    所述存储器与所述一个或多个处理器耦合,所述存储器用于存储程序代码,所述一个或多个处理器调用所述程序代码以使得所述电子设备执行以下操作:
    向应用服务器发送第一请求,所述第一请求用于指示应用服务器向所述电子设备发送一个或多个快应用的加速脚本;
    接收所述应用服务器发送的所述一个或多个快应用的加速脚本;
    检测到针对目标快应用的第一操作,响应于所述第一操作,向所述应用服务器发送第二请求,所述第二请求用于请求所述目标快应用的应用包,所述目标快应用的加速脚本包含于所述一个或多个快应用的加速脚本;
    响应于所述第一操作,运行所述目标快应用的加速脚本,得到第一统一资源定位符URL,并根据所述第一URL从第三方服务器中获取第一数据;
    接收所述应用服务器发送的所述目标快应用的应用包;
    运行所述目标快应用的应用包,得到第二URL;
    当所述第一URL与所述第二URL相同时,根据所述第一数据生成并显示所述目标快应用的首屏。
  14. 根据所述权利要求13所述的电子设备,其特征在于,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:
    接收到包含有所述一个或多个快应用的即时通信信息。
  15. 根据所述权利要求13所述的电子设备,其特征在于,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:
    检测到作用于所述一个或多个快应用的图标上的用户操作。
  16. 根据所述权利要求13所述的电子设备,其特征在于,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:
    接收到输入的快应用名称信息,所述快应用名称信息与所述一个或多个快应用具有对应关系。
  17. 根据权利要求13-16任一项所述的电子设备,其特征在于,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:
    当所述第一URL与所述第二URL不相同时,根据所述第二URL从所述第三方服务器中获取第二数据;
    根据所述第二数据生成并显示所述目标快应用的首屏。
  18. 根据权利要求17所述的电子设备,其特征在于,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:
    当所述第一URL与所述第二URL相同时,向应用服务器发送指示所述目标快应用的加速脚本命中成功的信息;
    当所述第一URL与所述第二URL不相同时,向应用服务器发送指示所述目标快应用的加速脚本命中失败的信息。
  19. 根据权利要求13-18任一项所述的方法,其特征在于,所述一个或多个处理器调用所述程序代码以使得所述电子设备还执行以下操作:
    根据所述目标快应用的加速脚本获取设备数据,所述设备数据包括所述电子设备的媒体存取控制MAC位址、引擎版本号、互联网协议IP地址、操作系统版本、所处的地址信息、网络类型、生厂商品牌中的一项或者多项;
    根据所述目标快应用的加速脚本和所述设备数据得到所述第一URL。
  20. 一种应用服务器,其特征在于,所述应用服务器包括一个或多个处理器、存储器;
    所述存储器与所述一个或多个处理器耦合,所述存储器用于存储程序代码,所述一个或多个处理器调用所述程序代码以使得所述应用服务器执行以下操作:
    接收快应用的应用包;
    根据所述应用包生成所述快应用的加速脚本;
    接收第一电子设备发送的第一请求,所述第一请求用于指示所述应用服务器向所述第一电子设备发送所述快应用的加速脚本;
    根据所述第一请求向所述第一电子设备发送所述快应用的加速脚本。
  21. 根据权利要求20所述应用服务器,其特征在于,所述一个或多个处理器调用所述程序代码以使得所述应用服务器还执行以下操作:
    接收一个或多个第二电子设备发送的所述快应用的加速脚本的命中结果;
    根据所述命中结果计算所述快应用的加速脚本的命中率;
    确定所述快应用的加速脚本的命中率不小于预设值。
  22. 根据权利要求20或21所述的应用服务器,其特征在于,所述一个或多个处理器调用所述程序代码以使得所述应用服务器执行以下操作:
    解析所述应用包,得到对应于所述快应用首页显示的第一源代码;
    解析所述第一源代码,得到抽象语法树;
    在所述抽象语法树的一个或多个节点处注入统计上传代码,得到第二源代码;
    根据所述第二源代码得到处理后的应用包;
    运行所述处理后的应用包,得到所述统计上传代码指示的关键路径;
    根据所述关键路径从第一源代码中选取出第三源代码;
    根据所述第三源代码得到所述快应用的加速脚本。
  23. 一种集成开发平台,其特征在于,所述集成开发平台包括一个或多个处理器、存储器;
    所述存储器与所述一个或多个处理器耦合,所述存储器用于存储程序代码,所述一个或多个处理器调用所述程序代码以使得所述集成开发平台执行以下操作:
    接收用户输入的快应用的第一源代码;
    根据所述快应用的第一源代码生成所述快应用的应用包;
    根据所述快应用的第一源代码生成所述快应用的加速脚本;
    向应用服务器发送所述快应用的应用包和所述快应用的加速脚本。
  24. 根据权利要求23所述的集成开发平台,其特征在于,所述一个或多个处理器调用所述程序代码以使得所述集成开发平台还执行以下操作:
    从所述第一源代码中选取对应于所述快应用首页显示的第二源代码;
    解析所述第二源代码,得到抽象语法树;
    在所述抽象语法树的一个或多个节点处注入统计上传代码,得到第三源代码;
    根据所述第三源代码得到处理后的应用包;
    运行所述处理后的应用包,得到所述统计上传代码指示的关键路径;
    根据所述关键路径从第一源代码中选取出第四源代码;
    根据所述第四源代码得到所述快应用的加速脚本。
  25. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求1至12中任一项所述的方法。
  26. 一种计算机可读存储介质,包括指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1至12中任一项所述的方法。
PCT/CN2020/112300 2019-09-26 2020-08-29 一种启动快应用的方法及相关装置 WO2021057390A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20868733.5A EP4024208B1 (en) 2019-09-26 2020-08-29 Method for launching quick application, and related device
US17/763,842 US20220292141A1 (en) 2019-09-26 2020-08-29 Quick Application Startup Method and Related Apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910919851.9 2019-09-26
CN201910919851.9A CN112650540B (zh) 2019-09-26 2019-09-26 一种启动快应用的方法及相关装置

Publications (1)

Publication Number Publication Date
WO2021057390A1 true WO2021057390A1 (zh) 2021-04-01

Family

ID=75165591

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/112300 WO2021057390A1 (zh) 2019-09-26 2020-08-29 一种启动快应用的方法及相关装置

Country Status (4)

Country Link
US (1) US20220292141A1 (zh)
EP (1) EP4024208B1 (zh)
CN (2) CN114706621B (zh)
WO (1) WO2021057390A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4354286A4 (en) * 2021-07-30 2024-08-14 Petal Cloud Tech Co Ltd FAST APPLICATION PROCESSING METHOD, ELECTRONIC DEVICE AND FAST APPLICATION SYSTEM

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115577024B (zh) * 2022-12-07 2023-03-14 湖南省计量检测研究院 直流电能量值回溯方法、装置及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202100A (zh) * 2015-05-05 2016-12-07 腾讯科技(深圳)有限公司 页面的加载方法及装置
CN109408136A (zh) * 2018-09-12 2019-03-01 Oppo广东移动通信有限公司 信息处理方法、装置、存储介质及电子设备
CN109408150A (zh) * 2018-10-30 2019-03-01 维沃移动通信有限公司 一种快应用加载方法及移动终端
CN109814930A (zh) * 2018-12-27 2019-05-28 维沃移动通信有限公司 一种应用加载方法、装置及移动终端
US20190251188A1 (en) * 2018-02-13 2019-08-15 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and apparatus for opening file, and electronic device

Family Cites Families (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6243750B1 (en) * 1998-03-26 2001-06-05 International Business Machines Corporation Method and system for measuring Web site access requests
US7366766B2 (en) * 2000-03-24 2008-04-29 Eliza Corporation Web-based speech recognition with scripting and semantic objects
US20030061515A1 (en) * 2001-09-27 2003-03-27 Timothy Kindberg Capability-enabled uniform resource locator for secure web exporting and method of using same
US20040153558A1 (en) * 2002-10-31 2004-08-05 Mesut Gunduc System and method for providing java based high availability clustering framework
EP2193420A4 (en) * 2007-07-27 2010-10-06 Synergy Sports Technology Llc SYSTEM AND METHOD FOR USING A WEBSITE CONTAINING VIDEOS READING LISTS AS INTRODUCED ON A DOWNLOAD MANAGER
US9213541B2 (en) * 2009-04-17 2015-12-15 ArtinSoft Corporation, S.A. Creation, generation, distribution and application of self-contained modifications to source code
US20120191840A1 (en) * 2009-09-25 2012-07-26 Vladislav Gordon Managing Application State Information By Means Of A Uniform Resource Identifier (URI)
US8538480B2 (en) * 2010-03-30 2013-09-17 Qualcomm Incorporated Methods and apparatus for device applet management on smart cards
US8601468B1 (en) * 2010-05-18 2013-12-03 Google Inc. Web-based applications using web extents
CN103198113B (zh) * 2013-03-29 2016-12-28 华为技术有限公司 一种对网页的处理方法及装置
JP6179231B2 (ja) * 2013-07-10 2017-08-16 株式会社リコー 端末装置、情報処理プログラム、情報処理方法および情報処理システム
UA121198C2 (uk) * 2013-07-21 2020-04-27 Мобіліті В'Ю Інк. Система для розподілення операцій інтелектуального пристрою (варіанти) та спосіб такого розподілення
US9940221B2 (en) * 2013-11-27 2018-04-10 Gmc Software Ag System and method for testing data representation for different mobile devices
US20150358478A1 (en) * 2014-06-10 2015-12-10 Vonage Network Llc Systems and methods for identifying and updating service account information
US10069832B2 (en) * 2014-11-14 2018-09-04 Google Llc Ephemeral applications
US11057446B2 (en) * 2015-05-14 2021-07-06 Bright Data Ltd. System and method for streaming content from multiple servers
CN106294372B (zh) * 2015-05-15 2019-06-25 阿里巴巴集团控股有限公司 应用程序页面快速访问方法及应用其的移动终端
US9684501B2 (en) * 2015-06-05 2017-06-20 Apple Inc. Associating a URL or link between two applications
CN106445809B (zh) * 2016-08-30 2019-04-05 北京华恒铭圣科技发展有限责任公司 一种获取网页加载首屏时延方法
CN108228305A (zh) * 2018-02-02 2018-06-29 广东欧珀移动通信有限公司 应用页面的显示方法、装置、存储介质及电子设备
CN108846100A (zh) * 2018-06-19 2018-11-20 上海掌门科技有限公司 快速搜索寄宿应用的方法及设备
CN108804707B (zh) * 2018-06-21 2024-01-09 深圳市雅阅科技有限公司 一种页面处理方法、装置以及相关设备
JP7195796B2 (ja) * 2018-07-23 2022-12-26 キヤノン株式会社 情報処理装置、情報処理装置の制御方法、及び、プログラム
CN109284144B (zh) * 2018-08-27 2021-08-27 维沃移动通信有限公司 一种快应用处理方法及移动终端
CN109388453B (zh) * 2018-09-07 2020-05-12 Oppo广东移动通信有限公司 应用页面的展示方法、装置、存储介质和电子设备
CN109271779A (zh) * 2018-10-24 2019-01-25 维沃移动通信有限公司 一种安装包检测方法、终端设备及服务器
CN109885302A (zh) * 2019-01-29 2019-06-14 维沃移动通信有限公司 一种快应用的展示方法及终端设备
CN109885355A (zh) * 2019-02-21 2019-06-14 珠海市魅族科技有限公司 一种应用启动方法及相关装置
CN110083467B (zh) * 2019-04-30 2021-10-26 上海连尚网络科技有限公司 小程序消息的处理方法、设备和计算机存储介质
CN110187913B (zh) * 2019-05-17 2023-06-09 北京百度网讯科技有限公司 小程序的发布、运行方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106202100A (zh) * 2015-05-05 2016-12-07 腾讯科技(深圳)有限公司 页面的加载方法及装置
US20190251188A1 (en) * 2018-02-13 2019-08-15 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method and apparatus for opening file, and electronic device
CN109408136A (zh) * 2018-09-12 2019-03-01 Oppo广东移动通信有限公司 信息处理方法、装置、存储介质及电子设备
CN109408150A (zh) * 2018-10-30 2019-03-01 维沃移动通信有限公司 一种快应用加载方法及移动终端
CN109814930A (zh) * 2018-12-27 2019-05-28 维沃移动通信有限公司 一种应用加载方法、装置及移动终端

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP4024208A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4354286A4 (en) * 2021-07-30 2024-08-14 Petal Cloud Tech Co Ltd FAST APPLICATION PROCESSING METHOD, ELECTRONIC DEVICE AND FAST APPLICATION SYSTEM

Also Published As

Publication number Publication date
EP4024208C0 (en) 2024-07-31
US20220292141A1 (en) 2022-09-15
EP4024208A4 (en) 2022-10-19
CN112650540A (zh) 2021-04-13
CN112650540B (zh) 2022-07-22
EP4024208B1 (en) 2024-07-31
EP4024208A1 (en) 2022-07-06
CN114706621A (zh) 2022-07-05
CN114706621B (zh) 2023-03-24

Similar Documents

Publication Publication Date Title
WO2020103764A1 (zh) 一种语音控制方法及电子设备
WO2021036735A1 (zh) 显示用户界面的方法及电子设备
CN115623115B (zh) 一种跨设备创建应用快捷方式的方法、设备、系统及存储介质
EP3543842A2 (en) Application configuration file generation method and apparatus, application page display method and apparatus and storage medium
CN110865837B (zh) 一种进行系统升级的方法和终端
WO2020233556A1 (zh) 一种通话内容处理方法和电子设备
WO2020134892A1 (zh) 一种媒体文件裁剪的方法、电子设备和服务器
WO2021073337A1 (zh) 安装插件的方法、装置和存储介质
WO2021057390A1 (zh) 一种启动快应用的方法及相关装置
WO2023005715A1 (zh) 快应用处理方法、电子设备与快应用系统
WO2022253158A1 (zh) 一种用户隐私保护方法及装置
WO2024037032A1 (zh) 账号登录的方法及电子设备
CN111078325B (zh) 应用程序运行方法、装置、电子设备及存储介质
WO2022057889A1 (zh) 一种对应用程序的界面进行翻译的方法及相关设备
CN111125602A (zh) 页面构建方法、装置、设备和存储介质
CN116483734B (zh) 一种基于编译器的插桩方法、系统及相关电子设备
CN116467221B (zh) 一种基于解释器的插桩方法、系统及相关电子设备
CN112328330A (zh) iOS组件的调用方法、装置、中间件、电子设备及介质
CN110020338A (zh) 浏览器、网页打开方法及设备
CN115576623B (zh) 一种应用程序启动方法及装置
WO2022111664A1 (zh) 打补丁的方法、相关设备及系统
WO2021238376A1 (zh) 功能包的加载方法、装置、服务器和电子设备
WO2024153170A1 (zh) 一种快应用运行方法及电子设备
CN114816973A (zh) 调试代码的方法、装置、电子设备和可读存储介质
WO2022188766A1 (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: 20868733

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2020868733

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2020868733

Country of ref document: EP

Effective date: 20220331