WO2015014143A1 - Method and apparatus for cross-platform application conversion - Google Patents

Method and apparatus for cross-platform application conversion Download PDF

Info

Publication number
WO2015014143A1
WO2015014143A1 PCT/CN2014/076858 CN2014076858W WO2015014143A1 WO 2015014143 A1 WO2015014143 A1 WO 2015014143A1 CN 2014076858 W CN2014076858 W CN 2014076858W WO 2015014143 A1 WO2015014143 A1 WO 2015014143A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
platform application
preset function
rules
platform
Prior art date
Application number
PCT/CN2014/076858
Other languages
French (fr)
Inventor
Liang Ma
Guishan HUANG
Chunhua LUO
Zhiqiang He
Original Assignee
Tencent Technology (Shenzhen) Company Limited
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 Tencent Technology (Shenzhen) Company Limited filed Critical Tencent Technology (Shenzhen) Company Limited
Publication of WO2015014143A1 publication Critical patent/WO2015014143A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/51Source to source

Definitions

  • the present invention generally relates to computer technologies and, more particularly, to methods and apparatuses for cross-platform application conversion.
  • a method for releasing different platform versions of the same application is: based on code types of the applications corresponding to various platforms, applications corresponding to various platforms are written respectively, and then the code is compiled to generate the versions of the applications corresponding to various platforms. For example, when a C++ client terminal game is developed for Win32 environment, if a browser Flash version of the game needs to be developed, the game needs to be rewritten by using ActionScript scripting language, and then a Flash file in a SWF format is compiled and generated based on the code rewritten by using ActionScript scripting language.
  • One aspect of the present disclosure includes a cross-platform application conversion method.
  • the method includes acquiring semantic rules as well as constant and variable information of a first code of a first platform application to be converted.
  • the method also includes generating a second code of a second platform application based on the semantic rules as well as the constant and variable information.
  • the method includes generating an executable file of the second platform application by compiling the second code based on the second code of the second platform application.
  • the semantic rules belong to syntax rules of the first code, based on corresponding relationships between the syntax rules of the first code and syntax rules of the second code, the syntax rules of the second code corresponding to the semantic rules are determined.
  • the preset function of the second code corresponding to the semantic rules is determined. Based on any one of the syntax rules of the second code and the preset function of the second code, as well as the constant and variable information, the second code of the second platform application is generated.
  • the apparatus includes a first acquiring module configured to acquire semantic rules as well as constant and variable information of a first code of a first platform application to be converted.
  • the apparatus also includes a generating module configured to, based on the semantic rules as well as the constant and variable information, generate a second code of a second platform application.
  • the apparatus includes a compile module configured to, based on the second code of the second platform application, generate an executable file of the second platform application by compiling the second code.
  • the generating module includes a first determination unit, a second determination unit, and a generating unit.
  • the first determination unit is configured to, when the semantic rules belong to syntax rules of the first code, based on the corresponding relationships between the syntax rules of the first code and syntax rules of the second code, determine the syntax rules of the second code corresponding to the semantic rules.
  • the second determination unit is configured to, when the semantic rules belong to a preset function of the first code, based on corresponding relationships between the preset function of the first code and a preset function of the second code, determine the preset function of the second code corresponding to the semantic rules.
  • the generating unit is configured to, based on any one of the syntax rules of the second code and the preset function of the second code as well as the constant and variable information, generate the second code of the second platform application.
  • the second determination unit further includes a determination subunit and a processing subunit.
  • the determination subunit is configured to, when the preset function of the first code is a network communication function, based on corresponding relationships between the preset function of the first code and the preset function of the second code, determine the preset function of the second code corresponding to the network communication function.
  • the processing subunit is configured to use a preset address of a proxy server as a destination address of the preset function of the second code corresponding to the network communication function, and use the destination address of the network communication function as parameters of a forwarding destination address of the preset function of the second code corresponding to the network communication function.
  • the apparatus includes a second acquiring module, a third acquiring module, and a fourth acquiring module.
  • the second acquiring module is configured to acquire file path information of the first platform application to be converted.
  • the third acquiring module is configured to acquire files that store the code of the first platform application based on the file path information.
  • the fourth acquiring module is configured to acquire the first code of the files that store the code of the first platform application in order based on acquiring order of the files in the file path information.
  • Figure 1 shows a flow chart of an exemplary cross-platform application conversion process consistent with the disclosed embodiments
  • Figure 2 shows a flow chart of another exemplary cross-platform application conversion process consistent with the disclosed embodiments
  • Figure 3 shows a structure diagram of an exemplary cross-platform application conversion apparatus consistent with the disclosed embodiments
  • Figure 4 shows a structure diagram of an exemplary generating module consistent with the disclosed embodiments
  • Figure 5 shows a schematic diagram of an exemplary cross-platform application conversion process consistent with the disclosed embodiments
  • Figure 6 shows a schematic diagram of an exemplary cross-platform engine framework model consistent with the disclosed embodiments
  • Figure 7 shows a structure diagram of an exemplary cross-platform engine framework model consistent with the disclosed embodiments
  • Figure 8 shows a block diagram of an exemplary computing system according to the disclosed embodiments.
  • UFO is a framework built on top of a low level virtual machine (LLVM) compiler infrastructure, including an application layer, a framework layer, and a platform layer.
  • LLVM low level virtual machine
  • the UFO framework is used for developing cross-platform applications, which supports iOS, Android, Symbian, Win32, WP7, Bada, and iMac platform.
  • LLVM Low Level Virtual Machine
  • LLVM is a compiler infrastructure written in C++.
  • LLVM is designed for compile-time, link-time, and run-time optimization of programs written in arbitrary programming languages.
  • AS3 is a productive object-oriented script programming language for Adobe Flash Player platform that is used on Webpages in the form of embedded SWF files.
  • FlasCC provides a complete BSD-like C/C++ development environment based on GCC that lets developers compile C/C++ code to target the Adobe Flash Runtimes (Flash Player and AIR). With FlasCC, the developers can port existing C/C++ code to the web, across browsers.
  • SWF shockwave Flash
  • SWF is an Adobe Flash file format used for multimedia, vector graphics and ActionScript. The SWF files can contain animations or applets of varying degrees of interactivity and function.
  • SWC shockwave Flash Component
  • a SWC file is compressed by means of the ZIP archive format.
  • An uncompressed SWC file contains at least a catalog.xml file, and a SWF file, usually named "library.swf".
  • the SWC file may also contain other files, such as CSS files.
  • Makefile contains rules that are used to manage compiled projects, which allow a user to specify which files are created from which others, and then run appropriate commands to update the created files.
  • FIG. 8 shows a block diagram of an exemplary computer system 800 capable of implementing cross-platform application conversion.
  • computer system 800 may include a processor 802, a storage medium 804, a monitor 806, a communication module 808, a database 810, and peripherals 812. Certain devices may be omitted and other devices may be included.
  • Processor 802 may include any appropriate processor or processors. Further, processor 802 can include multiple cores for multi-thread or parallel processing.
  • Storage medium 504 may include memory modules, such as ROM, RAM, flash memory modules, and erasable and rewritable memory, and mass storages, such as CD-ROM, U-disk, and hard disk, etc.
  • Storage medium 804 may store computer programs for implementing various processes, when executed by processor 802.
  • peripherals 812 may include I/O devices such as keyboard and mouse, and communication module 808 may include network devices for establishing connections through the communication network.
  • Database 810 may include one or more databases for storing certain data and for performing certain operations on the stored data, such as database searching.
  • FIG. 5 shows a schematic diagram of an exemplary cross-platform application conversion process consistent with the disclosed embodiments.
  • UFO is a framework built on top of a low level virtual machine (LLVM) compiler infrastructure, including an application layer, a framework layer, and a platform layer.
  • the cross-platform application conversion may be implemented by using a Flash platform on the bottom level of interface.
  • FlasCC uses a version of LLVM-GCC with a custom LLVM backend that generates ActionScript bytecode (a SWF or SWC file) capable of running within the Flash Runtime. More specifically, the bytecode runs in the ActionScript virtual machine (AVM).
  • AVM ActionScript virtual machine
  • Figure 1 shows a flow chart of an exemplary cross-platform application conversion process performed on or by the computer system consistent with the disclosed embodiments. As shown in Figure 1, the process may include the following steps.
  • Step 101 acquiring semantic rules as well as constant and variable information of a first code of a first platform application to be converted, after the computer obtains the first code of a first platform application from, for example, a user input, a computer storage, another computer system or another application program.
  • Step 102 based on the semantic rules as well as the constant and variable information, generating a second code of a second platform application.
  • Step 103 based on the second code of the second platform application, generating an executable file of the second platform application by compiling the second code.
  • the semantic rules as well as the constant and variable information of the first code of the first platform application to be converted are first acquired. Based on preset conversion relation corresponding to the type of the semantic rules in the first code, the semantic rules of the first code are converted. Based on the converted code and the constant and variable information, the second code of the second platform is generated. Then, the second platform application is generated by compiling the second code of the second platform.
  • FIG. 2 shows a flow chart of another exemplary cross-platform application conversion process consistent with the disclosed embodiments. It should be noted that, in this exemplary embodiment, a first platform application is written in C++ language for a Win32 platform on a PC, and a second platform application is written in ActionScript language for a browser platform on a PC. As shown in Figure 2, the process may include the following steps.
  • Step 201 acquiring file path information of a first platform application to be converted.
  • the current process for converting the application code needs to be configured. For example, at least file path information of project source code of the first platform application needs to be set. Based on the file path information, a source code file of the application that stores the code is acquired. [0013] Further, the file name of the second platform application generated after converting can be also included.
  • the path information of the resource file of the first platform application needed in the compile process can be also included, such as path information of image files, video files and audio files.
  • the way to find the file path of the project source code can be also included. For example, a recursion search is implemented or not. That is, after the file path information is given, whether a deeper level file path contained in the file path information is searched.
  • the file path information of header files involved in the file code of the first platform application can be also included.
  • Step 202 based on the file path information, acquiring one or more files that store the code of the first platform application.
  • the file path information may include the file path information of one or more files. Therefore, based on the file path information of one or more files included in the file path information, the files that store the code of the first platform application are acquired in order based on the order of the file path information is acquired.
  • Step 203 based on the acquiring order of the files in the file path information, acquiring the first code of the code files of the first platform application in order.
  • Step 204 acquiring semantic rules as well as constant and variable information of the first code of the first platform application to be converted.
  • the semantic rules of the first code may include two types.
  • corresponding to different platforms are pre-stored. That is, the corresponding relationships between the syntax rules of C++ code and the syntax rules of ActionScript code are pre-stored herein. As the application logic on different platforms is the same, based on the above- mentioned corresponding relationships and the constants and variables that are added to the syntax rules of the converted second code, the syntax rules of the code can be converted.
  • the second type of the semantic rules is a preset function of the first code.
  • the corresponding relationships among different functions for different platforms are pre-stored.
  • the corresponding relationships between functions of C++ code and functions of ActionScript code are pre-stored herein.
  • every function in C++ code is searched in order in the corresponding relationships between the functions of C++ code and the functions of ActionScript code, and the ActionScript function corresponding to every C++ function is acquired in order.
  • FIG. 6 shows a schematic diagram of an exemplary cross-platform engine framework model consistent with the disclosed embodiments.
  • UFO uses C++ language as a programing language. FlasCC compiles C/C++ code into SWF or SWC files, calls AS3 code in C/C++, and uses a SWC library compiled by C/C++ in AS3 code.
  • AS3 code in the platform interface layer implements interfaces to realize applications for the Flash platform.
  • the client-based engine framework model mainly includes a native UFO Engine, an application layer, a framework layer, and a platform layer.
  • the application layer and the framework layer are platform-independent.
  • the platform layer abstracts the concrete platform layer interfaces.
  • a Win32 platform For example, a Win32 platform, an Android platform, an iOS platform, a Bada platform, a WinPhone8 platform and an iMac platform have the corresponding platform layers, respectively.
  • flash_render, flash_socket and flash_sound modules are configured to support for Flash runtime, and FlasCC compiles and generates an executable SWF file.
  • Figure 7 shows a structure diagram of an exemplary cross-platform engine framework model consistent with the disclosed embodiments.
  • the cross- platform engine framework model mainly includes an application layer, a framework layer, a platform interface layer, an application common module, and Flash Runtime.
  • the platform interface layer mainly includes a rendering interface layer, a system interface layer, a network interface layer, a sound interface layer, and an event interface layer.
  • the rendering interface layer is configured for rendering the related interface functions directly using corresponding Flash functions for implementation.
  • a drawBitmap function in C++ corresponds to a Bitmap function in ActionScript.
  • a drawText function in C++ corresponds to one of TextField functions in ActionScript.
  • drawRect/drawLine function in C++ corresponds to a Graphic function in ActionScript.
  • the system interface layer implements system interface functions.
  • the system interface functions may include ufo_system_common.h, ufo_system_ui.h, etc.
  • the ufo_system_common.h mainly includes certain time interface functions and directory interface functions.
  • the time interface functions can be implemented by the corresponding time functions in ActionScript.
  • the directory interface functions are implemented by a virtual file system (VFS) provided in a tool for transcoding to simulate the local directories and store some configuration data.
  • the ufo_system_ui.h mainly includes a text edit box function, a built-in browser function, etc.
  • the edit box function corresponds to the TextField function in ActionScript.
  • the event interface layer provides event interface functions.
  • the event interface functions mainly include ufoOnTouchDown (), ufoOnTouchUp (), ufoOnTouchMove (), ufoOnKeyDown () and ufoOnKeyUp (), which correspond to mouse and keyboard event functions in ActionScript.
  • the sound interface layer provides sound functions. Flash platform only supports a MP3 audio format, but not supports an ogg audio format, so the current sound interface is temporarily implemented only in the MP3 audio format. To compile the applications, file format conversion tools need to be used to convert files with the ogg audio format into files with the MP3 audio format.
  • the network interface layer provides network communication for the applications.
  • Network requests are implemented by asynchronous processing of new threads. Thread tasks are added to the events per frame.
  • the network communication is implemented by using Socket. Socket function of Flash is asynchronous.
  • Socket network proxy needs to implement the following functions: based on a received Internet Protocol (IP) port, connecting to the IP port;
  • IP Internet Protocol
  • the entire Flash platform interface layer can be compiled as a library file (libufoplatform.a), and only a link is needed for subsequent application projects.
  • the application layer and the framework layer include a user interface (UI) component library, a Scud interface animation engine, a physical engine, particle effect, and so on.
  • UI user interface
  • Scud interface animation engine a physical engine
  • particle effect a physical engine
  • FlasCC FlasCC
  • an application common module includes splash screen, log on, set and other functions, which can be also used directly by various applications.
  • the application common module is compiled as libGameComm.a, and various functions in the application common module are compiled into the corresponding functions in ActionScript.
  • the proxy server receives a network communication request sent from a Flash application, and forwards the request. After receiving feedback data, the proxy server forwards the feedback data to the Flash application that sends the network communication request.
  • an original destination address in the network communication function corresponding to C++ is changed to a preset address of the proxy server, and a destination address in the network communication function corresponding to C++ is set in the network communication function corresponding to ActionScript as parameters of a forwarding destination address.
  • the proxy server forwards the network communication request.
  • the conversion process for network communication function is as follows.
  • the preset function is the network communication function
  • the intermediate function corresponding to the network communication function is determined.
  • the preset address of the proxy server is used as the destination address of the intermediate function corresponding to the network communication function, and the destination address of the network communication function is used as the parameters of the forwarding destination address of the intermediate function corresponding to the network communication function.
  • Step 204 the process for acquiring the semantic rules as well as the constant and variable information of the first code of the first platform application to be converted includes the following steps.
  • Step 2041 when the semantic rules belong to syntax rules of the first code, based on the corresponding relationships between the syntax rules of the first code and the syntax rules of the second code, the syntax rules of the second code corresponding to the semantic rules are determined.
  • Step 2042 when the semantic rules belong to the preset function of the first code, based on the corresponding relationships between the preset function of the first code and a preset function of the second code, the preset function of the second code corresponding to the semantic rules is determined. [0040] After the preset function of the second code corresponding to the semantic rules is found, the original constant and variable information is added to a corresponding position in the preset function of the second code.
  • this step may include the folio wings.
  • the preset function of the first code is the network communication function
  • the preset function of the second code corresponding to the network communication function is determined.
  • the preset address of the proxy server is used as the destination address of the preset function of the second code corresponding to the network communication function, and the destination address of the network communication function is used as the parameters of the forwarding destination address of the preset function of the second code corresponding to the network communication function.
  • Step 2043 based on the syntax rules of the second code and/or the preset function of the second code, as well as the constant and variable information, the second code of the second platform application is generated.
  • Step 205 based on the second code, an executable file of the second platform application is generated by compiling the second code.
  • the ActionScript intermediate code and intermediate function are compiled to generate a corresponding Flash SWF executable file.
  • the process for converting the first platform application to the second application is completed.
  • Step 1 compiling UFO and the application common module.
  • Step 2 creating a new flash directory in a build directory of an application project (e.g., on-line QQ game), and then creating a new Makefile file in the flash directory.
  • an application project e.g., on-line QQ game
  • Makefile file code for a QQ Mahjong game is as follows:
  • SRC_DIR_RECURSION N # judging whether a recursive search is implemented.
  • a Make command is executed completely. If the compile process is successful, a SWF file is generated. Flash Player can implement the generated SWF file. If the compile process is unsuccessful, the corresponding process is executed based on cause of failure. When the code needs to be modified, the following pre-compiled conditions can be used to modify the code.
  • the semantic rules as well as the constant and variable information of the first code of the first platform application to be converted are acquired. Based on preset conversion relation corresponding to the type of the semantic rules in the first code of the first platform application, the semantic rules of the first code are converted. Based on the converted code and the constant and variable information, the second code of the second platform is generated. Then, the second platform application is generated by compiling the second code of the second platform. Without changing the application logic, the speed for generating the same application on different platforms is improved, thus improving the efficiency of application development.
  • Figure 3 shows a structure diagram of an exemplary cross-platform application conversion apparatus consistent with the disclosed embodiments.
  • the apparatus may include a first acquiring module 301, a generating module 302, and a compile module 303.
  • the first acquiring module 301 is configured to acquire semantic rules as well as constant and variable information of a first code of a first platform application to be converted.
  • the generating module 302 is configured to, based on the semantic rules as well as the constant and variable information, generate a second code of a second platform application.
  • the compile module 303 is configured to, based on the second code of the second platform application, generate an executable file of the second platform application by compiling the second code.
  • FIG. 4 shows a structure diagram of an exemplary generating module consistent with the disclosed embodiments.
  • a generating module 302 includes a first determination unit 3021, a second determination unit 3023 and a generating unit 3025.
  • the first determination unit 3021 is configured to, when semantic rules belong to syntax rules of a first code, based on the corresponding relationships between the syntax rules of the first code and syntax rules of a second code, determine the syntax rules of the second code corresponding to the semantic rules.
  • the second determination unit 3023 is configured to, when the semantic rules belong to a preset function of the first code, based on the corresponding relationships between the preset function of the first code and a preset function of the second code, determine the preset function of the second code corresponding to the semantic rules.
  • the generating unit 3025 is configured to, based on the syntax rules of the second code and/or the preset function of the second code as well as constant and variable information, generate the second code of the second platform application.
  • the second determination unit 3023 includes a first determination subunit 30231 and a processing subunit 30233.
  • the determination subunit 30231 is configured to, when the preset function of the first code is a network communication function, based on the corresponding relationships between the preset function of the first code and the preset function of the second code, determine the preset function of the second code corresponding to the network communication function.
  • the processing subunit 30233 is configured to use the preset address of the proxy server as the destination address of the preset function of the second code corresponding to the network communication function, and use the destination address of the network communication function as parameters of a forwarding destination address of the preset function of the second code corresponding to the network communication function.
  • the apparatus may also include a second acquiring module 304, a third acquiring module 305, and a fourth acquiring module 306.
  • the second acquiring module 304 is configured to acquire file path information of the first platform application to be converted.
  • the third acquiring module 305 is configured to, based on the file path information, acquire files that store the code of the first platform application.
  • the fourth acquiring module 306 is configured to, based on acquiring order of the files in the file path information, acquire the first code of the files that store the code of the first platform application in order.
  • the semantic rules as well as the constant and variable information of the first code of the first platform application to be converted are acquired. Based on preset conversion relation corresponding to the type of the semantic rules in the first code of the first platform application, the semantic rules of the first code are converted. Based on the converted code and the constant and variable information, the second code of the second platform is generated. Then, the second platform application is generated by compiling the second code of the second platform. Without changing the application logic, the speed for generating the same application on different platforms is improved, thus improving the efficiency of application development.
  • semantic rules as well as constant and variable information of a first code of a first platform application to be converted are acquired. Based on preset conversion relation corresponding to the type of the semantic rules in the first code of the first platform application, the semantic rules of the first code are converted. Based on the converted code and the constant and variable information, a second code of a second platform is generated. Then, the second platform application is generated by compiling the second code of the second platform. Without changing the application logic, the speed for generating the same application on different platforms is improved, thus improving the efficiency of application development.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

