Nothing Special   »   [go: up one dir, main page]

CN106775795A - A kind of method and apparatus that service is provided for hypbrid app - Google Patents

A kind of method and apparatus that service is provided for hypbrid app Download PDF

Info

Publication number
CN106775795A
CN106775795A CN201510827845.2A CN201510827845A CN106775795A CN 106775795 A CN106775795 A CN 106775795A CN 201510827845 A CN201510827845 A CN 201510827845A CN 106775795 A CN106775795 A CN 106775795A
Authority
CN
China
Prior art keywords
function
module
native
web
native module
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.)
Pending
Application number
CN201510827845.2A
Other languages
Chinese (zh)
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.)
Cainiao Smart Logistics Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201510827845.2A priority Critical patent/CN106775795A/en
Publication of CN106775795A publication Critical patent/CN106775795A/en
Pending legal-status Critical Current

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/44573Execute-in-place [XIP]
    • 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

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)

Abstract

The invention provides the method and apparatus that one kind provides service for mixed mode applications (hypbrid app), wherein method includes:The function statement that web modules detection native modules are provided;According to the function of detecting, code logic corresponding with the function of detecting is performed.For native modules and web modules in the case ofs of not upgrading synchronously, web modules are not carried out the function that native modules are not supported, it is to avoid compatibility issue.

Description

Method and device for providing service for hypbridge app
[ technical field ] A method for producing a semiconductor device
The invention relates to the technical field of computer application, in particular to a method and a device for providing services for hypbridge apps.
[ background of the invention ]
The hybrid app (mixed-mode application) refers to an app between a web app (web page application) and a native app (native application), is developed by using a web page language and a program language, and has the advantages of good user interaction experience of the native app and cross-platform development of the web app. The Hybrid app still needs to be installed and used, and although the Hybrid app looks like a native app, a UI webView (Web view) is provided, and a web app is accessed. That is, the hybrid app includes two parts: the system comprises a native module and a web module, wherein the native module needs to be installed and operated locally in the intelligent device, and the native module provides a container for the web module to operate. The Web module is actually a series of Web page codes running in the container, and the current mainstream is HTML 5.
For a native module, the latest installation package needs to be downloaded from an application market for upgrading, the upgrading of the web module only needs an application provider to issue new code logic to an application server, and when a user uses the hybrid app, the upgraded web module is automatically used. However, such compatibility issues are encountered during the upgrade of the hybrid app: the user does not upgrade the native module, but the web module is automatically upgraded, which causes the native module to report an error when running the new function upgraded by the web module.
[ summary of the invention ]
In view of this, the invention provides a method and a device for providing service for a hybrid app, which solve the compatibility problem caused by the asynchronous upgrade of a native module and a web module.
The specific technical scheme is as follows:
the invention provides a method for providing services for a mixed-mode application hypbid app, which comprises the following steps:
the web module detects a function statement provided by the native module;
code logic corresponding to the detected function is executed in accordance with the detected function.
According to a preferred embodiment of the present invention, the function declaration provided by the web module detection native module includes:
the web module determining a function to which the provided service relates;
and judging whether the function related to the provided service exists in the function statement provided by the native module, and if so, detecting the function.
According to a preferred embodiment of the present invention, the web module maintains a window object attribute corresponding to a function related to the provided service;
the judging whether the function related to the provided service exists in the function statement provided by the native module comprises the following steps: and judging whether the native module declares the widow object attribute corresponding to the function related to the provided service.
According to a preferred embodiment of the present invention, the determining whether the function related to the provided service exists in the function declaration provided by the native module includes:
calling an API (application program interface) of the localStorage or sessionstorege, and inquiring a value corresponding to a key of a function related to the service provided by the web module from the localStorage or sessionstorege; if value indicates that the native module supports the function, the web module determines that the function is detected; or,
and inquiring a value corresponding to a key of a function related to the service provided by the web module from a cookie carried in the page request, and if the value indicates that the native module supports the function, determining that the function is detected by the web module.
The invention also provides a method for providing services for hypbridge apps, which comprises the following steps:
the native module determines the functions supported by the native module;
and providing a function statement of the functions supported by the native so as to facilitate the web module to perform function detection.
According to a preferred embodiment of the invention, the method further comprises:
and the native module provides the function statement through a window object injected in the window object set.
According to a preferred embodiment of the present invention, providing the function declaration specifically includes:
and declaring a window object attribute corresponding to the function supported by the native module under the injected window object.
According to a preferred embodiment of the invention, the method further comprises:
the native module declares functions supported by the native module in a localStorage, sessionstorege or cookie in the form of key-value pairs.
According to a preferred embodiment of the invention, the method further comprises:
the native module acquires function information supported by the native module from an application configuration file of the hybrid app; or,
and the native module acquires the function information supported by the native module from the metadata information of the installation package or the upgrade package each time the installation package or the upgrade package is downloaded.
The invention provides a device for providing service for hypbridge app, which is arranged on a web module of the hypbridge app, and comprises:
the detection unit is used for detecting a function statement provided by a native module of the hypbid app;
and the execution unit is used for executing the code logic corresponding to the detected function according to the function detected by the detection unit.
According to a preferred embodiment of the present invention, the detecting unit is specifically configured to determine a function related to a service provided by the web module; and judging whether the function related to the service provided by the web module exists in the function statement provided by the native module, and if so, detecting the function.
According to a preferred embodiment of the invention, the apparatus further comprises:
the maintenance unit is used for maintaining the window object attribute corresponding to the function related to the service provided by the web module;
the detecting unit is specifically configured to determine whether the native module declares a window object attribute corresponding to a function related to the service provided by the web module, and if so, determine that the function related to the service provided by the web module exists in the function declaration provided by the native module.
According to a preferred embodiment of the present invention, the detecting unit is specifically configured to call an API of a localStorage or sessionstorege, and query, from the localStorage or sessionstorege, a value corresponding to a key of a function related to a service provided by the web module; if value indicates that the native module supports the function, the web module determines that the function is detected; or,
and inquiring a value corresponding to a key of a function related to the service provided by the web module from a cookie carried in the page request, and if the value indicates that the native module supports the function, determining that the function is detected by the web module.
The invention also provides a device for providing service for the hypbid app, which is arranged in a native module of the hypbid app, and comprises:
the determining unit is used for determining functions supported by the native module;
and the declaration unit is used for providing the function declaration of the functions supported by the native module.
According to a preferred embodiment of the present invention, the declaration unit is specifically configured to provide the functional declaration by a window object injected in a window object set.
According to a preferred embodiment of the present invention, the declaration unit is specifically configured to declare a window object attribute corresponding to a function supported by the native module under the injected window object when providing the function declaration.
According to a preferred embodiment of the present invention, the declaration unit is specifically configured to declare the functions supported by the native module in a key-value pair in a localStorage, sessionstoreage, or cookie.
According to a preferred embodiment of the present invention, the determining unit is specifically configured to obtain, from an application configuration file of the hybrid app, function information supported by the native module; or,
and the native module acquires the function information supported by the native module from the metadata information of the installation package or the upgrade package each time the installation package or the upgrade package is downloaded.
The invention also provides a hypbridge app, comprising: the device comprises a web module containing the first device and a native module containing the second device.
According to the technical scheme, the web module executes the code logic corresponding to the detected function in a mode of detecting the function statement provided by the native module, and the web module cannot execute the function which is not supported by the native module under the condition that the native module and the web module are not synchronously upgraded, so that the compatibility problem is avoided.
[ description of the drawings ]
FIG. 1 is a flow chart of a method provided by an embodiment of the present invention;
FIG. 2 is a block diagram of an apparatus according to an embodiment of the present invention;
FIG. 3 is a block diagram of another apparatus according to an embodiment of the present invention;
fig. 4 is a block diagram of a hypbridge app according to an embodiment of the present invention.
[ detailed description ] embodiments
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
For ease of understanding, the composition of the hypbid app will be briefly described first, and as described in the background, the hypbid app mainly includes a native module and a web module, where the native module is a part that needs to be installed locally on the smart device, and the native module needs to download an installation package from an application market such as app store and install and run locally on the smart device. The Web module may be Web page code corresponding to the service provided by the server side, for example, HTML5 Web page code, which runs in a container provided by the native module.
Fig. 1 is a flowchart of a method provided by an embodiment of the present invention, and as shown in fig. 1, the method may include the following steps:
in 101, the web module detects a functional declaration provided by a native module.
In the embodiment of the invention, the native module can perform function declaration on the functions supported by the native module. When determining the functions supported by the native module, the native module may obtain the functions currently supported by the native module from an application configuration file, that is, an application configuration file of the hypbid app.
In addition, for the native module, each time the installation or upgrade may cause the addition, deletion and modification of functions, and these information are included in the metadata information and provided to the native module when the native module downloads the installation package or the upgrade package. For example, when a user downloads an installation package (actually an installation package of a native module) of a hypbridge app from an app store, the installation package may have metadata information, which may typically include the name, version number, function description, keywords, supported URLs, screenshots, contact details, and so forth of the application. When a user downloads an upgrade package from an app store, metadata information may also exist for the upgrade package, which may include the name of the application, version number, description of changed functions (including add, delete, and modify functions), keywords, supported URLs, screenshots, contact details, and so forth. Therefore, the native module can acquire the function information supported by the native module from the metadata information of the installation package or the upgrade package downloaded each time.
For the upgraded native module, the function statement can be correspondingly changed according to the function of the upgrade change, including adding a new function statement, deleting the function statement, modifying the function statement and the like.
When the Native module performs function declaration, the function declaration can be provided by injecting a window object into the window object set, and the window object attribute corresponding to the function supported by the Native module is declared under the injected window object. For example, a window _ native _ features object is injected into a window object set, all functions supported by a native module are used as object attributes of the window _ native _ features object, and the object attributes of the window _ native _ features object corresponding to the functions supported by all the native modules are listed, so that the function declaration of the functions supported by the native modules is completed.
When the Web module detects the function statement provided by the native module, the Web module actually detects the function related to the service provided by the Web module. Taking HTML5 code as an example, when a certain HTML5 webpage code runs in a container provided by a native module, the service provided by the HTML5 webpage code involves some functions which need to be supported by the native module, and then the HTML5 webpage code detects the functions to see whether the native module declares the functions.
Specifically, the web module may determine whether a function related to the service provided by the web module is present in a function declaration provided by the native module (the native module that sends a url request to the web module), and if so, detect the function. Because the function declaration provided by the native module can be in the form of window object attributes, the window object attributes corresponding to the functions related to the services provided by the web module are maintained at the web module end (namely, the server end), when detection is carried out, the web module actually judges whether the native module declares the window object attributes corresponding to the functions related to the services provided by the web module, and if yes, the function is determined to be detected.
In addition, for the web module, the change of the function is also involved after each time the web module is upgraded, and the change of the function comprises the addition of a new function, the deletion of the function and the change of the function. And correspondingly maintaining the corresponding relation between the functions and the window object attributes at the web module end according to the function change caused by the upgrading, for example, increasing the corresponding relation between the new functions and the window object attributes, and deleting the corresponding relation between the deleted functions and the window object attributes.
It should be noted that, in addition to the manner provided in the foregoing embodiment, the native module may also adopt other function declaration manners, for example, a local storage function may be used to store the function declaration into a localStorage, sessionstoreage or cookie in a form of a key-value pair, such as representing a function by a key, where the corresponding value indicates whether the native module supports the function, by injecting a window object into a window object set and declaring a window object attribute corresponding to the function supported by the native module under the injected window object. The web module can call APIs of localStorage and sessionStorage, a value corresponding to a key of a function related to the service provided by the web module is inquired from localStorage and sessionStorage, and if the value indicates that the native module supports the function, the web module determines that the function is detected. Or, the web module may query a value corresponding to a key of a function related to the service provided by the web module from a cookie carried in the page request, and if the value indicates that the native module supports the function, the web module determines that the function is detected.
The localStorage and sessionstorege can realize the query of key-value by calling a special API, data in sessionStorage exists along with the page, and the data of sessionStorage is emptied when the page is closed, so that a function statement is required to be executed each time the page is opened; the data in the cookies is sent along with the page request, thereby causing the network data volume to increase. Therefore, in the present invention, in consideration of reducing the amount of network data, it is preferable to perform the function declaration by injecting the window objects collectively into the window objects.
At 102, the web module executes code logic corresponding to the detected function in accordance with the detected function.
By code logic is meant a block of code for providing certain service content or performing certain functions. The web module side (i.e. each web page code provided by the server side) contains some code logic, and some code logic is fixed, i.e. is executed for any native module. Some code logic is corresponding to the function, and if the native module does not support the function, but the web module executes the code logic corresponding to the function, an error is generated. Thus, in this step, for code logic corresponding to a particular function, the web module only executes code logic corresponding to the detected function.
And for the function which is not detected by the native module, the native module does not support the function, and the web module does not execute the code logic corresponding to the function.
In view of the advantages of the hypbid app combining the good user interaction experience of the native app and the cross-platform development of the web app, the hypbid app is mostly used for app types with frequent service content updates, such as shopping type, group purchase type, news type, and the like. The above method provided by the embodiment of the present invention is described below by taking an example. Assuming that a hypbid app of a certain group purchase class is installed in a mobile phone of a certain user, a native module in the hypbid app currently supports: a comment function, a share function, a code scan function, a search function, and the like. Then the native module can inject a window object in the window object set:
native _ features object
And declaring in the window object the following window object attributes:
window.native_features.comment
window.native_features.share
window.native_features.scan
window.native_features.search
……
native _ features, share, scan, and search are used for declaring a search function.
Assuming that the hypbid app opens some HTML5 web page code, the native module sends a url request for the web page code to the web module. The HTML5 web page code, after being upgraded, provides functionality relating to: the method comprises a sharing function and a collection function, wherein the collection function can be supported after a native module is upgraded.
The server maintains the corresponding relation between the sharing function and the window. HTML5 web page code detects whether the native module declares window. The native module declares window, native _ features, share, and collection, so it is detected that the native module supports the share function but does not support the collection function. The HTML5 webpage code only executes the code logic corresponding to the sharing function, but not executes the code logic corresponding to the collection function, so that no error is produced for the native module which is not upgraded and does not support the collection function.
According to the implementation mode provided by the invention, only the code logic corresponding to each function needs to be maintained at the server side, so that the code complexity caused by maintaining each version number of a native module is avoided. In order to compare the mode provided by the application with the mode of maintaining each version number of the native module, the following briefly introduces the mode of maintaining each version number of the native module:
the Web module judges the current version number of the native module, maintains all code logics corresponding to the version numbers at the Web module end, and executes the corresponding code logics according to the current version number of the native module. Since one version of a web module may correspond to multiple functions and one function may exist in multiple versions, the correspondence between the version number maintained at the web module side and the code logic is much more complicated than the code logic provided by the present invention, which maintains only the correspondence of functions.
The above is a detailed description of the method provided by the present invention, and the following is a detailed description of the apparatus provided by the present invention by way of example.
Fig. 2 is a block diagram of a device according to an embodiment of the present invention, the device is disposed in a native module of a hypbid app, as shown in fig. 2, the device may include: a determination unit 01 and a lighting unit 02. The main functions of each constituent unit are as follows:
the determining unit 01 is responsible for determining the functions supported by the native module. Specifically, the determining unit 01 may obtain function information supported by a native module from an application configuration file of the hybrid app; and the function information supported by the native module can be acquired from the metadata information of the installation package or the upgrade package when the native module downloads the installation package or the upgrade package each time.
The declaration unit 02 is responsible for providing a functional declaration of the functions supported by the native module. Specifically, a function statement can be provided through a window object injected in the window object set, and corresponding window object attributes are respectively stated for functions supported by the native module.
It should be noted that, in addition to the manner provided in the above embodiment, the native module may adopt other function declaration manners besides a manner that the window object is centrally injected into the window object, and a window object attribute corresponding to a function supported by the native module is declared under the injected window object. For example, a local store function can be utilized to save a function declaration into a localStorage, sessionstore, or cookie in the form of a key-value pair, such as a key characterizing a function, with the corresponding value indicating whether the native module supports the function.
For the upgraded native module, the declaration unit 02 may perform corresponding changes to the function declaration according to the function of the upgrade change, including adding a new function declaration, deleting the function declaration, modifying the function declaration, and the like.
The device can be realized by the script injected into the native module in view of the characteristic that the native module can execute the script.
Fig. 3 is a block diagram of another apparatus according to an embodiment of the present invention, which is disposed in a web module of the hypbridge app, and may be embodied as executable code in a web page. As shown in fig. 3, the apparatus may include: a detection unit 11 and an execution unit 12, and may further include a maintenance unit 13. The main functions of each constituent unit are as follows:
the detection unit 11 is responsible for detecting the function declaration provided by the native module of the hypbid app. Specifically, the detection unit 11 may determine the function related to the service provided by the web module; and judging whether the function related to the service provided by the web module exists in the function statement provided by the native module, and if so, detecting the function.
Since the native module declares the function by declaring the window object attribute corresponding to the function supported by the native module under the window object, the maintenance unit 13 maintains the window object attribute corresponding to the function related to the service provided by the web module at the web module end. The detection unit 11 judges whether the native module declares a window object attribute corresponding to a function related to the service provided by the web module, and if so, determines that the function related to the service provided by the web module exists in the function declaration provided by the native module.
In addition, after the web module is upgraded, the change of the functions is also involved, including the addition of new functions, the deletion of the functions and the change of the functions. The maintenance unit 13 also maintains the correspondence between the functions and the window object attributes according to the function change caused by the upgrade, for example, adds the correspondence between the new functions and the window object attributes, and deletes the correspondence between the deleted functions and the window object attributes.
If the native module performs the function declaration in other manners, the detection unit 11 may also perform other manners of detecting the function, for example: calling an API (application program interface) of the localStorage or sessionStorage, and inquiring a value corresponding to a key of a function related to the service provided by the web module from the localStorage or sessionStorage; if value indicates that the native module supports the function, the detection unit 11 determines that the function is detected; or,
from the cookies carried in the page request, a value corresponding to a key of a function related to the service provided by the web module is queried, and if the value indicates that the native module supports the function, the detection unit 11 determines that the function is detected.
The execution unit 12 is responsible for executing the code logic corresponding to the detected function according to the function detected by the detection unit 11. For a function that is not detected by the native module, it indicates that the native module does not support the function, and the execution unit 12 does not execute the code logic corresponding to the function.
In addition, an embodiment of the present invention further provides a structure diagram of a hypbridge app, as shown in fig. 4, the hypbridge app includes: a web module and a native module.
The native module includes a device shown in fig. 2, and the web module includes a device shown in fig. 3, which are not described in detail.
As can be seen from the above description, the method and apparatus provided by the present invention can have the following advantages:
1) according to the method, the web module executes the code logic corresponding to the detected function in a mode of detecting the function statement provided by the native module, and the web module cannot execute the function which is not supported by the native module under the condition that the native module and the web module are not synchronously upgraded, so that the compatibility problem is avoided.
2) The invention only needs to maintain the corresponding relation between the functions and the execution codes at the server end, and compared with the maintenance of the corresponding relation between the version numbers of the native module and the execution codes, because each version can correspond to a plurality of functions and one function can correspond to a plurality of versions, the invention has the advantages of easier maintenance and lower code complexity.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (19)

1. A method of providing services for mixed-mode applications hypbrid apps, the method comprising:
the web module detects a function statement provided by the native module;
code logic corresponding to the detected function is executed in accordance with the detected function.
2. The method of claim 1, wherein the web module detecting the functional declaration provided by the native module comprises:
the web module determining a function to which the provided service relates;
and judging whether the function related to the provided service exists in the function statement provided by the native module, and if so, detecting the function.
3. The method of claim 2, wherein the web module maintains a window object property corresponding to a function involved in the provided service;
the judging whether the function related to the provided service exists in the function statement provided by the native module comprises the following steps: and judging whether the native module declares the widow object attribute corresponding to the function related to the provided service.
4. The method of claim 2, wherein the determining whether the function related to the provided service exists in the function declaration provided by the native module comprises:
calling an API (application program interface) of the localStorage or sessionstorege, and inquiring a value corresponding to a key of a function related to the service provided by the web module from the localStorage or sessionstorege; if value indicates that the native module supports the function, the web module determines that the function is detected; or,
and inquiring a value corresponding to a key of a function related to the service provided by the web module from a cookie carried in the page request, and if the value indicates that the native module supports the function, determining that the function is detected by the web module.
5. A method of providing services for a hypbridge app, the method comprising:
the native module determines the functions supported by the native module;
and providing a function statement of the functions supported by the native so as to facilitate the web module to perform function detection.
6. The method of claim 5, further comprising:
and the native module provides the function statement through a window object injected in the window object set.
7. The method according to claim 6, wherein providing the functional declaration comprises in particular:
and declaring a window object attribute corresponding to the function supported by the native module under the injected window object.
8. The method of claim 5, further comprising:
the native module declares functions supported by the native module in a localStorage, sessionstorege or cookie in the form of key-value pairs.
9. The method of claim 7 or 8, further comprising:
the native module acquires function information supported by the native module from an application configuration file of the hybrid app; or,
and the native module acquires the function information supported by the native module from the metadata information of the installation package or the upgrade package each time the installation package or the upgrade package is downloaded.
10. An apparatus for providing a service for a hypbridge app, the apparatus being provided to a web module of the hypbridge app, the apparatus comprising:
the detection unit is used for detecting a function statement provided by a native module of the hypbid app;
and the execution unit is used for executing the code logic corresponding to the detected function according to the function detected by the detection unit.
11. The apparatus according to claim 10, wherein the detection unit is specifically configured to determine a function involved in the service provided by the web module; and judging whether the function related to the service provided by the web module exists in the function statement provided by the native module, and if so, detecting the function.
12. The apparatus of claim 11, further comprising:
the maintenance unit is used for maintaining the window object attribute corresponding to the function related to the service provided by the web module;
the detecting unit is specifically configured to determine whether the native module declares a window object attribute corresponding to a function related to the service provided by the web module, and if so, determine that the function related to the service provided by the web module exists in the function declaration provided by the native module.
13. The apparatus according to claim 11, wherein the detecting unit is specifically configured to invoke an API of a localStorage or sessionstorege, and query a value corresponding to a key of a function related to the service provided by the web module from the localStorage or sessionstorege; if value indicates that the native module supports the function, the web module determines that the function is detected; or,
and inquiring a value corresponding to a key of a function related to the service provided by the web module from a cookie carried in the page request, and if the value indicates that the native module supports the function, determining that the function is detected by the web module.
14. An apparatus for providing service for a hypbid app, the apparatus being disposed in a native module of the hypbid app, the apparatus comprising:
the determining unit is used for determining functions supported by the native module;
and the declaration unit is used for providing the function declaration of the functions supported by the native module.
15. The apparatus according to claim 14, wherein the declaration unit is specifically configured to provide the functional declaration by a window object injected in a set of window objects.
16. The apparatus according to claim 15, wherein the declaring unit, when providing the function declaration, is specifically configured to declare a window object property under the injected window object, the window object property corresponding to a function supported by the native module.
17. The apparatus according to claim 14, wherein the declaration unit is specifically configured to declare the functionality supported by the native module in a key-value pair in a localStorage, sessionstorege, or cookie.
18. The apparatus according to claim 16 or 17, wherein the determining unit is specifically configured to obtain, from an application configuration file of the hybrid app, function information supported by the native module; or,
and the native module acquires the function information supported by the native module from the metadata information of the installation package or the upgrade package each time the installation package or the upgrade package is downloaded.
19. A hypbid app, comprising: a web module and a native module;
wherein the web module comprises an apparatus as claimed in any one of claims 10 to 13;
the native module comprises an apparatus as claimed in any of claims 14 to 17.
CN201510827845.2A 2015-11-25 2015-11-25 A kind of method and apparatus that service is provided for hypbrid app Pending CN106775795A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510827845.2A CN106775795A (en) 2015-11-25 2015-11-25 A kind of method and apparatus that service is provided for hypbrid app

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510827845.2A CN106775795A (en) 2015-11-25 2015-11-25 A kind of method and apparatus that service is provided for hypbrid app

Publications (1)

Publication Number Publication Date
CN106775795A true CN106775795A (en) 2017-05-31

Family

ID=58963718

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510827845.2A Pending CN106775795A (en) 2015-11-25 2015-11-25 A kind of method and apparatus that service is provided for hypbrid app

Country Status (1)

Country Link
CN (1) CN106775795A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107342934A (en) * 2017-06-19 2017-11-10 浪潮金融信息技术有限公司 A kind of mixed mode Mobile solution real-time messages method for pushing and system based on WebSocket
CN107678817A (en) * 2017-09-21 2018-02-09 北京三快在线科技有限公司 View switching method and apparatus and computing device
CN108509604A (en) * 2018-03-30 2018-09-07 成都优易数据有限公司 A kind of method of the data sharing duke groups of multiple Shipping Options Pages
CN112597423A (en) * 2021-01-04 2021-04-02 聚好看科技股份有限公司 Webpage content display method, terminal and server

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201827A (en) * 2006-12-14 2008-06-18 阿里巴巴公司 Method and system for displaying web page
CN102904947A (en) * 2012-09-29 2013-01-30 北京百度网讯科技有限公司 Application client presentation style updating and/or content expanding method and system
CN103942225A (en) * 2013-01-23 2014-07-23 阿里巴巴集团控股有限公司 Method and system for invoking resources of Hybrid App client and client

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101201827A (en) * 2006-12-14 2008-06-18 阿里巴巴公司 Method and system for displaying web page
CN102904947A (en) * 2012-09-29 2013-01-30 北京百度网讯科技有限公司 Application client presentation style updating and/or content expanding method and system
CN103942225A (en) * 2013-01-23 2014-07-23 阿里巴巴集团控股有限公司 Method and system for invoking resources of Hybrid App client and client

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107342934A (en) * 2017-06-19 2017-11-10 浪潮金融信息技术有限公司 A kind of mixed mode Mobile solution real-time messages method for pushing and system based on WebSocket
CN107678817A (en) * 2017-09-21 2018-02-09 北京三快在线科技有限公司 View switching method and apparatus and computing device
WO2019056645A1 (en) * 2017-09-21 2019-03-28 北京三快在线科技有限公司 View switching
CN108509604A (en) * 2018-03-30 2018-09-07 成都优易数据有限公司 A kind of method of the data sharing duke groups of multiple Shipping Options Pages
CN112597423A (en) * 2021-01-04 2021-04-02 聚好看科技股份有限公司 Webpage content display method, terminal and server
CN112597423B (en) * 2021-01-04 2023-11-03 聚好看科技股份有限公司 Webpage content display method, terminal and server

