CN112416533A - Method and device for running application program on browser and electronic equipment - Google Patents

Method and device for running application program on browser and electronic equipment Download PDF

Info

Publication number
CN112416533A
CN112416533A CN202110093229.4A CN202110093229A CN112416533A CN 112416533 A CN112416533 A CN 112416533A CN 202110093229 A CN202110093229 A CN 202110093229A CN 112416533 A CN112416533 A CN 112416533A
Authority
CN
China
Prior art keywords
code
browser
execution
programming language
execution result
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202110093229.4A
Other languages
Chinese (zh)
Inventor
崔宝秋
董红光
董永清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110093229.4A priority Critical patent/CN112416533A/en
Publication of CN112416533A publication Critical patent/CN112416533A/en
Pending legal-status Critical Current

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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45516Runtime code conversion or optimisation
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45516Runtime code conversion or optimisation
    • G06F9/4552Involving translation to a different instruction set architecture, e.g. just-in-time translation in a JVM
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45529Embedded in an application, e.g. JavaScript in a Web browser

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure provides a method and a device for running an application program on a browser and electronic equipment, and belongs to the technical field of browsers. Wherein, the method comprises the following steps: obtaining code of an application program, wherein the code comprises first programming language code and second programming language code, the first programming language code comprises first code for business logic implementation of the application program, and the second programming language code comprises second code for page rendering of the application program; transcoding the first code to convert to a first execution code of the browser; calling a browser to execute a first execution code and generate a first execution result; and calling a display interface of the browser to display the first execution result. Therefore, the first code is converted into the execution code of the browser, one-time development and multi-terminal operation of the application program are realized, repeated development is avoided, and the research and development cost is greatly reduced.

Description