A cross-platform application conversion method is provided. The method includes acquiring semantic rules as well as constant and variable information of a first code of a first platform application to be converted. The method also includes generating a second code of a second platform application based on the semantic rules as well as the constant and variable information. Further, the method includes generating an executable file of the second platform application by compiling the second code based on the second code of the second platform application.

Description

METHOD AND APPARATUS FOR CROSS-PLATFORM APPLICATION
CONVERSION
CROSS-REFERENCES TO RELATED APPLICATIONS
[0001] This application claims priority of Chinese Patent Application No.
201310323033.5, filed on July 29, 2013, the entire contents of which are incorporated by reference herein.
FIELD OF THE TECHNOLOGY
[0002] The present invention generally relates to computer technologies and, more particularly, to methods and apparatuses for cross-platform application conversion. BACKGROUND
[0003] With development of application technologies, different platform versions of the same application may be released according to actual needs, such that users who use the different platforms can acquire service of the application. For example, different platform versions of a game (i.e. personal computer version, Android platform version, or iOS platform version) may be released for users who use PCs (personal computers) or mobile terminals playing games.
[0004] In current technologies, a method for releasing different platform versions of the same application is: based on code types of the applications corresponding to various platforms, applications corresponding to various platforms are written respectively, and then the code is compiled to generate the versions of the applications corresponding to various platforms. For example, when a C++ client terminal game is developed for Win32 environment, if a browser Flash version of the game needs to be developed, the game needs to be rewritten by using ActionScript scripting language, and then a Flash file in a SWF format is compiled and generated based on the code rewritten by using ActionScript scripting language.
[0005] That is, when writing different platform versions of the same application, the code needs to be rewritten based on different code types. Therefore, this process may consume more time, impacting application development progress. The disclosed method and apparatus are directed to solve one or more problems set forth above and other problems.
BRIEF SUMMARY OF THE DISCLOSURE
[0006] One aspect of the present disclosure includes a cross-platform application conversion method. The method includes acquiring semantic rules as well as constant and variable information of a first code of a first platform application to be converted. The method also includes generating a second code of a second platform application based on the semantic rules as well as the constant and variable information. Further, the method includes generating an executable file of the second platform application by compiling the second code based on the second code of the second platform application. [0007] Further, when the semantic rules belong to syntax rules of the first code, based on corresponding relationships between the syntax rules of the first code and syntax rules of the second code, the syntax rules of the second code corresponding to the semantic rules are determined. When the semantic rules belong to preset function of the first code, based on corresponding relationship between the preset function of the first code and a preset function of the second code, the preset function of the second code corresponding to the semantic rules is determined. Based on any one of the syntax rules of the second code and the preset function of the second code, as well as the constant and variable information, the second code of the second platform application is generated.
[0008] Another aspect of the present disclosure includes a cross-platform application conversion apparatus. The apparatus includes a first acquiring module configured to acquire semantic rules as well as constant and variable information of a first code of a first platform application to be converted. The apparatus also includes a generating module configured to, based on the semantic rules as well as the constant and variable information, generate a second code of a second platform application. Further, the apparatus includes a compile module configured to, based on the second code of the second platform application, generate an executable file of the second platform application by compiling the second code.
[0009] Further, the generating module includes a first determination unit, a second determination unit, and a generating unit. The first determination unit is configured to, when the semantic rules belong to syntax rules of the first code, based on the corresponding relationships between the syntax rules of the first code and syntax rules of the second code, determine the syntax rules of the second code corresponding to the semantic rules. The second determination unit is configured to, when the semantic rules belong to a preset function of the first code, based on corresponding relationships between the preset function of the first code and a preset function of the second code, determine the preset function of the second code corresponding to the semantic rules. The generating unit is configured to, based on any one of the syntax rules of the second code and the preset function of the second code as well as the constant and variable information, generate the second code of the second platform application.
[0010] Further, the second determination unit further includes a determination subunit and a processing subunit. The determination subunit is configured to, when the preset function of the first code is a network communication function, based on corresponding relationships between the preset function of the first code and the preset function of the second code, determine the preset function of the second code corresponding to the network communication function. The processing subunit is configured to use a preset address of a proxy server as a destination address of the preset function of the second code corresponding to the network communication function, and use the destination address of the network communication function as parameters of a forwarding destination address of the preset function of the second code corresponding to the network communication function.
[0011] Further, the apparatus includes a second acquiring module, a third acquiring module, and a fourth acquiring module. The second acquiring module is configured to acquire file path information of the first platform application to be converted. The third acquiring module is configured to acquire files that store the code of the first platform application based on the file path information. The fourth acquiring module is configured to acquire the first code of the files that store the code of the first platform application in order based on acquiring order of the files in the file path information.
[0012] Other aspects of the present disclosure can be understood by those skilled in the art in light of the description, the claims, and the drawings of the present disclosure.
BRIEF DESCRIPTION OF THE DRAWINGS
[0013] In order to describe the technical solution of the embodiments of the present invention more clearly, drawings used in the description of the embodiments are introduced below. The drawings described below are merely some exemplary embodiments of the present invention. For those skilled in the art, on the premise of no inventive effort being involved, other drawings may also be obtained according to these drawings and the descriptions included herein.
[0014] Figure 1 shows a flow chart of an exemplary cross-platform application conversion process consistent with the disclosed embodiments; [0015] Figure 2 shows a flow chart of another exemplary cross-platform application conversion process consistent with the disclosed embodiments;
[0016] Figure 3 shows a structure diagram of an exemplary cross-platform application conversion apparatus consistent with the disclosed embodiments;
[0017] Figure 4 shows a structure diagram of an exemplary generating module consistent with the disclosed embodiments;
[0018] Figure 5 shows a schematic diagram of an exemplary cross-platform application conversion process consistent with the disclosed embodiments;
[0019] Figure 6 shows a schematic diagram of an exemplary cross-platform engine framework model consistent with the disclosed embodiments; [0020] Figure 7 shows a structure diagram of an exemplary cross-platform engine framework model consistent with the disclosed embodiments; and
[0021] Figure 8 shows a block diagram of an exemplary computing system according to the disclosed embodiments. DETAILED DESCRIPTION
[0022] In order to explain the objectives, technical solutions and advantages of the present invention more clearly, the embodiments of the present invention will be further described in detail below in conjunction with the drawings. [0023] The following acronyms and definitions may be used through this disclosure to illustrate certain embodiments of the present invention.
[0024] UFO: UFO is a framework built on top of a low level virtual machine (LLVM) compiler infrastructure, including an application layer, a framework layer, and a platform layer. The UFO framework is used for developing cross-platform applications, which supports iOS, Android, Symbian, Win32, WP7, Bada, and iMac platform.
[0025] Low Level Virtual Machine (LLVM): LLVM is a compiler infrastructure written in C++. LLVM is designed for compile-time, link-time, and run-time optimization of programs written in arbitrary programming languages.
[0026] ActionScript3 (AS3): AS3 is a productive object-oriented script programming language for Adobe Flash Player platform that is used on Webpages in the form of embedded SWF files.
[0027] FlasCC: FlasCC provides a complete BSD-like C/C++ development environment based on GCC that lets developers compile C/C++ code to target the Adobe Flash Runtimes (Flash Player and AIR). With FlasCC, the developers can port existing C/C++ code to the web, across browsers. [0028] SWF (Shockwave Flash): SWF is an Adobe Flash file format used for multimedia, vector graphics and ActionScript. The SWF files can contain animations or applets of varying degrees of interactivity and function.
[0029] SWC (Shockwave Flash Component): a SWC file is a package of precompiled Flash symbols and ActionScript code that allows a Flash developer to distribute classes and assets, or to avoid recompiling symbols and code that will not change. A SWC file is compressed by means of the ZIP archive format. An uncompressed SWC file contains at least a catalog.xml file, and a SWF file, usually named "library.swf". The SWC file may also contain other files, such as CSS files. [0030] Makefile: Makefile contains rules that are used to manage compiled projects, which allow a user to specify which files are created from which others, and then run appropriate commands to update the created files.
[0031] Figure 8 shows a block diagram of an exemplary computer system 800 capable of implementing cross-platform application conversion. [0001] As shown in Figure 8, computer system 800 may include a processor 802, a storage medium 804, a monitor 806, a communication module 808, a database 810, and peripherals 812. Certain devices may be omitted and other devices may be included.
[0002] Processor 802 may include any appropriate processor or processors. Further, processor 802 can include multiple cores for multi-thread or parallel processing. Storage medium 504 may include memory modules, such as ROM, RAM, flash memory modules, and erasable and rewritable memory, and mass storages, such as CD-ROM, U-disk, and hard disk, etc. Storage medium 804 may store computer programs for implementing various processes, when executed by processor 802.
[0003] Further, peripherals 812 may include I/O devices such as keyboard and mouse, and communication module 808 may include network devices for establishing connections through the communication network. Database 810 may include one or more databases for storing certain data and for performing certain operations on the stored data, such as database searching.
[0004] In operation, computer system 800 may perform certain service for cross-platform application conversion. Figure 5 shows a schematic diagram of an exemplary cross-platform application conversion process consistent with the disclosed embodiments. As shown in Figure 5, UFO is a framework built on top of a low level virtual machine (LLVM) compiler infrastructure, including an application layer, a framework layer, and a platform layer. The cross-platform application conversion may be implemented by using a Flash platform on the bottom level of interface. For example, FlasCC uses a version of LLVM-GCC with a custom LLVM backend that generates ActionScript bytecode (a SWF or SWC file) capable of running within the Flash Runtime. More specifically, the bytecode runs in the ActionScript virtual machine (AVM). Thus, any C/C++ code can be compiled into ActionScript code capable of implementing cross-platform application conversion.
[0005] Figure 1 shows a flow chart of an exemplary cross-platform application conversion process performed on or by the computer system consistent with the disclosed embodiments. As shown in Figure 1, the process may include the following steps.
[0006] Step 101: acquiring semantic rules as well as constant and variable information of a first code of a first platform application to be converted, after the computer obtains the first code of a first platform application from, for example, a user input, a computer storage, another computer system or another application program.
[0007] Step 102: based on the semantic rules as well as the constant and variable information, generating a second code of a second platform application.
[0008] Step 103: based on the second code of the second platform application, generating an executable file of the second platform application by compiling the second code.
[0009] The semantic rules as well as the constant and variable information of the first code of the first platform application to be converted are first acquired. Based on preset conversion relation corresponding to the type of the semantic rules in the first code, the semantic rules of the first code are converted. Based on the converted code and the constant and variable information, the second code of the second platform is generated. Then, the second platform application is generated by compiling the second code of the second platform. Thus, without the need to change the application logic, the speed of generating the same application for different platforms is improved, improving the efficiency of application development.
[0010] Figure 2 shows a flow chart of another exemplary cross-platform application conversion process consistent with the disclosed embodiments. It should be noted that, in this exemplary embodiment, a first platform application is written in C++ language for a Win32 platform on a PC, and a second platform application is written in ActionScript language for a browser platform on a PC. As shown in Figure 2, the process may include the following steps.
[0011] Step 201: acquiring file path information of a first platform application to be converted. [0012] Before acquiring code of the first platform application, the current process for converting the application code needs to be configured. For example, at least file path information of project source code of the first platform application needs to be set. Based on the file path information, a source code file of the application that stores the code is acquired. [0013] Further, the file name of the second platform application generated after converting can be also included. The path information of the resource file of the first platform application needed in the compile process can be also included, such as path information of image files, video files and audio files. The way to find the file path of the project source code can be also included. For example, a recursion search is implemented or not. That is, after the file path information is given, whether a deeper level file path contained in the file path information is searched. The file path information of header files involved in the file code of the first platform application can be also included.
[0014] Step 202: based on the file path information, acquiring one or more files that store the code of the first platform application. [0015] The file path information may include the file path information of one or more files. Therefore, based on the file path information of one or more files included in the file path information, the files that store the code of the first platform application are acquired in order based on the order of the file path information is acquired.
[0016] Step 203: based on the acquiring order of the files in the file path information, acquiring the first code of the code files of the first platform application in order.
[0017] Step 204: acquiring semantic rules as well as constant and variable information of the first code of the first platform application to be converted. [0018] The semantic rules of the first code may include two types. The first type of the semantic rules is syntax rules of the first code. For example, if the code is A+B=C, a syntax rule is an assignment statement, where A and B can be a variable or a constant; or the syntax rule is a cyclic operation, etc. [0019] The corresponding relationships among the syntax rules of the code
corresponding to different platforms are pre-stored. That is, the corresponding relationships between the syntax rules of C++ code and the syntax rules of ActionScript code are pre-stored herein. As the application logic on different platforms is the same, based on the above- mentioned corresponding relationships and the constants and variables that are added to the syntax rules of the converted second code, the syntax rules of the code can be converted.
[0020] The second type of the semantic rules is a preset function of the first code.
Specifically, the corresponding relationships among different functions for different platforms are pre-stored. For example, the corresponding relationships between functions of C++ code and functions of ActionScript code are pre-stored herein. In the acquired code, every function in C++ code is searched in order in the corresponding relationships between the functions of C++ code and the functions of ActionScript code, and the ActionScript function corresponding to every C++ function is acquired in order.
[0021] Figure 6 shows a schematic diagram of an exemplary cross-platform engine framework model consistent with the disclosed embodiments. In the embodiments of the present disclosure, UFO uses C++ language as a programing language. FlasCC compiles C/C++ code into SWF or SWC files, calls AS3 code in C/C++, and uses a SWC library compiled by C/C++ in AS3 code. Thus, AS3 code in the platform interface layer implements interfaces to realize applications for the Flash platform. [0022] Further, the client-based engine framework model mainly includes a native UFO Engine, an application layer, a framework layer, and a platform layer. The application layer and the framework layer are platform-independent. The platform layer abstracts the concrete platform layer interfaces. For example, a Win32 platform, an Android platform, an iOS platform, a Bada platform, a WinPhone8 platform and an iMac platform have the corresponding platform layers, respectively. In the Flash-based platform, flash_render, flash_socket and flash_sound modules are configured to support for Flash runtime, and FlasCC compiles and generates an executable SWF file.
[0023] Figure 7 shows a structure diagram of an exemplary cross-platform engine framework model consistent with the disclosed embodiments. As shown in Figure 7, the cross- platform engine framework model mainly includes an application layer, a framework layer, a platform interface layer, an application common module, and Flash Runtime.
[0024] The platform interface layer mainly includes a rendering interface layer, a system interface layer, a network interface layer, a sound interface layer, and an event interface layer.
[0025] The rendering interface layer is configured for rendering the related interface functions directly using corresponding Flash functions for implementation. For example, a drawBitmap function in C++ corresponds to a Bitmap function in ActionScript. A drawText function in C++ corresponds to one of TextField functions in ActionScript. A
drawRect/drawLine function in C++ corresponds to a Graphic function in ActionScript.
[0026] Further, the system interface layer implements system interface functions. The system interface functions may include ufo_system_common.h, ufo_system_ui.h, etc. The ufo_system_common.h mainly includes certain time interface functions and directory interface functions. The time interface functions can be implemented by the corresponding time functions in ActionScript. The directory interface functions are implemented by a virtual file system (VFS) provided in a tool for transcoding to simulate the local directories and store some configuration data. The ufo_system_ui.h mainly includes a text edit box function, a built-in browser function, etc. The edit box function corresponds to the TextField function in ActionScript.
[0027] The event interface layer provides event interface functions. The event interface functions mainly include ufoOnTouchDown (), ufoOnTouchUp (), ufoOnTouchMove (), ufoOnKeyDown () and ufoOnKeyUp (), which correspond to mouse and keyboard event functions in ActionScript.
[0028] The sound interface layer provides sound functions. Flash platform only supports a MP3 audio format, but not supports an ogg audio format, so the current sound interface is temporarily implemented only in the MP3 audio format. To compile the applications, file format conversion tools need to be used to convert files with the ogg audio format into files with the MP3 audio format.
[0029] The network interface layer provides network communication for the applications. Network requests are implemented by asynchronous processing of new threads. Thread tasks are added to the events per frame. The network communication is implemented by using Socket. Socket function of Flash is asynchronous. Currently, the way to implement cross-domain access is to create a new proxy server. The Socket network proxy needs to implement the following functions: based on a received Internet Protocol (IP) port, connecting to the IP port;
implementing a secure domain protocol to return a secure domain file; and based on the received domain name, implementing simple domain name resolution service to return a parsed IP. [0030] After the above interfaces are implemented, the entire Flash platform interface layer can be compiled as a library file (libufoplatform.a), and only a link is needed for subsequent application projects.
[0031] Based on the platform interface layer, the application layer and the framework layer include a user interface (UI) component library, a Scud interface animation engine, a physical engine, particle effect, and so on. The application layer is used directly by various applications, therefore the application layer needs to be compiled into a library supported by FlasCC.
[0032] In addition, an application common module includes splash screen, log on, set and other functions, which can be also used directly by various applications. Currently, the application common module is compiled as libGameComm.a, and various functions in the application common module are compiled into the corresponding functions in ActionScript.
[0033] Further, the proxy server receives a network communication request sent from a Flash application, and forwards the request. After receiving feedback data, the proxy server forwards the feedback data to the Flash application that sends the network communication request.
[0034] Therefore, an original destination address in the network communication function corresponding to C++ is changed to a preset address of the proxy server, and a destination address in the network communication function corresponding to C++ is set in the network communication function corresponding to ActionScript as parameters of a forwarding destination address. Thus, when the Flash application sends the network communication function corresponding to ActionScript to implement the network communication request, based on the parameters of the forwarding destination address, the proxy server forwards the network communication request. The conversion process for network communication function is as follows.
[0035] When the preset function is the network communication function, based on a corresponding relationship between the preset function and an intermediate function, the intermediate function corresponding to the network communication function is determined.
[0036] The preset address of the proxy server is used as the destination address of the intermediate function corresponding to the network communication function, and the destination address of the network communication function is used as the parameters of the forwarding destination address of the intermediate function corresponding to the network communication function.
[0037] Therefore, in Step 204, the process for acquiring the semantic rules as well as the constant and variable information of the first code of the first platform application to be converted includes the following steps.
[0038] Step 2041: when the semantic rules belong to syntax rules of the first code, based on the corresponding relationships between the syntax rules of the first code and the syntax rules of the second code, the syntax rules of the second code corresponding to the semantic rules are determined.
[0039] Step 2042: when the semantic rules belong to the preset function of the first code, based on the corresponding relationships between the preset function of the first code and a preset function of the second code, the preset function of the second code corresponding to the semantic rules is determined. [0040] After the preset function of the second code corresponding to the semantic rules is found, the original constant and variable information is added to a corresponding position in the preset function of the second code.
[0041] When the preset function of the first code is the network communication function, this step may include the folio wings.
[0042] When the preset function of the first code is the network communication function, based on the corresponding relationships between the preset function of the first code and the preset function of the second code, the preset function of the second code corresponding to the network communication function is determined.
[0043] The preset address of the proxy server is used as the destination address of the preset function of the second code corresponding to the network communication function, and the destination address of the network communication function is used as the parameters of the forwarding destination address of the preset function of the second code corresponding to the network communication function.
[0044] Step 2043: based on the syntax rules of the second code and/or the preset function of the second code, as well as the constant and variable information, the second code of the second platform application is generated.
[0045] Step 205: based on the second code, an executable file of the second platform application is generated by compiling the second code.
[0046] After acquiring the ActionScript intermediate code and intermediate function of the second platform application, the ActionScript intermediate code and intermediate function are compiled to generate a corresponding Flash SWF executable file. Thus, the process for converting the first platform application to the second application is completed.
[0047] The process for compiling C++ code in an application frame layer and Flash code in a FLASH runtime includes the following two steps. [0048] Step 1: compiling UFO and the application common module.
[0049] After entering a directory: UFO/UFO_Application/UFO_Application/main/flash, a command (i.e. make alllibs) is executed in the directory.
[0050] Step 2: creating a new flash directory in a build directory of an application project (e.g., on-line QQ game), and then creating a new Makefile file in the flash directory. [0051] For example, makefile file code for a QQ Mahjong game is as follows:
#
TARGET: = QQMJ.swf
CONSOLE = $(DEFAULT_CONSOLE)
RESDIR:= ../../../../../Client/Client_QQMJ/build_res #resource file directory LIB +=
SRC_FILE_DIRS += ../../client/game/QQMJ #application project source directory, makefile can automatically search.cpp/.c/.cc file in the application project source directory
SRC_DIR_RECURSION = N # judging whether a recursive search is implemented.
SRC_FILES+= ../../client/init.cpp # other source code file SRCDIR = ../../../../../Client/Client_QQMJ/Client_QQMJ
INCLUDE += -I$(SRCDIR)/includes # adding a header file directory INCLUDE += -I$(SRCDIR)/cfg INCLUDE += -I$(SRCDIR)/client/includes
# include ../../../../../UFO/UFO_Application/UFO_ApplicatioiVmaiiVflash/Make_Flash.inc
# Make_Flash.inc must be included in the application project, and the directory including Make_Flash.inc may be adjusted
#
[0052] A Make command is executed completely. If the compile process is successful, a SWF file is generated. Flash Player can implement the generated SWF file. If the compile process is unsuccessful, the corresponding process is executed based on cause of failure. When the code needs to be modified, the following pre-compiled conditions can be used to modify the code.
#ifdef _AVM2_ #endif
[0053] The semantic rules as well as the constant and variable information of the first code of the first platform application to be converted are acquired. Based on preset conversion relation corresponding to the type of the semantic rules in the first code of the first platform application, the semantic rules of the first code are converted. Based on the converted code and the constant and variable information, the second code of the second platform is generated. Then, the second platform application is generated by compiling the second code of the second platform. Without changing the application logic, the speed for generating the same application on different platforms is improved, thus improving the efficiency of application development.
[0054] Figure 3 shows a structure diagram of an exemplary cross-platform application conversion apparatus consistent with the disclosed embodiments. As shown in Figure 3, the apparatus may include a first acquiring module 301, a generating module 302, and a compile module 303.
[0055] The first acquiring module 301 is configured to acquire semantic rules as well as constant and variable information of a first code of a first platform application to be converted.
[0056] The generating module 302 is configured to, based on the semantic rules as well as the constant and variable information, generate a second code of a second platform application.
[0057] The compile module 303 is configured to, based on the second code of the second platform application, generate an executable file of the second platform application by compiling the second code.
[0058] Figure 4 shows a structure diagram of an exemplary generating module consistent with the disclosed embodiments. As shown in Figure 4, a generating module 302 includes a first determination unit 3021, a second determination unit 3023 and a generating unit 3025.
[0059] The first determination unit 3021 is configured to, when semantic rules belong to syntax rules of a first code, based on the corresponding relationships between the syntax rules of the first code and syntax rules of a second code, determine the syntax rules of the second code corresponding to the semantic rules.
[0060] The second determination unit 3023 is configured to, when the semantic rules belong to a preset function of the first code, based on the corresponding relationships between the preset function of the first code and a preset function of the second code, determine the preset function of the second code corresponding to the semantic rules. [0061] The generating unit 3025 is configured to, based on the syntax rules of the second code and/or the preset function of the second code as well as constant and variable information, generate the second code of the second platform application.
[0062] Further, the second determination unit 3023 includes a first determination subunit 30231 and a processing subunit 30233.
[0063] The determination subunit 30231 is configured to, when the preset function of the first code is a network communication function, based on the corresponding relationships between the preset function of the first code and the preset function of the second code, determine the preset function of the second code corresponding to the network communication function.
[0064] The processing subunit 30233 is configured to use the preset address of the proxy server as the destination address of the preset function of the second code corresponding to the network communication function, and use the destination address of the network communication function as parameters of a forwarding destination address of the preset function of the second code corresponding to the network communication function.
[0065] The apparatus may also include a second acquiring module 304, a third acquiring module 305, and a fourth acquiring module 306.
[0066] The second acquiring module 304 is configured to acquire file path information of the first platform application to be converted. [0067] The third acquiring module 305 is configured to, based on the file path information, acquire files that store the code of the first platform application. [0068] The fourth acquiring module 306 is configured to, based on acquiring order of the files in the file path information, acquire the first code of the files that store the code of the first platform application in order.
[0069] The semantic rules as well as the constant and variable information of the first code of the first platform application to be converted are acquired. Based on preset conversion relation corresponding to the type of the semantic rules in the first code of the first platform application, the semantic rules of the first code are converted. Based on the converted code and the constant and variable information, the second code of the second platform is generated. Then, the second platform application is generated by compiling the second code of the second platform. Without changing the application logic, the speed for generating the same application on different platforms is improved, thus improving the efficiency of application development.
[0070] The reference numbers of the above-mentioned embodiments of the present invention are merely for description, rather than representing whether the embodiment is good or bad.
[0071] Those skilled in the art would understand that all or some of the steps for realizing the above-mentioned embodiments can be achieved by hardware, and can also be achieved by instructing relevant hardware by a program, which program can be stored in a computer readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk or an optical disk.
[0072] What are mentioned above are merely preferred embodiments of the present invention, which are not intended to limit the present invention; and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be covered in the scope of protection of the present invention. INDUSTRIAL APPLICABILITY AND ADVANTAGEOUS EFFECTS
[0073] Without limiting the scope of any claim and/or the specification, examples of industrial applicability and certain advantageous effects of the disclosed embodiments are listed for illustrative purposes. Various alternations, modifications, or equivalents to the technical solutions of the disclosed embodiments can be obvious to those skilled in the art and can be included in this disclosure.
[0074] By using the disclosed methods and apparatuses for cross-platform application conversion, semantic rules as well as constant and variable information of a first code of a first platform application to be converted are acquired. Based on preset conversion relation corresponding to the type of the semantic rules in the first code of the first platform application, the semantic rules of the first code are converted. Based on the converted code and the constant and variable information, a second code of a second platform is generated. Then, the second platform application is generated by compiling the second code of the second platform. Without changing the application logic, the speed for generating the same application on different platforms is improved, thus improving the efficiency of application development.

