WO2023245365A1 - Procédé et appareil d'acquisition de progiciel d'installation d'application rapide, dispositif électronique et support de stockage - Google Patents

Procédé et appareil d'acquisition de progiciel d'installation d'application rapide, dispositif électronique et support de stockage Download PDF

Info

Publication number
WO2023245365A1
WO2023245365A1 PCT/CN2022/099929 CN2022099929W WO2023245365A1 WO 2023245365 A1 WO2023245365 A1 WO 2023245365A1 CN 2022099929 W CN2022099929 W CN 2022099929W WO 2023245365 A1 WO2023245365 A1 WO 2023245365A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
language
target
wasm
entry
Prior art date
Application number
PCT/CN2022/099929
Other languages
English (en)
Chinese (zh)
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 CN202280004160.6A priority Critical patent/CN117616382A/zh
Priority to PCT/CN2022/099929 priority patent/WO2023245365A1/fr
Publication of WO2023245365A1 publication Critical patent/WO2023245365A1/fr

Links

Images

Definitions

  • the present disclosure relates to the field of control technology, and in particular, to a method and device for obtaining a quick application installation package, an electronic device, and a storage medium.
  • the present disclosure provides a method and device for obtaining a quick application installation package, an electronic device, and a storage medium to solve the deficiencies of related technologies.
  • a method for obtaining a WASM quick application installation package for compiling a platform.
  • the method includes:
  • the target file is implemented in assemblyscript language
  • the entry file is used to introduce a user development interface
  • obtain the target file based on the ux file including:
  • the ux language is composed of css language, xml language and assemblyscript language
  • the ux source code of the ux file includes template code blocks written in xml language, using Logic code blocks written in assemblyscript language and style code blocks written in css language
  • Compile the style code block and the template code block into a json file compile the logic code block into a ts file, and use the ts file as the target file.
  • an entry file based on the target file including:
  • the entry file includes a registration application page and an interface that provides communication with the local framework.
  • compile the entry file into a wasm file including:
  • precompile the wasm file into the installation file required by the target device including:
  • the wasm file is pre-compiled into a corresponding installation file; when the target device is of the second type, pre-compiling into an installation file during installation is supported.
  • a device for obtaining a quick application installation package for compiling a platform, and the device includes:
  • Ux file acquisition module used to obtain ux files
  • the target file acquisition module is used to obtain the target file according to the ux file; the target file is implemented in assemblyscript language;
  • An entry file acquisition module is used to generate an entry file based on the target file; the entry file is used to introduce a user development interface;
  • the wasm file acquisition module is used to compile the entry file into a wasm file
  • the installation file acquisition module is used to precompile the wasm file into the installation file required by the target device.
  • the target file acquisition module includes:
  • the loader determination unit is used to determine the language loader corresponding to different language types in the ux file;
  • the ux language is composed of css language, xml language and assemblyscript language, and the ux source code of the ux file includes the xml language Template code blocks written in assemblyscript language, logic code blocks written in assemblyscript language, and style code blocks written in css language;
  • a target file compilation unit is used to compile the style code block and the template code block into a json file, compile the logical code block into a ts file, and use the ts file as the target file.
  • the entry file acquisition module includes:
  • the entry file construction unit is used to package the target file and the local framework and build the entry file
  • the entry file includes a registration application page and an interface that provides communication with the local framework.
  • the wasm file acquisition module includes:
  • the wasm file compilation unit is used to compile the entry file into a wasm file using the assemblyscript compiler Binaryen.
  • the installation file acquisition module includes:
  • a device type acquisition unit used to acquire the type of the target device
  • An installation file compilation unit configured to precompile the wasm file into a corresponding installation file when the target device is of the first type; and to support precompiling into an installation file during installation when the target device is of the second type.
  • an electronic device including:
  • the memory is used to store computer programs executable by the processor
  • the processor is used to execute the computer program in the memory to implement the above method.
  • a non-transitory computer-readable storage medium which can implement the above method when an executable computer program in the storage medium is executed by a processor.
  • a ux file can be obtained; and a target file can be obtained according to the ux file; the target file is implemented using assemblyscript language; then, an entry file is generated according to the target file; so The entry file is used to introduce the user development interface; then, the entry file is compiled into a wasm file; finally, the wasm file is pre-compiled into an installation file required by the target device.
  • this embodiment by converting the ux file into an installation file that is directly recognized by the wasm runtime and placing it into the vela operating system, there is no need to perform code conversion in the target device, and the memory usage of the target device can be reduced; and , this embodiment can reduce the difficulty of developing vela applications, improve development efficiency and developer experience.
  • Figure 1 is a flow chart of a method for obtaining a quick application installation package according to an exemplary embodiment.
  • Figure 2 is a flow chart of another method for obtaining a quick application installation package according to an exemplary embodiment.
  • Figure 3 is a block diagram of a device for obtaining a quick application installation package according to an exemplary embodiment.
  • FIG. 4 is a block diagram of an electronic device according to an exemplary embodiment.
  • embodiments of the present disclosure provide a method and device for obtaining a quick application installation package, an electronic device, and a storage medium, which are used to set up a compilation platform of the electronic device.
  • Figure 1 is shown according to an exemplary embodiment.
  • step 11 get the preset ux file.
  • the electronic device can obtain the ux file of the default wasm quick application written by the developer.
  • the ux file includes ux source code written in ux language (also called DSL language (Domain Specific Language)).
  • ux language is the language used in the program source code of vela operating system, which can include xml language, css language and assemblyscript language.
  • the structure of the above ux file may include: input code block (import), template code block (template), logical code block (script) and style code block (style).
  • input code block is written in xml language and is used to describe the introduced external components.
  • template code block is written in XML language and is used to describe the hierarchical structure, attributes and method names of the page display elements.
  • Logical code blocks are written in assemblyscript language and are used to define the logic of the page.
  • Style code blocks are written in CSS language and are used to define the style of page elements.
  • step 12 the target file is obtained according to the ux file; the target file is implemented using assemblyscript language.
  • the electronic device can obtain the front-end compilation tool to convert the style code blocks and template code blocks in the ux file into an ast.json file, that is, a json file.
  • the ast.json file is the data loaded and used by the local framework during the running process after the wasm quick application is installed, and is used for rendering the page.
  • the electronic device can convert the logical code blocks in the ux file into a ts file for use by the wasm quick application framework.
  • the ts file is a source code file including assemblyscript, where ts refers to the suffix name of the ts file.
  • the front-end compilation tool can be implemented using the webpack tool, which can convert different languages into assemblyscript language.
  • the webpack tool provided by this disclosure includes a customized ux language loader.
  • the ux language loader includes a template loader (template_loader), a style loader (style_loader) and a logic loader (script_loader).
  • the template loader can convert files written in xml language into template data in ast.Json files
  • the style loader can convert files written in css language into style data in ast.Json files
  • the logic loader can convert assemblyscript into
  • the conversion of language files into assemblyscript language files mainly involves the conversion of variable names in the assemblyscript language.
  • ux files are written in ux language
  • the ux language includes xml language, css language and assembly script language
  • the ux language loader includes a template loader, a style loader and a logic Loader.
  • corresponding loaders can also be added, and the corresponding solutions fall within the protection scope of the present disclosure.
  • the electronic device can determine the language loader corresponding to different language types in the ux file.
  • the template code block in the ux file can use the template loader to implement language conversion
  • the style code block in the ux file can use the style loader to implement language conversion
  • the logical code block in the ux file can use the logic loader to implement language conversion. Then, the electronic device can use the corresponding language loader to compile the style code block and the template code block into a json file, compile the logical code block into a ts file, and use the ts file as the target file .
  • This example provides application construction output support based on the WebAssembly engine to ensure that the simple DSL can work normally at runtime.
  • step 13 an entry file is generated according to the target file; the entry file is used to introduce a user development interface.
  • the electronic device can package the target file and a native framework (native framework) to build the entry file entry.ts.
  • the entry file includes the registration application page and provides an interface for communicating with the local framework.
  • the structure example code of the entry file entry.ts is as follows:
  • step 14 the entry file is compiled into a wasm file.
  • the electronic device can use the assemblyscript compiler Binaryen to compile the entry file into a wasm file.
  • step 15 the wasm file is pre-compiled into an installation file required by the target device.
  • the electronic device can obtain the type of the target device.
  • the target device is of the first type
  • the wasm file is pre-compiled into a corresponding installation file
  • the target device is of the second type, pre-compiling into an installation file during installation is supported.
  • the above-mentioned first type refers to designated lightweight devices, such as smart bracelets
  • the second type refers to designated devices with better performance, such as smart watches.
  • the ux file can be obtained; and the target file can be obtained according to the ux file; the target file is implemented using assemblyscript language; then, the entry file is generated according to the target file; the entry file is After introducing the user development interface; then, the entry file is compiled into a wasm file; finally, the wasm file is pre-compiled into an installation file required by the target device.
  • this embodiment by converting the ux file into an installation file that is directly recognized by the wasm runtime and placing it into the vela operating system, there is no need to perform code conversion in the target device, and the memory usage of the target device can be reduced; and , this embodiment can reduce the difficulty of developing vela applications, improve development efficiency and developer experience.
  • compile-time verification is performed based on the data types declared by the application, which can effectively discover logical errors in the application code during the compilation stage and reduce the probability of the application crashing at runtime.
  • application-based template data analysis relies on data items and outputs them to json files, reducing the performance overhead of runtime dynamic analysis.
  • the ts file generated by the application is packaged together with the runtime framework, and the entry file entry.ts is generated by construction.
  • the wasm module AOT (pre-compiled) to the installation package required by the device platform. Choose different AOT solutions according to the target device for distribution. For example, lightweight devices (i.e. the first type) AOT the wasm file into the corresponding installation package and dynamically distribute it according to the device type; devices with acceptable performance (i.e. the second type) can support AOT is compiled into installation files during installation. Convert application code into local binary code to further improve runtime performance. At the same time, the AOT method can be selected according to the target device, providing flexibility and versatility of the solution.
  • lightweight devices i.e. the first type
  • AOT the wasm file into the corresponding installation package and dynamically distribute it according to the device type
  • devices with acceptable performance i.e. the second type
  • the AOT method can be selected according to the target device, providing flexibility and versatility of the solution.
  • this embodiment can facilitate developers to participate in the development of wasm quick applications, reduce application development costs, and make the DSL syntax designed by the quick application framework of wasm runtime consistent with the quick applications.
  • an embodiment of the present disclosure also provides a device for obtaining a quick application installation package for compilation platform. See Figure 3.
  • the device includes:
  • Ux file acquisition module 31 used to obtain ux files
  • the target file acquisition module 32 is used to obtain the target file according to the ux file; the target file is implemented in assemblyscript language;
  • the entry file acquisition module 33 is used to generate an entry file according to the target file; the entry file is used to introduce a user development interface;
  • the wasm file acquisition module 34 is used to compile the entry file into a wasm file
  • the installation file acquisition module 35 is used to precompile the wasm file into an installation file required by the target device.
  • the target file acquisition module includes:
  • the loader determination unit is used to determine the language loader corresponding to different language types in the ux file;
  • the ux language is composed of css language, xml language and assemblyscript language, and the ux source code of the ux file includes the xml language Template code blocks written in assemblyscript language, logic code blocks written in assemblyscript language, and style code blocks written in css language;
  • a target file compilation unit is used to compile the style code block and the template code block into a json file, compile the logical code block into a ts file, and use the ts file as the target file.
  • the entry file acquisition module includes:
  • the entry file construction unit is used to package the target file and the local framework and build the entry file
  • the entry file includes a registration application page and an interface that provides communication with the local framework.
  • the wasm file acquisition module includes:
  • the wasm file compilation unit is used to compile the entry file into a wasm file using the assemblyscript compiler Binaryen.
  • the installation file acquisition module includes:
  • a device type acquisition unit used to acquire the type of the target device
  • An installation file compilation unit configured to precompile the wasm file into a corresponding installation file when the target device is of the first type; and to support precompiling into an installation file during installation when the target device is of the second type.
  • FIG. 4 is a block diagram of an electronic device according to an exemplary embodiment.
  • the electronic device 400 may be a smartphone, a computer, a digital broadcast terminal, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
  • the electronic device 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power supply component 406 , a multimedia component 408 , an audio component 410 , an input/output (I/O) interface 412 , and a sensor component 414 , communication component 416, image acquisition component 418.
  • a processing component 402 a memory 404 , a power supply component 406 , a multimedia component 408 , an audio component 410 , an input/output (I/O) interface 412 , and a sensor component 414 , communication component 416, image acquisition component 418.
  • Processing component 402 generally controls the overall operations of electronic device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • Processing component 402 may include one or more processors 420 to execute computer programs. Additionally, processing component 402 may include one or more modules that facilitate interaction between processing component 402 and other components. For example, processing component 402 may include a multimedia module to facilitate interaction between multimedia component 408 and processing component 402.
  • Memory 404 is configured to store various types of data to support operations at electronic device 400 . Examples of such data include computer programs for any application or method operating on electronic device 400, contact data, phonebook data, messages, pictures, videos, etc.
  • Memory 404 may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EEPROM), Programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EEPROM erasable programmable read-only memory
  • EPROM Programmable read-only memory
  • PROM programmable read-only memory
  • ROM read-only memory
  • magnetic memory flash memory, magnetic or optical disk.
  • Power supply component 406 provides power to various components of electronic device 400 .
  • Power supply components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 400 .
  • the power component 406 may include a power chip, and the controller can communicate with the power chip to control the power chip to turn on or off the switching device, so that the battery supplies power to the motherboard circuit or not.
  • Multimedia component 408 includes a screen that provides an output interface between electronic device 400 and the target object.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input information from the target object.
  • the touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. A touch sensor can not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action.
  • Audio component 410 is configured to output and/or input audio file information.
  • audio component 410 includes a microphone (MIC) configured to receive external audio file information when electronic device 400 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio file information may be further stored in memory 404 or sent via communication component 416 .
  • audio component 410 also includes a speaker for outputting audio file information.
  • the I/O interface 412 provides an interface between the processing component 402 and a peripheral interface module, which may be a keyboard, a click wheel, a button, etc.
  • Sensor component 414 includes one or more sensors for providing various aspects of status assessment for electronic device 400.
  • the sensor component 414 can detect the open/closed state of the electronic device 400, the relative positioning of components, such as the display screen and the keypad of the electronic device 400, and the sensor component 414 can also detect the position change of the electronic device 400 or a component. , the presence or absence of the target object in contact with the electronic device 400 , the orientation or acceleration/deceleration of the electronic device 400 and the temperature change of the electronic device 400 .
  • the sensor component 414 may include a magnetic sensor, a gyroscope, and a magnetic field sensor, where the magnetic field sensor includes at least one of the following: a Hall sensor, a thin film magnetoresistive sensor, and a magnetic liquid acceleration sensor.
  • Communication component 416 is configured to facilitate wired or wireless communication between electronic device 400 and other devices.
  • the electronic device 400 can access a wireless network based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, or a combination thereof.
  • the communication component 416 receives broadcast information or broadcast-related information from an external broadcast management system via a broadcast channel.
  • communications component 416 also includes a near field communications (NFC) module to facilitate short-range communications.
  • NFC near field communications
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • electronic device 400 may be configured by one or more application specific integrated circuits (ASICs), digital information processors (DSPs), digital information processing devices (DSPDs), programmable logic devices (PLDs), field programmable Programmed gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation.
  • ASICs application specific integrated circuits
  • DSPs digital information processors
  • DSPDs digital information processing devices
  • PLDs programmable logic devices
  • FPGA field programmable Programmed gate array
  • controller microcontroller, microprocessor or other electronic component implementation.
  • a non-transitory computer-readable storage medium such as a memory 404 including instructions, and the above-mentioned executable computer program can be executed by a processor.
  • the readable storage medium can be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

Landscapes

  • Stored Programmes (AREA)

Abstract

La présente invention concerne un procédé et un appareil d'acquisition d'un progiciel d'installation d'application rapide, ainsi qu'un dispositif électronique et un support de stockage. Le procédé consiste à : acquérir un fichier ux ; acquérir un fichier cible en fonction du fichier ux, le fichier cible étant obtenu à l'aide d'un langage assemblyscript ; puis générer un fichier d'entrée en fonction du fichier cible, le fichier d'entrée étant utilisé pour introduire une interface de développement d'utilisateur ; puis compiler le fichier d'entrée en un fichier wasm ; et enfin, précompiler le fichier wasm en un fichier d'installation requis par un dispositif cible. De cette manière, dans le présent mode de réalisation, un fichier ux est converti en un fichier d'installation qui est identifié directement au moyen d'un moteur d'exécution wasm, et est placé dans un système d'exploitation vela, et il n'est pas nécessaire d'effectuer de conversion de code dans un dispositif cible, ce qui permet de réduire l'encombrement mémoire du dispositif cible ; de plus, le présent mode de réalisation facilite le développement d'un programme d'application vela, ce qui permet d'améliorer l'efficacité du développement et l'expérience de développement pour un développeur.
PCT/CN2022/099929 2022-06-20 2022-06-20 Procédé et appareil d'acquisition de progiciel d'installation d'application rapide, dispositif électronique et support de stockage WO2023245365A1 (fr)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202280004160.6A CN117616382A (zh) 2022-06-20 2022-06-20 快应用安装包获取方法和装置、电子设备、存储介质
PCT/CN2022/099929 WO2023245365A1 (fr) 2022-06-20 2022-06-20 Procédé et appareil d'acquisition de progiciel d'installation d'application rapide, dispositif électronique et support de stockage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/099929 WO2023245365A1 (fr) 2022-06-20 2022-06-20 Procédé et appareil d'acquisition de progiciel d'installation d'application rapide, dispositif électronique et support de stockage

Publications (1)

Publication Number Publication Date
WO2023245365A1 true WO2023245365A1 (fr) 2023-12-28

Family

ID=89378997

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/099929 WO2023245365A1 (fr) 2022-06-20 2022-06-20 Procédé et appareil d'acquisition de progiciel d'installation d'application rapide, dispositif électronique et support de stockage

Country Status (2)

Country Link
CN (1) CN117616382A (fr)
WO (1) WO2023245365A1 (fr)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026396A (zh) * 2019-12-13 2020-04-17 北京小米移动软件有限公司 页面渲染方法、装置、电子设备及存储介质
CN111510744A (zh) * 2020-07-01 2020-08-07 北京美摄网络科技有限公司 一种处理视音频的方法、装置、电子设备及存储介质
US20200410996A1 (en) * 2019-06-28 2020-12-31 Microsoft Technology Licensing, Llc Voice assistant-enabled web application or web page
CN112597454A (zh) * 2020-12-28 2021-04-02 深圳市欢太科技有限公司 代码混淆方法、代码运行方法、装置、介质与设备
CN114564156A (zh) * 2022-02-10 2022-05-31 深圳市纵维立方科技有限公司 模型切片的方法和装置、3d打印系统、电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200410996A1 (en) * 2019-06-28 2020-12-31 Microsoft Technology Licensing, Llc Voice assistant-enabled web application or web page
CN111026396A (zh) * 2019-12-13 2020-04-17 北京小米移动软件有限公司 页面渲染方法、装置、电子设备及存储介质
CN111510744A (zh) * 2020-07-01 2020-08-07 北京美摄网络科技有限公司 一种处理视音频的方法、装置、电子设备及存储介质
CN112597454A (zh) * 2020-12-28 2021-04-02 深圳市欢太科技有限公司 代码混淆方法、代码运行方法、装置、介质与设备
CN114564156A (zh) * 2022-02-10 2022-05-31 深圳市纵维立方科技有限公司 模型切片的方法和装置、3d打印系统、电子设备