Method and device for running application program on browser and electronic equipment
Technical Field
The present disclosure relates to the field of browser technologies, and in particular, to a method and an apparatus for running an application on a browser, and an electronic device.
Background
Native means that Native language is written corresponding to Native application on the system, and Native language is different on different systems, for example, Native application of apple (IOS) system is generally written in Objective-C, Native application of Android (Android) system is generally written in Java.
In the related art, Native APPs (applications) are developed based on a local OS (Operating System), and run based on the local OS, and cannot run under different types of OS, so that the Native APPs with the same function need to be developed based on different local OSs for multiple versions, which is high in research and development cost, not beneficial to version update, and generates a large amount of code redundancy.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for running an application program on a browser and an electronic device, which realize one-time development and multi-terminal running of the application program, avoid repeated development and greatly reduce research and development cost.
An embodiment of a first aspect of the present disclosure provides a method for running an application on a browser, including: obtaining code of an application program, wherein the code comprises first programming language code and second programming language code, the first programming language code comprises first code for business logic implementation of the application program, and the second programming language code comprises second code for page rendering of the application program; transcoding the first code to convert to browser's first execution code; calling the browser to execute the first execution code and generate a first execution result; and calling a display interface of the browser to display the first execution result.
In one embodiment of the present disclosure, the code further includes third programming language code including third code for Document Object Model (DOM) building of the application program and fourth code for style calculation and layout.
In an embodiment of the present disclosure, the method for running an application on a browser further includes: transcoding the third code and the fourth code to convert to second execution code and third execution code, respectively, of the browser; after the first execution result is generated, calling the browser to execute the second execution code and the third execution code, and generating a second execution result, wherein the second execution result comprises the first execution result; and calling a display interface of the browser to display the second execution result.
In an embodiment of the present disclosure, the display interface is a style calculation interface of the browser, or a rendering interface of the browser.
In an embodiment of the present disclosure, the first programming language code is a JS (JavaScript, just-in-time compilation type programming language) code and/or a Typescript code, the second programming language code is a C + + code, and the third programming language code is a Dart code.
In one embodiment of the present disclosure, the first execution code, the second execution code, and the third execution code are JS codes.
The embodiment of the second aspect of the present disclosure provides an apparatus for running an application on a browser, including: an obtaining module, configured to obtain code of an application, where the code includes a first programming language code and a second programming language code, the first programming language code includes a first code for a business logic implementation of the application, and the second programming language code includes a second code for page rendering of the application; the conversion module is used for carrying out code conversion on the first code so as to convert the first code into a first execution code of the browser; the generating module is used for calling the browser to execute the first execution code and generating a first execution result; and the display module is used for calling a display interface of the browser to display the first execution result.
In one embodiment of the present disclosure, the code further includes third programming language code including third code for document object model, DOM, building of the application program and fourth code for style calculation and layout.
In an embodiment of the present disclosure, the conversion module is further configured to respectively transcode the third code and the fourth code to convert into a second execution code and a third execution code of the browser; the generating module is further configured to, after the first execution result is generated, invoke the browser to execute the second execution code and the third execution code, and generate a second execution result, where the second execution result includes the first execution result; the display module is further configured to call a display interface of the browser to display the second execution result.
In an embodiment of the present disclosure, the display interface is a style calculation interface of the browser, or a rendering interface of the browser.
In an embodiment of the present disclosure, the first programming language code is a JS code and/or a Typescript code, the second programming language code is a C + + code, and the third programming language code is a Dart code.
In one embodiment of the present disclosure, the first execution code, the second execution code, and the third execution code are JS codes.
An embodiment of a third aspect of the present disclosure provides an electronic device, including: a processor; a memory for storing the processor-executable instructions; the processor is configured to execute the instructions to implement the method for running the application program on the browser, which is set forth in the embodiment of the first aspect of the present disclosure.
A fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium, where instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method for running an application on a browser, which is set forth in the first aspect of the present disclosure.
A fifth aspect of the present disclosure provides a computer program product, which includes a computer program, and when the computer program is executed by a processor in a communication device, the computer program implements the method for running an application program on a browser, which is provided in the first aspect of the present disclosure.
According to the method, the device and the electronic equipment for running the application program on the browser, the codes of the application program are obtained through the electronic equipment, the first codes in the codes are subjected to code conversion to be converted into the first execution codes of the browser, the browser is called to execute the first execution codes and generate first execution results, and then the display interface of the browser is called to display the first execution results. Therefore, the first code is converted into the execution code of the browser, one-time development and multi-terminal operation of the application program are realized, repeated development is avoided, and the research and development cost is greatly reduced.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for running an application on a browser according to an embodiment of the present disclosure.
Fig. 2 is a flowchart illustrating another method for running an application on a browser according to an embodiment of the present disclosure.
Fig. 3 is a schematic structural diagram of an apparatus for running an application on a browser according to an embodiment of the present disclosure.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with embodiments of the present disclosure.
The terminology used in the embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the embodiments of the present disclosure. As used in the disclosed embodiments, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information in the embodiments of the present disclosure, such information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of embodiments of the present disclosure. The words "if" and "if" as used herein may be interpreted as "at … …" or "at … …" or "in response to a determination", depending on the context.
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the like or similar elements throughout. The embodiments described below with reference to the drawings are exemplary and intended to be illustrative of the present disclosure, and should not be construed as limiting the present disclosure.
The method, the apparatus, and the electronic device for running an application on a browser according to the embodiments of the present disclosure are described below with reference to the drawings.
The method for running the application program on the browser provided by the embodiment of the disclosure may be executed by an electronic device, and the electronic device may be a tablet computer, a mobile phone, a smart television, and the like, which is not limited herein.
In the disclosed embodiment, the electronic device may be provided with a processing component, a storage component and a driving component. Alternatively, the driving component and the processing component may be integrated, the storage component may store an operating system, an application program, or other program modules, and the processing component implements the method for running the application program on the browser provided by the embodiment of the present disclosure by executing the application program stored in the storage component.
Fig. 1 is a flowchart illustrating a method for running an application on a browser according to an embodiment of the present disclosure.
The method for running the application program on the browser according to the embodiment of the disclosure can be further executed by the device for running the application program on the browser provided by the embodiment of the disclosure, and the device can be configured in the electronic device to obtain the code of the application program, perform code conversion on the first code in the code to convert the first code into the first execution code of the browser, call the browser to execute the first execution code and generate the first execution result, and then call the display interface of the browser to display the first execution result, so that one-time development and multi-terminal running of the application program is realized, and the research and development cost is greatly reduced.
As shown in fig. 1, the method for running an application on a browser may include:
step 101, obtaining codes of an application program, wherein the codes comprise first programming language codes and second programming language codes, the first programming language codes comprise first codes used for realizing business logic of the application program, and the second programming language codes comprise second codes used for page rendering of the application program.
It should be noted that the application described in this embodiment may be a Native APP, where the application may be installed on the browser in the form of a plug-in. The installation mode can be various, for example, the user actively downloads Native APPs for installation according to the reminding of the browser or according to the self requirement in the process of using the browser, or the browser downloads and installs the Native APPs according to the operation record of the user and the server related to the browsing record connection, so as to improve the experience of using the browser by the user.
In the embodiment of the disclosure, the browser may be a browser in an electronic device such as a mobile phone, a tablet computer, and a smart television, where the electronic device may have an Android (Android) system or an apple (IOS) system built therein.
It should be noted that the application program (i.e., Native APP) described in this embodiment may also be directly adapted to an operating system (e.g., Android system or apple (IOS) system) of the electronic device. The browser can run the application on the browser according to the triggering instruction. The triggering instruction can comprise an instruction actively triggered by a user and an instruction actively triggered by a browser.
Specifically, in the process that a user uses a browser through an electronic device, after the user triggers a certain application (i.e., Native APP), the electronic device may obtain a code of the application through the browser, for example, when an Android system is built in the electronic device, the electronic device may obtain the code of the application by calling an Android Application Package (APK) of the application. Wherein the code may include first programming language code that may include first code for business logic implementation of an application and second programming language code that may include second code for page rendering of the application.
In one embodiment of the present disclosure, the first programming language code may be JS code and/or Typescript code and the second programming language code may be C + + code. It should be noted that, if the first programming language code is a JS code, the first code in the first programming language code is also the JS code; if the first programming language code is a Typescript code, the first code in the first programming language code is also the Typescript code; if the first programming language code is a JS code and a Typescript code, the first code in the first programming language code can be the JS code and the Typescript code; if the second programming language code is C + + code, then the second code within the second programming language code is also C + + code.
It should be noted that the first programming language code described in this embodiment is JS code and Typescript code, which means that the first programming language code is composed of JS code and Typescript code, that is, JS code and Typescript code may be included in program code written in the first programming language.
In other disclosed embodiments, the first programming language code may also be other programming languages, such as Dart code.
Step 102, the first code is transcoded to be converted into a first execution code of the browser. Wherein the first execution code may be a JS code.
It should be noted that the code language executed by browsers in different systems and browsers of different brands may be different.
In the embodiment of the disclosure, the first code may be converted by a code conversion model to obtain a first execution code of the browser.
It should be noted that the transcoding model described in this embodiment may be trained in advance and pre-stored in the memory space of the electronic device to facilitate the retrieval of the application. The storage space is not limited to an entity-based storage space, such as a hard disk, and may also be a storage space (cloud storage space) of a network hard disk connected to the electronic device.
The training and the generation of the code conversion model can be performed by a related server, the server can be a cloud server or a host of a computer, a communication connection is established between the server and the electronic equipment capable of executing the method for running the application program on the browser provided by the application embodiment, and the communication connection can be at least one of a wireless network connection and a wired network connection. The server can send the trained transcoding model to the electronic device so that the electronic device can call the trained transcoding model when needed, thereby greatly reducing the computational stress of the electronic device.
Specifically, after acquiring a code of an application program through a browser, the electronic device may parse the code to obtain a first code for implementing a business logic of the application program. The electronic device may then input the first code to a transcoding model, thereby converting the first code through the transcoding model to output a first execution code of the browser.
As a possible scenario, after obtaining the first code, the electronic device may further determine a code language executable by the browser, and if the code language executable by the browser is the same as the code language of the first code, the electronic device may use the first code as the execution code of the browser without performing conversion.
As another possible case, even after determining that the code language executable by the browser is the same as the code language of the first code, the electronic device inputs the first code to the code conversion model, so that the first code is converted by the code conversion model to output the first execution code of the browser. It should be noted that the code conversion model described in this embodiment may also implement conversion of the framework and the code layout, so that the first execution code is more suitable for the execution of the browser, thereby increasing the speed of the browser executing the first execution code.
Step 103, calling the browser to execute the first execution code and generate a first execution result.
And 104, calling a display interface of the browser to display the first execution result.
Specifically, after obtaining a first execution code of the browser, the electronic device may directly invoke the browser to execute the first execution code and generate a first execution result, and then invoke a display interface of the browser to display the first execution result, that is, display the first execution result in the browser.
It should be noted that the browser described in this embodiment is rendering-enabled, and the page of the application (i.e., Native APP) is different from the page of the browser, so that the rendering of the application (i.e., Native APP) cannot be applied on the browser, and therefore this disclosure needs to exclude this part of code, and only extract the business logic code, i.e., the first code.
In the embodiment of the disclosure, the code of the application program is firstly obtained, the first code in the code is subjected to code conversion to be converted into the first execution code of the browser, the browser is called to execute the first execution code and generate the first execution result, and then the display interface of the browser is called to display the first execution result. Therefore, the first code is converted into the execution code of the browser, one-time development and multi-terminal operation of the application program are realized, repeated development is avoided, and the research and development cost is greatly reduced.
Further, in an embodiment of the present disclosure, the code may further include a third programming language code, and the third programming language code may include a third code for document object model DOM building of an application program and a fourth code for style calculation and layout. Wherein the third programming language code may be a Dart code. It should be noted that, if the third programming language code is a Dart code, both the third code and the fourth code in the third programming language code are Dart codes.
In another embodiment of the present disclosure, as shown in fig. 2, the method for running an application on a browser may further include:
step 201, respectively transcoding the third code and the fourth code to convert into a second execution code and a third execution code of the browser. And the second execution code and the third execution code can both be JS codes.
In the embodiment of the present disclosure, the third code and the fourth code may also be converted by the above-mentioned code conversion model to obtain the second execution code and the third execution code of the browser, respectively.
Specifically, after the electronic device obtains the code of the application program through the browser, the electronic device can analyze the code, and obtain a third code for constructing a Document Object Model (DOM) of the application program and a fourth code for style calculation and layout while obtaining the first code. The electronic device may then transcode the first code, the third code, and the fourth code to convert to the first execution code, the second execution code, and the third execution code, respectively, of the browser.
Step 202, after the first execution result is generated, invoking the browser to execute the second execution code and the third execution code, and generating a second execution result, wherein the second execution result includes the first execution result.
And step 203, calling a display interface of the browser to display a second execution result.
Specifically, after obtaining the first execution code, the second execution code, and the third execution code, the electronic device may first invoke the browser to execute the first execution code and generate a first execution result, then may continue to invoke the browser to sequentially execute the second execution code and the third execution code and generate a second execution result, and then invoke the display interface of the browser to display the second execution result, that is, display the second execution result in the browser.
It should be noted that the execution result generated when the browser executes the plurality of execution codes (for example, the first execution code, the second execution code, and the third execution code) in sequence may include the execution result generated when each execution code in the plurality of execution codes is executed.
To clarify the above embodiment, in one embodiment of the present disclosure, the display interface may be a style computation interface of a browser.
Specifically, when the display interface is a style calculation interface of the browser, after calling the browser to sequentially execute the first execution code, the second execution code, and the third execution code and generate a second execution result, the electronic device may call the style calculation interface of the browser to display the second execution result.
It should be noted that, after being called, the style computation interface described in this embodiment executes the code for style computation and layout again (i.e., the execution code corresponding to the fourth code), and then performs the rendering operation.
In order to increase the loading speed of the browser, in another embodiment of the present disclosure, the display interface may also be a rendering interface of the browser.
Specifically, when the display interface is a style calculation interface of the browser, after calling the browser to sequentially execute the first execution code, the second execution code, and the third execution code and generate a second execution result, the electronic device may call a rendering interface of the browser to display the second execution result.
It should be noted that, after being called, the rendering interface described in this embodiment may directly perform a subsequent rendering operation, and the code for style calculation and layout (i.e., the execution code corresponding to the fourth code) does not need to be executed again, so that the loading speed of the browser is increased.
According to the method for running the application program on the browser, the codes of the application program are firstly obtained, the codes of the first codes in the codes are converted into the first execution codes of the browser, the browser is called to execute the first execution codes and generate first execution results, and then the display interface of the browser is called to display the first execution results. Therefore, the first code is converted into the execution code of the browser, one-time development and multi-terminal operation of the application program are realized, repeated development is avoided, and the research and development cost is greatly reduced.
Fig. 3 is a schematic structural diagram of an apparatus for running an application on a browser according to an embodiment of the present disclosure.
The device for running the application program on the browser in the embodiment of the disclosure can be configured in the electronic device to obtain the code of the application program, perform code conversion on the first code in the code to convert the first code into the first execution code of the browser, call the browser to execute the first execution code and generate the first execution result, and then call the display interface of the browser to display the first execution result, thereby realizing one-time development and multi-terminal running of the application program and greatly reducing the research and development cost.
As shown in fig. 3, the apparatus 300 for running an application on a browser may include: an acquisition module 310, a conversion module 320, a generation module 330, and a display module 340.
The obtaining module 310 is configured to obtain code of an application program, where the code includes a first programming language code and a second programming language code, the first programming language code includes a first code for business logic implementation of the application program, and the second programming language code includes a second code for page rendering of the application program.
The conversion module 320 is used for transcoding the first code to convert into the first execution code of the browser.
The generating module 330 is configured to invoke the browser to execute the first execution code and generate a first execution result.
The display module 340 is configured to invoke a display interface of the browser to display the first execution result.
In one embodiment of the present disclosure, the code further includes third programming language code including third code for document object model, DOM, building of the application program and fourth code for style calculation and layout.
In an embodiment of the present disclosure, the conversion module 320 is further configured to respectively transcode the third code and the fourth code to convert into the second execution code and the third execution code of the browser; the generating module 330 is further configured to, after generating the first execution result, invoke the browser to execute the second execution code and the third execution code, and generate a second execution result, where the second execution result includes the first execution result; the display module 340 is further configured to invoke a display interface of the browser to display the second execution result.
In one embodiment of the present disclosure, the display interface is a style computation interface of a browser, or a rendering interface of a browser.
In one embodiment of the present disclosure, the first programming language code is JS code and/or Typescript code, the second programming language code is C + + code, and the third programming language code is Dart code.
In one embodiment of the present disclosure, the first execution code, the second execution code, and the third execution code are JS codes.
It should be noted that the foregoing explanation on the embodiment of the method for running the application on the browser also applies to the device for running the application on the browser in this embodiment, and is not repeated here.
The device for running the application program on the browser of the embodiment of the disclosure acquires the code of the application program through the acquisition module, wherein the code comprises a first programming language code and a second programming language code, the first programming language code comprises a first code for realizing the business logic of the application program, the second programming language code comprises a second code for rendering the page of the application program, the first code is subjected to code conversion through the conversion module to be converted into a first execution code of the browser, the browser is called through the generation module to execute the first execution code and generate a first execution result, and then the display interface of the browser is called through the display module to display the first execution result. Therefore, the first code is converted into the execution code of the browser, one-time development and multi-terminal operation of the application program are realized, repeated development is avoided, and the research and development cost is greatly reduced.
According to a third aspect of the embodiments of the present disclosure, there is also provided an electronic apparatus, including: a processor; a memory for storing processor executable instructions, wherein the processor is configured to execute the instructions to implement the method of running an application on a browser as above.
In order to implement the above embodiments, the present disclosure also provides a storage medium.
Wherein the instructions in the storage medium, when executed by a processor of the electronic device, enable the electronic device to perform the method of running an application on a browser as above.
To implement the above embodiments, the present disclosure also provides a computer program product.
Wherein the computer program product, when executed by a processor of an electronic device, enables the electronic device to perform the method as above.
FIG. 4 is a block diagram of an electronic device shown in accordance with an example embodiment. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 4, the electronic device 1000 includes a processor 111 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 112 or a program loaded from a Memory 116 into a Random Access Memory (RAM) 113. In the RAM 113, various programs and data necessary for the operation of the electronic apparatus 1000 are also stored. The processor 111, the ROM 112, and the RAM 113 are connected to each other through a bus 114. An Input/Output (I/O) interface 115 is also connected to the bus 114.
The following components are connected to the I/O interface 115: a memory 116 including a hard disk and the like; and a communication section 117 including a Network interface card such as a LAN (Local Area Network) card, a modem, or the like, the communication section 117 performing communication processing via a Network such as the internet; a drive 118 is also connected to the I/O interface 115 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program, carried on a computer readable medium, containing program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 117. Which when executed by the processor 111 performs the above-described functions defined in the method of the present disclosure.
In an exemplary embodiment, a storage medium comprising instructions, such as a memory comprising instructions, executable by the processor 111 of the electronic device 1000 to perform the above-described method is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer-readable signal medium may include a propagated data signal with computer-readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the embodiment of the disclosure, codes of an application program are obtained through an electronic device, a first code in the codes is subjected to code conversion to be converted into a first execution code of a browser, the browser is called to execute the first execution code and generate a first execution result, and then a display interface of the browser is called to display the first execution result. Therefore, the first code is converted into the execution code of the browser, one-time development and multi-terminal operation of the application program are realized, repeated development is avoided, and the research and development cost is greatly reduced.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof.