Claims

What is claimed is:
1. A cross-platform application conversion method, comprising: acquiring semantic rules as well as constant and variable information of a first code of a first platform application to be converted; based on the semantic rules as well as the constant and variable information, generating a second code of a second platform application, different from the first platform application; and based on the second code of the second platform application, generating an executable file of the second platform application by compiling the second code.
2. The method according to claim 1, further including: when the semantic rules belong to syntax rules of the first code, based on corresponding relationships between the syntax rules of the first code and syntax rules of the second code, determining the syntax rules of the second code corresponding to the semantic rules; when the semantic rules belong to preset function of the first code, based on corresponding relationship between the preset function of the first code and a preset function of the second code, determining the preset function of the second code corresponding to the semantic rules; and based on any one of the syntax rules of the second code, the preset function of the second code, and the constant and variable information, generating the second code of the second platform application.
3. The method according to claim 2, wherein determining the preset function of the second code corresponding to the semantic rules further includes: when the preset function of the first code is a network communication function, based on the corresponding relationships between the preset function of the first code and the preset function of the second code, determining the preset function of the second code corresponding to the network communication function; using a preset address of a proxy server as a destination address of the preset function of the second code corresponding to the network communication function; and using the destination address of the network communication function as parameters of a forwarding destination address of the preset function of the second code corresponding to the network communication function.
4. The method according to claim 2, before acquiring semantic rules as well as constant and variable information of a first code of a first platform application to be converted, further including: acquiring file path information of the first platform application to be converted; based on the file path information, acquiring one or more files that store the code of the first platform application; based on the acquiring order of the files in the file path information, acquiring the first code of the code files of the first platform application in order; and acquiring the semantic rules as well as the constant and variable information of the first code of the first platform application to be converted.
5. The method according to claim 4, wherein: before acquiring code of the first platform application, a current process for converting the application code is set, at least file path information of project source code of the first platform application is set.
6. The method according to claim 5, wherein: the file path information includes the file path information of one or more files.
7. The method according to claim 2, further including: pre-storing the corresponding relationships among the syntax rules of the code
corresponding to different platforms; and pre-storing the corresponding relationships among different functions for different platforms.
8. A cross-platform application conversion apparatus, comprising: a first acquiring module configured to acquire semantic rules as well as constant and variable information of a first code of a first platform application to be converted; a generating module configured to, based on the semantic rules as well as the constant and variable information, generate a second code of a second platform application; and a compile module configured to, based on the second code of the second platform application, generate an executable file of the second platform application by compiling the second code.
9. The apparatus according to claim 8, wherein the generating module further includes: a first determination unit configured to, when the semantic rules belong to syntax rules of the first code, based on the corresponding relationships between the syntax rules of the first code and syntax rules of the second code, determine the syntax rules of the second code corresponding to the semantic rules; a second determination unit configured to, when the semantic rules belong to a preset function of the first code, based on corresponding relationships between the preset function of the first code and a preset function of the second code, determine the preset function of the second code corresponding to the semantic rules; and a generating unit configured to, based on any one of the syntax rules of the second code and the preset function of the second code as well as the constant and variable information, generate the second code of the second platform application.
10. The apparatus according to claim 9, wherein the second determination unit further
includes: a determination subunit configured to, when the preset function of the first code is a network communication function, based on corresponding relationships between the preset function of the first code and the preset function of the second code, determine the preset function of the second code corresponding to the network communication function; and a processing subunit configured to use a preset address of a proxy server as a destination address of the preset function of the second code corresponding to the network communication function, and use the destination address of the network communication function as parameters of a forwarding destination address of the preset function of the second code corresponding to the network communication function.
11. The apparatus according to claim 8, further including: a second acquiring module configured to acquire file path information of the first platform application to be converted; a third acquiring module configured to, based on the file path information, acquire files that store the code of the first platform application; and a fourth acquiring module configured to, based on acquiring order of the files in the file path information, acquire the first code of the files that store the code of the first platform application in order.
12. The apparatus according to claim 11, wherein: before acquiring code of the first platform application, a current process for converting the application code is set, at least file path information of project source code of the first platform application is set.
13. The apparatus according to claim 12, wherein: the file path information includes the file path information of one or more files.
14. The apparatus according to claim 9, wherein: the corresponding relationships among the syntax rules of the code corresponding to different platforms are pre-stored; and the corresponding relationships among different functions for different platforms are stored.
PCT/CN2014/076858 2013-07-29 2014-05-06 Method and apparatus for cross-platform application conversion WO2015014143A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310323033.5A CN104346146B (en) 2013-07-29 2013-07-29 A kind of method of cross-platform transformation applications code and device
CN201310323033.5 2013-07-29

