CN114489681B - Mobile terminal cross-platform development system and method based on browser kernel - Google Patents

Mobile terminal cross-platform development system and method based on browser kernel Download PDF

Info

Publication number
CN114489681B
CN114489681B CN202210359007.7A CN202210359007A CN114489681B CN 114489681 B CN114489681 B CN 114489681B CN 202210359007 A CN202210359007 A CN 202210359007A CN 114489681 B CN114489681 B CN 114489681B
Authority
CN
China
Prior art keywords
page
application
browser kernel
starting time
file
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.)
Active
Application number
CN202210359007.7A
Other languages
Chinese (zh)
Other versions
CN114489681A (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.)
Nanjing Hurricane Engine Information Technology Co ltd
Original Assignee
Nanjing Hurricane Engine Information Technology 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 Nanjing Hurricane Engine Information Technology Co ltd filed Critical Nanjing Hurricane Engine Information Technology Co ltd
Priority to CN202210359007.7A priority Critical patent/CN114489681B/en
Publication of CN114489681A publication Critical patent/CN114489681A/en
Application granted granted Critical
Publication of CN114489681B publication Critical patent/CN114489681B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Abstract

The invention discloses a mobile terminal cross-platform development system and method based on a browser kernel, and belongs to the technical field of computer software development. The system comprises a source code compiling module, a packaging and packaging module, an application manager, a page manager, a loader, a browser kernel selecting module and a communication bridge; according to the method, abstract program source codes can be defined, the source codes are compiled through a compiler, compiled files are packaged, an iOS and an Android application manager perform unpacking and analysis, files are loaded, resources are distributed, a page manager creates a program running environment, and a browser kernel renders the interface. By the method, the code can be compiled once, and the application program which can run on a plurality of platforms can be obtained, so that the development efficiency is improved, the development experience is improved, and the development cost is saved.

Description