Claims (14)

1. A method for running an application on a browser, comprising:
obtaining code of an application program, wherein the code comprises first programming language code and second programming language code, the first programming language code comprises first code for business logic implementation of the application program, and the second programming language code comprises second code for page rendering of the application program;
transcoding the first code to convert to browser's first execution code;
calling the browser to execute the first execution code and generate a first execution result; and
and calling a display interface of the browser to display the first execution result.
2. The method of claim 1, wherein the code further comprises third programming language code comprising third code for Document Object Model (DOM) building of the application and fourth code for style calculation and layout.
3. The method of claim 2, further comprising:
transcoding the third code and the fourth code to convert to second execution code and third execution code, respectively, of the browser;
after the first execution result is generated, calling the browser to execute the second execution code and the third execution code, and generating a second execution result, wherein the second execution result comprises the first execution result;
and calling a display interface of the browser to display the second execution result.
4. The method of claim 1, wherein the display interface is a style computation interface of the browser or a rendering interface of the browser.
5. The method of claim 2, wherein the first programming language code is JS code and/or Typescript code, the second programming language code is C + + code, and the third programming language code is Dart code.
6. The method of claim 3, wherein the first execution code, the second execution code, and the third execution code are JS codes.
7. An apparatus for running an application on a browser, comprising:
an obtaining module, configured to obtain code of an application, where the code includes a first programming language code and a second programming language code, the first programming language code includes a first code for a business logic implementation of the application, and the second programming language code includes a second code for page rendering of the application;
the conversion module is used for carrying out code conversion on the first code so as to convert the first code into a first execution code of the browser;
the generating module is used for calling the browser to execute the first execution code and generating a first execution result; and
and the display module is used for calling a display interface of the browser to display the first execution result.
8. The apparatus of claim 7, wherein the code further comprises third programming language code, the third programming language code comprising third code for document object model, DOM, build of the application and fourth code for style calculation and layout.
9. The apparatus of claim 8, wherein the translation module is further to transcode the third code and the fourth code to translate to second execution code and third execution code, respectively, of the browser;
the generating module is further configured to, after the first execution result is generated, invoke the browser to execute the second execution code and the third execution code, and generate a second execution result, where the second execution result includes the first execution result;
the display module is further configured to call a display interface of the browser to display the second execution result.
10. The apparatus of claim 7, wherein the display interface is a style computation interface of the browser or a rendering interface of the browser.
11. The apparatus of claim 8, wherein the first programming language code is JS code and/or Typescript code, the second programming language code is C + + code, and the third programming language code is Dart code.
12. The apparatus of claim 9, wherein the first execution code, the second execution code, and the third execution code are JS codes.
13. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of running an application on a browser as claimed in any one of claims 1 to 6.
14. A non-transitory computer readable storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of running an application on a browser of any one of claims 1 to 6.
CN202110093229.4A 2021-01-25 2021-01-25 Method and device for running application program on browser and electronic equipment Pending CN112416533A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110093229.4A CN112416533A (en) 2021-01-25 2021-01-25 Method and device for running application program on browser and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110093229.4A CN112416533A (en) 2021-01-25 2021-01-25 Method and device for running application program on browser and electronic equipment

