CN109683990A - H5 multiterminal cut-in method based on mixed mode mobile application - Google Patents

H5 multiterminal cut-in method based on mixed mode mobile application Download PDF

Info

Publication number
CN109683990A
CN109683990A CN201811619724.9A CN201811619724A CN109683990A CN 109683990 A CN109683990 A CN 109683990A CN 201811619724 A CN201811619724 A CN 201811619724A CN 109683990 A CN109683990 A CN 109683990A
Authority
CN
China
Prior art keywords
mobile application
mixed mode
mode mobile
sdk
data
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
CN201811619724.9A
Other languages
Chinese (zh)
Other versions
CN109683990B (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.)
Sichuan XW Bank Co Ltd
Original Assignee
Sichuan XW Bank 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 Sichuan XW Bank Co Ltd filed Critical Sichuan XW Bank Co Ltd
Priority to CN201811619724.9A priority Critical patent/CN109683990B/en
Publication of CN109683990A publication Critical patent/CN109683990A/en
Application granted granted Critical
Publication of CN109683990B publication Critical patent/CN109683990B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44568Immediately runnable code
    • G06F9/44578Preparing or optimising for loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a kind of H5 multiterminal cut-in method based on mixed mode mobile application belongs to H5 multiterminal access mixed mode mobile solution.It solves in the prior art, disposably to load all resources when initializing H5, lead to the problem that resource utilization is lower.The present invention analyzes the interaction document of each mixed mode mobile application and H5, obtains interaction similarities and differences of the H5 in each mixed mode mobile application and operation discrepancy;H5 life cycle is distinguished, the task that corresponding life cycle should be completed, including preparing environment variable, on-demand loading respective resources, combination function link and initialization project are obtained;In preparing environment variable task, unitizes and handle interaction similarities and differences and operation discrepancy, obtain the data interactive method of unified mixed mode mobile application and H5;Based on unified data interactive method, corresponding function link is combined after on-demand loading respective resources, realizes that H5 multiterminal access initialization project.The present invention accesses each mixed mode mobile application for H5.

Description

H5 multiterminal cut-in method based on mixed mode mobile application
Technical field
A kind of H5 multiterminal cut-in method based on mixed mode mobile application accesses each mixed mode movement for H5 and answers With, belong to H5 multiterminal access mixed mode mobile solution.
Background technique
With the fast development of mobile terminal function, have both " advantage of the good user-interaction experience of Native App " and The mixed mode mobile application of " advantage of WebApp Cross-border congestion management " is increasingly by the favor of internet industry, with using Mixed mode mobile application enterprise increases, and accesses multiple mixed mode mobile applications simultaneously with a set of H5 code and keeps code easy Become a problem in maintenance and expansion.When mixed mode mobile application to be accessed is more and more, different mixing need to be called In the case that the distinct methods of motion of defect modes application are also increasing, how to make the mixed mode mobile application of access configurable Change, H5 becomes the emphasis problem to be solved of building insertion mixed mode mobile application.
When accessing different mixed mode mobile application (referring to application platform), if disposably loading all moneys when initialization H5 Source, but the resource actually used is to load the subset of resource, causes resource utilization lower;Mixed mode mobile application environment Judgement is placed in the running environment after H5 initialization, and H5 is made to have the shortcomings that high coupling, high complexity;And each mixed mode moves It is dynamic to apply sdk variable under same scope, easily there is the case where global variable pollution, i.e., each mixed mode mobile application Sdk is present in the same global name space, when different mixed mode mobile application sdk have it is of the same name but different role complete When office's variable, naming conflict is unavoidable.
Summary of the invention
Aiming at the problem that the studies above, the purpose of the present invention is to provide a kind of H5 based on mixed mode mobile application is more Cut-in method is held, is solved in the prior art, when accessing different mixed mode mobile applications, disposably load is owned when initializing H5 Resource leads to the problem that resource utilization is lower;The judgement of mixed mode mobile application environment is placed on the fortune after H5 initialization In row environment, make H5 that there is the problem of high coupling, high complexity;Each mixed mode mobile application sdk variable is in same effect Under domain, easily there is the problem of global variable pollution.
In order to achieve the above object, the present invention adopts the following technical scheme:
A kind of H5 multiterminal cut-in method based on mixed mode mobile application, which comprises the steps of:
The interaction document of step 1, analysis each mixed mode mobile application and H5, obtains H5 in each mixed mode mobile application In interaction similarities and differences and operation discrepancy;
Step 2 distinguishes H5 life cycle, obtains the task that corresponding life cycle should be completed, including preparing environment variable, presses Respective resources, combination function link and initialization project need to be loaded;
Step 3, in preparing environment variable task, unitize handle interaction similarities and differences and operation discrepancy, obtain unification Mixed mode mobile application and H5 data interactive method;
Step 4, based on unified data interactive method, corresponding function link is combined after on-demand loading respective resources, is realized H5 multiterminal access initialization project.
Further, the specific steps of the step 1 are as follows:
Step 1.1, in conjunction with each mixed mode mobile application sdk document, data interaction document, terminal device classification it is existing Data obtain known conditions of the H5 when accessing each mixed mode mobile application using analysis method;
Step 1.2, according to known conditions, H5 is obtained each mixed using discriminant analysis to the data with existing in step 1.1 Interaction similarities and differences and operation discrepancy in syntype mobile application find out the interaction similarities and differences and operation difference of interaction document Point.
Further, the known conditions that the step 1.1 obtains are as follows:
The mixed mode mobile application of H5 access;
The load of the sdk for each mixed mode mobile application for needing to call and method of calling;
The terminal device classification of mixed mode mobile application operation;
The H5 function type of access is needed in each mixed mode mobile application;
The data interaction format of each mixed mode mobile application and H5.
Further, the interaction similarities and differences that the step 1.2 obtains are as follows:
In the identical situation of sdk function for the mixed mode mobile application that H5 is relied on:
The load of sdk and method of calling are different;
The parameter field that H5 is transmitted to each mixed mode mobile application is different;
The return data mode of each mixed mode mobile application passback is different with the data format of H5;
The function type for the H5 that mixed mode mobile application need to access is different;
The operation discrepancy that the step 1.2 obtains are as follows:
The mixed mode mobile application of H5 access is different;
The terminal device classification of mixed mode mobile application operation is different.
Further, the specific steps of the step 3 are as follows:
Step 3.1, interaction similarities and differences and operation in preparing environment variable task, to all mixed mode mobile applications Discrepancy uses variable storage form, obtains environmental variance configuration file;
Step 3.2, the running environment based on obtained environmental variance configuration file and H5, obtain global context variable;
Step 3.3, according to global context variable, the differentiation of sdk is subjected to unification, obtains consistent and expansible data Exchange method is to get the data interactive method for arriving unified mixed mode mobile application and H5.
Further, the specific steps of the step 3.2 are as follows:
Step 3.2.1, the data structure based on environmental variance configuration file and map key-value pair is answered with mixed mode movement As unit of, interaction similarities and differences and the form for running discrepancy variable declarations are stored in environmental variance configuration file;
Step 3.2.2, when H5 is operated in each mixed mode mobile application, each mixed mode mobile application can will be unique Identifier be transmitted to H5, all configuration items are traversed in environmental variance configuration file according to this identifier and are matched, are found After occurrence, the configuration item that will match to is injected in global context variable and is exported, and obtains global context variable, wherein unique Identifier be which mixed mode mobile application to refer to the accession to be.
Further, data interactive method includes sdk call method, sdk data callback method and passback in the step 3.3 Data format method, specific steps are as follows:
Step 3.3.1, the configuration information for storing each mixed mode mobile application, obtains respective profiles
According to the load of known sdk and the data interaction format of method of calling, H5 and each mixed mode mobile application, wound The sdk call method file and return data formatted file of a mixed mode mobile application are built, with " mixed mode mobile application Identifier-terminal device classification-sdk functional method " is key, and specific " sdk functional method method of calling-mixed mode is mobile Using return data mode-return data formatting method name " it is value, the H5 of each mixed mode mobile application need to be used Sdk call method store into sdk call method file, obtain a unordered configuration key-value pair set, wherein sdk function Energy method refers to that sdk can provide a variety of methods and only call the function that can be used to H5, H5;
Step 3.3.2, a sdk functional method global reference function is created, enters ginseng to need the function side sdk called Method class name is defaulted after taking out each mixed mode mobile application identifier and terminal device classification in global context variable, in conjunction with Sdk functional method forms corresponding key value, can obtain each sdk function in unordered configuration key-value pair set by key The specific method of calling of method and data format mode export the sdk call method of unified each mixed mode mobile application, and It stores in sdk call method file;
Step 3.3.3, the return data mode based on the passback of each mixed mode mobile application is different with the data format of H5 Interaction discrepancy, uniform data call-back manner to get to consistent and expansible mixed mode mobile application sdk data return Tune method, and store into sdk call method file;
Step 3.3.4, the return data format of unified each mixed mode mobile application is collected each mixed mode movement and is answered , for the return data format being collected into, corresponding number is created as unit of mixed mode mobile application with return data format The data format of passback is formatted as unified data format method using the method for variable assignments according to format output function and is led Out, then by data format method function name it is respectively written into return data formatted file.
Further, there are three types of the data call-back manners in the step 3.3.3, three kinds of call-back manners are used Promise object dresses up simultaneously operating, and exports a unified call function, obtains consistent and expansible platform application sdk Data callback method:
Data call-back manner is to synchronize, and is directly obtained return data;
Data call-back manner is asynchronous and needs to be mounted on Windows global approach, need to create corresponding method, because The asynchronism callback execution time of Windows global approach is uncertain, and eventBus publish/subscribe person's mode has been used to monitor this side Method executes readjustment, can just get return data;
Data call-back manner is asynchronous and is Promise asynchronism callback, and can listen to after asynchronism callback can just get Return data.
Further, the specific steps of the step 4 are as follows:
The sdk of step 4.1, on-demand loading mixed mode mobile application
Task and unified data interactive method based on the on-demand loading respective resources in life cycle, according to what is obtained The configuration of global context variable is gone in the load path of corresponding sdk to add by the loading method of the sdk of mixed mode mobile application It carries;
Step 4.2, combination H5 functional link
Based on the task of the combination function link in life cycle, H5 creates different function according to different H5 functional links Entrance, each of the links are composed in series according to different function types by different H5 functional modules, when mixed mode mobile application After the completion of configuration and resource load, the H5 function type classification used as needed for different mixed mode mobile applications is different, root According to the specified access H5 function type classification in global context variable, enter from corresponding H5 functional entrance, and according to entrance File dynamically load H5 functional link;
After the completion of step 4.3, the task of combination H5 functional link, realize that H5 multiterminal access initialization project.
The present invention compared with the existing technology, its advantages are shown in:
One, the present invention gets out environmental resource before a set of H5 initialization, is become according to the different environment in each application platform side The corresponding sdk resource of amount configuration on-demand loading simultaneously does unitized processing, and the equal abbreviation of the method that different sdk are provided is at public place Function is managed, the H5 functional link needed for being then assembled under the application platform, after assembling load completion to required resource, initialization H5, at this point, H5 only needs to pay close attention to its own function logic in the process of running, and at the configuration whole concentration of application platform Reason loads respective resources according to varying environment variable, also only need to be in configuration file if the application platform of access need to be increased newly Add environmental variance and respective resources;
Two, H5 application is split into the module of different life cycle and different responsibilities (task) by the present invention, each In life cycle, corresponding task is only responsible for executing oneself task, and environment is distinguished and has been placed on H5 initialization and comes to do, makes H5 Application function is separated with environment configurations, different H5 application function logics is executed according to different environment, by each application platform Discrepancy turns to unification, reduces the code degree of coupling, and the access of each application platform is made to become configurableization and H5 function logic Unrelated process keeps code easy to maintain and extends;
Three, the sdk of on-demand loading mixed mode mobile application of the present invention, prevents under same scope, each sdk statement Same variable or Same Way cause global the case where polluting, and are provided according to needed for the Different Dynamic on-demand loading of running environment The problem of global variable easily conflicts under more sdk is reduced while improving resource utilization in source.
Detailed description of the invention
Fig. 1 is should completing in four life cycles in the present invention for task;
Fig. 2 is the similarities and differences of each mixed mode mobile application analyzed in the present invention;
Fig. 3 is to obtain each mixed mode mobile application in the present invention there is consistent and expansible platform application sdk to call The schematic diagram of method.
Specific embodiment
Below in conjunction with the drawings and the specific embodiments, the invention will be further described.
In order to solve in the prior art, when accessing different application platforms, all resources is disposably loaded when initializing H5, are led The problem for causing resource utilization lower;The judgement of application platform environment is placed in the running environment after H5 initialization, has H5 There is the problem of high coupling, high complexity;Easily there is global variable pollution under same scope in each application platform sdk variable The problem of.The present invention provides a kind of method, specifically:
A kind of H5 multiterminal cut-in method based on mixed mode mobile application, includes the following steps:
The interaction document of step 1, analysis each mixed mode mobile application and H5, obtains H5 in each mixed mode mobile application In interaction similarities and differences and operation discrepancy;
Specific steps are as follows:
Step 1.1, in conjunction with each mixed mode mobile application sdk document, data interaction document, terminal device classification it is existing Data obtain known conditions of the H5 when accessing each mixed mode mobile application using analysis method;
Known conditions are as follows:
The mixed mode mobile application of H5 access;
The load of the sdk for each mixed mode mobile application for needing to call and method of calling;
The terminal device classification of mixed mode mobile application operation, terminal device classification refer to mixed mode mobile application (i.e. Mixing APP) operation carrier, such as ipad, mobile phone are needed, because H5 is nested in mixed mode mobile application, therefore its operation carrier Unanimously;But essence mainly operates on mobile phone, and mobile phone is divided into Android and IOS etc. by device type;
The H5 function type of access is needed in each mixed mode mobile application;
The data interaction format of each mixed mode mobile application and H5.
Step 1.2, according to known conditions, H5 is obtained each mixed using discriminant analysis to the data with existing in step 1.1 Interaction similarities and differences and operation discrepancy in syntype mobile application find out the interaction similarities and differences and operation difference of interaction document Point.
Interaction similarities and differences are as follows:
In the identical situation of sdk function for the mixed mode mobile application that H5 is relied on, the identical finger H5 of function needs movement to answer Be with the function of offer it is identical, if function is to obtain user geographical location, different only method of calling, such as in mixed mode It is call method A that user geographical location is obtained on mobile application A, and user geographical location is obtained on mixed mode mobile application B Call method B, the function that method AB is realized is consistent, only realize the mode of calling it is inconsistent (function is identical be in order to Interactive similarities and differences are found in identical function, so that subsequent realization data interactive method is unified).
The load of sdk and method of calling are different;
The parameter field that H5 is transmitted to each mixed mode mobile application is different;
The return data mode of each mixed mode mobile application passback is different with the data format of H5;
The function type for the H5 that mixed mode mobile application need to access is different;
Run discrepancy are as follows:
The mixed mode mobile application of H5 access is different;
The terminal device classification of mixed mode mobile application operation is different.
Step 2 distinguishes H5 life cycle, obtains the task that corresponding life cycle should be completed, including preparing environment variable, presses Respective resources, combination function link and initialization project need to be loaded;Wherein the purposes of each task is as follows:
Preparing environment variable is that mixed mode mobile application sdk unified in order to obtain calls callback method, data readjustment Method;
On-demand loading resource is to improve resource utilization;
Combination H5 functional link is in order to which at resource dynamically load, the H5 module that only load needs saves bandwidth;
Initialization project is to initialize H5.
Step 3, in preparing environment variable task, unitize handle interaction similarities and differences and operation discrepancy, obtain unification Mixed mode mobile application and H5 data interactive method;Specific steps are as follows:
Specific steps are as follows:
Step 3.1, interaction similarities and differences and operation in preparing environment variable task, to all mixed mode mobile applications Discrepancy uses variable storage form, obtains environmental variance configuration file;
Step 3.2, the running environment based on obtained environmental variance configuration file and H5, obtain global context variable;
Step 3.2.1, the data structure based on environmental variance configuration file and map key-value pair is answered with mixed mode movement As unit of, interaction similarities and differences and the form for running discrepancy variable declarations are stored in environmental variance configuration file;Its Middle variable declarations refer to that mixing application identifier and corresponding identification information, sdk obtain geographical location method and corresponding geographical position Set method etc..
Step 3.2.2, when H5 is operated in each mixed mode mobile application, each mixed mode mobile application can will be unique Identifier be transmitted to H5, traversed in environmental variance configuration file (referring to obtained in step 3.2.1) according to this identifier all Configuration item is simultaneously matched, and after finding occurrence, the configuration item that will match to is injected in global context variable and exported, and is obtained complete Office's environmental variance (the global context variable that obtains obtained herein be to obtain global context variable after injection, it is subsequent based on this entirely Office's environmental variance is handled), wherein unique identifier is which mixed mode mobile application, i.e. needle to refer to the accession to is It is different to the mixed mode mobile application of the H5 access in operation discrepancy.
Step 3.3, according to global context variable, the differentiation of sdk is subjected to unification, obtains consistent and expansible data Exchange method is to get the data interactive method for arriving unified mixed mode mobile application and H5.Data interaction in the step 3.3 Method includes sdk call method, sdk data callback method and return data formatting method, specific steps are as follows:
Step 3.3.1, the configuration information for storing each mixed mode mobile application, obtains respective profiles
According to the load of known sdk and the data interaction format of method of calling, H5 and each mixed mode mobile application, wound The sdk call method file and return data formatted file of a mixed mode mobile application are built, with " mixed mode mobile application Identifier-terminal device classification-sdk functional method " is key, and specific " sdk functional method method of calling-mixed mode is mobile Using return data mode-return data formatting method name " it is value, the H5 of each mixed mode mobile application need to be used Sdk call method store into sdk call method file, obtain a unordered configuration key-value pair set, wherein sdk function Energy method refers to that sdk can provide a variety of methods and only call the function that can be used to H5, H5;
Step 3.3.2, a sdk functional method global reference function is created, enters ginseng to need the function side sdk called Method class name is defaulted after taking out each mixed mode mobile application identifier and terminal device classification in global context variable, in conjunction with Sdk functional method forms corresponding key value, can obtain each sdk function in unordered configuration key-value pair set by key The specific method of calling of method and data format mode export the sdk call method of unified each mixed mode mobile application, and It stores in sdk call method file;
Step 3.3.3, the return data mode based on the passback of each mixed mode mobile application is different with the data format of H5 Interaction discrepancy, uniform data call-back manner to get to consistent and expansible mixed mode mobile application sdk data return Tune method, and store into sdk call method file;There are three types of data call-back manners, and three kinds of call-back manners are used Promise object dresses up simultaneously operating, and exports a unified call function, obtains consistent and expansible platform application sdk Data callback method:
Data call-back manner is to synchronize, and is directly obtained return data;
Data call-back manner is asynchronous and needs to be mounted on Windows global approach, need to create corresponding method, because The asynchronism callback execution time of Windows global approach is uncertain, and eventBus publish/subscribe person's mode has been used to monitor this side Method executes readjustment, can just get return data;
Data call-back manner is asynchronous and is Promise asynchronism callback, and can listen to after asynchronism callback can just get Return data.
Step 3.3.4, the return data format of unified each mixed mode mobile application is collected each mixed mode movement and is answered , for the return data format being collected into, corresponding number is created as unit of mixed mode mobile application with return data format The data format of passback is formatted as unified data format method using the method for variable assignments according to format output function and is led Out, then by data format method function name it is respectively written into return data formatted file.
Step 4, based on unified data interactive method, corresponding function link is combined after on-demand loading respective resources, is realized H5 multiterminal access initialization project;Specific steps are as follows:
Step 4.1, on-demand loading respective resources, the i.e. sdk of on-demand loading mixed mode mobile application
Task and unified data interactive method based on the on-demand loading respective resources in life cycle, according to what is obtained The configuration of global context variable, by the loading method of the sdk of mixed mode mobile application, (remote loading, local load, synchronization add Carry or asynchronous load) go in the load path of corresponding sdk to load, when sdk execution reports an error, be also convenient for mistake investigation and detection, And the sdk for loading all motion of defect modes applications is avoided in H5 operation, it prevents under same scope, each sdk statement is same One variable or Same Way cause global the case where polluting, while on-demand loading also improves the utilization rate of resource;
Step 4.2, combination H5 functional link
Based on the task of the combination function link in life cycle, H5 creates H5 not according to different H5 functional links Congenerous entrance, each of the links are composed in series according to different function types by different H5 functional modules, when application platform is matched Set and resource load after the completion of, the H5 function type of the load as needed for different mixed mode mobile solution platform sides is classified different (such as H5, which is applied, only needs a H5 functional link in load H5 in A mixed mode mobile application), according in global context variable Specified access H5 function type classification, enter from corresponding H5 functional entrance, and according to entry file dynamically load H5 function It can link.
Step 4.3, initialization project
When above step after the completion of, just carry out H5 initialization, H5 obtains H5 from global context variable and need to application The parameter of platform biography is simultaneously transmitted to other side by ajax request, starts to execute H5 function logic after getting data, H5 is only needed at this time The H5 application function logic for paying close attention to itself, without carrying out the differentiation of environment and the calling of different sdk methods in H5 function logic It distinguishes, reduces the degree of coupling of H5 function and environment differentiation, ensure that its responsibility unicity and maintainability, H5, which is applied, respectively to be answered With also there is different function types between platform, the function that a set of H5 application code accesses different mixing mobile applications is realized.
Embodiment
When user enters H5 by certain mixed mode mobile application, mixed mode mobile application can be by unique identifier Be transmitted to H5, thus identifier from environmental variance configuration file match global context variable (i.e. the mixed mode mobile application with The interaction similarities and differences of H5 and operation discrepancy), according in global context variable configuration and unified data interactive method, sdk Load path on-demand loading this mixed mode mobile application sdk resource, it is mobile further according to this mixed mode in global variable Using the H5 function type combination function link that needs access, project is finally initialized, H5 is showed into user.Wherein, program Existing judgement present terminal device type method is called to obtain the terminal device classification that active user uses, when H5 need to call mixing When the sdk call method of motion of defect modes application, the calling function of invocation step 3.3.2, incoming obtained mixed mode movement is answered The functional method that identifier, terminal device classification and H5 need to be called forms corresponding key value, according to this key:
1, this mixed mode mobile application is matched to from the sdk call method file of mixed mode mobile application to need to call Sdk call method and execute;
2, current mixed mode mobile application data are found from the sdk call method file of mixed mode mobile application to return Tune method simultaneously executes, and obtains return data;
3, the data format method that this mixed mode mobile application is finally found from return data formatted file carries out Return data format obtains the consistent return data of format.
The above function of completing a set of H5 application code while accessing different mixing mobile applications, in any hybrid guided mode In formula mobile application, H5 is according to current running environment (in which mixed mode mobile application and currently used movement Terminal class), the calling function of step 3.3.2 need to be only had invoked, the sdk of current mixed mode mobile application can be called to call Method and the return data for obtaining unified format, reduce the degree of coupling of code.
When needing to access new mixed mode mobile application, discrepancy also need to will be only run in environmental variance configuration file It is increased newly into interaction discrepancy, then increases this mixed mode newly in sdk method call file and return data formatted file and move It is dynamic to apply sdk call method, data callback method and return data formatting method, improve the scalability of code.
The above is only the representative embodiment in the numerous concrete application ranges of the present invention, to protection scope of the present invention not structure At any restrictions.It is all using transformation or equivalence replacement and the technical solution that is formed, all fall within rights protection scope of the present invention it It is interior.

Claims (9)

1. a kind of H5 multiterminal cut-in method based on mixed mode mobile application, which comprises the steps of:
The interaction document of step 1, analysis each mixed mode mobile application and H5, obtains H5 in each mixed mode mobile application Interaction similarities and differences and operation discrepancy;
Step 2 distinguishes H5 life cycle, obtains the task that corresponding life cycle should be completed, including preparing environment variable, on demand plus Carry respective resources, combination function link and initialization project;
Step 3, in preparing environment variable task, unitize handle interaction similarities and differences and operation discrepancy, unify mix The data interactive method of syntype mobile application and H5;
Step 4, based on unified data interactive method, corresponding function link is combined after on-demand loading respective resources, realizes that H5 is more It terminates into initialization project.
2. a kind of H5 multiterminal cut-in method based on mixed mode mobile application according to claim 1, which is characterized in that The specific steps of the step 1 are as follows:
Step 1.1 has number in conjunction with the sdk document, data interaction document, terminal device classification of each mixed mode mobile application According to obtaining known conditions of the H5 when accessing each mixed mode mobile application using analysis method;
Step 1.2, according to known conditions, H5 is obtained in each hybrid guided mode using discriminant analysis to the data with existing in step 1.1 Interaction similarities and differences and operation discrepancy in formula mobile application find out the interaction similarities and differences and operation discrepancy of interaction document.
3. a kind of H5 multiterminal cut-in method based on mixed mode mobile application according to claim 2, which is characterized in that The known conditions that the step 1.1 obtains are as follows:
The mixed mode mobile application of H5 access;
The load of the sdk for each mixed mode mobile application for needing to call and method of calling;
The terminal device classification of mixed mode mobile application operation;
The H5 function type of access is needed in each mixed mode mobile application;
The data interaction format of each mixed mode mobile application and H5.
4. a kind of H5 multiterminal cut-in method based on mixed mode mobile application according to claim 3, which is characterized in that The interaction similarities and differences that the step 1.2 obtains are as follows:
In the identical situation of sdk function for the mixed mode mobile application that H5 is relied on:
The load of sdk and method of calling are different:
The parameter field that H5 is transmitted to each mixed mode mobile application is different;
The return data mode of each mixed mode mobile application passback is different with the data format of H5;
The function type for the H5 that mixed mode mobile application need to access is different;
The operation discrepancy that the step 1.2 obtains are as follows:
The mixed mode mobile application of H5 access is different;
The terminal device classification of mixed mode mobile application operation is different.
5. a kind of H5 multiterminal cut-in method based on mixed mode mobile application according to claim 1 or 3, feature exist In the specific steps of the step 3 are as follows:
Step 3.1, interaction similarities and differences and operation difference in preparing environment variable task, to all mixed mode mobile applications Point uses variable storage form, obtains environmental variance configuration file;
Step 3.2, the running environment based on obtained environmental variance configuration file and H5, obtain global context variable;
Step 3.3, according to global context variable, the differentiation of sdk is subjected to unification, obtains consistent and expansible data interaction Method is to get the data interactive method for arriving unified mixed mode mobile application and H5.
6. a kind of H5 multiterminal cut-in method based on mixed mode mobile application according to claim 5, which is characterized in that The specific steps of the step 3.2 are as follows:
Step 3.2.1, the data structure based on environmental variance configuration file and map key-value pair is with mixed mode mobile application Interaction similarities and differences and the form for running discrepancy variable declarations are stored in environmental variance configuration file by unit;
Step 3.2.2, when H5 is operated in each mixed mode mobile application, each mixed mode mobile application will can uniquely be marked Will symbol is transmitted to H5, traverses all configuration items in environmental variance configuration file according to this identifier and is matched, finds matching Xiang Hou, the configuration item that will match to are injected in global context variable and are exported, and obtain global context variable, wherein unique mark Know symbol is which mixed mode mobile application to refer to the accession to be.
7. a kind of H5 multiterminal cut-in method based on mixed mode mobile application according to claim 5, which is characterized in that Data interactive method includes sdk call method, sdk data callback method and return data formatting method in the step 3.3, Specific steps are as follows:
Step 3.3.1, the configuration information for storing each mixed mode mobile application, obtains respective profiles
According to the load of known sdk and the data interaction format of method of calling, H5 and each mixed mode mobile application, creation one The sdk call method file and return data formatted file of a mixed mode mobile application, with " mixed mode mobile application mark Symbol-terminal device classification-sdk functional method " is key, specific " sdk functional method method of calling-mixed mode mobile application Return data mode-return data formatting method name " is value, the sdk that the H5 of each mixed mode mobile application need to be used Call method is stored into sdk call method file, obtains a unordered configuration key-value pair set, wherein the function side sdk Method refers to that sdk can provide a variety of methods and only call the function that can be used to H5, H5;
Step 3.3.2, a sdk functional method global reference function is created, enters ginseng to need the sdk functional method class called Name is defaulted after taking out each mixed mode mobile application identifier and terminal device classification in global context variable, in conjunction with sdk function Energy method forms corresponding key value, can obtain each sdk functional method in unordered configuration key-value pair set by key Specific method of calling and data format mode, export the sdk call method of unified each mixed mode mobile application, and store Into sdk call method file;
Step 3.3.3, the return data mode friendship different with the data format of H5 based on the passback of each mixed mode mobile application Mutual discrepancy, uniform data call-back manner is to get the sdk data readjustment side for arriving consistent and expansible mixed mode mobile application Method, and store into sdk call method file;
Step 3.3.4, the return data format of unified each mixed mode mobile application, that is, collect each mixed mode mobile application and return It passes data format and, for the return data format being collected into, creates corresponding data lattice as unit of mixed mode mobile application The data format of passback is formatted as unified data format method using the method for variable assignments and exported by formula function, then Data format method function name is respectively written into return data formatted file.
8. a kind of H5 multiterminal cut-in method based on mixed mode mobile application according to claim 7, which is characterized in that There are three types of data call-back manners in the step 3.3.3, and three kinds of call-back manners are dressed up synchronous behaviour using Promise object Make, and export a unified call function, obtains consistent and expansible platform application sdk data callback method:
Data call-back manner is to synchronize, and is directly obtained return data;
Data call-back manner is asynchronous and needs to be mounted on Windows global approach, corresponding method need to be created, because of Windows The asynchronism callback execution time of global approach is uncertain, and eventBus publish/subscribe person's mode has been used to monitor holding for the method Row readjustment, can just get return data;
Data call-back manner is asynchronous and is Promise asynchronism callback, and can listen to can just get passback after asynchronism callback Data.
9. a kind of H5 multiterminal cut-in method based on mixed mode mobile application according to claim 8, which is characterized in that The specific steps of the step 4 are as follows:
The sdk of step 4.1, on-demand loading mixed mode mobile application
Task and unified data interactive method based on the on-demand loading respective resources in life cycle, according to the obtained overall situation The configuration of environmental variance is gone in the load path of corresponding sdk to load by the loading method of the sdk of mixed mode mobile application;
Step 4.2, combination H5 functional link
Based on the task of the combination function link in life cycle, H5 enters according to different H5 functional link creation different function Mouthful, each of the links are composed in series according to different function types by different H5 functional modules, when mixed mode mobile application is matched Set and resource load after the completion of, the classification of the H5 function type that is used as needed for different mixed mode mobile applications is different, according to Specified access H5 function type classification in global context variable, enters from corresponding H5 functional entrance, and according to entrance text Part dynamically load H5 functional link;
After the completion of step 4.3, the task of combination H5 functional link, realize that H5 multiterminal access initialization project.
CN201811619724.9A 2018-12-27 2018-12-27 H5 multiterminal cut-in method based on mixed mode mobile application Active CN109683990B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811619724.9A CN109683990B (en) 2018-12-27 2018-12-27 H5 multiterminal cut-in method based on mixed mode mobile application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811619724.9A CN109683990B (en) 2018-12-27 2018-12-27 H5 multiterminal cut-in method based on mixed mode mobile application

Publications (2)

Publication Number Publication Date
CN109683990A true CN109683990A (en) 2019-04-26
CN109683990B CN109683990B (en) 2019-07-23

Family

ID=66190099

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811619724.9A Active CN109683990B (en) 2018-12-27 2018-12-27 H5 multiterminal cut-in method based on mixed mode mobile application

Country Status (1)

Country Link
CN (1) CN109683990B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175816A (en) * 2019-05-09 2019-08-27 江苏南高智能装备创新中心有限公司 A kind of industrial equipment management system based on mobile terminal app
CN110597709A (en) * 2019-08-13 2019-12-20 平安国际智慧城市科技股份有限公司 Interactive debugging method and device for mixed-mode mobile application and computer equipment
CN113626105A (en) * 2021-08-18 2021-11-09 赞同科技股份有限公司 SDK system and mobile device of mobile terminal mixed mode

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104765617A (en) * 2015-05-04 2015-07-08 北京奇虎科技有限公司 Stream application function interface distributing method and system realized on basis of HTML5
CN105786513A (en) * 2016-02-29 2016-07-20 四川长虹电器股份有限公司 Mixed mobile application development method based on Html5
CN106874035A (en) * 2017-01-11 2017-06-20 深圳中顺易金融服务有限公司 One kind is applied for updating(app)The method and its framework of built-in H5
CN107357554A (en) * 2016-05-10 2017-11-17 北京慧点科技有限公司 Method and apparatus based on the exploitation of mixed mode Mobile solution
CN107864066A (en) * 2017-08-24 2018-03-30 平安普惠企业管理有限公司 Offline H5 pages monitoring method, device, equipment and readable storage medium storing program for executing
CN107924318A (en) * 2015-08-14 2018-04-17 微软技术许可有限责任公司 Desktop and application remote processing solution based on web browser
CN108632807A (en) * 2018-05-03 2018-10-09 平安科技(深圳)有限公司 The method and device of mobile terminal accessing control
CN109032576A (en) * 2018-06-26 2018-12-18 珠海宏桥高科技有限公司 A kind of cross-platform generation method and device based on configuration

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104765617A (en) * 2015-05-04 2015-07-08 北京奇虎科技有限公司 Stream application function interface distributing method and system realized on basis of HTML5
CN107924318A (en) * 2015-08-14 2018-04-17 微软技术许可有限责任公司 Desktop and application remote processing solution based on web browser
CN105786513A (en) * 2016-02-29 2016-07-20 四川长虹电器股份有限公司 Mixed mobile application development method based on Html5
CN107357554A (en) * 2016-05-10 2017-11-17 北京慧点科技有限公司 Method and apparatus based on the exploitation of mixed mode Mobile solution
CN106874035A (en) * 2017-01-11 2017-06-20 深圳中顺易金融服务有限公司 One kind is applied for updating(app)The method and its framework of built-in H5
CN107864066A (en) * 2017-08-24 2018-03-30 平安普惠企业管理有限公司 Offline H5 pages monitoring method, device, equipment and readable storage medium storing program for executing
CN108632807A (en) * 2018-05-03 2018-10-09 平安科技(深圳)有限公司 The method and device of mobile terminal accessing control
CN109032576A (en) * 2018-06-26 2018-12-18 珠海宏桥高科技有限公司 A kind of cross-platform generation method and device based on configuration

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175816A (en) * 2019-05-09 2019-08-27 江苏南高智能装备创新中心有限公司 A kind of industrial equipment management system based on mobile terminal app
CN110597709A (en) * 2019-08-13 2019-12-20 平安国际智慧城市科技股份有限公司 Interactive debugging method and device for mixed-mode mobile application and computer equipment
CN110597709B (en) * 2019-08-13 2022-11-01 深圳赛安特技术服务有限公司 Interactive debugging method and device for mixed-mode mobile application and computer equipment
CN113626105A (en) * 2021-08-18 2021-11-09 赞同科技股份有限公司 SDK system and mobile device of mobile terminal mixed mode
CN113626105B (en) * 2021-08-18 2023-10-27 赞同科技股份有限公司 SDK system of mobile terminal mixed mode and mobile device

