CN109032606A - The process of compilation method, apparatus and terminal of native applications program - Google Patents

The process of compilation method, apparatus and terminal of native applications program Download PDF

Info

Publication number
CN109032606A
CN109032606A CN201810753513.8A CN201810753513A CN109032606A CN 109032606 A CN109032606 A CN 109032606A CN 201810753513 A CN201810753513 A CN 201810753513A CN 109032606 A CN109032606 A CN 109032606A
Authority
CN
China
Prior art keywords
code
native applications
format
tree
converted
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.)
Granted
Application number
CN201810753513.8A
Other languages
Chinese (zh)
Other versions
CN109032606B (en
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 CN201810753513.8A priority Critical patent/CN109032606B/en
Publication of CN109032606A publication Critical patent/CN109032606A/en
Application granted granted Critical
Publication of CN109032606B publication Critical patent/CN109032606B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

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)

Abstract

The disclosure is directed to a kind of process of compilation method, apparatus of native applications program and terminals, which comprises obtain the source code of native applications program, the source code is write using preceding end instruction;According to preset syntax conversion library, the source code is converted, obtains intermediate code, the intermediate code is write using the language of control page service logic;According to the intermediate code, the executable code of the native applications program is generated.This method passes through the intermediate code that is converted into writing using the language of control page service logic by the source code write using preceding end instruction, so that the source code write using preceding end instruction can directly be run based on the operating system for running native applications, native applications are developed using the development scheme of Web application to realize, improve the portability of front-end code.Meanwhile developer can be accustomed to developing native applications according to the exploitation of front end, the also significant increase development efficiency of native applications.

Description