Publications (1)

Publication Number Publication Date
CN112416533A true CN112416533A (en) 2021-02-26

Family

ID=74782954

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110093229.4A Pending CN112416533A (en) 2021-01-25 2021-01-25 Method and device for running application program on browser and electronic equipment

Country Status (1)

Country Link
CN (1) CN112416533A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799670A (en) * 2021-04-14 2021-05-14 盛威时代科技集团有限公司 Method and system for unified multi-terminal logic development
CN113127361A (en) * 2021-04-23 2021-07-16 中国工商银行股份有限公司 Application program development method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021356A (en) * 2017-11-06 2018-05-11 江苏省测绘研究所 It is a kind of cross-platform to measure live-action map method for organizing across shielding
CN111090431A (en) * 2019-11-29 2020-05-01 亚信科技(南京)有限公司 Data processing method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108021356A (en) * 2017-11-06 2018-05-11 江苏省测绘研究所 It is a kind of cross-platform to measure live-action map method for organizing across shielding
CN111090431A (en) * 2019-11-29 2020-05-01 亚信科技(南京)有限公司 Data processing method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799670A (en) * 2021-04-14 2021-05-14 盛威时代科技集团有限公司 Method and system for unified multi-terminal logic development
CN112799670B (en) * 2021-04-14 2021-08-03 盛威时代科技集团有限公司 Method and system for unified multi-terminal logic development
CN113127361A (en) * 2021-04-23 2021-07-16 中国工商银行股份有限公司 Application program development method and device, electronic equipment and storage medium
CN113127361B (en) * 2021-04-23 2024-02-23 中国工商银行股份有限公司 Application development method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11106434B1 (en) Method, device, and computer program product for generating program code
US11720344B2 (en) Code hot-update method and device, storage medium, processor, and terminal
CN105718313A (en) Application operation method and device
US9823908B2 (en) Apparatus for providing framework to develop client application executed on multiple platforms, and method using the same
CN112416533A (en) Method and device for running application program on browser and electronic equipment
CN111338623A (en) Method, device, medium and electronic equipment for developing user interface
US9632804B2 (en) Method, apparatus, and communication system for implementing internet application
CN114996619A (en) Page display method and device, computer equipment and storage medium
CN114138372A (en) Front-end component loading method and device
CN111027333B (en) Chapter translation method and apparatus
CN108804120B (en) Page construction method, device, equipment and storage medium
CN112817595A (en) Interface rendering method and device, storage medium and electronic equipment
US9916391B2 (en) Method, apparatus and terminal for webpage content browsing
CN116841559A (en) Transcoding method, device, apparatus, medium and program product
CN110362317B (en) Code conversion method, device and storage medium
CN113315829A (en) Client offline H5 page loading method and device, computer equipment and medium
CN112799658A (en) Model training method, model training platform, electronic device, and storage medium
CN112800078A (en) Lightweight text labeling method, system, equipment and storage medium based on javascript
US20220365762A1 (en) Neural network model conversion method server, and storage medium
CN111966347A (en) Method, device, equipment and storage medium for front-end driving back-end service
CN113760274A (en) Front-end component logic injection method and device
CN113961279A (en) Page rendering method, device, server and storage medium
CN111913712A (en) Method and apparatus for deploying neural network model at Web end
CN110837896B (en) Storage and calling method and device of machine learning model
CN108845803B (en) Method, device and equipment for updating list view and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination