CN108776601B - Android H5 page loading method, device, equipment and storage medium - Google Patents

Android H5 page loading method, device, equipment and storage medium Download PDF

Info

Publication number
CN108776601B
CN108776601B CN201810569847.XA CN201810569847A CN108776601B CN 108776601 B CN108776601 B CN 108776601B CN 201810569847 A CN201810569847 A CN 201810569847A CN 108776601 B CN108776601 B CN 108776601B
Authority
CN
China
Prior art keywords
kernel
loading
page
party
android
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
CN201810569847.XA
Other languages
Chinese (zh)
Other versions
CN108776601A (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.)
Ping An E Wallet Electronic Commerce Co Ltd
Original Assignee
Ping An E Wallet Electronic Commerce 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 Ping An E Wallet Electronic Commerce Co Ltd filed Critical Ping An E Wallet Electronic Commerce Co Ltd
Priority to CN201810569847.XA priority Critical patent/CN108776601B/en
Publication of CN108776601A publication Critical patent/CN108776601A/en
Application granted granted Critical
Publication of CN108776601B publication Critical patent/CN108776601B/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/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The invention discloses a loading method of an android H5 page, and belongs to the technical field of communication. A loading method of an android H5 page comprises the following steps: the method comprises the steps that a loading frame receives an H5 page loading request sent by a user, wherein a package guiding path of a native kernel class and a package guiding path of a third-party kernel class are arranged in the loading frame; the method comprises the steps that a loading frame obtains configuration information of an H5 page to be loaded, the configuration information comprises a kernel change-over switch, and a loading kernel of the H5 page is selected through the kernel change-over switch; and identifying the state of the kernel change-over switch, and loading the H5 page by adopting a kernel corresponding to the result according to the identified result, wherein the kernel comprises a primary kernel and a third party kernel. According to the invention, two sets of loading kernels are arranged in the loading framework, so that switching interaction between the H5 page and the two sets of kernels is realized, and the purpose that codes can be replaced for life at one time is realized.

Description

Android H5 page loading method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of communication, in particular to a loading method, a loading device, loading equipment and a storage medium of an android H5 page.
Background
Because the system version above Android 6.0 supports the HTTP 2.0 network protocol, many APP can select an open source H5 loading kernel supporting the HTTP 2.0 network protocol to replace a native kernel, and the open source kernel has a certain improvement on the time and flow of H5 loading.
However, the kernel access of the open source needs to replace all classes related to WebView in the project by the package, and although the kernel of the open source also has the function of providing scripts to scan the whole project, the code change amount and the workload of the whole project scan replacement are too large, and in addition, the scanning inspection and the replacement are very troublesome before each version is sent.
In addition, if a bug appears on the production line due to the stability and compatibility of the open source kernel after switching to the open source kernel, the bug can only be solved by version issuing or heating repair, which is troublesome and costly.
Disclosure of Invention
The invention aims to solve the technical problem that in the prior art, in order to adapt to the use of an android system, an open-source kernel is adopted to replace a native kernel, and the problem that errors are easy to occur is solved, and provides a loading method, a loading device, loading equipment and a storage medium of the android H5 page, wherein switching interaction between the H5 page and the two sets of kernels is realized by arranging the two sets of loading kernels in a loading frame, and the purpose that codes can be replaced for life once is realized by mapping packet guiding paths of all native kernels related to webview into packet guiding paths of inherited kernels to write the packet guiding paths into the loading frame.
The invention solves the technical problems by the following technical scheme:
a loading method of an android H5 page comprises the following steps:
s1, a loading frame receives an H5 page loading request sent by a user, wherein the request comprises a model used by the user and identification information of the H5 page, and a package guiding path of a native kernel class and a package guiding path of a third party kernel class are arranged in the loading frame;
s2, the loading framework acquires configuration information of an H5 page to be loaded according to the request, wherein the configuration information comprises a kernel change-over switch, and a loading kernel of the H5 page is selected through the kernel change-over switch;
s3, recognizing the state of the kernel change-over switch, and loading the H5 page by adopting a kernel corresponding to the recognized result, wherein the kernel comprises a primary kernel and a third party kernel.
Preferably, the step S3 includes the following substeps:
s31, judging the state of the kernel change-over switch, if the state is open, executing step 32, and if the state is closed, executing step 33;
s32, loading an H5 page by adopting a third-party kernel, wherein a package guiding path of a native kernel class related to WebView in the third-party kernel is preset in a loading frame by adopting a package guiding path of an inheritance native kernel class;
s33, loading the H5 page by adopting a native kernel.
Preferably, the configuration information in S2 further includes a whitelist, and models applicable to loading of the H5 page by the third party kernel are listed in the whitelist;
before S31, the method further comprises:
s301, judging whether the machine type for sending the H5 page loading request is in a white list, if so, executing S31, and if not, directly executing S33.
Preferably, the configuration information in S2 further includes a blacklist, and models which are not applicable to loading the H5 page by the third party kernel are listed in the blacklist;
before S31, the method further comprises:
s302, judging whether the machine type for sending the H5 page loading request is located in a blacklist, if not, executing S31, and if yes, directly executing S33.
Preferably, the configuration information in S2 further includes a white list and a black list, in which a model suitable for loading the H5 page by the third party kernel is listed, and a model unsuitable for loading the H5 page by the third party kernel is listed;
before S31, the method further comprises:
s303, judging whether the machine type sending the H5 page loading request is located in a white list or not and whether the machine type sending the H5 page loading request is located in a black list, executing S31 if the machine type sending the H5 page loading request is located in the white list only, and directly executing S33 if the machine type sending the H5 page loading request is located in the black list only.
Preferably, in S303, when the model sending the H5 page load request is neither in the white list nor in the black list, S33 is directly executed;
the S33 further includes the loading framework recording a case where the H5 page is loaded by the native kernel.
Preferably, the model for sending the H5 page load request is obtained by intercepting the request.
An electronic device having stored thereon a loading framework system of android H5 pages, the loading framework system of android H5 pages comprising:
the receiving module is used for receiving an H5 page loading request sent by a user, wherein the request comprises a model used by the user;
the packet guiding path setting module is used for setting a packet guiding path of the original kernel class and a packet guiding path of the third-party kernel class;
the configuration information acquisition module is used for acquiring configuration information of an H5 page to be loaded, wherein the configuration information comprises a kernel change-over switch, and a loading kernel of the H5 page is selected through the kernel change-over switch;
the identification loading module is used for identifying the state of the kernel change-over switch, loading the H5 page by adopting a kernel corresponding to the result according to the identified result, wherein the kernel comprises a primary kernel and a third party kernel.
A computer device comprising a memory and a processor, the memory having stored thereon a loading framework system of android H5 pages executable by the processor, the system when executed by the processor implementing the steps of the loading method of android H5 pages as claimed in any preceding claim.
A computer readable storage medium having stored therein computer program instructions executable by at least one processor to cause the at least one processor to perform the steps of the loading method of an android H5 page as claimed in any preceding claim.
The invention has the positive progress effects that:
1. when the native kernel or other third party kernels are needed, only the packet guiding paths of the kernel classes in the loading frame are needed to be modified, the related kernel class packet guiding paths in the whole project are not needed to be modified, modification workload is reduced, and omission is effectively avoided.
2. When the third party kernel appears bug after the H5 page is online, the bug can be repaired by only switching the kernel interacted with the H5 page into the original kernel, and after bug of the third party kernel is repaired, the bug is switched back, thereby realizing the functions of quick switching and repairing.
3. When a specific business logic in the H5 pages needs to be added or deleted, two sets of H5 pages do not need to be maintained, development workload is reduced, possibility of missing functions is avoided, code coupling degree is reduced, code quality is improved, and robustness of the architecture is enhanced.
Drawings
FIG. 1 shows a flowchart of a first embodiment of a loading method of an android H5 page;
FIG. 2 is a flowchart illustrating a second embodiment of a loading method of an android H5 page;
FIG. 3 is a schematic program module of a first embodiment of a loading framework system for android H5 pages in an electronic device according to the present invention;
fig. 4 is a schematic diagram of a hardware architecture of an embodiment of a computer device according to the present invention.
Reference numerals:
the achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
The invention is further illustrated by means of the following examples, which are not intended to limit the scope of the invention.
Firstly, the invention provides a loading method of an android H5 page.
In a first embodiment, as shown in fig. 1, the loading method of the android H5 page includes the following steps:
s1, a loading frame receives an H5 page loading request sent by a user, wherein the request comprises a model used by the user and identification information of the H5 page, and a package guiding path of a native kernel class and a package guiding path of a third party kernel class are arranged in the loading frame.
Some basic tools (such as protocols, password modifications, presentation introductions, etc.) are needed in the H5 page, and these basic tool calls require the addition of a wrapper path in the code.
The original code for the H5 page is loaded with the native kernel, so the wrapper path of the native kernel class needs to be written in the code. However, when the H5 page runs on the android system, it may not be possible to support a high version of the network protocol if the android system version is too low, and thus the loading is typically not performed by using a native kernel, but rather is performed by using a third party kernel.
The H5 page is usually propagated by the WebView, the common third party kernel is the Tencent X5 kernel, and the H5 page is to be displayed in the WebView, which is one of the kernels for displaying the web page, so that the packet-guiding paths of all the native kernel classes related to the WebView need to be replaced by the packet-guiding paths of the third party kernel classes.
The loading framework is used for realizing interaction between the H5 page and the kernel so as to judge which kernel is adopted to load the H5 page on the model used by the user.
S2, the loading framework acquires configuration information of the H5 page to be loaded according to the request, wherein the configuration information comprises a kernel change-over switch, and the loading kernel of the H5 page is selected through the kernel change-over switch.
Specifically, which kernel is adopted to load the H5 page is preset in the kernel loading configuration information of the loading frame by a programmer, wherein the kernel change-over switch is equivalent to a kernel selection switch, and the on and off of the kernel change-over switch respectively correspond to different kernels.
For example: opening a corresponding third-party kernel, namely selecting to load the H5 page by using the third-party kernel, and closing a corresponding original kernel, namely selecting to load the H5 page by using the original kernel; the above is only an exemplary illustration, and the corresponding native kernel, guan Duiying third party kernel, may be provided in advance.
S3, recognizing the state of the kernel change-over switch, and loading the H5 page by adopting a kernel corresponding to the recognized result, wherein the kernel comprises a primary kernel and a third party kernel.
The identification result is to identify whether the kernel change-over switch is on or off, and then call the corresponding kernel to load the H5 page according to the preset corresponding relation. Such as: and (3) a third party kernel corresponding to the "on" is called to load the H5 page when the identification result is "on".
In a second embodiment, based on the first embodiment, as shown in fig. 2, the step S3 includes the following sub-steps:
s31, judging the state of the kernel change-over switch, if the state is open, executing step 32, and if the state is closed, executing step 33.
S32, loading the H5 page by adopting a third-party kernel, wherein a package guiding path of a native kernel class related to WebView in the third-party kernel is preset in a loading frame by adopting a package guiding path of an inheritance native kernel class.
Since propagating WebView control is used to implement page display, the envelope path of the native kernel class associated with WebView must be replaced. The original method is that the scanning is carried out and then the scanning is carried out manually, so that the workload is large and the error is easy.
In this embodiment, an inheritance manner is adopted, and a method of inheriting a package guiding path of a native kernel class related to WebView in a third-party kernel is adopted to set a package guiding path of the native kernel class in a loading frame.
For example: the method comprises the steps that YQBWebView-inheritance-WebView, when a loading frame receives a loading request of an H5 page, the WebView used in codes is automatically replaced with the YQBWebView in a unified mode, and the inheritance operation mode is the inheritance operation mode.
Therefore, when other H5 pages are used for related classes in the WebView kernel, the purpose of switching the WebView kernel can be achieved by replacing the guide packet of the inherited original kernel class without searching the classes in the newly used kernel each time and then replacing the guide packet one by one, so that the purpose of realizing the life-time availability of code replacement.
S33, loading the H5 page by adopting a native kernel.
In this embodiment, it is assumed that the core switch corresponds to the third party core when it is on, and corresponds to the native core when it is off.
In a third embodiment, based on the second embodiment, the configuration information in S2 further includes a white list, where models applicable to loading of the H5 page by the third party kernel are listed in the white list;
before S31, the method further comprises:
s301, judging whether the machine type for sending the H5 page loading request is in a white list, if so, executing S31, and if not, directly executing S33.
The model for sending the H5 page loading request can be obtained by intercepting the request.
Each H5 page is tested before being online to see if the page is suitable for display on various types of display screens, which may cause abnormal display due to different types. For testing, it is not guaranteed that all models can be tested.
In this embodiment, a white list is added to the configuration information, so as to ensure that the third party kernel is used for loading only when the model passing the test is displayed, and the native kernel is used for loading on the model not passing the test or not passing the test, so that poor customer experience caused by display errors is avoided as much as possible.
Further, the white list may also be provided with a switch, on means enabled and off means not enabled, and when enabled, the steps described in the present embodiment are performed, and when not enabled, the steps described in the second embodiment are performed.
In a fourth embodiment, based on the second embodiment, the configuration information in S2 further includes a blacklist, where models that are not applicable to loading the H5 page by the third party kernel are listed in the blacklist;
before S31, the method further comprises:
s302, judging whether the machine type for sending the H5 page loading request is located in a blacklist, if not, executing S31, and if yes, directly executing S33.
The model for sending the H5 page loading request can be obtained by intercepting the request.
In this embodiment, a blacklist is added to the configuration information to ensure that the native kernel is used for loading when the model which fails the test is displayed, and the third party kernel is directly used for loading on the model which fails the test or does not pass the test.
In an embodiment, a function of acquiring loading condition feedback can be further added to obtain the actual loading condition of the H5 page on the mobile phone of the user, and particularly for those model which are not tested, the loading condition is acquired by means of the feedback of the user, so that the H5 page publisher is helped to test.
Further, the blacklist may also be provided with a switch, on means enabled and off means not enabled, and when enabled, the steps described in the present embodiment are performed, and when not enabled, the steps described in the second embodiment are performed.
In a fifth embodiment, based on the second embodiment, the configuration information in S2 further includes a white list and a black list, where the white list is listed with a model suitable for loading the H5 page by the third party kernel, and the black list is listed with a model not suitable for loading the H5 page by the third party kernel;
before S31, the method further comprises:
s303, judging whether the machine type sending the H5 page loading request is located in a white list or not and whether the machine type sending the H5 page loading request is located in a black list, executing S31 if the machine type sending the H5 page loading request is located in the white list only, and directly executing S33 if the machine type sending the H5 page loading request is located in the black list only.
The model for sending the H5 page loading request can be obtained by intercepting the request.
The test requires time, and the online time of the H5 page sometimes determines who the business is preempted, so that the publisher often wants to go online better the earlier, and the test can continue after being online.
Therefore, in this embodiment, the white list and the black list are added at the same time, and by using the two lists at the same time, all tested machine types are included, and each time a machine type is tested, the machine type can be added into the corresponding white list or black list according to the test result, so that the use is more flexible.
Further, the white list and the black list can be provided with separate switches, the on state indicates that the switch is not started, the switch is simultaneously started, the switch is not started, any one of the switch and the switch is started, and the flexibility of configuration is improved.
In the sixth embodiment, based on the fifth embodiment, when the model sending the H5 page load request is neither in the white list nor in the black list, S33 is directly executed;
the S33 further includes the loading framework recording a case where the H5 page is loaded by the native kernel.
In the implementation, through the record of the loading condition, the publisher of the H5 page can timely learn the loading condition of the untested machine model to the H5 page, so that the publisher adds the untested machine model to a white list or a black list corresponding to the loading condition, and supplements the tested machine model.
Secondly, the invention provides an electronic device, wherein a loading framework system 20 of an android H5 page is stored on the electronic device, the system 20 is used for realizing interaction between the H5 page and a kernel, and the system 20 can be divided into one or more program modules.
For example, fig. 3 shows a program module schematic of a first embodiment of the loading framework system 20 of the android H5 page, where the system 20 may be divided into a receiving module 201, a packet routing module 202, a configuration information obtaining module 203, and an identification loading module 204. Program modules in accordance with the invention are referred to herein as a series of computer program instruction segments capable of performing particular functions. The following description will specifically introduce specific functions of the program modules 201-204.
The receiving module 201 is configured to receive an H5 page loading request sent by a user, where the request includes a model used by the user.
In the device, the H5 page is loaded through the loading framework system 20, so that the H5 page loading request sent by the user is directly received by the receiving module 201 in the system 20.
The packet routing path setting module 202 is configured to set a packet routing path of a native kernel class and a packet routing path of a third party kernel class.
Some basic tools (such as protocols, password modifications, presentation introductions, etc.) are needed in the H5 page, and these basic tool calls require the addition of a wrapper path in the code. The original code for the H5 page is loaded with the native kernel, so the wrapper path of the native kernel class needs to be written in the code. However, when the H5 page runs on the android system, it may not be possible to support a high version of the network protocol if the android system version is too low, and thus the loading is typically not performed by using a native kernel, but rather is performed by using a third party kernel. The H5 page is usually propagated by the WebView, the common third party kernel is the Tencent X5 kernel, and the H5 page is to be displayed in the WebView, which is one of the kernels for displaying the web page, so that the packet-guiding paths of all the native kernel classes related to the WebView need to be replaced by the packet-guiding paths of the third party kernel classes.
Both of the aforementioned packet routing paths are preset by the packet routing path setting module 202.
The configuration information obtaining module 203 is configured to obtain configuration information of an H5 page to be loaded, where the configuration information includes a kernel switch, and the kernel switch selects a loading kernel of the H5 page.
Specifically, which kernel is adopted to load the H5 page is preset in the kernel loading configuration information of the loading frame by a programmer, wherein the kernel change-over switch is equivalent to a kernel selection switch, and the on and the off correspond to different kernels respectively.
For example: opening a corresponding third-party kernel, namely selecting to load the H5 page by using the third-party kernel, and closing a corresponding original kernel, namely selecting to load the H5 page by using the original kernel; the above is only an exemplary illustration, and the corresponding native kernel, guan Duiying third party kernel, may be provided in advance.
Through setting up kernel change over switch in configuration information, when the third party kernel appears the bug, only need turn off the kernel change over switch, make all models temporarily all adopt the primitive kernel to show, switch back after the bug of third party kernel is restoreed to realize quick switch over and prosthetic function, do not influence user's use.
The identifying and loading module 204 is configured to identify a state of the kernel switch, and load the H5 page with a kernel corresponding to the result according to the identified result, where the kernel includes a native kernel and a third party kernel.
The identification result is to identify whether the kernel change-over switch is on or off, and then call the corresponding kernel to load the H5 page according to the preset corresponding relation. Such as: and (3) a third party kernel corresponding to the "on" is called to load the H5 page when the identification result is "on".
Further, the identification loading module 204 may be further divided into a status judging module, a third party kernel loading module, and a native kernel loading module.
The state judging module is used for judging the state of the kernel change-over switch. I.e., to determine whether the core switch is "on" or "off".
And the third-party kernel loading module is used for loading the H5 page by adopting a third-party kernel when the state of the kernel change-over switch is on, and the package guiding path of the native kernel class related to the WebView in the third-party kernel is preset in the loading frame by adopting the package guiding path of the inheritance native kernel class.
Since propagating WebView control is used to implement page display, the envelope path of the native kernel class associated with WebView must be replaced. The original method is that the scanning is carried out and then the scanning is carried out manually, so that the workload is large and the error is easy. The method is characterized in that the method that the inheritance mode is adopted to set the package guiding path of the native kernel class related to WebView in the third-party kernel into the loading frame by adopting the method that the package guiding path of the native kernel class is inherited.
For example, assuming YQBWebView-inheritance-WebView, when a loading frame receives a loading request of an H5 page, the WebView used in the code is automatically replaced by YQBWebView in a unified way, so that when other H5 pages are used to related classes in the WebView kernel, the purpose of switching the WebView kernel can be achieved by replacing the inherited native kernel class leader packet without searching the classes in the kernel for each time and replacing the leader packet one by one.
The native kernel loading module is used for loading the H5 page by adopting the native kernel when the state of the kernel change-over switch is off.
Furthermore, since each H5 page is tested before being online to see whether the page is suitable for being displayed on display screens of various models, display anomalies may be caused due to different models. For testing, it is not guaranteed that all models can be tested.
Therefore, the configuration information can also comprise a white list and/or a black list besides the kernel change-over switch, and the white list is internally provided with a model suitable for loading an H5 page by a third party kernel; and the blacklist is internally provided with a model which is not applicable to the loading of the H5 page by the third party kernel. The whitelist and the usage of the list refer to method embodiments three to six, and are not described herein again.
The white list and the black list can be independently added with a switch, and the white list and the black list are simultaneously started, and either one of the white list and the black list is not started or is started through the change of the state of the switch.
The invention further provides computer equipment.
Fig. 4 is a schematic diagram of a hardware architecture of an embodiment of a computer device according to the present invention. In this embodiment, the computer device 2 is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction. For example, it may be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including a stand-alone server or a server cluster composed of a plurality of servers), etc. As shown, the computer device 2 includes, but is not limited to, a loading framework system 20 communicatively coupled to a memory 21, a processor 22, a network interface 23, and android H5 pages via a system bus. Wherein:
the memory 21 includes at least one type of computer-readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 21 may be an internal storage unit of the computer device 2, such as a hard disk or a memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 2. Of course, the memory 21 may also comprise both an internal memory unit of the computer device 2 and an external memory device. In this embodiment, the memory 21 is generally used to store an operating system and various application software installed on the computer device 2, such as program code of the loading framework system 20 of the android H5 page. Further, the memory 21 may be used to temporarily store various types of data that have been output or are to be output.
The processor 22 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 2, such as performing control and processing related to data interaction or communication with the computer device 2. In this embodiment, the processor 22 is configured to execute the program code or process data stored in the memory 21, for example, execute the loading framework system 20 of the android H5 page.
The network interface 23 may comprise a wireless network interface or a wired network interface, which network interface 23 is typically used for establishing a communication connection between the computer device 2 and other computer devices. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, establish a data transmission channel and a communication connection between the computer device 2 and the external terminal, and the like. The network may be an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, GSM), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, or other wireless or wired network.
It is noted that fig. 4 only shows a computer device 2 having components 21-23, but it is understood that not all of the illustrated components are required to be implemented, and that more or fewer components may alternatively be implemented.
In this embodiment, the loading framework system 20 of the android H5 page stored in the memory 21 may be executed by one or more processors (the processor 22 in this embodiment) to complete the operations of the loading method of the android H5 page.
Furthermore, the invention provides a computer readable storage medium, which is a nonvolatile storage medium and stores computer program instructions, wherein the computer program instructions can be executed by one or more processors to implement the loading method of the android H5 page or the operation of the electronic device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the principles and spirit of the invention, but such changes and modifications fall within the scope of the invention.

Claims (9)

1. The android H5 page loading method is characterized by comprising the following steps of:
s1, a loading frame receives an H5 page loading request sent by a user, wherein the request comprises a model used by the user and identification information of the H5 page, and a package guiding path of a native kernel class and a package guiding path of a third party kernel class are arranged in the loading frame;
s2, the loading framework acquires configuration information of an H5 page to be loaded according to the request, wherein the configuration information comprises a kernel change-over switch, and a loading kernel of the H5 page is selected through the kernel change-over switch;
s3, recognizing the state of the kernel change-over switch, and loading the H5 page by adopting a kernel corresponding to the recognized result according to the recognized result, wherein the kernel comprises a primary kernel and a third party kernel;
the step S3 comprises the following substeps:
s31, judging the state of the kernel change-over switch, if the state is open, executing step 32, and if the state is closed, executing step 33;
s32, loading an H5 page by adopting a third-party kernel, wherein a package guiding path of a native kernel class related to WebView in the third-party kernel is preset in a loading frame by adopting a method for inheriting the package guiding path of the native kernel class;
s33, loading the H5 page by adopting a native kernel.
2. The loading method of the android H5 page according to claim 1, wherein the configuration information in S2 further includes a whitelist, and models applicable to loading the H5 page by a third party kernel are listed in the whitelist;
before S31, the method further comprises:
s301, judging whether the machine type for sending the H5 page loading request is in a white list, if so, executing S31, and if not, directly executing S33.
3. The loading method of the android H5 page according to claim 1, wherein the configuration information in S2 further includes a blacklist, and models which are not applicable to loading the H5 page by the third party kernel are listed in the blacklist;
before S31, the method further comprises:
s302, judging whether the machine type for sending the H5 page loading request is located in a blacklist, if not, executing S31, and if yes, directly executing S33.
4. The loading method of the android H5 page according to claim 1, wherein the configuration information in S2 further includes a white list and a black list, the white list is listed with models applicable to loading the H5 page by the third party kernel, and the black list is listed with models not applicable to loading the H5 page by the third party kernel;
before S31, the method further comprises:
s303, judging whether the machine type sending the H5 page loading request is located in a white list or not and whether the machine type sending the H5 page loading request is located in a black list, executing S31 if the machine type sending the H5 page loading request is located in the white list only, and directly executing S33 if the machine type sending the H5 page loading request is located in the black list only.
5. The loading method of android H5 pages according to claim 4,
in the step S303, when the model sending the H5 page load request is neither in the white list nor in the black list, directly executing step S33;
the S33 further includes the loading framework recording a case where the H5 page is loaded by the native kernel.
6. The loading method of an android H5 page according to any one of claims 2-4, wherein said model sending an H5 page loading request is obtained by intercepting from said request.
7. An electronic device, wherein a loading frame system of an android H5 page is stored on the electronic device, the loading frame system of the android H5 page comprises:
the receiving module is used for receiving an H5 page loading request sent by a user, wherein the request comprises a model used by the user;
the packet guiding path setting module is used for setting a packet guiding path of the original kernel class and a packet guiding path of the third-party kernel class;
the configuration information acquisition module is used for acquiring configuration information of an H5 page to be loaded, wherein the configuration information comprises a kernel change-over switch, and a loading kernel of the H5 page is selected through the kernel change-over switch;
the identification loading module is used for identifying the state of the kernel change-over switch, loading the H5 page by adopting a kernel corresponding to the result according to the identified result, wherein the kernel comprises a primary kernel and a third-party kernel;
the state judging module is used for judging the state of the kernel change-over switch, executing the third-party kernel loading module if the state is on, and executing the original kernel loading module if the state is off;
the third-party kernel loading module is used for loading an H5 page by adopting the third-party kernel, and a package guiding path of a native kernel class related to WebView in the third-party kernel is preset in a loading frame by adopting a method of inheriting the package guiding path of the native kernel class;
the native kernel loading module is used for loading the H5 page by adopting the native kernel.
8. Computer device comprising a memory and a processor, characterized in that the memory has stored thereon a loading framework system of android H5 pages executable by the processor, which system, when executed by the processor, implements the steps of the loading method of android H5 pages according to any of claims 1-6.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein computer program instructions executable by at least one processor to cause the at least one processor to perform the steps of the loading method of the android H5 page according to any one of claims 1-6.
CN201810569847.XA 2018-06-05 2018-06-05 Android H5 page loading method, device, equipment and storage medium Active CN108776601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810569847.XA CN108776601B (en) 2018-06-05 2018-06-05 Android H5 page loading method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810569847.XA CN108776601B (en) 2018-06-05 2018-06-05 Android H5 page loading method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108776601A CN108776601A (en) 2018-11-09
CN108776601B true CN108776601B (en) 2024-04-05

Family

ID=64024554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810569847.XA Active CN108776601B (en) 2018-06-05 2018-06-05 Android H5 page loading method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108776601B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110618768B (en) * 2019-03-18 2021-05-04 北京无限光场科技有限公司 Information presentation method and device
CN112416496A (en) * 2020-11-24 2021-02-26 平安普惠企业管理有限公司 Page display method and device and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102722551A (en) * 2012-05-26 2012-10-10 广州市动景计算机科技有限公司 Intelligent switching method and system for browser kernels
CN103067423A (en) * 2011-10-20 2013-04-24 腾讯科技(深圳)有限公司 Browser kernel adaption method and browser
CN104951326A (en) * 2014-03-31 2015-09-30 腾讯科技(深圳)有限公司 Web access method and device
CN106681792A (en) * 2016-11-14 2017-05-17 乐视控股(北京)有限公司 Switching method and switching device of rendering engine and electronic device
CN107145375A (en) * 2017-06-12 2017-09-08 广州阿里巴巴文学信息技术有限公司 Kernel loads method, device, system, user terminal and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10296653B2 (en) * 2010-09-07 2019-05-21 F5 Networks, Inc. Systems and methods for accelerating web page loading

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067423A (en) * 2011-10-20 2013-04-24 腾讯科技(深圳)有限公司 Browser kernel adaption method and browser
CN102722551A (en) * 2012-05-26 2012-10-10 广州市动景计算机科技有限公司 Intelligent switching method and system for browser kernels
CN104951326A (en) * 2014-03-31 2015-09-30 腾讯科技(深圳)有限公司 Web access method and device
CN106681792A (en) * 2016-11-14 2017-05-17 乐视控股(北京)有限公司 Switching method and switching device of rendering engine and electronic device
CN107145375A (en) * 2017-06-12 2017-09-08 广州阿里巴巴文学信息技术有限公司 Kernel loads method, device, system, user terminal and storage medium

Also Published As

Publication number Publication date
CN108776601A (en) 2018-11-09

Similar Documents

Publication Publication Date Title
US8533691B2 (en) Managing non-common features for program code translation
CN109885480B (en) Automatic interface compatibility testing method and device based on debugging bridge
WO2016206505A1 (en) Automated testing system and testing method
CN108563579B (en) White box testing method, device and system and storage medium
WO2019227708A1 (en) Online debugging apparatus and method for test case, and computer-readable storage medium
US11003668B2 (en) Programming language independent software testing environment
US20130326484A1 (en) Synchronization point visualization for modified program source code
CN107066377B (en) Page element obtaining method based on Android system and terminal equipment
WO2017028574A1 (en) Router testing method and testing device
CN111881054B (en) User interface automatic test method, system, equipment and storage medium
CN108776601B (en) Android H5 page loading method, device, equipment and storage medium
CN115454869A (en) Interface automation test method, device, equipment and storage medium
CN111563032A (en) APP debugging method and device, computer equipment and storage medium
CN112115055A (en) Multi-machine automatic testing method and device and computer equipment
CN111913889A (en) Test system building method and test system
US20100312541A1 (en) Program test device and program
US20120110383A1 (en) Method and apparatus for off-line analyzing crashed programs
CN105095009B (en) A kind of method for deleting and device of memory
CN108287720B (en) Software compiling method, device, equipment and storage medium
CN104484176B (en) A kind of Android system window object acquisition methods and device
KR102096085B1 (en) Apparatus and method for monitoring application
CN111858302B (en) Method and device for testing small program, electronic equipment and storage medium
CN112181727B (en) Method for realizing dynamic adjustment of mirror image synchronization rate of storage volume
CN111026667B (en) Script execution method and device and electronic equipment
CN113515447A (en) System automation test method and device

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