CN109101228B - Application program execution method and device - Google Patents

Application program execution method and device Download PDF

Info

Publication number
CN109101228B
CN109101228B CN201810910837.8A CN201810910837A CN109101228B CN 109101228 B CN109101228 B CN 109101228B CN 201810910837 A CN201810910837 A CN 201810910837A CN 109101228 B CN109101228 B CN 109101228B
Authority
CN
China
Prior art keywords
data information
data
control
page
application program
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
CN201810910837.8A
Other languages
Chinese (zh)
Other versions
CN109101228A (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.)
Baidu Online Network Technology Beijing Co Ltd
Original Assignee
Baidu Online Network Technology Beijing 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 Baidu Online Network Technology Beijing Co Ltd filed Critical Baidu Online Network Technology Beijing Co Ltd
Priority to CN201810910837.8A priority Critical patent/CN109101228B/en
Publication of CN109101228A publication Critical patent/CN109101228A/en
Application granted granted Critical
Publication of CN109101228B publication Critical patent/CN109101228B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Landscapes

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

Abstract

The invention provides an application program execution method and device, wherein the method comprises the following steps: the method comprises the steps of sending first data information to a native control of an application program through a preset data interaction interface, wherein the first data information is used for indicating that the native control inserts a first interaction control into an H5 page, receiving a calling request for calling the data interaction interface by the native control, and obtaining second data information carried by the calling request, wherein the second data information is generated after the first interaction control detects first user operation, and updating an H5 page according to the second data information, so that platform direct interaction can be achieved between the H5 page and the native control without distinguishing between platforms, the application development efficiency is improved, meanwhile, in the interaction process, the interaction control is dynamically generated, the application performance is improved, and the version sending efficiency is also improved.

Description

Application program execution method and device
Technical Field
The present invention relates to the field of mobile terminal technologies, and in particular, to an application program execution method and apparatus.
Background
With the development of mobile internet technology and the popularization of intelligent mobile terminals, the importance of mobile internet in life is more and more obvious, the development of application programs of mobile terminals is more and more important, and at present, the application programs of the mobile terminals mainly adopt a hybrid development mode, namely, a webpage language and a program language are adopted for writing at the same time, and application programs required to be installed by users are distributed by distinguishing operating systems through application stores. Due to the application program of hybrid development, the method has good user experience and low development cost, and is more and more popular with developers.
In the related technology, page writing is mostly performed on a mixed application program by HTML5, JavaScript and the like, and data interaction is performed through an HTML5 end and a Native end to realize the function of the application program, but due to the platform differences of an Android operating system and an IOS operating system, data interaction between the HTML5 end and the Native end needs to distinguish platforms, so that corresponding codes need to be developed separately for different platforms, development efficiency is low, maintainability of the codes is poor, meanwhile, after the application program is developed, the control encapsulation of the Native control end is completed, if the control needs to be updated, the application program needs to be updated again, so that user requirements cannot be met in time, and version sending efficiency is low.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first objective of the present invention is to provide an execution method of an application program, so that platform interaction between an H5 page and a native control may not be distinguished by presetting an interface conforming to a method defined by the native control in an H5 page, development efficiency is improved, maintenance cost is reduced, and meanwhile, in an interaction process, the H5 page may also invoke the method defined by the native control to dynamically generate a first interaction control, thereby implementing data interaction between the H5 page and the native control, and simultaneously improving performance of the application and publishing efficiency.
A second object of the present invention is to provide another method for executing an application program.
A third object of the present invention is to provide an application program execution apparatus.
A fourth object of the present invention is to provide another application program execution apparatus.
A fifth object of the invention is to propose a computer device.
A sixth object of the invention is to propose a non-transitory computer-readable storage medium.
A seventh object of the invention is to propose a computer program product.
To achieve the above object, an embodiment of a first aspect of the present invention provides an execution method of an application program, where the method includes the following steps:
sending first data information to a native control of an application program through a preset data interaction interface; wherein the first data information is used for indicating that the native control inserts a first interaction control in the H5 page;
receiving a calling request for calling the data interaction interface by the native control;
acquiring the second data information carried by the calling request; the second data information is generated after the first interaction control detects the first user operation;
and updating the H5 page according to the second data information. In order to achieve the above object, an embodiment of a second aspect of the present invention provides another method for executing an application program, where the method includes the following steps:
the H5 editor sends first data information through a preset data interaction interface; the H5 editor is used for editing and processing an H5 page of an application program;
inserting a first interaction control in the H5 page according to the first data information;
when the first interactive control detects a preset first user operation, generating corresponding second data information; the second data information for instructing the H5 editor to update the H5 page;
and sending a call request for calling the data interaction interface to the H5 editor, wherein the call request carries the second data information.
To achieve the above object, an embodiment of a third aspect of the present invention provides an execution apparatus of an application, where the execution apparatus is applied to the H5 page, and includes:
the sending module is used for sending first data information to the native control of the application program through a preset data interaction interface; wherein the first data information is used for indicating that the native control inserts a first interaction control in an H5 page of the application program;
the acquisition module is used for receiving a calling request for calling the data interaction interface by the native control; acquiring the second data information carried by the calling request; the second data information is generated after the first interaction control detects the first user operation;
and the processing module is used for updating the H5 page according to the second data information. To achieve the above object, a fourth aspect of the present invention provides an execution apparatus of another application program, where the execution apparatus is applied to the native control, and includes:
the receiving module is used for acquiring first data information sent by the H5 editor through a preset data interaction interface; the H5 editor is used for editing and processing an H5 page of an application program;
the processing module is used for inserting a first interaction control into the H5 page according to the first data information; when the first interactive control detects a preset first user operation, generating corresponding second data information; the second data information for instructing the H5 editor to update the H5 page;
and the sending module is used for sending a calling request for calling the data interaction interface to the H5 editor, wherein the calling request carries the second data information.
In order to achieve the above object, a fifth embodiment of the present invention provides a computer device, including a memory, a processor, and an application program stored in the memory and executable on the processor, where the processor executes the application program to implement the method for executing the application program according to one aspect or the method for executing the application program according to another aspect.
In order to achieve the above object, a sixth aspect of the present invention proposes a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements an execution method of an application program as described in the one hand or an execution method of an application program as described in the other hand.
In order to achieve the above object, a seventh embodiment of the present invention proposes a computer program product, in which instructions, when executed by a processor, implement an execution method of an application program as described in the above aspect or an execution method of an application program as described in the above aspect.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the method comprises the steps of sending first data information to a native control of an application program through a preset data interaction interface, wherein the first data information is used for indicating that the native control inserts a first interaction control into an H5 page, receiving a calling request for calling the data interaction interface by the native control, and acquiring second data information carried by the calling request, wherein the second data information is generated after the first interaction control detects first user operation, and updating the H5 page according to the second data information. The interface of the method conforming to the native control definition is preset in the H5 page, so that platform interaction between the H5 page and the native control can be avoided, the development efficiency is improved, the maintenance cost is reduced, meanwhile, in the interaction process, the H5 page can also call the method defined by the native control to dynamically generate the first interaction control, the data interaction between the H5 page and the native control is realized, the application performance is improved, and the publishing efficiency is also improved.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a flowchart illustrating an execution method of an application according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating another method for executing an application according to an embodiment of the present invention;
FIG. 3a is a schematic view illustrating an interface operation of an application according to an embodiment of the present invention;
fig. 3b is a second schematic view illustrating an interface operation of an application according to the embodiment of the present invention;
fig. 3c is a third schematic view illustrating an interface operation of an application according to the embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for executing another application according to an embodiment of the present invention;
fig. 5 is a flowchart illustrating an interaction executing method of an application according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an apparatus for executing an application according to an embodiment of the present invention;
FIG. 7 is a block diagram of an apparatus for executing another application according to an embodiment of the present invention; and
FIG. 8 illustrates a block diagram of an exemplary computer device suitable for use in implementing embodiments of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
An execution method and apparatus of an application program according to an embodiment of the present invention are described below with reference to the drawings.
Fig. 1 is a flowchart illustrating an execution method of an application according to an embodiment of the present invention.
As shown in fig. 1, the method comprises the steps of:
step 101, sending first data information to a native control of an application program through a preset data interaction interface, wherein the first data information is used for indicating that the native control inserts a first interaction control into an H5 page.
The application program comprises a browser kernel, a native control and an H5 page, the H5 page is edited by an H5 editor, the execution body of the method is the H5 editor, a data interaction interface is generated by interface information sent when the browser kernel of the application program loads the H5 page, the interface information conforms to the definition of the native control, and cross-platform data interaction between the H5 page and the native control can be achieved through the data interaction interface.
Specifically, the data format processing is performed on the first data information through the data format defined by the data interaction interface preset in the H5 page, so that the first data information after the data format processing is matched with the data format defined by the native control, and the processed first data information is written into the receiving class preset in the native control, so that the native control generates the first interaction control for calling the method indicated by the first data information according to the received first data information and inserts the first interaction control into the corresponding position in the H5 page, thereby realizing the dynamic generation of the first interaction control, improving the performance of the application program, improving the publishing efficiency, and having high user satisfaction.
The generation manner of the first data information will be described in the following embodiments.
It should be understood that the first data information is sent to the native control after being processed in the data format, and the native control can analyze the first data by using a method defined by the native control without format conversion, so that the efficiency of the native control in processing the data is improved.
And 102, receiving a calling request for calling the data interaction interface by the native control.
Specifically, a calling request for calling the data interaction interface by the native control is received through a browser kernel for loading an H5 page, and data returned to the H5 editor by the native control is obtained from the calling request.
Step 103, second data information carried by the call request is obtained, wherein the second data information is generated after the first interaction control detects the first user operation.
The first interactive control is generated based on a native control definition method, and the user operation detected by the first interactive control end is called first user operation.
Specifically, after the first interaction control detects a first user operation, second data information is generated, and when the native control sends a call request to the data interaction interface through a browser kernel for loading an H5 page, the H5 editor obtains the second data information carried by the call request through the data interaction interface.
And step 104, updating the H5 page according to the second data information.
Specifically, according to the second data information, a corresponding first user operation is determined, and according to the first user operation, the content of the H5 page is updated.
In the execution method of the application program of the embodiment of the invention, first data information is sent to a native control of the application program through a preset data interaction interface, wherein the first data information is used for indicating that the native control inserts a first interaction control into an H5 page, receiving a calling request for calling the data interaction interface by the native control, and acquiring second data information carried by the calling request, wherein the second data information is generated after the first interaction control detects a first user operation, an H5 page is updated according to the second data information, platform-independent interaction between the H5 page and the native control is realized through the preset data interaction interface conforming to a native control definition method, the efficiency of application development is improved, meanwhile, in the interaction process, the native control is indicated to dynamically generate the interaction control, data interaction is realized, and simultaneously, the performance of the application is improved, and the plate sending efficiency is also improved.
To clearly illustrate the above embodiment, this embodiment provides another execution method of an application program, and fig. 2 is a flowchart illustrating the execution method of another application program according to the embodiment of the present invention.
As shown in fig. 2, the method may include the steps of:
step 201, acquiring interface information, and generating a data interaction interface.
Specifically, interface information sent when a browser kernel of an application program loads an H5 page is obtained, a data interaction interface is generated according to the interface information, the data interaction interface conforms to a method defined by a native control, direct interaction between the H5 page and the native control is achieved through the generated data interaction interface, and distinguishing of platforms is not needed.
Step 202, detecting a preset second user operation through a second interactive control, and generating first data information.
And generating a second interaction control based on the method defined by the H5 page, and referring the user operation detected by the second interaction control to be the second user operation.
Specifically, the H5 page is loaded in the browser kernel of the application program, and the H5 page is displayed. The H5 page detects a preset second user operation through a second interaction control, and after the second user operation is detected, first data information is generated in response to the second user operation, wherein the first data information is used for indicating that the native control inserts the first interaction control into the H5 page.
Based on a possible application scenario, fig. 3a is one of interface operation diagrams of an application program provided in an embodiment of the present invention, as shown in fig. 3a, in an H5 page loaded in the figure, when a preset second user operation is detected through a second interaction control indicated by B in an H5 page, for example, after the second interaction control indicated by B is clicked, a blinking cursor appears in response to the click operation, the H5 page indicates that text input is to be performed, and the text input requires text input, picture insertion, font editing, and the like, so that after the second user operation is detected, corresponding first data information is generated, the first data information indicates a generation method for generating controls such as a text input control, a picture insertion control, or font editing, and indicates a display position of the control in the H5 page, where the control is the first interaction control.
Step 203, sending first data information to the native control of the application program through a preset data interaction interface.
The preset data interaction interface in the H5 page can be implemented by the JS code.
Specifically, the H5 page performs data format processing on the first data information according to a data format defined by a preset data interaction interface, as a possible implementation manner, a data format tool (JavaScript Object notification, JSON) may be used to perform data format processing on the first data information, so that the first data information after the data format processing is matched with the data format defined by the native control, and the first data information after the data format processing is written into a preset receiving class in the native control, so that the native control does not need to perform data format conversion after acquiring the first data information, and according to a method indicated by the first data information, a control capable of calling the method indicated by the first data information is generated, and is inserted into the H5 page at a position indicated by the first data information.
As shown in FIG. 3a, the control outlined in the dashed box is the first interactive control inserted in the H5 page.
It should be understood that the first interaction control is generated according to the method indicated by the first data information and is inserted into the corresponding position of the H5 page for display, that is, the first interaction control displayed in the H5 page is not fixed along with the publishing of the application program, but is dynamically generated based on the second user operation detected by the second interaction control in the H5 page, so that the performance of the application program is improved, and the publishing efficiency of the application program is also improved.
And step 204, receiving a calling request for calling the data interaction interface by the native control.
Specifically, the H5 page needs to receive data sent by the native control, and needs to receive a call request for calling the data interaction interface by the native control, and obtain the interaction data from the call request.
Step 205, second data information carried by the call request is obtained, wherein the second data information is generated after the first interaction control detects the first user operation.
Specifically, after the first interaction control detects a first user operation, second data information is generated, and when the native control sends a call request to the data interaction interface through a browser kernel for loading an H5 page, the H5 editor obtains the second data information carried by the call request through the data interaction interface.
Fig. 3b is a second schematic view of an interface operation of the application program according to the embodiment of the present invention, and fig. 3b shows that the second data message is generated after the picture selection module indicated by the first interaction control detects the first user operation, which is described in detail in the following embodiments.
And step 206, updating the H5 page according to the second data information.
Fig. 3c is a third schematic view of an interface operation of the application program according to the embodiment of the present invention, as shown in fig. 3c, the H5 page clicks the selected picture according to the second data information, obtains the picture B selected by the user, inserts the picture B selected by the user into the corresponding position in the H5 page, and updates the H5 page.
In the execution method of the application program, the first data information is sent to the native control of the application program through the preset data interaction interface, wherein the first data information is used for indicating that the native control inserts the first interaction control into the H5 page, receiving a calling request for calling the data interaction interface by the native control, and acquiring the second data information carried by the calling request, wherein the second data information is generated after the first interaction control detects the first user operation, and the H5 page is updated according to the second data information, so that platform-independent direct interaction between the H5 page and the native control can be realized, the application development efficiency is improved, meanwhile, the interaction control is dynamically generated at the native control end in the interaction process, the application performance is improved, and the version sending efficiency is also improved.
In order to implement the above embodiments, the present invention further provides a possible implementation manner of an execution method of an application program, where an execution subject of the method is a native control.
Fig. 4 is a flowchart illustrating a method for executing another application according to an embodiment of the present invention.
As shown in fig. 4, the method includes the steps of:
step 401, acquiring first data information sent by an H5 editor through a preset data interaction interface, wherein the H5 editor is used for editing an H5 page of an application program.
Specifically, a receiving class is preset in the native control and is used for receiving first data information sent by the H5 editor through a preset data interaction interface.
In the embodiment of the present invention, the first data information is generated in the H5 page in advance, specifically, the H5 page detects a preset second user operation through a second interactive control in the H5 page, and when the second user operation is detected, the second user operation is responded to, and the first data information is generated. As shown in fig. 3a, in an H5 page in the figure, after a preset second user operation is detected through a second interactive control indicated by B in an H5 page, for example, after the second interactive control indicated by B is clicked, a flashing cursor appears in response to the click operation, the H5 page indicates that text input is to be performed, and text input requires text input, picture insertion, font editing, and the like, so that after the second user operation is detected, first data information is generated, the first data information indicates a generation method for generating controls such as a text input control, a picture insertion control, or font editing, and indicates a display position of the control in the H5 page. And then, format conversion is carried out on the first data information, and the first data information is converted into data information matched with the native control definition method, so that after the native control receives the first data information, format conversion is not needed, the native control can be directly analyzed according to the native definition method, and the efficiency of data processing at the native control end is improved.
Step 402, inserting a first interaction control in the H5 page according to the first data information.
Specifically, the native control generates a first interactive control by using a method defined by the native control according to an indication method of a control to be generated in an H5 page carried in the first data information, and inserts the first interactive control at a corresponding position of the H5 page according to the position information carried in the first data.
It should be understood that the first interactive control is dynamically generated based on the second user operation in the H5 page, and meets the user's requirements better.
Step 403, when the first interactive control detects a preset first user operation, generating corresponding second data information, where the second data information is used to instruct the H5 editor to update the H5 page.
As shown in fig. 3a, after the picture insertion control indicated by a in the first interactive control is clicked by the user, the picture selection module generated by the native control is invoked, as shown in fig. 3B, in the picture selection module, "animals" are searched for and pictures related to the animals are displayed according to the user operation, and then corresponding second data information is generated according to the pictures selected by the user, that is, the pictures indicated by B, and the second data information indicates the pictures selected by the user in the picture selection module.
And step 404, sending a call request for calling the data interaction interface to the H5 editor, wherein the call request carries the second data information.
Specifically, the native control sends a call request for calling the data interaction interface to the H5 editor through a browser kernel for loading the H5 page, so that the H5 page can obtain second data information carried by the call request through the data interaction interface, and according to the second data information, the corresponding first user operation is responded, the H5 page is updated, and cross-platform data interaction between the H5 page and the native control is achieved.
According to the execution method of the application program, the first data information sent by the H5 editor through the preset data interaction interface is obtained, the first interaction control is inserted into the H5 page according to the first data information, the interaction control is dynamically generated according to the method indicated by the user operation in the H5 page, the user requirements are better met, and version updating along with the application program is not needed. When the first interactive control detects the preset first user operation, the native control generates corresponding second data information and sends a calling request for calling the data interactive interface to the H5 editor, so that after the H5 page obtains the second data information carried by the calling request through the data interactive interface, the first user operation is responded, the H5 page is updated, when the communication between the H5 page and the native control is realized, a platform does not need to be distinguished, the application development efficiency is improved, and the code maintenance cost is low.
Based on the foregoing embodiment, the present invention further provides an application program interaction execution method, and fig. 5 is a flowchart illustrating the application program interaction execution method according to the embodiment of the present invention, as shown in fig. 5, the method includes the following steps:
in step 501, the browser kernel loads the H5 page.
Specifically, the browser kernel of the application loads the H5 page.
At step 502, the browser kernel sends interface information to the H5 editor.
Specifically, the browser kernel of the application sends interface information to the H5 editor when loading the H5 page.
And 503, generating a data interaction interface according to the interface information.
The data interaction interface can realize cross-platform communication between the H5 page and the native control, and the following steps are specifically described.
In step 504, the H5 editor detects a second user operation through the second interactive control to generate corresponding first data information.
The second interactive control is generated based on a method defined by the H5 page, can be stored in a preset control library, and can be directly called when the H5 page is loaded.
The second user action is detected by a second interactive control in the H5 page.
In step 505, the H5 editor sends the first data information to the native control through the preset interface.
Specifically, the H5 editor sends first data information to the native control through a preset interface, and the native control receives the first data information through a preset receiving class, so that data transmission from the H5 page to the native control end is realized.
At step 506, the native control inserts the first interactive control into the H5 page according to the method indicated by the first data information.
Specifically, according to the method indicated by the first data information, a first interactive control for calling the method is generated, and according to the position indicated by the first data information, the first interactive control is inserted into the corresponding position in the H5 page, so that dynamic generation of the native control is realized, and the user requirements are better met.
In step 507, when the first interactive control detects a preset first user operation, corresponding second data information is generated.
Specifically, reference may be made to step 403 in the embodiment corresponding to fig. 4, which is not described herein again.
In step 508, the native control sends a call request for calling the data interaction interface to the H5 editor through the browser kernel.
Specifically, when the native control needs to transmit data to the H5 page, the native control sends a call request for calling the data interaction interface to the H5 editor through the browser kernel, so that the native control transmits the data to the H5 page.
In step 509, the H5 editor obtains the second data information carried by the call request through the interface.
In step 510, the H5 editor updates the H5 page according to the second data information.
Specifically, the step 509-.
In the execution interaction method of the application program, a data communication interface is preset in an H5 page, a receiving class is preset at a native control end, data transmitted to a native control by an H5 page through the data interaction interface is received by the receiving class preset in the native control, data transmission from an H5 page to the native control is realized, when the native control end transmits data to an H5 page, a calling request for calling the data interaction interface is sent to an H5 editor through a browser kernel, so that the H5 page obtains the data carried in the calling request through the interface, and thus the data transmission from the native control to an H5 page is realized, namely the H5 page and the native control are in accordance with the native control definition through the preset method, the data communication without platform distinguishing is realized, the development efficiency of the application program is improved, and simultaneously, in the interaction process, the native control transmits data according to the H5 page, the interactive control is dynamically generated, so that the interactive control is dynamically generated according to the user requirements, version sending updating of the application program is not depended on, and the version sending efficiency of the application program is improved.
In order to implement the above embodiments, the embodiment of the present invention further provides an application program execution apparatus, which is applied to an H5 editor.
Fig. 6 is a schematic structural diagram of an apparatus for executing an application according to an embodiment of the present invention, as shown in fig. 6, the apparatus includes: a sending module 61, an obtaining module 62 and a processing module 63.
The sending module 61 is configured to send first data information to a native control of an application through a preset data interaction interface, where the first data information is used to indicate that the native control inserts a first interaction control in an H5 page of the application.
The obtaining module 62 is configured to receive a call request for calling the data interaction interface by the native control; acquiring the second data information carried by the calling request; and the second data information is generated after the first interaction control detects the first user operation.
And the processing module 63 is configured to update the H5 page according to the second data information.
Further, in a possible implementation manner of the embodiment of the present invention, the apparatus further includes: the device comprises a first generation module and a second generation module.
The first generation module is used for detecting a preset second user operation through a second interaction control in the H5 page; and responding to the second user operation, and generating the first data information.
The second generation module is used for acquiring interface information sent when the browser kernel of the application program loads the H5 page; and generating the data interaction interface according to the interface information.
As a possible implementation manner, the sending module 61 is specifically configured to
Performing data format processing on the first data information according to a data format defined by the data interaction interface; the first data information after the data format processing is matched with the data format defined by the native control;
and writing the first data information into a receiving class preset in the native control.
As a possible implementation manner, the obtaining module 62 is specifically configured to:
and receiving a calling request for calling the data interaction interface by the native control through a browser kernel for loading the H5 page.
It should be noted that the foregoing explanation of the embodiment of the method executed by the H5 editor also applies to the apparatus of this embodiment, and details are not repeated here.
In the execution device of the application program, the first data information is sent to the native control of the application program through the preset data interaction interface, wherein the first data information is used for indicating that the native control inserts the first interaction control into the H5 page, receiving a calling request for calling the data interaction interface by the native control, and acquiring the second data information carried by the calling request, wherein the second data information is generated after the first interaction control detects the first user operation, and the H5 page is updated according to the second data information, so that platform-independent direct interaction between the H5 page and the native control can be realized, the application development efficiency is improved, meanwhile, the interaction control is dynamically generated through the native control end in the interaction process, the application performance is improved, and the version sending efficiency is also improved.
Based on the foregoing embodiment, an embodiment of the present invention further provides a possible implementation manner of an execution apparatus for an application, where the apparatus is applied to a native control, and fig. 7 is a schematic structural diagram of an execution apparatus for another application provided in an embodiment of the present invention, where the apparatus includes: a receiving module 71, a processing module 72 and a transmitting module 73.
The receiving module 71 is configured to obtain first data information sent by an H5 editor through a preset data interaction interface, and the H5 editor is configured to perform editing processing on an H5 page of an application program.
The processing module 72 is configured to insert a first interaction control in the H5 page according to the first data information; when the first interactive control detects a preset first user operation, generating corresponding second data information; second data information for instructing the H5 editor to update the H5 page.
And the sending module 73 is configured to send a call request for calling the data interaction interface to the H5 editor, where the call request carries the second data information.
As a possible implementation manner of the embodiment of the present invention, the receiving module 71 is specifically configured to:
and reading a preset receiving class to obtain the first data information.
As a possible implementation manner, the processing module 72 is specifically configured to:
generating a first interactive control for calling the method according to the method indicated by the first data information;
and inserting the first interaction control at the corresponding position in the H5 page according to the position indicated by the first data information.
It should be noted that the foregoing explanation of the method embodiment executed by the native control is also applicable to the apparatus of this embodiment, and is not repeated herein.
In the application program execution device of the embodiment of the invention, first data information sent by an H5 editor through a preset data interaction interface is obtained, and a first interaction control is inserted into an H5 page according to the first data information, wherein the interaction control is dynamically generated according to a method indicated by user operation in an H5 page, so that the user requirements are better met, and version updating along with the application program is not required. When the first interactive control detects the preset first user operation, the native control generates corresponding second data information and sends a calling request for calling the data interactive interface to the H5 editor, so that after the H5 page obtains the second data information carried by the calling request through the data interactive interface, the first user operation is responded, the H5 page is updated, when the communication between the H5 page and the native control is realized, a platform does not need to be distinguished, the application development efficiency is improved, and the code maintenance cost is low.
In order to implement the foregoing embodiments, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and an application program stored in the memory and executable on the processor, and when the processor executes the application program, the computer device implements the execution method of the application program described in the foregoing method embodiments.
In order to implement the foregoing embodiments, the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements an execution method of an application program that implements the foregoing method embodiments.
In order to implement the foregoing embodiments, the present invention further provides a computer program product, where instructions in the computer program product, when executed by a processor, implement the execution method of the application program described in the foregoing method embodiments.
FIG. 8 illustrates a block diagram of an exemplary computer device suitable for use in implementing embodiments of the present application. The computer device 12 shown in fig. 8 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present application.
As shown in FIG. 8, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. These architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus, to name a few.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 30 and/or cache Memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 8, and commonly referred to as a "hard drive"). Although not shown in FIG. 8, a disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read Only Memory (CD-ROM), a Digital versatile disk Read Only Memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the application.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described herein.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Moreover, computer device 12 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network such as the Internet) via Network adapter 20. As shown, network adapter 20 communicates with the other modules of computer device 12 via bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing, for example, implementing the methods mentioned in the foregoing embodiments, by executing programs stored in the system memory 28.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (12)

1. A method for executing an application program, the method comprising the steps of:
sending first data information to a native control of an application program through a preset data interaction interface; wherein the first data information is used for indicating that the native control inserts a first interaction control in the H5 page;
receiving a calling request for calling the data interaction interface by the native control;
acquiring second data information carried by the calling request; the second data information is generated after the first interaction control detects the first user operation;
and updating the H5 page according to the second data information.
2. The execution method according to claim 1, before sending the first data information to the native control of the application program through the preset data interaction interface, further comprising:
detecting a preset second user operation through a second interaction control in the H5 page;
and responding to the second user operation, and generating the first data information.
3. The execution method of claim 1, wherein the sending the first data information to the native control of the application program through the preset data interaction interface comprises:
performing data format processing on the first data information according to a data format defined by the data interaction interface; the first data information after the data format processing is matched with the data format defined by the native control;
and writing the first data information into a receiving class preset in the native control.
4. The execution method of claim 1, wherein before sending the first data information to the native control of the application program through the data interaction interface, the execution method further comprises:
acquiring interface information sent when a browser kernel of an application program loads the H5 page;
and generating the data interaction interface according to the interface information.
5. The execution method of any one of claims 1-4, wherein the receiving a call request for the native control to call the data interaction interface comprises:
and receiving a calling request for calling the data interaction interface by the native control through a browser kernel for loading the H5 page.
6. A method for executing an application program, the method comprising the steps of:
acquiring first data information sent by an H5 editor through a preset data interaction interface; the H5 editor is used for editing and processing an H5 page of an application program;
inserting a first interaction control in the H5 page according to the first data information;
when the first interactive control detects a preset first user operation, generating corresponding second data information; the second data information for instructing the H5 editor to update the H5 page;
and sending a call request for calling the data interaction interface to the H5 editor, wherein the call request carries the second data information.
7. The execution method of claim 6, wherein the acquiring H5 first data information sent by the editor through the preset data interaction interface comprises:
and reading a preset receiving class to obtain the first data information.
8. The execution method of claim 6 or 7, wherein the inserting a first interaction control in the H5 page according to the first data information comprises:
generating a first interactive control for calling the method according to the method indicated by the first data information;
and inserting the first interaction control at the corresponding position in the H5 page according to the position indicated by the first data information.
9. An apparatus for executing an application program, the apparatus comprising:
the sending module is used for sending first data information to the native control of the application program through a preset data interaction interface; wherein the first data information is used for indicating that the native control inserts a first interaction control in an H5 page of the application program;
the acquisition module is used for receiving a calling request for calling the data interaction interface by the native control; acquiring second data information carried by the calling request; the second data information is generated after the first interaction control detects the first user operation;
and the processing module is used for updating the H5 page according to the second data information.
10. An apparatus for executing an application program, the apparatus comprising:
the receiving module is used for acquiring first data information sent by the H5 editor through a preset data interaction interface; the H5 editor is used for editing and processing an H5 page of an application program;
the processing module is used for inserting a first interaction control into the H5 page according to the first data information; when the first interactive control detects a preset first user operation, generating corresponding second data information; the second data information for instructing the H5 editor to update the H5 page;
and the sending module is used for sending a calling request for calling the data interaction interface to the H5 editor, wherein the calling request carries the second data information.
11. A computer device comprising a memory, a processor and an application program stored on the memory and executable on the processor, wherein the processor implements the method of executing the application program according to any one of claims 1 to 5 or the method of executing the application program according to any one of claims 6 to 8 when the processor executes the application program.
12. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements a method of executing an application program according to any one of claims 1 to 5, or a method of executing an application program according to any one of claims 6 to 8.
CN201810910837.8A 2018-08-10 2018-08-10 Application program execution method and device Active CN109101228B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810910837.8A CN109101228B (en) 2018-08-10 2018-08-10 Application program execution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810910837.8A CN109101228B (en) 2018-08-10 2018-08-10 Application program execution method and device