The process of compilation method, apparatus and terminal of native applications program
Technical field
This disclosure relates to computer field, in particular to the process of compilation method, apparatus of a kind of native applications program and end End.
Background technique
With the rapid development of mobile communication technology, there is the application program more and more run on mobile terminals (Application, APP).Wherein, the application program run on mobile terminals can be mainly divided into answering based on browser With i.e. Web application and native applications.Wherein, Web application needs the support of browser to carry out page presentation and user again Interaction, native applications directly directly can manipulate hardware device using language and tool etc. provided by operating system provider.
In the related technology, Web application can be used HTML5 technology and be developed, and native applications are according to the operation system of operation System, is developed using language provided by operating system provider and tool.
Summary of the invention
The embodiment of the present disclosure provides the process of compilation method, apparatus and terminal of a kind of native applications program, the technology Scheme is as follows.
According to the first aspect of the embodiments of the present disclosure, a kind of process of compilation method of native applications program is provided, comprising:
The source code of native applications program is obtained, the source code is write using preceding end instruction;
According to preset syntax conversion library, the source code is converted, obtains intermediate code, the intermediate code makes It is write with the language of control page service logic, the intermediate code, according to the intermediate code, generates the original for terminal The executable code of raw application program.
The technical solution that the embodiment of the present disclosure provides can include the following benefits:
What the language by the way that the source code for using preceding end instruction to write to be converted into using control page service logic was write Intermediate code, so that the source code write using preceding end instruction can be based on the operating system for running native applications come directly Operation develops native applications using the development scheme of Web application to realize, improves the portability of front-end code.Meanwhile Developer can be accustomed to developing native applications according to the exploitation of front end, also the significant increase development efficiency of native applications. Also, the various experience of Web application may be implemented using the obtained native applications of this method, therefore can also be used with significant increase The usage experience at family.
Further, the native applications program is fast application;
The front end language includes hypertext markup language HTML5, java script language JS and Cascading Style Sheet CSS;
The intermediate code is the code of JS format.
It is further, described that the source code is converted, intermediate code is obtained according to preset syntax conversion library, Include:
According to preset syntax conversion library, by the source code HTML5 code and CSS code be converted into JS generation Code;
JS code combination in the JS code being converted to and the source code is formed into the intermediate code.
The technical solution that the embodiment of the present disclosure provides can include the following benefits:
By by source code HTML5 code and CSS code conversion be JS code, can not only realize will be unable to base In the code that operating system is directly run be converted into can based on the code that operating system is directly run, and due to selection JS make For intermediate code, therefore, it is possible to reduce the size of code for needing to convert promotes the efficiency of code conversion.
Further, described according to preset syntax conversion library, by the source code HTML5 and CSS be converted into JS, comprising:
According to the picture transformation rule in the preset syntax conversion library, by the figure of HTML5 format in the source code The picture of piece code and CSS format is converted into the picture code of JS format;And/or
According to the text conversion rule in the preset syntax conversion library, by the text of HTML5 format in the source code Word code and the text conversion of CSS format at JS format character code;And/or
According to the list transformation rule in the preset syntax conversion library, by the column of HTML5 format in the source code The list of table code and CSS format is converted into the List code of JS format.
Further, described according to the intermediate code, generate the executable code of the native applications program, comprising:
The intermediate code is loaded using preset engine, generates tree-like component code;
According to the tree-like component code, the executable code of the native applications program is generated.
Further, further includes:
Receive the operation instruction of user;
According to the operation instruction of the user, the tree-like component code is updated.
Further, further includes:
Receive the update instruction that server is sent;
According to the update instruction that the server is sent, the tree-like component code is updated.
It is further, described to update the tree-like component code, comprising:
Determine the element to be updated in the tree-like component code;
The element to be updated is executed and updates operation, the update operation includes increasing operation, delete operation or repairing Change operation.
According to the second aspect of an embodiment of the present disclosure, a kind of process of compilation device of native applications program is provided, comprising:
Module is obtained, is configured as obtaining the source code of native applications program, the source code is write using preceding end instruction;
Conversion module is configured as converting the source code according to preset syntax conversion library, obtaining intermediate generation Code, the intermediate code are write using the language of control page service logic, and the intermediate code is for terminal according in described Between code, generate the executable code of the native applications program.
Further, the native applications program is fast application;
The front end language includes hypertext markup language HTML5, java script language JS and Cascading Style Sheet CSS;
The intermediate code is the code of JS format.
Further, the conversion module includes:
Transform subblock, is configured as according to preset syntax conversion library, by the source code HTML5 code and CSS code is converted into JS code;
Submodule is combined, the JS code combination being configured as in the JS code that will be converted to and the source code is formed The intermediate code.
Further, the transform subblock is configured as:
According to the picture transformation rule in the preset syntax conversion library, by the figure of HTML5 format in the source code The picture of piece code and CSS format is converted into the picture code of JS format;And/or
According to the text conversion rule in the preset syntax conversion library, by the text of HTML5 format in the source code Word code and the text conversion of CSS format at JS format character code;And/or
According to the list transformation rule in the preset syntax conversion library, by the column of HTML5 format in the source code The list of table code and CSS format is converted into the List code of JS format.
Further, described according to the intermediate code, the executable code for generating the native applications program includes:
The intermediate code is loaded using preset engine, generates tree-like component code;
According to the tree-like component code, the executable code of the native applications program is generated.
Further, further includes:
First receiving module is configured as receiving the operation instruction of user;
First update module is configured as the operation instruction according to the user, updates the tree-like component code.
Further, further includes:
Second receiving module is configured as receiving the update instruction that server is sent;
Second update module is configured as the update instruction sent according to the server, updates the tree-like component generation Code.
It is further, described to update the tree-like component code, comprising:
Determine the element to be updated in the tree-like component code;
The element to be updated is executed and updates operation, the update operation includes increasing operation, delete operation or repairing Change operation.
According to the third aspect of an embodiment of the present disclosure, a kind of terminal is provided, the terminal includes:
Processor;
For storing the memory of the executable instruction of the processor;
Wherein, the processor is configured to executing method and step described in above-mentioned first aspect.
According to a fourth aspect of embodiments of the present disclosure, a kind of terminal is provided, the terminal includes:
Memory, processor and computer program, the processor run the computer program and execute above-mentioned first Method and step described in aspect.
According to a fifth aspect of the embodiments of the present disclosure, a kind of computer readable storage medium is provided, is stored on the medium There is computer program, method and step described in above-mentioned first aspect is realized when described program is executed by processor.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure Example, and together with specification for explaining the principles of this disclosure.
Fig. 1 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment;
Fig. 2 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment;
Fig. 3 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment;
Fig. 4 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment;
Fig. 5 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment;
Fig. 6 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment;
Fig. 7 is a kind of modular structure of the process of compilation device of native applications program shown according to an exemplary embodiment Figure;
Fig. 8 is a kind of modular structure of the process of compilation device of native applications program shown according to an exemplary embodiment Figure;
Fig. 9 is a kind of modular structure of the process of compilation device of native applications program shown according to an exemplary embodiment Figure;
Figure 10 is a kind of module knot of the process of compilation device of native applications program shown according to an exemplary embodiment Composition;
Figure 11 is a kind of block diagram of the entity of terminal shown according to an exemplary embodiment;
Figure 12 is a kind of block diagram of terminal 1100 shown according to an exemplary embodiment.
Through the above attached drawings, it has been shown that the specific embodiment of the disclosure will be hereinafter described in more detail.These attached drawings It is not intended to limit the scope of this disclosure concept by any means with verbal description, but is by referring to specific embodiments Those skilled in the art illustrate the concept of the disclosure.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
Following is embodiment of the present disclosure, can be used for executing embodiments of the present disclosure.It is real for disclosure device Undisclosed details in example is applied, embodiments of the present disclosure is please referred to.
It should be noted that for ease of description, " native applications program " is referred to as in disclosure following embodiment " primary Using ".
In the related technology, Web application can be used HTML5 technology and be developed, and native applications are according to the operation system of operation System, is developed using language provided by operating system provider and tool.I.e. for native applications, due to using operation to be Language provided by system provider and tool are developed, therefore, for a native applications, it is necessary to be developed for not More set codes of biconditional operation system, the portability that this will lead to primary code is poor, development efficiency is low.
The disclosure based on the above issues, provides a kind of process of compilation method of native applications program, passes through such as HTML5's Preceding end instruction writes source code, and then by front end language conversion at the code of the control page service logic of such as JS, in turn Executable code is obtained based on intermediate code, native applications are developed using the development scheme of Web application to realize, before improving Hold the portability of code.Meanwhile developer can be accustomed to developing native applications according to the exploitation of front end, also significant increase The development efficiency of native applications.Also, the various bodies of Web application may be implemented using the obtained native applications of this method It tests, therefore can also be with the usage experience of significant increase user.
Fig. 1 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment, The executing subject of this method can be the equipment for carrying out native applications compiling, such as desktop computer etc. is specifically as follows and operates in Compiler in the equipment.As shown in Figure 1, this method comprises:
In step s101, the source code of native applications program is obtained, which is write using preceding end instruction.
After developer has write the source code of native applications using preceding end instruction, this can be obtained by compiler A little source codes.Illustratively, source code is stored under preset catalogue by evolution personnel, and the catalogue is inputted in compiler, In turn, compiler can get these source codes.
Wherein, above-mentioned preceding end instruction refers to the front end page pair for being used to write native applications that developer gets used to Answer the language of code.
In step s 102, according to preset syntax conversion library, above-mentioned source code is converted, intermediate code is obtained, The intermediate code is write using the language of control page service logic.
Above-mentioned preset syntax conversion library is the set for the transformation rule being stored in advance in compiler, using in the set Transformation rule, the source code that preceding end instruction is write can be converted into intermediate code by compiler.
Wherein, above-mentioned intermediate code is write using the language of control page service logic.
Wherein, above-mentioned intermediate code generates holding for above-mentioned native applications program for terminal according to above-mentioned intermediate code Line code.
Front-end code is mainly used for realizing the function of front end page, therefore, in front-end code includes realizing page framework And the code of the functions such as style sheet, these codes are not business logic codes, therefore, these codes can not be directly based upon Operating system where native applications is run.Therefore, in this step, source code is converted by preset syntax conversion library The intermediate code write using the language of control page logic, since intermediate code is compiled using the language of control page service logic It writes, therefore, after the intermediate code is further compiled into executable code, so that it may the operation being directly based upon where native applications System is run.
In turn, optionally, after generating above-mentioned intermediate code, which can be packaged as installation file for Family downloading installation.When the installation file is downloaded in terminal used by a user, after user clicks the installation file, terminal The executable code of above-mentioned native applications program can be generated according to above-mentioned intermediate code, which for example can be can File is executed, under the triggering of user's operation etc., which is activated and runs executable code therein.
In the present embodiment, control page service logic is used by the way that the source code for using preceding end instruction to write to be converted into The intermediate code that language is write, so that the source code write using preceding end instruction can be based on the operation of operation native applications System is directly run, and is developed native applications using the development scheme of Web application to realize, is improved the removable of front-end code Plant property.Meanwhile developer can be accustomed to developing native applications according to the exploitation of front end, also significant increase native applications Development efficiency.Also, the various experience of Web application may be implemented using the obtained native applications of this method, therefore can also be with The usage experience of significant increase user.
As an alternative embodiment, above-mentioned native applications program can be fast application.Fast application is to be different from biography A kind of application applied of uniting is ecological, and user is using in application, installing without downloading, i.e., point is to use, and user can be made fast fastly Speed easily gets required service.
In addition, above-mentioned preceding end instruction may include hypertext markup language (HyperText Markup Language, letter Claim HTML) 5, java script language (Javascript, abbreviation JS) and Cascading Style Sheet (Cascading Style Sheets, abbreviation CSS).
Wherein, HTML5 is the 5th revision version of html language, and HTML5 is mainly responsible for the frame of the page.CSS is responsible for The pattern of the page.JS is responsible for the service logic of the page.In the related art, the exploitation of Web application mainly uses this three, still The code of HTML5 and CSS, which needs to run in a browser, normally to be shown.And in the disclosure, although source code also makes With above-mentioned three kinds of language, but due to having carried out code conversion, code can be made not depend on browser and be directly based upon Operating system executes, that is, realizes and develop native applications using the development approach that Web is applied.
In addition, above-mentioned intermediate code is the code of JS format.
Due to JS be control page service logic language, can unify in the disclosure by front end language conversion at The code of JS format.
It should be noted that disclosure following embodiment all illustrates compilation process by taking above-mentioned optional embodiment as an example. And in addition to above-mentioned optional embodiment, disclosed method also can be applied to other native applications.Above-mentioned preceding end instruction It is also not limited to HTML5, CSS and JS, what above-mentioned intermediate code was also possible to be write with the language of other control service logics Code.
On the basis of the above embodiments, the present embodiment is related to carrying out source code the optional side for being converted to intermediate code Method.
Fig. 2 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment, As shown in Fig. 2, above-mentioned steps S102 includes:
In step s 201, according to preset syntax conversion library, by above-mentioned source code HTML5 code and CSS generation Code is converted into JS code.
In step S202, the JS code combination in the JS code being converted to and above-mentioned source code is formed among the above Between code.
As previously mentioned, HTML5 is mainly responsible for the frame of the page, CSS is responsible for the pattern of the page, and the business that JS is responsible for the page is patrolled Volume.It may include the code of these three types in the source code that developer is write, it will be in the code of these three types HTML5 and CSS is unified is converted into JS code, then the JS code and source code that will be converted to according to preset syntax conversion library In JS be combined, form complete intermediate code.
In the present embodiment, by by source code HTML5 code and CSS code conversion be JS code, can not only Realize the code that will be unable to directly run based on operating system be converted into can based on the code that operating system is directly run, and Due to selecting JS as intermediate code, it is possible to reduce the size of code for needing to convert promotes the efficiency of code conversion.
On the basis of the above embodiments, the present embodiment be related to by source code HTML5 and CSS be converted into the optional of JS Method.
Fig. 3 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment, As shown in figure 3, above-mentioned steps S201 includes:
It, will be in above-mentioned source code according to the picture transformation rule in above-mentioned preset syntax conversion library in step S301 The picture code of HTML5 format and the picture of CSS format are converted into the picture code of JS format.
It in step s 302, will be in above-mentioned source code according to the text conversion rule in above-mentioned preset syntax conversion library The text of HTML5 format and the character code of CSS format are converted into the character code of JS format.
It, will be in above-mentioned source code according to the list transformation rule in above-mentioned preset syntax conversion library in step S303 The list of HTML5 format and the List code of CSS format are converted into the List code of JS format.
It should be noted that in the actual implementation process, above-mentioned steps S301-S303 can be selected according to specific needs All steps, also can choose a portion step.Illustratively, when only including picture and text in source code, Above-mentioned steps S301 and S302 are then only executed, when in source code including picture, text and list, selects above-mentioned step Rapid S301-S303.
In addition, in the actual implementation process, can sequentially be executed according to above-mentioned steps S301-S303, alternatively, can also be with The sequence of above steps is determined by the code sequence in source code, such as list, then can be first before picture in source code Above-mentioned steps S303 is executed, then executes above-mentioned steps S301.The disclosure does not limit the execution sequence of above-mentioned steps S301-S303 It is fixed.
It optionally, include various elements, picture, text and list as escribed above in the page of native applications.Exploitation Personnel when writing source code, may be indicated according to actual needs using HTML5 or CSS above-mentioned picture, text and List.In turn, in compiling, compiler can carry out code conversion according to above-mentioned preset syntax conversion library.
Optionally, transformation rule is set forth for every kind of element in above-mentioned syntax conversion library, when compiler identifies When the element of HTML5 CSS format, the corresponding transformation rule of the element can be searched in syntax conversion library, and according to turning Change code of the rule by the code conversion of HTML5 or CSS format for JS format.
Illustrate transformation rule and conversion process by taking picture element and text element as an example below.
In a kind of example, for picture element, the code write using HTML5 language are as follows:
<image src="http://XXX.GIF"class="image"></image>
For the element, picture transformation rule can be set are as follows:
Then obtained JS code after above-mentioned example code conversion are as follows:
In another example, for text element, the code write using HTML5 language are as follows:
<text class="item-title">test</text>
For the element, text conversion rule can be set are as follows:
Then obtained JS code after above-mentioned example code conversion are as follows:
On the basis of the above embodiments, this implementation is related to generating the optional method of executable code according to intermediate code.
Fig. 4 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment, As shown in figure 4, when generating the executable code of native applications according to intermediate code by terminal in above-mentioned steps S102, it specifically can be with Include:
In step S401, above-mentioned intermediate code is loaded using preset engine, generates tree-like component code.
In step S402, according to above-mentioned tree-like component code, the executable code of above-mentioned native applications program is generated.
Wherein, above-mentioned preset engine can be JS engine, which is loading above-mentioned intermediate code, such as JS code Later, tree-like component code can be generated, which for example can be the code of JS Tree Element format.In turn, eventually End can be saved the tree-like component code that engine exports in the form of executable file, so that it is corresponding to obtain above-mentioned source code Executable code.
In turn, under the triggering of user's operation etc., which can be performed by an operating system, to realize to user Display interface element and the function of being interacted with user.
On the basis of the above embodiments, the present embodiment is related to the process being updated to tree-like component code.
It should be noted that source code has been completed to compile by above-described embodiment.Following embodiments are compilation of source code The process of tree-like component code is updated after the completion, which can be executed by running native applications at the terminal.
Wherein, updating tree-like component code may be triggered by the operation of user, alternatively, may also be touched by server Hair, is illustrated individually below.
Fig. 5 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment, As shown in figure 5, this method further include:
In step S501, the operation instruction of user is received.
In step S502, according to the operation instruction of above-mentioned user, above-mentioned tree-like component code is updated.
Illustratively, it is assumed that a line text is inputted on some page of user's native applications, then the page becomes at this time Change, native applications can modify the corresponding tree-like component code of the page accordingly, and in turn, native applications are notified that operating system is come Update the current page.
Fig. 6 is a kind of flow chart of the process of compilation method of native applications program shown according to an exemplary embodiment, As shown in fig. 6, this method further include:
In step s 601, the update instruction that server is sent is received.
In step S602, according to the update instruction that above-mentioned server is sent, above-mentioned tree-like component code is updated.
Optionally, in native applications operational process, server may send update instruction to native applications, with instruction Update display format, the display content etc. of some page.It, can phase after primary colors application receives the update instruction of server transmission Tree-like component code, and then the page for notifying operating system update current should be updated.
It is primary when updating tree-like component code in above-mentioned steps S502 and S602 in a kind of optional embodiment Using the element to be updated that can be determined first in tree-like component code, in turn, which is executed and updates behaviour Make.Wherein, update operation can be increase operation, delete operation or modification operation.
Illustratively, by taking scene shown in fig. 6 as an example, it is assumed that native applications receive the update instruction of server transmission, Instruction native applications increase picture C above the picture B in page A, then native applications are searched in tree-like component code first Picture B increases the corresponding code of picture C, to realize the update of tree-like component code in turn, before the corresponding code of picture B.Into And native applications notify operating system update page A, operating system can update page A according to new tree-like component code.
Fig. 7 is a kind of modular structure of the process of compilation device of native applications program shown according to an exemplary embodiment Figure, as shown in fig. 7, the device includes:
Module 701 is obtained, is configured as obtaining the source code of native applications program, the source code is compiled using preceding end instruction It writes.
Conversion module 702 is configured as converting the source code according to preset syntax conversion library, obtains Between code, the intermediate code using control page service logic language write, the intermediate code for terminal according to institute Intermediate code is stated, the executable code of the native applications program is generated.
In another embodiment, the native applications program is fast application.
The front end language includes HTML5, Java JS and CSS.
The intermediate code is the code of JS format.
Fig. 8 is a kind of modular structure of the process of compilation device of native applications program shown according to an exemplary embodiment Figure, as shown in figure 8, conversion module 702 includes:
Transform subblock 7021 is configured as according to preset syntax conversion library, by the HTML5 code in the source code And CSS code is converted into JS code;
Combine submodule 7022, the JS code combination being configured as in the JS code that will be converted to and the source code Form the intermediate code.
In another embodiment, transform subblock is configured as:
According to the picture transformation rule in the preset syntax conversion library, by the figure of HTML5 format in the source code The picture of piece code and CSS format is converted into the picture code of JS format;And/or
According to the text conversion rule in the preset syntax conversion library, by the text of HTML5 format in the source code Word code and the text conversion of CSS format at JS format character code;And/or
According to the list transformation rule in the preset syntax conversion library, by the column of HTML5 format in the source code The list of table code and CSS format is converted into the List code of JS format.
It is above-mentioned according to the intermediate code in another embodiment, generate the executable code packet of the native applications program It includes:
The intermediate code is loaded using preset engine, generates tree-like component code.
According to the tree-like component code, the executable code of the native applications program is generated.
Fig. 9 is a kind of modular structure of the process of compilation device of native applications program shown according to an exemplary embodiment Figure, as shown in figure 9, the device further include:
First receiving module 703 is configured as receiving the operation instruction of user.
First update module 704 is configured as the operation instruction according to the user, updates the tree-like component code.
Figure 10 is a kind of module knot of the process of compilation device of native applications program shown according to an exemplary embodiment Composition, as shown in Figure 10, the device further include:
Second receiving module 705 is configured as receiving the update instruction that server is sent.
Second update module 706 is configured as the update instruction sent according to the server, updates the tree-like component Code.
It is described to update the tree-like component code in another embodiment, comprising:
Determine the element to be updated in the tree-like component code;
The element to be updated is executed and updates operation, the update operation includes increasing operation, delete operation or repairing Change operation.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
Figure 11 is a kind of block diagram of the entity of terminal shown according to an exemplary embodiment, as shown in figure 11, the terminal Include:
Memory 91 and processor 92.
Memory 91 is used for the executable instruction of storage processor 92.
Processor 92 is configured as executing method and step described in above method embodiment.
In the embodiment of above-mentioned terminal, it should be appreciated that processor 92 can be central processing submodule (English: Central Processing Unit, referred to as: CPU), it can also be other general processors, digital signal processor (English: Digital Signal Processor, referred to as: DSP), specific integrated circuit (English: Application Specific Integrated Circuit, referred to as: ASIC) etc..General processor can be microprocessor or the processor is also possible to any conventional place Device etc. is managed, and memory above-mentioned can be read-only memory (English: read-only memory, abbreviation: ROM), deposit at random Access to memory (English: random access memory, abbreviation: RAM), flash memory, hard disk or solid state hard disk.SIM Card is also referred to as subscriber identification card, smart card, and digital mobile telephone must load onto this card and can use.I.e. in computer chip On store the information of digital mobile phone client, the contents such as telephone directory of the key of encryption and user.In conjunction with disclosure reality The step of applying method disclosed in example can be embodied directly in hardware processor and execute completion, or in processor hardware and Software module combination executes completion.
Figure 12 is a kind of block diagram of terminal 1200 shown according to an exemplary embodiment.Wherein, terminal 1200 can be Mobile phone, computer, tablet device, personal digital assistant etc..
Referring to Fig.1 2, terminal 1200 may include following one or more components: processing component 1202, memory 1204, Power supply module 1206, multimedia component 1208, audio component 1210, the interface 1212 of input/output (I/O), sensor module 1214 and communication component 1216.
The integrated operation of the usual controlling terminal 1200 of processing component 1202, such as with display, telephone call, data communication, Camera operation and record operate associated operation.Processing component 1202 may include one or more processors 1220 to execute Instruction, to perform all or part of the steps of the methods described above.In addition, processing component 1202 may include one or more moulds Block, convenient for the interaction between processing component 1202 and other assemblies.For example, processing component 1202 may include multi-media module, To facilitate the interaction between multimedia component 1208 and processing component 1202.
Memory 1204 is configured as storing various types of data to support the operation in terminal 1200.These data Example includes the instruction of any application or method for operating in terminal 1200, contact data, telephone book data, Message, picture, video etc..Memory 1204 can by any kind of volatibility or non-volatile memory device or they Combination is realized, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), it is erasable can Program read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory Reservoir, disk or CD.
Power supply module 1206 provides electric power for the various assemblies of terminal 1200.Power supply module 1206 may include power management System, one or more power supplys and other with for terminal 1200 generate, manage, and distribute the associated component of electric power.
Multimedia component 1208 includes that the touch-control of one output interface of offer between the terminal 1200 and user is aobvious Display screen.In some embodiments, touching display screen may include liquid crystal display (LCD) and touch panel (TP).Touch panel Including one or more touch sensors to sense the gesture on touch, slide, and touch panel.The touch sensor can be with The boundary of a touch or slide action is not only sensed, but also detects duration associated with the touch or slide operation and pressure Power.In some embodiments, multimedia component 1208 includes a front camera and/or rear camera.When terminal 1200 In operation mode, such as in a shooting mode or a video mode, front camera and/or rear camera can receive the more of outside Media data.Each front camera and rear camera can be a fixed optical lens system or have focal length and light Learn zoom capabilities.
Audio component 1210 is configured as output and/or input audio signal.For example, audio component 1210 includes a wheat Gram wind (MIC), when terminal 1200 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone quilt It is configured to receive external audio signal.The received audio signal can be further stored in memory 1204 or via communication Component 1216 is sent.In some embodiments, audio component 1210 further includes a loudspeaker, is used for output audio signal.
I/O interface 1212 provides interface, above-mentioned peripheral interface module between processing component 1202 and peripheral interface module It can be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and Locking press button.
Sensor module 1214 includes one or more sensors, and the state for providing various aspects for terminal 1200 is commented Estimate.For example, sensor module 1214 can detecte the state that opens/closes of terminal 1200, the relative positioning of component, such as institute The display and keypad that component is terminal 1200 are stated, sensor module 1214 can also detect terminal 1200 or terminal 1,200 1 The position change of a component, the existence or non-existence that user contacts with terminal 1200,1200 orientation of terminal or acceleration/deceleration and end The temperature change at end 1200.Sensor module 1214 may include proximity sensor, be configured in not any physics It is detected the presence of nearby objects when contact.Sensor module 1214 can also include optical sensor, as CMOS or ccd image are sensed Device, for being used in imaging applications.In some embodiments, which can also include acceleration sensing Device, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 1216 is configured to facilitate the communication of wired or wireless way between terminal 1200 and other equipment.Eventually End 1200 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their combination.It is exemplary at one In embodiment, communication component 1216 receives broadcast singal or broadcast correlation from external broadcasting management system via broadcast channel Information.In one exemplary embodiment, the communication component 1216 further includes near-field communication (NFC) module, to promote short distance Communication.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band can be based in NFC module (UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, terminal 1200 can be by one or more application specific integrated circuit (ASIC), number Signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing above-mentioned native applications program Process of compilation method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided It such as include the memory 1204 of instruction, above-metioned instruction can be executed by the processor 1220 of terminal 1200 to complete the above method.Example Such as, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, soft Disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processing of terminal 1200 When device executes, so that terminal 1200 is able to carry out a kind of process of compilation method of native applications program.The described method includes:
The source code of native applications program is obtained, the source code is write using preceding end instruction;
According to preset syntax conversion library, the source code is converted, obtains intermediate code, the intermediate code makes It is write with the language of control page service logic, the intermediate code, according to the intermediate code, generates the original for terminal The executable code of raw application program.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the disclosure Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following Claims are pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by appended claims System.

Claims (19)

1. a kind of process of compilation method of native applications program characterized by comprising
The source code of native applications program is obtained, the source code is write using preceding end instruction;
According to preset syntax conversion library, the source code is converted, obtains intermediate code, the intermediate code uses control The language of page service logic processed is write, and the intermediate code according to the intermediate code, generates described primary answer for terminal With the executable code of program.
2. the method according to claim 1, wherein the native applications program is fast application;
The front end language includes hypertext markup language HTML5, java script language JS and Cascading Style Sheet CSS;
The intermediate code is the code of JS format.
3. according to the method described in claim 2, it is characterized in that, described according to preset syntax conversion library, to the source generation Code is converted, and intermediate code is obtained, comprising:
According to preset syntax conversion library, by the source code HTML5 code and CSS code be converted into JS code;
JS code combination in the JS code being converted to and the source code is formed into the intermediate code.
4. according to the method described in claim 3, it is characterized in that, described according to preset syntax conversion library, by the source generation HTML5 and CSS in code are converted into JS, comprising:
According to the picture transformation rule in the preset syntax conversion library, by the picture generation of HTML5 format in the source code The picture of code and CSS format is converted into the picture code of JS format;And/or
According to the text conversion rule in the preset syntax conversion library, by the text generation of HTML5 format in the source code Code and CSS format text conversion at JS format character code;And/or
According to the list transformation rule in the preset syntax conversion library, by the list generation of HTML5 format in the source code The list of code and CSS format is converted into the List code of JS format.
5. according to the described in any item methods of right 1-4, which is characterized in that it is described according to the intermediate code, generate the original The executable code of raw application program, comprising:
The intermediate code is loaded using preset engine, generates tree-like component code;
According to the tree-like component code, the executable code of the native applications program is generated.
6. according to the method described in claim 5, it is characterized by further comprising:
Receive the operation instruction of user;
According to the operation instruction of the user, the tree-like component code is updated.
7. according to the method described in claim 5, it is characterized by further comprising:
Receive the update instruction that server is sent;
According to the update instruction that the server is sent, the tree-like component code is updated.
8. method according to claim 6 or 7, which is characterized in that described to update the tree-like component code, comprising:
Determine the element to be updated in the tree-like component code;
The element to be updated is executed and updates operation, the update operation includes increasing operation, delete operation or modification behaviour Make.
9. a kind of process of compilation device of native applications program characterized by comprising
Module is obtained, is configured as obtaining the source code of native applications program, the source code is write using preceding end instruction;
Conversion module is configured as converting the source code according to preset syntax conversion library, obtaining intermediate code, The intermediate code is write using the language of control page service logic, and the intermediate code is for terminal according to the intermediate generation Code, generates the executable code of the native applications program.
10. device according to claim 9, which is characterized in that the native applications program is fast application;
The front end language includes hypertext markup language HTML5, java script language JS and Cascading Style Sheet CSS;
The intermediate code is the code of JS format.
11. device according to claim 10, which is characterized in that the conversion module includes:
Transform subblock is configured as according to preset syntax conversion library, by the HTML5 code and CSS in the source code Code is converted into JS code;
Submodule is combined, the JS code combination being configured as in the JS code that will be converted to and the source code forms described Intermediate code.
12. device according to claim 11, which is characterized in that the transform subblock is configured as:
According to the picture transformation rule in the preset syntax conversion library, by the picture generation of HTML5 format in the source code The picture of code and CSS format is converted into the picture code of JS format;And/or
According to the text conversion rule in the preset syntax conversion library, by the text generation of HTML5 format in the source code Code and CSS format text conversion at JS format character code;And/or
According to the list transformation rule in the preset syntax conversion library, by the list generation of HTML5 format in the source code The list of code and CSS format is converted into the List code of JS format.
13. according to the described in any item devices of claim 9-12, which is characterized in that it is described according to the intermediate code, it generates The executable code of the native applications program includes:
The intermediate code is loaded using preset engine, generates tree-like component code;
According to the tree-like component code, the executable code of the native applications program is generated.
14. device according to claim 13, which is characterized in that further include:
First receiving module is configured as receiving the operation instruction of user;
First update module is configured as the operation instruction according to the user, updates the tree-like component code.
15. device according to claim 13, which is characterized in that further include:
Second receiving module is configured as receiving the update instruction that server is sent;
Second update module is configured as the update instruction sent according to the server, updates the tree-like component code.
16. device according to claim 14 or 15, which is characterized in that described to update the tree-like component code, comprising:
Determine the element to be updated in the tree-like component code;
The element to be updated is executed and updates operation, the update operation includes increasing operation, delete operation or modification behaviour Make.
17. a kind of terminal, which is characterized in that the terminal includes:
Processor;
For storing the memory of the executable instruction of the processor;
Wherein, the processor is configured to perform claim requires the described in any item method and steps of 1-8.
18. a kind of terminal, which is characterized in that the terminal includes:
Memory, processor and computer program, the processor run the computer program perform claim and 1-8 are required to appoint Method and step described in one.
19. a kind of computer readable storage medium, computer program is stored on the medium, which is characterized in that described program Claim 1-8 described in any item method and steps are realized when being executed by processor.
CN201810753513.8A 2018-07-10 2018-07-10 Native application compiling method and device and terminal Active CN109032606B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810753513.8A CN109032606B (en) 2018-07-10 2018-07-10 Native application compiling method and device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810753513.8A CN109032606B (en) 2018-07-10 2018-07-10 Native application compiling method and device and terminal

Publications (2)

Publication Number Publication Date
CN109032606A true CN109032606A (en) 2018-12-18
CN109032606B CN109032606B (en) 2022-03-01

Family

ID=64641718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810753513.8A Active CN109032606B (en) 2018-07-10 2018-07-10 Native application compiling method and device and terminal

Country Status (1)

Country Link
CN (1) CN109032606B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110389754A (en) * 2019-06-18 2019-10-29 北京奇艺世纪科技有限公司 Method for processing business, system, server, terminal, electronic equipment and storage medium
CN110489124A (en) * 2019-07-12 2019-11-22 浙江口碑网络技术有限公司 Source code executes method, apparatus, storage medium and computer equipment
CN110737431A (en) * 2019-09-18 2020-01-31 深圳市金证科技股份有限公司 Software development method, development platform, terminal device and storage medium
CN111488152A (en) * 2019-01-29 2020-08-04 阿里巴巴集团控股有限公司 Method for compiling application program and previewing page, and related device and system
CN111736840A (en) * 2019-09-19 2020-10-02 北京沃东天骏信息技术有限公司 Compiling method and running method of applet, storage medium and electronic equipment
WO2020210994A1 (en) * 2019-04-16 2020-10-22 深圳市欢太科技有限公司 Quick application installation package debugging method and apparatus, and electronic device and storage medium
CN112416351A (en) * 2020-11-24 2021-02-26 广州虎牙科技有限公司 Code adding method and device, electronic equipment and computer readable storage medium
CN112579959A (en) * 2020-12-24 2021-03-30 京东数字科技控股股份有限公司 Application program processing method, device, equipment, storage medium and product
CN112965701A (en) * 2021-02-08 2021-06-15 中国工商银行股份有限公司 Front-end code generation method and device
CN113656042A (en) * 2021-08-24 2021-11-16 北京奇艺世纪科技有限公司 Code generation method and device, electronic equipment and storage medium
CN115373683A (en) * 2022-08-22 2022-11-22 北京字跳网络技术有限公司 Page display method, source code compiling method and related equipment
CN115437620A (en) * 2022-11-09 2022-12-06 广东省科技基础条件平台中心 Natural language programming method, device, equipment and storage medium
US11593077B1 (en) 2021-10-27 2023-02-28 Beijing Bytedance Network Technology Co., Ltd. Method and apparatus of code management

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009225081A (en) * 2008-03-17 2009-10-01 Nec Infrontia Corp Terminal data setting system for telephone exchange switchboard
CN104239071A (en) * 2014-10-13 2014-12-24 浪潮通信信息系统有限公司 Cross-platform mobile application development framework system based on general-purpose module and transfer service
CN105808305A (en) * 2016-03-29 2016-07-27 北京小米移动软件有限公司 Static resource loading method and device
CN105989068A (en) * 2015-02-10 2016-10-05 中国移动通信集团贵州有限公司 Hypertext markup language (HTML) based mobile application generating method and device
CN106293645A (en) * 2015-05-13 2017-01-04 Tcl集团股份有限公司 A kind of method and system improving Web application interface rendering efficiency
CN107632833A (en) * 2017-07-31 2018-01-26 广州神马移动信息科技有限公司 Generation method, equipment and the electronic equipment gently applied
US20180095737A1 (en) * 2014-09-09 2018-04-05 Liveperson, Inc. Dynamic code management

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009225081A (en) * 2008-03-17 2009-10-01 Nec Infrontia Corp Terminal data setting system for telephone exchange switchboard
US20180095737A1 (en) * 2014-09-09 2018-04-05 Liveperson, Inc. Dynamic code management
CN104239071A (en) * 2014-10-13 2014-12-24 浪潮通信信息系统有限公司 Cross-platform mobile application development framework system based on general-purpose module and transfer service
CN105989068A (en) * 2015-02-10 2016-10-05 中国移动通信集团贵州有限公司 Hypertext markup language (HTML) based mobile application generating method and device
CN106293645A (en) * 2015-05-13 2017-01-04 Tcl集团股份有限公司 A kind of method and system improving Web application interface rendering efficiency
CN105808305A (en) * 2016-03-29 2016-07-27 北京小米移动软件有限公司 Static resource loading method and device
CN107632833A (en) * 2017-07-31 2018-01-26 广州神马移动信息科技有限公司 Generation method, equipment and the electronic equipment gently applied

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LZM风雨无阻: "Quikapp快应用开发入门", 《HTTPS://WWW.CNBLOGS.COM/LZMFYWZ/P/8650546.HTML》 *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488152B (en) * 2019-01-29 2023-05-16 阿里巴巴集团控股有限公司 Application program page previewing method, related device and system
CN111488152A (en) * 2019-01-29 2020-08-04 阿里巴巴集团控股有限公司 Method for compiling application program and previewing page, and related device and system
WO2020210994A1 (en) * 2019-04-16 2020-10-22 深圳市欢太科技有限公司 Quick application installation package debugging method and apparatus, and electronic device and storage medium
CN110389754A (en) * 2019-06-18 2019-10-29 北京奇艺世纪科技有限公司 Method for processing business, system, server, terminal, electronic equipment and storage medium
CN110389754B (en) * 2019-06-18 2023-12-15 北京奇艺世纪科技有限公司 Service processing method, system, server, terminal, electronic equipment and storage medium
CN110489124A (en) * 2019-07-12 2019-11-22 浙江口碑网络技术有限公司 Source code executes method, apparatus, storage medium and computer equipment
CN110489124B (en) * 2019-07-12 2023-06-13 浙江口碑网络技术有限公司 Source code execution method, source code execution device, storage medium and computer equipment
CN110737431A (en) * 2019-09-18 2020-01-31 深圳市金证科技股份有限公司 Software development method, development platform, terminal device and storage medium
CN110737431B (en) * 2019-09-18 2023-07-14 深圳市金证科技股份有限公司 Software development method, development platform, terminal device and storage medium
CN111736840A (en) * 2019-09-19 2020-10-02 北京沃东天骏信息技术有限公司 Compiling method and running method of applet, storage medium and electronic equipment
CN112416351A (en) * 2020-11-24 2021-02-26 广州虎牙科技有限公司 Code adding method and device, electronic equipment and computer readable storage medium
CN112579959A (en) * 2020-12-24 2021-03-30 京东数字科技控股股份有限公司 Application program processing method, device, equipment, storage medium and product
CN112965701A (en) * 2021-02-08 2021-06-15 中国工商银行股份有限公司 Front-end code generation method and device
CN112965701B (en) * 2021-02-08 2024-02-09 中国工商银行股份有限公司 Front-end code generation method and device
CN113656042A (en) * 2021-08-24 2021-11-16 北京奇艺世纪科技有限公司 Code generation method and device, electronic equipment and storage medium
WO2023071722A1 (en) * 2021-10-27 2023-05-04 北京字节跳动网络技术有限公司 Code management method and apparatus
US11593077B1 (en) 2021-10-27 2023-02-28 Beijing Bytedance Network Technology Co., Ltd. Method and apparatus of code management
CN115373683A (en) * 2022-08-22 2022-11-22 北京字跳网络技术有限公司 Page display method, source code compiling method and related equipment
CN115437620A (en) * 2022-11-09 2022-12-06 广东省科技基础条件平台中心 Natural language programming method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN109032606B (en) 2022-03-01

Similar Documents

Publication Publication Date Title
CN109032606A (en) The process of compilation method, apparatus and terminal of native applications program
TWI528282B (en) Method for customizing launching of applications
CN106569800B (en) Front-end interface generation method and device
CN110990075B (en) Method, device, equipment and storage medium for starting fast application
CN106126685B (en) Page loading method and device
CN110874217B (en) Interface display method and device for quick application and storage medium
CN104778063A (en) Method and device for updating resource
EP3142006A2 (en) Device control method and apparatus
CN104133844A (en) Method and device for loading webpage
CN107193441B (en) Desktop pendant previewing method and device
CN105808305B (en) Static resource loading method and device
CN104052796A (en) Plug-in processing method, device, system and terminal
CN107423218B (en) Application testing method, device and terminal
CN106201610A (en) Web application accesses the method and device of the primary function of terminal
CN104881304B (en) Resource downloading method and device
CN105630949A (en) Page loading and backspacing method and device
CN107463372B (en) Data-driven page updating method and device
CN104063424B (en) Web page picture shows method and demonstration device
CN111246299A (en) Communication terminal and application management method
US11210449B2 (en) Page display method and device and storage medium
CN108108206A (en) Mobile payment cut-in method and device
CN105808304A (en) Code deployment method, device and system
KR102206426B1 (en) Method and apparatus for providing help of user device
CN108733731B (en) Convenient method and device for changing multimedia resources in document and electronic equipment
Chandnani et al. Evolution of android and its impact on mobile application development

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
GR01 Patent grant
GR01 Patent grant