Publications (1)

Publication Number Publication Date
WO2015014143A1 true WO2015014143A1 (en) 2015-02-05

Family

ID=52430945

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/076858 WO2015014143A1 (en) 2013-07-29 2014-05-06 Method and apparatus for cross-platform application conversion

Country Status (4)

Country Link
CN (1) CN104346146B (en)
AR (1) AR097097A1 (en)
TW (1) TWI528288B (en)
WO (1) WO2015014143A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110363425A (en) * 2019-07-15 2019-10-22 何永安 Recognition methods, device, system, server and the storage medium of cross-platform things
CN113626390A (en) * 2021-08-20 2021-11-09 中国第一汽车股份有限公司 BB file generation method and device, electronic equipment and storage medium
CN116700727A (en) * 2023-06-21 2023-09-05 广州洋葱时尚集团有限公司 Cross-platform data processing method and system

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105590051B (en) * 2015-11-18 2018-10-23 中国银联股份有限公司 Trusted application for credible performing environment generates and installation method
CN108595184B (en) * 2018-04-19 2022-02-11 北京微播视界科技有限公司 Code conversion method, device, computer storage medium and code conversion terminal
CN109725927B (en) * 2018-05-08 2023-07-21 中国平安人寿保险股份有限公司 Synchronization method and device of code management system, storage medium and terminal
CN108717357B (en) * 2018-05-23 2023-11-10 中国平安人寿保险股份有限公司 Page display code conversion method, device, equipment and computer storage medium
CN111580821B (en) * 2019-02-15 2022-10-25 厦门雅基软件有限公司 Script binding method and device, electronic equipment and computer readable storage medium
CN110716746B (en) * 2019-09-03 2023-04-07 五八有限公司 Method and device for converting RN style code into applet style code
CN111142935A (en) * 2019-12-31 2020-05-12 奇安信科技集团股份有限公司 Method, apparatus, computer system, and medium for cross-platform running of applications
CN111694572A (en) * 2020-05-27 2020-09-22 平安普惠企业管理有限公司 Code format conversion method, device, computer equipment and storage medium
CN113709019A (en) * 2021-08-27 2021-11-26 广州易方信息科技股份有限公司 Cross-platform bridging method, device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080127088A1 (en) * 2006-11-27 2008-05-29 Red Hat, Inc. Cross-platform software package generation
CN102567422A (en) * 2010-12-27 2012-07-11 北大方正集团有限公司 Page display method and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101945081A (en) * 2009-07-06 2011-01-12 北京易路联动技术有限公司 Code conversion method, system and server of class webpage applications

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080127088A1 (en) * 2006-11-27 2008-05-29 Red Hat, Inc. Cross-platform software package generation
CN102567422A (en) * 2010-12-27 2012-07-11 北大方正集团有限公司 Page display method and equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110363425A (en) * 2019-07-15 2019-10-22 何永安 Recognition methods, device, system, server and the storage medium of cross-platform things
CN110363425B (en) * 2019-07-15 2023-09-05 何永安 Cross-platform object identification method, device, system, server and storage medium
CN113626390A (en) * 2021-08-20 2021-11-09 中国第一汽车股份有限公司 BB file generation method and device, electronic equipment and storage medium
CN116700727A (en) * 2023-06-21 2023-09-05 广州洋葱时尚集团有限公司 Cross-platform data processing method and system
CN116700727B (en) * 2023-06-21 2024-02-13 广州洋葱时尚集团有限公司 Cross-platform data processing method and system

Also Published As

Publication number Publication date
AR097097A1 (en) 2016-02-17
CN104346146B (en) 2016-05-04
TWI528288B (en) 2016-04-01
CN104346146A (en) 2015-02-11
TW201504947A (en) 2015-02-01

Similar Documents

Publication Publication Date Title
WO2015014143A1 (en) Method and apparatus for cross-platform application conversion
US10209968B2 (en) Application compiling
CN108762815B (en) Method for realizing Android running environment based on non-virtualization system architecture
CN106843869B (en) Front-end development engineering system and method
US8615750B1 (en) Optimizing application compiling
JP6294886B2 (en) Generate native code from intermediate language code for applications
JP6122493B2 (en) Adaptively portable library
US20130167123A1 (en) Application debugging
US7478366B2 (en) Debugger and method for debugging computer programs across multiple programming languages
US7516441B2 (en) Method and system for program editing and debugging in a common language runtime environment
EP3035191B1 (en) Identifying source code used to build executable files
US8850414B2 (en) Direct access of language metadata
US8490117B1 (en) Bridging script engines
CN106933610B (en) Application program installation package generation method and device and electronic equipment
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
US8607203B1 (en) Test automation framework using dependency injection
Donovan et al. PNaCl: Portable native client executables
US8701096B2 (en) In-order execution in an asynchronous programming environment
JP2012512489A (en) User script code conversion for debugging
KR20220092615A (en) Just-In-Time Containers
CN113805882A (en) Method and device for developing application program, electronic equipment and storage medium
WO2022257503A1 (en) Translation method and apparatus for game
KR101219874B1 (en) Code morphing
US9141356B2 (en) Process for generating dynamic type
CN113515286A (en) Applet generating and running method, device, equipment and storage medium

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: 14831700

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02.08.2016)

122 Ep: pct application non-entry in european phase

Ref document number: 14831700

Country of ref document: EP

Kind code of ref document: A1