Similar Documents

Publication Publication Date Title
CN108845816B (en) Application program updating method, system, computer device and storage medium
CN102693280B (en) Webpage browsing method, WebApp framework, method and device for executing JavaScript, and mobile terminal
AU2014275115B2 (en) Debugging native code by transitioning from execution in native mode to execution in interpreted mode
US9471704B2 (en) Shared script files in multi-tab browser
CN107153536B (en) Application processing method and device
EP2486498A1 (en) Shared script files in multi-tab browser
WO2020253366A1 (en) Webpage mailbox data crawling method and apparatus, terminal, and storage medium
WO2014036142A2 (en) Systems and methods for tracking and updating hosted applications
US20120317363A1 (en) Memory Caching for Browser Processes
CN105786538A (en) Software upgrading method and device based on Android system
CN108920691B (en) Front-end static resource management method and device, computer equipment and storage medium
CN106775795A (en) A kind of method and apparatus that service is provided for hypbrid app
US20130159967A1 (en) Available symbol set generation using untyped variable
US9047100B2 (en) Abstract syntax tree transformation
CN108762809A (en) Software function extended method, device, computer equipment and storage medium
CN114995859A (en) Page hot updating method, device, equipment and storage medium
CN112559026B (en) API (application program interface) -based native capability development method, device and storage medium
US9760470B2 (en) Device, method, and program analysis of new source code to be added to execution program to check for bug
CN110688096A (en) Method, device, medium and electronic equipment for constructing application program containing plug-in
CN108073401B (en) Method and device for executing business logic and electronic equipment
CN108845864B (en) Spring frame-based JVM garbage recycling method and device
KR20070040695A (en) Apparatus of multimedia middle ware using metadata and management method and storing medium thereof
US20160350089A1 (en) Code caching system
US10740071B2 (en) Predicting and using utility of script execution in functional web crawling and other crawling
CN110825622A (en) Software testing method, device, equipment and computer readable medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180410

Address after: Four story 847 mailbox of the capital mansion of Cayman Islands, Cayman Islands, Cayman

Applicant after: CAINIAO SMART LOGISTICS HOLDING Ltd.

Address before: Cayman Islands Grand Cayman capital building a four storey No. 847 mailbox

Applicant before: ALIBABA GROUP HOLDING Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170531