Also Published As

Publication number Publication date
CN109683990B (en) 2019-07-23

Similar Documents

Publication Publication Date Title
CN109683990B (en) H5 multiterminal cut-in method based on mixed mode mobile application
CN109542457B (en) Distributed application distribution and deployment system and method for edge computing network
Soldatos et al. Convergence of utility computing with the internet-of-things
CN106599197B (en) Data acquisition exchange engine
Namiot et al. On m2m software
CN108932588B (en) Hydropower station group optimal scheduling system with separated front end and rear end and method
CN108681488B (en) Internet of things platform terminal data reporting method
CN103324173B (en) Based on many heterogeneous robots collaboration method of middleware
Sneps-Sneppe et al. About M2M standards and their possible extensions
CN102508919B (en) Data processing method and system
CN103839155A (en) Method for integrating heterogeneous information system model based on semantic gateway
CN103577568A (en) Cross-platform mobile safety comprehensive information aggregation system and method adopting same
KR20180137550A (en) Methods for enabling data analysis services at the service layer
Leitão et al. Integration patterns for interfacing software agents with industrial automation systems
CN105468756A (en) Design and realization method for mass data processing system
Zhang et al. Research on the overall architecture of Internet of Things middleware for intelligent industrial parks
CN113542390B (en) Internet of things equipment management method and system adopting memory data model
CN112887356A (en) System for sharing memory data distribution service and operation method thereof
Zeydan et al. Recent advances in data engineering for networking
Seydoux et al. Capturing the contributions of the semantic web to the IoT: a unifying vision
CN107896242B (en) Service sharing method and device
CN101321178A (en) Portal workflow engine system and its implementing method
Alaya et al. Frameself: A generic context-aware autonomic framework for self-management of distributed systems
CN104378682A (en) Key counting method based on android system and smart television based on android system
CN109783132B (en) Method and device for realizing system singleization and distribution

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
CB03 Change of inventor or designer information

Inventor after: Zhou Weiwei

Inventor after: Chen Junlin

Inventor after: He Wenchang

Inventor before: Zhou Weiwei

Inventor before: Chen Junlin

Inventor before: He Wenchang

CB03 Change of inventor or designer information