Mobile terminal cross-platform development system and method based on browser kernel
Technical Field
The invention relates to the technical field of computer software development, in particular to a mobile terminal cross-platform development system and a mobile terminal cross-platform development method based on a browser kernel.
Background
The application software development is highly related to the operating environment thereof, the currently mainstream mobile terminal operating systems are iOS and Android, the operating environments of the two operating systems are greatly different, and the development languages are greatly different. Therefore, the mainstream development mode in the industry at present is to respectively develop software for two operating systems, namely to develop an iOS application program by using Objective-C or swift language; android applications were developed using JAVA or Kotlin language. The development mode requires developers to master multiple programming languages or developers who master different development languages respectively complete different application developments. For the same software requirement, multiple manpower resources and time are used, multiple codes are compiled, multiple application programs are generated, manpower resource waste is caused, development efficiency is reduced, and maintenance cost is improved.
Currently, the cross-platform scheme in the industry is mainly divided into three technical schemes: web technology, runtime bridging, native rendering, self-rendering engine; the Web technology inherits the development mode of the traditional Web application, but all the capabilities are processed by the browser, most of the Web technology depends on the network environment, the offline operation cannot be performed, a certain performance bottleneck exists, and finally the user experience of the software is poor; when the system runs, bridging is performed, and the performance of the native rendering is improved to a certain extent compared with the Web technology, but development difference caused by difference of operating systems still exists, so that a developer needs to process the native rendering by himself, and development experience is poor; the self-rendering engine is excellent in performance, but because the self-rendering engine adopts a special rendering engine and uses a unique grammar and development framework, a developer cannot develop the self-rendering engine by using a known programming language, and the development cost is still high.
Disclosure of Invention
The present invention is directed to a system and a method for mobile cross-platform development based on a browser kernel, so as to solve the problems in the background art.
In order to solve the technical problems, the invention provides the following technical scheme:
a mobile terminal cross-platform development method based on a browser kernel comprises the following steps:
s1, defining abstract application program source codes, and compiling the source codes through a compiler;
s2, packaging and packaging the compiled file, entering a packager, sending a complete code packet to an application manager by the packager, and unpacking and analyzing by the application manager;
s3, the page manager allocates resources, creates a program runtime environment, and renders the interface through the browser kernel;
and S4, the communication bridge is used for being responsible for communication between the runtime environment and the native application bottom layer, the developer code transmits the signaling to the communication bridge through an interface provided by the communication bridge, and the communication bridge forwards the signaling to the bottom layer operating system and calls the bottom layer function of the operating system.
According to the above technical solution, the source code of the application program defining the abstraction includes:
making abstract definition for application software, wherein the application software is composed of a plurality of pages, and the source code of the application program of each page comprises: html files, css files, js files, json files;
The html file is used for describing an interface view structure of a page and declaring a binding relation with a style and a logic;
the css file is used for describing the presentation style of the page, such as color, size and the like;
the js file is used for describing the logic of the page;
the json file is used for describing the relationship and the additional attribute between pages; the json file comprises
Json, which describes the page path, title, name of all pages under the application.
According to the technical scheme, the compiler is used for reading all source code files, analyzing contents and generating executable page files, and the compiler injects style, logic reference indexes, communication bridge calling methods and component library calling indexes into the executable page files in the compiling process;
the packaging device is used for collecting and arranging the executable page file generated by the compiler, collecting application dependence, and carrying out isolation processing on the component style related to the page to finally form a code package;
the application manager is responsible for storing the code packet to a specified runtime program directory during the runtime of the application, and is responsible for starting, closing, updating and communication among applications of each application;
The application manager further comprises a packet parser;
the package parser is responsible for parsing the code package, parsing the configuration file into runtime data, and mapping the actual runtime path with the configuration path.
The packet parser extracts code packet files in the sandbox directory, reads configuration files in the sandbox directory, establishes a mapping relation table by traversing page configuration in the configuration files and paths in an actual sandbox directory, and simultaneously establishes an actual directory path index table for each executable file in the code packet.
According to the technical scheme, the page manager is responsible for managing pages in a single application, controlling the rendering sequence of the pages, processing the jump relation among the pages, and creating and destroying a runtime environment according to configuration;
the page manager creates a runtime environment for each page;
the page manager stores page data by using a stack structure, when a new page is opened, a page file is pressed from the bottom of a page stack, and the pressed page file is rendered at the top of a view; when a page existing in a page stack is opened, the opened page file is adjusted to the bottom of the page stack so as to be rendered at the top of the view;
When the number of the pages reaches K, or a developer specifies to close the pages, the page manager removes the specified page file from the page stack according to the mapping relation, wherein K is a settable constant.
According to the technical scheme, the method further comprises a browser kernel selection method:
acquiring the starting time of a native application and the starting time of a multi-terminal application under any browser kernel;
the native application starting time refers to the starting time of the running native application software under the native system;
the multi-terminal application starting time refers to the starting time of application software which is run under a native system and used by multiple terminals;
in the present application, the native application and the multi-end application represent applications in the same system, for example, in an IOS system, software a developed based on the IOS system cannot be adapted to an Android system, and at this time, if the Android system also needs to use software a, the Android system needs to be re-developed, but in the current technology, the software a is also the native application of the IOS system, and in the present application, based on the method of the present application, a code can be written only once during the development process, that is, a software B can be generated, which can be adapted to the IOS system and the Android system at the same time (substantially, software B and software a are the same application software, and here, only for the purpose of distinguishing), and software B is called as a multi-end application, and the application open time of software B in the IOS system is slightly different from the application open time of software a in the IOS system, because the native software is better adapted.
Constructing a starting time difference data set, and recording the starting time difference data set
Figure 374259DEST_PATH_IMAGE001
In which
Figure 590477DEST_PATH_IMAGE002
Respectively obtaining the time difference value of the native application starting time and the multi-terminal application starting time under any browser kernel;
constructing a browser kernel set, wherein the browser kernel set comprises all browser kernels adapted to interface rendering;
acquiring a starting time difference value data set of all browser kernels in a browser kernel set;
according to the starting time difference data set of any browser kernel, taking n groups of data as historical data, constructing a prediction model, and predicting to obtain the starting time difference data of the (n + 1) th time of the browser kernel:
constructing an original data structure column by using data in the starting time difference data set, and recording the original data structure column as
Figure 472982DEST_PATH_IMAGE003
(ii) a Wherein
Figure 356624DEST_PATH_IMAGE004
={X0(1),X0(2),X0(3),……,X0(n)};
To pair
Figure 299173DEST_PATH_IMAGE003
Performing gray accumulation generation processing to generate
Figure 65003DEST_PATH_IMAGE005
={X1(1),X1(2),X1(3),……,X1(n)};
Satisfies the following conditions:
Figure 16779DEST_PATH_IMAGE006
wherein m =1, 2, … …, n;
to pair
Figure 489348DEST_PATH_IMAGE005
Processing, calculating in a manner of being close to the mean value, and recording as Z1I.e. Z1={Z1(1),Z1(2),Z1(3),……,Z1(n)};
Satisfies the following conditions:
Figure DEST_PATH_IMAGE007
the calculation results are entered into a matrix B, Y;
wherein the content of the first and second substances,
Figure 868377DEST_PATH_IMAGE008
Figure 643477DEST_PATH_IMAGE009
establishing
Figure 867785DEST_PATH_IMAGE005
The whitening differential equation of (a) is:
Figure 460440DEST_PATH_IMAGE010
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE011
for the development coefficient, b is the ash contribution;
solving to obtain:
Figure 541528DEST_PATH_IMAGE012
the predicted value can be measured:
Figure 750793DEST_PATH_IMAGE013
according to the matrix and the least square method, the following calculation results:
Figure 309950DEST_PATH_IMAGE014
Setting m = n, and substituting into a prediction model to obtain
Figure 22691DEST_PATH_IMAGE015
Is marked as browser kernel number
Figure 946785DEST_PATH_IMAGE016
Secondary startup time difference prediction data;
in the application, the difference value of the starting time belongs to a data type containing uncertain factors, so a grey prediction mode is adopted, the degree of dissimilarity of development trends among system factors is identified, namely, correlation analysis is carried out, the original data is generated and processed to find the law of system change, a data sequence with strong regularity is generated, and then a corresponding differential equation model is established, so that the condition of future development trends of objects is predicted. By using the method, the accuracy can be effectively improved, so that the gap between the native application and the multi-terminal application is further reduced in the future development, and the completely consistent ranks are achieved.
Through a prediction model, calculating to obtain
Figure 879231DEST_PATH_IMAGE016
In the second case, the starting time difference prediction data of all the browser kernels are selected, and the browser kernel with the minimum data is selected as the first
Figure 976500DEST_PATH_IMAGE016
And a browser kernel for secondary interface rendering.
A mobile end cross-platform development system based on a browser kernel comprises a source code compiling module, a packaging and packaging module, an application manager, a page manager, a loader, a browser kernel selecting module and a communication bridge;
The source code compiling module is used for defining an abstract application program source code; the packaging and packaging module is used for compiling the source code through the compiler, packaging and packaging the compiled file into the packager, and the packager sends a complete code package to the application manager; the application manager is used for unpacking and analyzing the complete code packet sent by the packer; the page manager is used for allocating resources, creating a program runtime environment and rendering an interface through a browser kernel; the loader is used for loading the executable code according to the mapping path and providing the executable code for the page manager for injecting the runtime environment; the browser kernel selection module is used for selecting a browser kernel with the lowest application starting time difference according to the constructed prediction model; the communication bridge is used for communicating the runtime environment with the native application bottom layer, and two ends of the bridge are respectively arranged in the page runtime environment and the native runtime environment.
According to the technical scheme, the source code compiling module comprises a software definition sub-module, a page composition sub-module and a compiler;
the software definition submodule is used for making abstract definition on the application software; the page composition submodule is used for grouping application software into a plurality of pages, and the application program source code of each page comprises: html files, css files, js files, json files; the compiler is used for reading all source code files, analyzing contents and generating an executable page file, and the compiler injects style, logical reference indexes, communication bridge calling methods and component library calling indexes into the executable page file in the compiling process;
The html file is used for describing an interface view structure of a page and declaring a binding relation with a style and a logic;
the css file is used for describing the presentation style of the page, such as color, size and the like;
the js file is used for describing the logic of the page;
the json file is used for describing the relationship and the additional attribute between pages; the json file comprises
Json, which describes the page path, title, name of all pages under the application.
According to the technical scheme, the application manager is responsible for storing the code packages to the appointed runtime program directory during the runtime of the application, and is responsible for starting, closing, updating and communication among applications of each application;
the application manager further comprises a packet parser;
the package parser is responsible for parsing the code package, parsing the configuration file into runtime data, and mapping an actual runtime path and a configuration path.
According to the technical scheme, the page manager is responsible for managing pages in a single application, controlling the rendering sequence of the pages, processing the jump relation between the pages, and creating and destroying a runtime environment according to configuration;
The page manager creates a runtime environment for each page;
the page manager stores page data by using a stack structure, when a new page is opened, a page file is pressed from the bottom of a page stack, and the pressed page file is rendered at the top of a view; when a page existing in a page stack is opened, the opened page file is adjusted to the bottom of the page stack so as to be rendered at the top of the view;
when the number of the pages reaches K, or a developer specifies to close the pages, the page manager removes the specified page file from the page stack according to the mapping relation, wherein K is a settable constant.
According to the technical scheme, the browser kernel selection module comprises a data analysis submodule and a prediction selection submodule;
the data analysis submodule is used for acquiring historical data, acquiring a difference value between the starting time of a native application under any browser kernel and the starting time of a multi-terminal application, and analyzing the historical data; the native application starting time refers to the starting time of native application software running under a native system; the multi-terminal application starting time refers to the starting time of multi-terminal application software running under a native system; and the prediction selection submodule is used for constructing a prediction model, acquiring a starting time prediction difference value of the application software of each browser kernel according to the prediction model, and selecting the minimum value as the browser kernel of the interface rendering.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a method which can inherit Web development modes and languages and can ensure certain performance experience. The method can realize lower development cost, can obtain a plurality of application software capable of running on a plurality of platforms by developing once, and has good running performance and basically consistent multi-end user experience;
the invention provides a series of automatic flow tools and highly abstracts the bottom logic, and the final result can be generated without the developer paying attention to the bottom;
meanwhile, the invention is also accompanied with a browser kernel selection mode, so that the running performance gap can be further reduced, and the user experience is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of a mobile terminal cross-platform development system and method based on a browser kernel according to the present invention;
FIG. 2 is a schematic diagram of a system product application structure of the mobile-end cross-platform development system and method based on a browser kernel according to the present invention;
FIG. 3 is a schematic diagram illustrating the working principle of the packet parser of the system and method for mobile cross-platform development based on browser kernel according to the present invention;
FIG. 4 is a schematic diagram illustrating the working principle of the page manager of the mobile cross-platform development system and method based on the browser kernel according to the present invention;
FIG. 5 is a schematic diagram illustrating the working principle of a communication bridge of the mobile-end cross-platform development system and method based on the browser kernel according to the present invention;
FIG. 6 is a schematic diagram of a portion of iOS device preview in accordance with an embodiment of the present invention;
fig. 7 is a schematic diagram of previewing Android devices according to an embodiment of a system and a method for developing a mobile terminal cross-platform based on a browser kernel.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1-7, in the present embodiment:
the main description is the development process and the operation result using the system. Taking a music player as an example, the basic using method and capability of the system can be represented to a certain extent:
defining an abstract application program source code, compiling the source code through a compiler to obtain executable files of two pages as shown in the following table 1, and automatically packaging the executable files by a system;
page name Page content
Play list The page provides a music list, displays pictures and music titles
Player A music player containing multiple pictures for displaying player buttons, the play button calling the communication bridge interface, sending music play signaling, and pausing the button Sending pause playing signaling by using communication bridge interface
TABLE 1
Packaging and packaging the compiled file and entering a packager, gathering and arranging executable page files generated by the compiler by the packager, collecting application dependence, carrying out isolation processing on component styles related to the page to finally form a code packet, sending the complete code packet to an application manager by the packager, and unpacking and analyzing by the application manager;
The package analyzer is responsible for disassembling the code package, analyzing the configuration file into runtime data, and mapping an actual runtime path and a configuration path;
the method comprises the steps that a package parser extracts code package files in a sandbox directory, reads configuration files in the code package files, establishes a mapping relation table by traversing page configuration in the configuration files and paths in an actual sandbox directory, and simultaneously establishes an actual directory path index table for each executable file in the code package;
the page manager allocates resources, creates a program running environment and renders an interface through a browser kernel;
selecting a browser kernel:
acquiring the starting time of a native application and the starting time of a multi-terminal application under any browser kernel;
the native application starting time refers to the starting time of the running native application software under the native system;
the multi-terminal application starting time refers to the starting time of application software which is run under a native system and used by multiple terminals;
constructing a starting time difference data set, and recording the starting time difference data set
Figure 809327DEST_PATH_IMAGE001
In which
Figure 966639DEST_PATH_IMAGE002
Respectively obtaining the time difference value of the native application starting time and the multi-terminal application starting time under any browser kernel;
constructing a browser kernel set, wherein the browser kernel set comprises all browser kernels adapted to interface rendering; comprises a Trident kernel, a Gecko kernel, a WebKit kernel and a Blink kernel;
Acquiring a starting time difference value data set of all browser kernels in a browser kernel set;
according to the starting time difference data set of any browser kernel, taking n groups of data as historical data, constructing a prediction model, and predicting to obtain the starting time difference data of the (n + 1) th time of the browser kernel:
constructing an original data structure column by using data in the starting time difference data set, and recording the original data structure column as
Figure 884916DEST_PATH_IMAGE003
(ii) a Wherein
Figure 785876DEST_PATH_IMAGE004
={X0(1),X0(2),X0(3),……,X0(n)};
To pair
Figure 207630DEST_PATH_IMAGE003
Performing gray accumulation generation processing to generate
Figure 739106DEST_PATH_IMAGE005
={X1(1),X1(2),X1(3),……,X1(n)};
Satisfies the following conditions:
Figure 879100DEST_PATH_IMAGE006
wherein m =1, 2, … …, n;
to pair
Figure 82286DEST_PATH_IMAGE005
Processing, calculating in a manner of being close to the mean value, and recording as Z1I.e. Z1={Z1(1),Z1(2),Z1(3),……,Z1(n)};
Satisfies the following conditions:
Figure 889705DEST_PATH_IMAGE017
the calculation results are entered into a matrix B, Y;
wherein the content of the first and second substances,
Figure 388819DEST_PATH_IMAGE008
Figure 16110DEST_PATH_IMAGE009
establishing
Figure 462135DEST_PATH_IMAGE005
The whitening differential equation of (a) is:
Figure 858481DEST_PATH_IMAGE010
wherein the content of the first and second substances,
Figure 528497DEST_PATH_IMAGE011
for the development coefficient, b is the ash contribution;
solving to obtain:
Figure 908662DEST_PATH_IMAGE018
the predicted value can be measured:
Figure 689537DEST_PATH_IMAGE019
according to the matrix and the least square method, the following calculation results:
Figure 409231DEST_PATH_IMAGE014
setting m = n, and substituting into a prediction model to obtain
Figure 751613DEST_PATH_IMAGE015
Is marked as browser kernel number
Figure 619075DEST_PATH_IMAGE016
Secondary startup time difference prediction data;
through a prediction model, calculating to obtain
Figure 203640DEST_PATH_IMAGE016
In the second case, the starting time difference prediction data of all the browser kernels are selected, and the browser kernel with the minimum data is selected as the first
Figure 574578DEST_PATH_IMAGE016
And a browser kernel for secondary interface rendering.
The communication bridge is used for being responsible for communication between the runtime environment and the native application bottom layer, the developer codes transmit the signaling to the communication bridge through an interface provided by the communication bridge, and the communication bridge forwards the signaling to the bottom layer operating system and calls the bottom layer function of the operating system.
The player is processed on the iOS device and the Android device, and the generated pages are as shown in fig. 6 and fig. 7.
In this example 2:
the mobile terminal cross-platform development system based on the browser kernel is arranged and comprises a source code compiling module, a packaging and packaging module, an application manager, a page manager, a loader, a browser kernel selecting module and a communication bridge;
the source code compiling module is used for defining an abstract application program source code; the packaging and packaging module is used for compiling the source code through the compiler, packaging and packaging the compiled file into the packager, and the packager sends a complete code package to the application manager; the application manager is used for unpacking and analyzing the complete code packet sent by the packer; the page manager is used for allocating resources, creating a program runtime environment and rendering an interface through a browser kernel; the loader is used for loading the executable code according to the mapping path and providing the executable code for the page manager for injecting the runtime environment; the browser kernel selection module is used for selecting the browser kernel with the lowest application starting time difference value according to the constructed prediction model; the communication bridge is used for communicating the runtime environment with the native application bottom layer, and two ends of the bridge are respectively arranged in the page runtime environment and the native runtime environment.
The source code compiling module comprises a software definition sub-module, a page composition sub-module and a compiler;
the software definition submodule is used for making abstract definition on the application software; the page composition submodule is used for grouping the application software into a plurality of pages, and the application program source code of each page comprises: html files, css files, js files, json files; the compiler is used for reading all source code files, analyzing contents and generating executable page files, and the compiler injects style, logical reference indexes, communication bridge calling methods and component library calling indexes into the executable page files in the compiling process;
the html file is used for describing an interface view structure of a page and declaring a binding relation with a style and a logic;
the css file is used for describing the presentation style of the page;
the js file is used for describing the logic of the page;
the json file is used for describing the relationship and the additional attribute between pages; the json file comprises
Json, which describes the page path, title, name of all pages under the application.
The application manager is responsible for storing the code packet to a specified runtime program directory during the runtime of the application, and is responsible for starting, closing, updating and communication among applications of each application;
The application manager further comprises a packet parser;
the package parser is responsible for parsing the code package, parsing the configuration file into runtime data, and mapping the actual runtime path with the configuration path.
The page manager is responsible for managing pages in a single application, controlling the rendering sequence of the pages, processing the jump relation among the pages, and creating and destroying a runtime environment according to configuration;
the page manager creates a runtime environment for each page;
the page manager stores page data by using a stack structure, when a new page is opened, a page file is pressed from the bottom of a page stack, and the pressed page file is rendered at the top of a view; when a page which already exists in the page stack is opened, the opened page file is adjusted to the bottom of the page stack so as to be rendered at the top of the view;
when the number of the pages reaches K, or a developer specifies to close the pages, the page manager removes the specified page file from the page stack according to the mapping relation, wherein K is a settable constant.
The browser kernel selection module comprises a data analysis submodule and a prediction selection submodule;
The data analysis submodule is used for acquiring historical data, acquiring a difference value between the starting time of a native application under any browser kernel and the starting time of a multi-terminal application, and analyzing the historical data; the native application starting time refers to the starting time of native application software running under a native system; the multi-terminal application starting time refers to the starting time of multi-terminal application software running under a native system; the prediction selection submodule is used for constructing a prediction model, obtaining a prediction difference value of the starting time of the application software of each browser kernel according to the prediction model, and selecting the minimum value as the browser kernel of the current interface rendering.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described above, or equivalents may be substituted for elements thereof. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. A mobile terminal cross-platform development method based on a browser kernel is characterized in that: the method comprises the following steps:
s1, defining an abstract application program source code, and compiling the source code through a compiler;
s2, packaging and packaging the compiled files, entering a packager, sending a complete code package to an application manager by the packager, and unpacking and analyzing by the application manager;
s3, the page manager allocates resources, creates a program runtime environment, and renders the interface through the browser kernel;
s4, the communication bridge is used for being responsible for communication between the runtime environment and the native application bottom layer, the developer code transmits the signaling to the communication bridge through an interface provided by the communication bridge, and the communication bridge forwards the signaling to the bottom layer operating system and calls the bottom layer function of the operating system;
The abstract defining application source code comprises:
making abstract definition for application software, wherein the application software is composed of a plurality of pages, and the source code of the application program of each page comprises: html files, css files, js files, json files;
the html file is used for describing an interface view structure of a page and declaring a binding relationship with a style and logic;
the css file is used for describing the presentation style of the page;
the js file is used for describing the logic of the page;
the json file is used for describing the relationship and the additional attribute between pages; the json file comprises
Json, which is used for describing page paths, titles and names of all pages under an application;
the compiler is used for reading all source code files, analyzing contents and generating an executable page file, and the compiler injects style, logical reference indexes, communication bridge calling methods and component library calling indexes into the executable page file in the compiling process;
the packaging device is used for collecting and arranging the executable page file generated by the compiler, collecting application dependence, and carrying out isolation processing on the component style related to the page to finally form a code package;
The application manager is responsible for storing the code packages to a specified runtime program directory during application runtime and is responsible for starting, closing, updating and communication among applications of each application;
the application manager further comprises a packet parser;
the package analyzer is responsible for disassembling the code package, analyzing the configuration file into runtime data, and mapping an actual runtime path and a configuration path;
the page manager is responsible for managing pages in a single application, controlling the rendering sequence of the pages, processing the jump relation among the pages, and creating and destroying a runtime environment according to configuration;
the page manager creates a runtime environment for each page;
the page manager stores page data by using a stack structure, when a new page is opened, a page file is pressed from the bottom of a page stack, and the pressed page file is rendered at the top of a view; when a page existing in a page stack is opened, the opened page file is adjusted to the bottom of the page stack so as to be rendered at the top of the view;
when the number of the pages reaches K, or a developer specifies to close the pages, the page manager removes the specified page file from the page stack according to the mapping relation, wherein K is a settable constant.
2. The method for mobile end cross-platform development based on the browser kernel as claimed in claim 1, wherein: the method also comprises a browser kernel selection method:
acquiring the starting time of a native application and the starting time of a multi-terminal application under any browser kernel;
the native application starting time refers to the starting time of native application software running under a native system;
the multi-terminal application starting time refers to the starting time of multi-terminal application software running under a native system;
constructing a starting time difference data set, and recording the starting time difference data set
Figure DEST_PATH_IMAGE002
In which
Figure DEST_PATH_IMAGE004
Respectively obtaining the time difference value of the native application starting time and the multi-terminal application starting time under any browser kernel;
constructing a browser kernel set, wherein the browser kernel set comprises all browser kernels adapted to interface rendering;
acquiring a starting time difference value data set of all browser kernels in a browser kernel set;
according to the starting time difference data set of any browser kernel, taking n groups of data as historical data, constructing a prediction model, and predicting to obtain the starting time difference data of the (n + 1) th time of the browser kernel:
constructing an original data structure column by using data in the starting time difference data set, and recording the original data structure column as
Figure DEST_PATH_IMAGE006
(ii) a Wherein
Figure DEST_PATH_IMAGE008
={X0(1),X0(2),X0(3),……,X0(n)};
To pair
Figure 344586DEST_PATH_IMAGE006
Performing gray accumulation generation processing to generate
Figure DEST_PATH_IMAGE010
={X1(1),X1(2),X1(3),……,X1(n)};
Satisfies the following conditions:
Figure DEST_PATH_IMAGE012
wherein m =1, 2, … …, n;
to pair
Figure 137092DEST_PATH_IMAGE010
Processing, calculating in a manner of being close to the mean value, and recording as Z1I.e. Z1={Z1(1),Z1(2),Z1(3),……,Z1(n)};
Satisfies the following conditions:
Figure DEST_PATH_IMAGE014
the calculation results are entered into a matrix B, Y;
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE015
Figure DEST_PATH_IMAGE016
establishing
Figure 261037DEST_PATH_IMAGE010
The whitening differential equation of (a) is:
Figure DEST_PATH_IMAGE018
wherein the content of the first and second substances,
Figure DEST_PATH_IMAGE020
for the development coefficient, b is the ash contribution;
solving to obtain:
Figure DEST_PATH_IMAGE022
the predicted value can be measured:
Figure DEST_PATH_IMAGE024
according to the matrix and the least square method, the following calculation results:
Figure DEST_PATH_IMAGE026
setting m = n, and substituting into a prediction model to obtain
Figure DEST_PATH_IMAGE028
Is marked as browser kernel number
Figure DEST_PATH_IMAGE030
Secondary startup time difference prediction data;
through a prediction model, calculating to obtain
Figure 82012DEST_PATH_IMAGE030
In the second case, the starting time difference prediction data of all the browser kernels are selected, and the browser kernel with the minimum data is selected as the first
Figure 365226DEST_PATH_IMAGE030
And a browser kernel for secondary interface rendering.
3. The mobile cross-platform development system based on the browser kernel, which applies the mobile cross-platform development method based on the browser kernel as recited in claim 1, is characterized in that: the system comprises a source code compiling module, a packaging and packaging module, an application manager, a page manager, a loader, a browser kernel selecting module and a communication bridge;
The source code compiling module is used for defining an abstract application program source code; the packaging and packaging module is used for compiling the source code through the compiler, packaging and packaging the compiled file into the packager, and the packager sends a complete code package to the application manager; the application manager is used for unpacking and analyzing the complete code packet sent by the packer; the page manager is used for allocating resources, creating a program runtime environment and rendering an interface through a browser kernel; the loader is used for loading the executable code according to the mapping path and providing the executable code for the page manager for injecting the runtime environment; the browser kernel selection module is used for selecting a browser kernel with the lowest application starting time difference according to the constructed prediction model; the communication bridge is used for communicating the runtime environment with the native application bottom layer, and two ends of the bridge are respectively arranged in the page runtime environment and the native runtime environment.
4. The browser kernel-based mobile end-to-platform development system of the browser kernel-based mobile end-to-platform development method according to claim 3, characterized in that: the source code compiling module comprises a software definition sub-module, a page composition sub-module and a compiler;
The software definition submodule is used for making abstract definition on the application software; the page composition submodule is used for grouping the application software into a plurality of pages, and the application program source code of each page comprises: html files, css files, js files, json files; the compiler is used for reading all source code files, analyzing contents and generating executable page files, and the compiler injects style, logical reference indexes, communication bridge calling methods and component library calling indexes into the executable page files in the compiling process;
the html file is used for describing an interface view structure of a page and declaring a binding relation with a style and a logic;
the css file is used for describing the presentation style of the page;
the js file is used for describing the logic of the page;
the json file is used for describing the relationship and the additional attribute between pages; the json file comprises
Json, which describes the page path, title, name of all pages under the application.
5. The mobile cross-platform development system based on the browser kernel of the mobile cross-platform development method based on the browser kernel of claim 3, wherein: the application manager is responsible for storing the code packages to a specified runtime program directory during application runtime and is responsible for starting, closing, updating and communication among applications of each application;
The application manager further comprises a packet parser;
the package parser is responsible for parsing the code package, parsing the configuration file into runtime data, and mapping the actual runtime path with the configuration path.
6. The browser kernel-based mobile end-to-platform development system of the browser kernel-based mobile end-to-platform development method according to claim 3, characterized in that: the page manager is responsible for managing pages in a single application, controlling the rendering sequence of the pages, processing the jump relation among the pages, and creating and destroying a runtime environment according to configuration;
the page manager creates a runtime environment for each page;
the page manager stores page data by using a stack structure, when a new page is opened, a page file is pressed from the bottom of a page stack, and the pressed page file is rendered at the top of a view; when a page which already exists in the page stack is opened, the opened page file is adjusted to the bottom of the page stack so as to be rendered at the top of the view;
when the number of the pages reaches K, or a developer specifies to close the pages, the page manager removes the specified page file from the page stack according to the mapping relation, wherein K is a settable constant.
7. The mobile cross-platform development system based on the browser kernel of the mobile cross-platform development method based on the browser kernel of claim 3, wherein: the browser kernel selection module comprises a data analysis submodule and a prediction selection submodule;
the data analysis submodule is used for acquiring historical data, acquiring a difference value between the starting time of a native application under any browser kernel and the starting time of a multi-terminal application, and analyzing the historical data; the native application starting time refers to the starting time of the running native application software under the native system; the multi-terminal application starting time refers to the starting time of application software which is run under a native system and used by multiple terminals; and the prediction selection submodule is used for constructing a prediction model, acquiring a starting time prediction difference value of the application software of each browser kernel according to the prediction model, and selecting the minimum value as the browser kernel of the interface rendering.
CN202210359007.7A 2022-04-07 2022-04-07 Mobile terminal cross-platform development system and method based on browser kernel Active CN114489681B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210359007.7A CN114489681B (en) 2022-04-07 2022-04-07 Mobile terminal cross-platform development system and method based on browser kernel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210359007.7A CN114489681B (en) 2022-04-07 2022-04-07 Mobile terminal cross-platform development system and method based on browser kernel