Publications (2)

Publication Number Publication Date
CN109101228A CN109101228A (en) 2018-12-28
CN109101228B true CN109101228B (en) 2022-01-28

Family

ID=64849366

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810910837.8A Active CN109101228B (en) 2018-08-10 2018-08-10 Application program execution method and device

Country Status (1)

Country Link
CN (1) CN109101228B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871198B (en) * 2019-01-31 2022-10-25 上海智臻智能网络科技股份有限公司 Application interaction demand adaptation method and device
CN109885787B (en) * 2019-02-21 2021-06-22 百度在线网络技术(北京)有限公司 APP page display method and system, mobile terminal and computer readable medium
CN111722935A (en) * 2019-03-20 2020-09-29 阿里巴巴集团控股有限公司 Communication method and device of page end and native end, electronic equipment and readable medium
CN111722936A (en) * 2019-03-20 2020-09-29 阿里巴巴集团控股有限公司 Communication method and device of page end and native end, electronic equipment and readable medium
CN110908711A (en) * 2019-11-21 2020-03-24 北京字节跳动网络技术有限公司 Control development method and device of application program and electronic equipment
CN111324378B (en) * 2020-03-18 2023-08-29 浩云科技股份有限公司 Configuration method, device and equipment for video monitoring application software
CN111459475B (en) * 2020-03-30 2023-05-16 北京三快在线科技有限公司 Interface calling method, interface docking configuration method, device, equipment and medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9910833B2 (en) * 2012-11-13 2018-03-06 International Business Machines Corporation Automatically rendering web and/or hybrid applications natively in parallel
US9069375B2 (en) * 2013-04-30 2015-06-30 MobileDataForce, Inc. Method and system for platform-independent application development
CN103902662B (en) * 2014-03-06 2017-10-20 杭州施强网络科技有限公司 A kind of examination question generation method based on browser
CN105760162A (en) * 2016-02-04 2016-07-13 四川长虹电器股份有限公司 Development method for hybrid APP software
CN105786513A (en) * 2016-02-29 2016-07-20 四川长虹电器股份有限公司 Mixed mobile application development method based on Html5
CN107203576B (en) * 2016-03-18 2020-06-05 北京京东尚科信息技术有限公司 Information synchronization method and device
CN105893508B (en) * 2016-03-30 2019-08-30 北京京东尚科信息技术有限公司 Determine the methods, devices and systems of the primary page and H5 page access order
CN107870821B (en) * 2016-09-26 2021-03-16 平安科技(深圳)有限公司 Cross-platform calling method and system for application program
CN107608801B (en) * 2017-09-05 2020-09-29 北京京东尚科信息技术有限公司 Native page and HTML5 page communication method, device, medium and equipment