Also Published As

Publication number Publication date
CN117616382A (zh) 2024-02-27

Similar Documents

Publication Publication Date Title
CN111026396B (zh) 页面渲染方法、装置、电子设备及存储介质
US7246346B2 (en) System and method for persisting dynamically generated code in a directly addressable and executable storage medium
US20090228862A1 (en) Modularized integrated software development environments
CN112052008A (zh) 代码检查方法、装置、计算机设备及计算机可读存储介质
US11726799B2 (en) Preventing framework conflicts for multi-OS applications
CN111736916A (zh) 基于Java语言的动态扩展方法、装置、电子设备及存储介质
CN110851240B (zh) 功能调用方法、装置及存储介质
CN108874554B (zh) 信息通信方法及装置
TW202403541A (zh) 第三方行動應用程式中引入小程序的系統、方法、裝置及介質
CN107402756B (zh) 用于绘制页面的方法、装置及终端
WO2023245365A1 (fr) Procédé et appareil d'acquisition de progiciel d'installation d'application rapide, dispositif électronique et support de stockage
CN113377370A (zh) 一种文件处理方法、装置、电子设备及存储介质
CN106775608A (zh) 独立系统进程的实现方法和装置
WO2023245375A1 (fr) Procédé et appareil de liaison de données de cadre d'application rapide wasm, ainsi que dispositif électronique et support de stockage
CN111796865B (zh) 一种字节码文件修改方法、装置、终端设备及介质
CN111459494A (zh) 一种代码处理方法及装置
CN110569037B (zh) 数据写入的方法和装置
CN112445484B (zh) 一种寄存器处理方法、装置、电子设备及存储介质
CN113761588A (zh) 一种数据校验方法、装置、终端设备及存储介质
CN111782196A (zh) 基于mvp架构的开发方法及装置
CN117348878A (zh) 源文件解析方法和装置、电子设备、存储介质
CN117982895A (zh) 数据调用方法、装置、介质及设备
WO2023103868A1 (fr) Procédé et appareil pour mettre en œuvre une injection de dépendances sur la base de hilt, et dispositif
CN117632131A (zh) 组件编译方法、装置、设备及介质
CN116009951A (zh) 代码处理方法、装置、设备及存储介质

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 202280004160.6

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22947146

Country of ref document: EP

Kind code of ref document: A1