Publications (2)

Publication Number Publication Date
CN114489681A CN114489681A (en) 2022-05-13
CN114489681B true CN114489681B (en) 2022-06-28

Family

ID=81489194

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210359007.7A Active CN114489681B (en) 2022-04-07 2022-04-07 Mobile terminal cross-platform development system and method based on browser kernel

Country Status (1)

Country Link
CN (1) CN114489681B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116126647B (en) * 2023-04-17 2023-06-20 南京飓风引擎信息技术有限公司 Data linkage analysis system suitable for digital enterprises

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030226145A1 (en) * 2002-05-31 2003-12-04 Marsh David J. Entering programming preferences while browsing an electronic programming guide
CN102843393A (en) * 2011-06-22 2012-12-26 腾讯科技(深圳)有限公司 Running device and method of network application
CN108563475A (en) * 2018-04-16 2018-09-21 百度在线网络技术(北京)有限公司 Operation method, device and the storage medium of application program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030226145A1 (en) * 2002-05-31 2003-12-04 Marsh David J. Entering programming preferences while browsing an electronic programming guide
CN102843393A (en) * 2011-06-22 2012-12-26 腾讯科技(深圳)有限公司 Running device and method of network application
CN108563475A (en) * 2018-04-16 2018-09-21 百度在线网络技术(北京)有限公司 Operation method, device and the storage medium of application program

Also Published As

Publication number Publication date
CN114489681A (en) 2022-05-13

Similar Documents

Publication Publication Date Title
US10481877B2 (en) Producer graph oriented programming and execution
Adler R in a nutshell: A desktop quick reference
CN105426172B (en) Dynamic web pages generation method based on XML analytic technique and template instruction
CN1987863B (en) Method and system comprising accessible role and state information in html documents
CN110069683B (en) Method and device for crawling data based on browser
CN102142016A (en) Cross-browser interactivity recording, playback and editing
CN110286917A (en) File packing method, device, equipment and storage medium
CA2345256A1 (en) Text object compilation method and system
CN109976729B (en) Storage and computing display globally configurable data analysis software architecture design method
van der Hoeven et al. Development of a universal virtual computer (UVC) for long-term preservation of digital objects
CN113031932B (en) Project development method, apparatus, electronic device and storage medium
CN109814865B (en) Mobile application page generation method based on json data format
CN114489681B (en) Mobile terminal cross-platform development system and method based on browser kernel
Standridge et al. TESS—the extended simulation support system
EP2756396B1 (en) Simulation of static members and parameterized constructors on an interface-based api
CN102006512B (en) Digital television HSML (Hypertext Service Markup Language) analysis method and system applying SAX (The Simple API for XML) analysis engine
Bufor et al. Integrating object-oriented scripting languages with HyTime
Flynn et al. On Instruction Sets and Their Fornmts
Stroulia et al. Reverse engineering interaction plans for legacy interface migration
JP2005122398A (en) Dynamic document generating program, recording medium thereof, dynamic document generating device, and dynamic document generating method
de Oliveira et al. Clouds and Reproducibility: A Way to Go to Scientific Experiments?
Doglio Mastering Python High Performance
CN116781965B (en) Virtual article synthesis method, apparatus, electronic device, and computer-readable medium
Ward et al. Structured Development for Real-Time Systems, Vol. III: Implementation Modeling Techniques
Reiser BAIL

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