Also Published As

Publication number Publication date
CN109101228A (en) 2018-12-28

Similar Documents

Publication Publication Date Title
CN109101228B (en) Application program execution method and device
CN109634598B (en) Page display method, device, equipment and storage medium
CN109213611B (en) Cross-process communication method, device, terminal and storage medium
CN110708346B (en) Information processing system and method
CN110209967B (en) Page loading method and device, terminal equipment and computer readable medium
CN109857506B (en) Method and device for realizing guide information, electronic equipment and storage medium
CN107341005B (en) Chart generation method and device
CN109582317B (en) Method and apparatus for debugging hosted applications
CN111740948B (en) Data packet issuing method, dynamic updating method, device, equipment and medium
CN109218393B (en) Push implementation method, device, equipment and computer storage medium
CN112966824A (en) Deployment method and device of inference library and electronic equipment
CN112416775A (en) Software automation testing method and device based on artificial intelligence and electronic equipment
CN110704148B (en) Acquisition method and device of equipment page element, server and storage medium
CN110083467B (en) Method and device for processing applet message and computer storage medium
CN115237713A (en) Application data acquisition method and device, computer equipment and storage medium
CN110795353A (en) Debugging method, device and equipment for fast application and storage medium
CN114168853A (en) Data visualization display method, device, medium and electronic equipment
CN109614592B (en) Text processing method and device, storage medium and electronic equipment
CN111309406A (en) Event processing method and device of application program and electronic equipment
CN111488731A (en) File generation method and device, computer equipment and storage medium
CN103442031A (en) Data updating method and display device
CN110716811A (en) Database calling method and device and computer equipment
CN113656041A (en) Data processing method, device, equipment and storage medium
CN112800373B (en) Webpage resource data generation method and device, computer equipment and storage medium
CN115016968A (en) Exception handling method, device, equipment and 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
GR01 Patent grant
GR01 Patent grant