Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
FIG. 1 is a diagram of an application environment for an application processing system in one embodiment. Referring to fig. 1, the application processing system includes a terminal 110 and a server 120. The server 120 stores therein a sub-application global logic file, a sub-application global configuration file, a sub-application page configuration file, and a page style file corresponding to the sub-application identifier. The terminal 110 runs an operating system, the operating system runs a parent application, and the terminal 110 implements an application processing method through the parent application to implement a child application page through the parent application. The terminal 110 may specifically create a sub-application logic layer processing unit and a corresponding sub-application view layer processing unit through a parent application; acquiring a public component provided by a parent application program through a child application program view layer processing unit according to a child application program page configuration file; the method comprises the steps that a sub-application page logic code is operated through a sub-application logic layer processing unit to obtain page data, and the page data are transmitted to a sub-application view layer processing unit; and rendering the sub-application page through the sub-application view layer processing unit according to the page data and the common component.
Fig. 2 is a schematic diagram of an internal structure of the terminal in one embodiment. Referring to fig. 2, the terminal includes a processor, a non-volatile storage medium, an internal memory, a network interface, a display screen, and an input device, which are connected through a system bus. The non-volatile storage medium of the terminal stores an operating system and also stores an application program processing device, and the application program processing device is used for realizing an application program processing method. The processor of the terminal is used to provide computing and control capabilities to support the operation of the entire terminal. The internal memory in the terminal provides an environment for the application processing device in the non-volatile storage medium to run. The internal memory may have computer readable instructions stored therein which, when executed by the processor, may cause the processor to perform an application processing method. And the network interface of the terminal is used for carrying out network communication with the server, such as downloading the sub-application page configuration file corresponding to the sub-application identifier. The display screen of the terminal can be a liquid crystal display screen or an electronic ink display screen, and the input device of the terminal can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the terminal, an external keyboard, a touch pad or a mouse and the like. The terminal may be a personal computer or a mobile terminal, such as a mobile phone, a tablet computer, a personal digital assistant, or a wearable device. Those skilled in the art will appreciate that the configuration shown in fig. 2 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation on the terminal to which the present application is applied, and that a particular terminal may include more or less components than those shown in fig. 2, or may combine certain components, or have a different arrangement of components.
FIG. 3 is a flowchart illustrating a method for processing an application according to one embodiment. The present embodiment is illustrated by applying the method to the terminal 110 in fig. 1. Referring to fig. 3, the method specifically includes the following steps:
s302, acquiring a public component provided by a parent application program through a child application program view layer processing unit according to a child application program page configuration file; the child application view layer processing unit is created by a parent application running on an operating system.
Specifically, the terminal creates a sub-application logical layer processing unit and a corresponding sub-application view layer processing unit through a parent application running on an operating system.
Referring to fig. 4, an operating system is run on the terminal, and a parent application is run on the operating system. The parent application program provides an environment for the running of the child application program, and creates a child application program logic layer processing unit and a corresponding child application program view layer processing unit for realizing the child application program. And the sub-application view layer processing unit is used for the view of the sub-application. And the sub-application logic layer processing unit is used for processing the interaction logic of the sub-application. The processing unit may specifically be a process or a thread, such as a sub-application logic layer thread and a corresponding sub-application view layer thread. The sub-application program logic layer processing unit can run in a virtual machine, and the sub-application program view layer processing unit can be realized through a browser control.
An Operating System (OS) is a computer program for managing and controlling hardware and software resources of a terminal, and is the most basic System software directly running on a bare computer of the terminal, and an application program needs to run under the support of the Operating System. The operating system may be a desktop operating system such as a Windows (Windows) operating system, a Linux operating system, or a Mac OS (apple desktop operating system), or may be a mobile terminal operating system such as an iOS (apple mobile terminal operating system) or an Android (Android) operating system.
The parent application is an application for bearing the child application, and provides an environment for implementing the child application. The parent application is a native application. A native application is an application that can run directly on an operating system. The parent application may be a social application, a dedicated application that specifically supports the child applications, a file management application, a mail application, or a gaming application, among others. The Social application program includes an instant messaging application, an SNS (Social networking service) application, or a live application.
The child application is an application that can be implemented in the environment provided by the parent application. The sub-application may specifically be a social application, a file management application, a mail application, or a game application, etc.
In one embodiment, the terminal can obtain the sub-application identifier through the parent application, and create a sub-application logic layer processing unit and a corresponding sub-application view layer processing unit. Wherein the sub-application identification is used to identify the corresponding sub-application. The sub-application logic layer processing units can be in one-to-one correspondence with the sub-application identifiers; thus, a sub-application may have only one sub-application logic layer processing unit for processing the interaction logic of the entire sub-application. The sub-application program view layer processing unit can be in a many-to-one relationship with the sub-application program identifier, and is in a one-to-one correspondence with the sub-application program page identifier corresponding to the sub-application program identifier; thus, a sub-application may have multiple sub-application view layer processing units, each of which may be used to maintain a sub-application page.
The terminal can acquire the sub-application page configuration file corresponding to the sub-application identifier through the parent application, so that the public component is acquired from the public component library provided by the parent application according to the content configured in the sub-application page configuration file.
Wherein the sub-application page configuration file can be obtained from a local or server. A sub-application page configuration file is a file that configures pages rendered by a sub-application. The sub-application page configuration file can be source code or a file obtained by compiling the source code. The pages presented by the sub-applications are referred to as sub-application pages, and a sub-application may include one or more sub-application pages.
Further, the terminal can determine a corresponding folder locally or on the server according to the sub-application identifier, and further acquire the sub-application page configuration file from the folder. Or the terminal can acquire the sub-application page configuration file corresponding to the sub-application identifier according to the corresponding relation between the sub-application identifier and the sub-application page identifier. The sub-application page identifier is used for uniquely identifying a sub-application page included in a sub-application, and different sub-applications can use the same sub-application page identifier.
In one embodiment, when the sub-application includes one sub-application page, and there is only one corresponding sub-application page configuration file, the terminal may directly obtain one sub-application page configuration file uniquely corresponding to the sub-application identifier.
Further, when the sub-application includes more than one sub-application page, the terminal may acquire a default sub-application page configuration file corresponding to the sub-application identifier, or may acquire a sub-application page configuration file corresponding to the sub-application identifier and corresponding to the designated sub-application page identifier. The designated sub-application page identification can be designated by the server or the terminal according to the user operation.
S304, the sub-application page logic code is operated through the sub-application logic layer processing unit to obtain page data, and the page data is transmitted to the sub-application view layer processing unit; the sub-application logic layer processing unit is created by the parent application.
Specifically, the terminal obtains and runs the sub-application page logic code from the sub-application page logic code file corresponding to the sub-application identifier through the sub-application logic layer processing unit, and generates page data when running the sub-application page logic code, so that the page data is transmitted to the sub-application view layer processing unit. The page data can be directly transmitted to the sub-application program view layer processing unit or transmitted to the sub-application program logic layer processing unit in a transfer mode.
Wherein the page data is data required for rendering the sub-application page. The page data may be page initial data defined in the sub-application page logic code, data pulled from a storage location specified by the sub-application page logic code, or data generated after processing an event transmitted by the sub-application view layer processing unit.
S306, rendering the sub-application page through the sub-application view layer processing unit according to the page data and the common component.
Specifically, the terminal can acquire default component style data carried by the common component, so that the common component is organized according to the default component style data, and the page data is applied to the common component and rendered to form a sub-application page. The default component style data is data describing the presentation form that the corresponding common component defaults to. The default component style data may include attributes such as the location, size, color, font, and font size of the corresponding common component default in the sub-application page. The terminal can specifically construct a sub-application page through a browser control integrated with the parent application and according to the selected common component. The page data can be data to be exposed by the common component, such as list data or button names.
According to the application processing method, a parent application is run on an operating system, the parent application creates a sub-application logical layer processing unit and a corresponding sub-application view layer processing unit, the sub-application logical layer processing unit runs a sub-application page logical code to obtain page data, and the sub-application view layer processing unit can obtain a common component provided by the parent application according to a sub-application page configuration file and render a sub-application page according to the page data and the common component. Therefore, when the parent application program runs, the public component provided by the parent application program and the logic code of the page of the child application program can be used for constructing the page of the child application program, the use efficiency of the application program is improved, and the installation time of the application program is shortened. And the sub-application program logic layer processing unit and the corresponding sub-application program view layer processing unit separate the view layer and the logic layer of the application program, and the sub-application program page configuration file and the sub-application program page logic code can be updated and used respectively, so that the realization and maintenance of the sub-application program are facilitated.
In one embodiment, step S302 specifically includes: analyzing the page configuration file of the sub-application program through the view layer processing unit of the sub-application program to obtain a public component identifier; and acquiring the public component corresponding to the public component identification in a public component library provided by the parent application program.
Wherein the common component identification is used to uniquely identify the corresponding common component. The common component is a component which is provided by the parent application and can be shared by different child applications, has a visual form, and is a constituent unit of a child application page. The common component may also be encapsulated with logic code for handling events triggered for the common component. Different sub-applications share common components, and specifically may invoke the same common components at the same time or at different times. In one embodiment, common components may also be shared by parent and child applications.
The common component library is a collection of common components provided by the parent application. Each common component in the common component library has a unique common component identification. The common component library may be downloaded locally by the parent application from a server at runtime or may be decompressed by the parent application from a corresponding application installation package when installed.
In this embodiment, the parent application provides a common component library, the child application page configuration file is analyzed by the child application view layer processing unit, so that the required common component can be obtained from the common component library, and the application page configuration file itself does not need to include the common component.
FIG. 5 is a flowchart illustrating steps of creating a sub-application logical layer processing unit and a corresponding sub-application view layer processing unit by a parent application running on an operating system according to an embodiment. Referring to fig. 5, creating a sub-application logical layer processing unit and a corresponding sub-application view layer processing unit by a parent application running on an operating system specifically includes the following steps:
and S502, acquiring the identifier of the sub-application program through the parent application program running on the operating system.
Specifically, the terminal can obtain the sub-application identifier through a parent application running on the operating system and according to the use record of the sub-application or the selection operation of the user on the sub-application. Such as obtaining the sub-application identifier corresponding to the sub-application used last time.
In one embodiment, the terminal can display the sub-application list through the parent application, receive a selection instruction for an option in the sub-application list, and determine a selected option in the sub-application list according to the selection instruction, so as to obtain a sub-application identifier corresponding to the selected option.
Further, each option in the sub-application list represents a sub-application, and the options may be in the form of graphics and/or text. The sub application list may be a list composed of all existing sub applications on the server, a list composed of sub applications screened from all existing sub applications on the server according to a specified condition, or a list composed of sub applications downloaded to the local. The sub-application list may include one or more options.
The condition according to which the sub-application is filtered may be a condition set by the server or a condition input by the user. The condition may be a sort condition, a keyword matching query condition, or a pre-sort query condition. The sorting condition is, for example, a condition for sorting by the release time, download amount, name, or the like of the sub-application. The keyword matching query condition is a condition for querying a sub-application that matches the keyword input by the terminal. The pre-classification query condition is a condition for querying the sub-application classified in advance by the server, such as a condition for querying the sub-application of an office class, a game class or a social class.
S504, acquiring the sub-application global logic file corresponding to the sub-application identification.
The sub-application global logic file is a file for configuring the interactive logic of the whole sub-application, and the interactive logic of the whole sub-application is logic for managing each sub-application page of the sub-application, or logic for starting and closing the sub-application, and the like. The sub-application global logic file can be read from the local or downloaded from the server, and the local sub-application global logic file can be downloaded from the server in advance and stored locally.
S506, creating a sub-application logic layer processing unit according to the sub-application global logic file.
Specifically, the terminal can create a corresponding sub-application logic layer processing unit through the parent application according to the sub-application global logic file, and the sub-application logic layer processing unit runs the sub-application global logic codes in the sub-application global logic file. Subsequent sub-application page logic code is also run by the sub-application logic layer processing unit.
S508, acquiring a sub-application global configuration file corresponding to the sub-application identification.
Specifically, the terminal may locally obtain, through the parent application, the sub-application global configuration file corresponding to the sub-application identifier. The terminal can also send the sub-application program identifier to the server through the parent application program, and receive the sub-application program global configuration file corresponding to the sub-application program identifier and fed back by the server. The sub-application global configuration file is a file for configuring the whole corresponding sub-application, and specifically can configure the path of the sub-application page configuration file, the sub-application window expression form, the network timeout threshold value of the sub-application and other sub-application global configuration information.
S510, acquiring the sub-application page configuration file specified by the sub-application global configuration file.
Specifically, the terminal can analyze the sub-application global configuration file through the parent application to obtain sub-application global configuration information from the sub-application global configuration file, wherein the sub-application global configuration information comprises a path of the sub-application page configuration file. The terminal can locate the corresponding sub-application page configuration file according to the acquired path through the parent application and acquire the sub-application page configuration file.
The terminal can apply the obtained sub-application global configuration information. The terminal can specifically acquire a corresponding and default sub-application page configuration file from the sub-application global configuration file, and can also acquire a corresponding and specified sub-application page configuration file according to user operation.
The path may specifically be a server or a local path, and may be an absolute or relative path. The sub-application global configuration information may also include a sub-application window representation and a sub-application network timeout threshold applicable to all sub-application pages included in the corresponding sub-application.
S512, creating a sub-application program view layer processing unit according to the sub-application program page configuration file.
Specifically, the terminal can create the child application view layer processing units corresponding to the child application page configuration files one to one through the parent application. The terminal can subsequently acquire the public component provided by the parent application program through the child application program view layer processing unit according to the child application program page configuration file.
In this embodiment, a corresponding sub-application logical layer processing unit is created according to the sub-application global logical file, and a sub-application view layer processing unit is created according to the sub-application page configuration file specified by the sub-application global configuration file, which is convenient for global management of the whole sub-application and management of each sub-application page.
FIG. 6 is a flowchart illustrating step S306 according to an embodiment. Referring to fig. 6, step S306 specifically includes the following steps:
s602, acquiring the page style file through the sub-application program view layer processing unit.
Specifically, for each sub-application page configuration file, a corresponding page style file exists, which can be obtained from a local or server, and is used for configuring the presentation form of the corresponding sub-application page.
S604, acquiring component style data corresponding to the common component from the page style file.
The page style file may include component style data corresponding to the common component identifier, and may further include page overall style data of the sub-application page. The component style data may include at least one of the attributes of position, size, color, font, and font size of the corresponding common component in the sub-application page to which it belongs. The page overall style data may include at least one of attributes such as a page size and a page background color of the corresponding sub-application page.
S606, rendering the sub-application page according to the page data, the common component and the component style data.
Specifically, the terminal can acquire a page style file corresponding to the sub-application page configuration file through the sub-application view layer processing unit, obtain component style data corresponding to the common component identifiers one to one, and the component style data corresponds to the common component accessible component identifiers, so that when the sub-application page is constructed according to the common components, the component style data corresponding to the common components are applied to the common components. And rendering the public component to which the component style data is applied and corresponding page data by the terminal to obtain a sub-application program page.
In this embodiment, through the page style file corresponding to the sub-application page configuration file, a differentiated presentation manner can be implemented for different sub-applications and different sub-application pages, so that the sub-applications can achieve a use experience substantially consistent with that of the native application, and are lighter than the native application.
In one embodiment, the application processing method further comprises the step of responding to events triggered by common components in the sub-application page. Referring to fig. 7, the step of responding to the event triggered by the common component in the sub application page specifically includes the following steps:
s702, acquiring an event triggered by a common component in a sub application page through the sub application view layer processing unit, and transmitting the event to the sub application logic layer processing unit.
Specifically, the terminal can detect or monitor an event triggered by a common component in the sub-application page through the sub-application view layer processing unit. The event triggered for a common component is an event triggered by the operation of the common component. Wherein the event is used to describe an operation occurring in the sub-application page. Events can be classified into various event types, such as touch events, form submission (Submit) events, input events, or Scroll (Scroll) events, among others. The touch event includes a start touch event, a touch move event, a touch cancel event, a touch end event, an event in which the touch exceeds a preset time period, and the like. The event can be transmitted to the sub-application program logic layer processing unit by the sub-application program view layer processing unit directly or through a transfer mode.
And S704, responding the event through the sub-application program logic layer processing unit according to the sub-application program page logic code, and transmitting corresponding event response data to the sub-application program view layer processing unit.
Specifically, the terminal may determine the event type of the event after receiving the event transmitted by the sub-application view layer processing unit through the sub-application logic layer processing unit, and further process the event by using a logic code matched with the event type in the sub-application page logic code to obtain corresponding event response data. The event can carry a corresponding public component identifier, and the terminal can process the event by adopting a logic code which corresponds to the public component identifier and the event type of the event in the logic code of the sub application program page to obtain corresponding event response data. The event can also carry data, and when the terminal processes the event through the parent application program, the data carried by the event can be transmitted into the page logic code of the sub-application program for processing.
S706, updating the sub-application page through the sub-application view layer processing unit according to the event response data.
Specifically, the terminal can re-render through the sub-application view layer processing unit according to the common component and the event response data in the sub-application page, so as to obtain an updated sub-application page.
In this embodiment, the event in the sub-application page is acquired by the sub-application view layer processing unit, the sub-application logic layer processing unit responds to the event, and re-rendering is performed by the sub-application view layer processing unit to update the sub-application page, and the acquisition of the event and the rendering of the event response data are separated from the event processing logic, so that convenience in implementation and maintenance of the sub-application is further improved.
In one embodiment, step S704 specifically includes: and calling an application programming interface provided by the parent application program through the processing unit of the logic layer of the child application program according to the logic code of the page of the child application program to respond to the event.
In particular, the parent application provides an application programming interface library that includes rich Application Programming Interfaces (APIs). The terminal can select an application programming interface required by the response event from the application programming interface library through the sub-application logic layer processing unit according to the sub-application page logic code, so that the event is processed through the selected application programming interface to obtain event response data. The application programming interface may be used to perform network operations, data processing, media operations, operate terminal hardware, or operate sub-application pages, etc. The corresponding relation between the event type and the application programming interface can be recorded in the sub-application page logic code, or the corresponding relation between the event type, the public component identification and the application programming interface can be recorded in the sub-application page logic code, so that the terminal can select the application programming interface required by processing the event in the application programming interface library through the sub-application logic layer processing unit according to the corresponding relation recorded in the sub-application page logic code.
In this embodiment, the processing of the event triggered in the sub application page is implemented through the application programming interface provided by the parent application, and the sub application page logic code is used to configure the call to the application programming interface provided by the parent application, so that the sub application is implemented more lightweight.
In one embodiment, step S704 specifically includes: and calling an application programming interface response event provided by an operating system through the sub-application logic layer processing unit according to the sub-application page logic code. In this embodiment, the parent application directly calls the application programming interface provided by the operating system to process the event, so that the child application is lighter in weight.
In one embodiment, step S704 specifically includes: calling an application programming interface provided by the parent application through the child application logic layer processing unit according to the child application page logic code, and calling the application programming interface provided by the operating system through the application programming interface provided by the parent application to respond to the event.
In particular, the application programming interface provided by the parent application may be a package of application programming interfaces provided by the operating system, and one application programming interface provided by the parent application may be a package of one or more application programming interfaces provided by the operating system. The terminal calls an application programming interface provided by the parent application program through the sub-application program logic layer processing unit, further calls the application programming interface provided by the operating system, transmits the event to the operating system for processing, and obtains corresponding event response data.
In this embodiment, the parent application processes the event triggered in the child application page through the application programming interface provided by the operating system, which can reduce the burden of the parent application compared with the case where the event is completely processed by the parent application.
In one embodiment, the sub-application page configuration file is written in a markup language; the page logic code of the sub application program is compiled by adopting a script language; and the child application program logic layer processing unit and the child application program view layer processing unit are in transit communication through a native interface provided by the parent application program.
Among other things, Markup Language (Markup Language) is a computer word code that combines text and other information related to the text to reveal details about the structure of a document and the processing of data. The sub-application page configuration file may be in HTML, XML, or a custom markup language based on XML extensions. Scripting languages such as JavaScript or VBScript. The native interface is an interface that is natively supported by the operating system, and may be javascript bridge, for example. In an android operating system, a native interface belongs to a local framework and is written by adopting C language and/or C + + language.
In the embodiment, the page configuration file of the sub-application program is written by adopting a markup language, so that the page configuration file of the sub-application program can be edited visually and conveniently. The page logic code of the sub application program is written by adopting a script language, so that the logic of the sub application program is convenient to realize. And through the native interface provided by the parent application program, the child application program logic layer processing unit and the child application program view layer processing unit which adopt different computer languages can normally communicate with each other.
Fig. 8 is a block diagram of an application processing device 800 in one embodiment. Referring to fig. 8, the application processing apparatus 800 includes: view layer module 802 and logical layer module 803.
The view layer module 802 is configured to obtain, by a view layer processing unit of a sub-application program and according to a sub-application program page configuration file, a common component provided by a parent application program; the child application view layer processing unit is created by a parent application running on an operating system.
The logic layer module 803 is configured to run a sub-application page logic code through the sub-application logic layer processing unit to obtain page data, and transmit the page data to the sub-application view layer processing unit; the sub-application logic layer processing unit is created by the parent application.
The view layer module 802 is also used to render the sub-application pages through the sub-application view layer processing units and according to the page data and common components.
According to the application processing device 800, a parent application runs on an operating system, the parent application creates a child application logical layer processing unit and a corresponding child application view layer processing unit, the child application logical layer processing unit runs a child application page logical code to obtain page data, and the child application view layer processing unit can obtain a common component provided by the parent application according to a child application page configuration file and render a child application page according to the page data and the common component. Therefore, when the parent application program runs, the common component provided by the parent application program and the logic code of the page of the child application program can be used for constructing the page of the child application program, and the use efficiency of the application program is improved. And the sub-application program logic layer processing unit and the corresponding sub-application program view layer processing unit separate the view layer and the logic layer of the application program, and the sub-application program page configuration file and the sub-application program page logic code can be updated and used respectively, so that the realization and maintenance of the sub-application program are facilitated.
As shown in fig. 9, in one embodiment, the application processing apparatus 800 further includes a processing unit management module 801 for creating a sub-application logical layer processing unit and a corresponding sub-application view layer processing unit by a parent application running on an operating system.
In one embodiment, the processing unit management module 801 is further configured to obtain a sub-application identifier from a parent application running on the operating system; acquiring a sub-application global logic file corresponding to the sub-application identifier; creating a sub-application program logic layer processing unit according to the sub-application program global logic file; acquiring a sub-application global configuration file corresponding to the sub-application identifier; acquiring a sub-application page configuration file specified by a sub-application global configuration file; and creating a sub-application program view layer processing unit according to the sub-application program page configuration file.
In this embodiment, a corresponding sub-application logical layer processing unit is created according to the sub-application global logical file, and a sub-application view layer processing unit is created according to the sub-application page configuration file specified by the sub-application global configuration file, which is convenient for global management of the whole sub-application and management of each sub-application page.
In one embodiment, the view layer module 802 is further configured to parse the sub-application page configuration file through the sub-application view layer processing unit to obtain the public component identifier; and acquiring the public component corresponding to the public component identification in a public component library provided by the parent application program.
In this embodiment, the parent application provides a common component library, the child application page configuration file is analyzed by the child application view layer processing unit, so that the required common component can be obtained from the common component library, and the application page configuration file itself does not need to include the common component.
In one embodiment, the view layer module 802 is further configured to obtain a page style file through a sub-application view layer processing unit; acquiring component style data corresponding to the common component from the page style file; the sub-application page is rendered according to the page data, the common component, and the component style data.
In this embodiment, through the page style file corresponding to the sub-application page configuration file, a differentiated presentation manner can be implemented for different sub-applications and different sub-application pages, so that the sub-applications can achieve a use experience substantially consistent with that of the native application, and are lighter than the native application.
In one embodiment, the view layer module 802 is further configured to obtain, by the sub-application view layer processing unit, an event triggered for a common component in the sub-application page, and transmit the event to the sub-application logical layer processing unit; the logic layer module 803 is further configured to respond to the event through the sub-application logic layer processing unit and according to the sub-application page logic code, and transmit corresponding event response data to the sub-application view layer processing unit; the view layer module 802 is further configured to update the sub-application page through the sub-application view layer processing unit according to the event response data.
In this embodiment, the event in the sub-application page is acquired by the sub-application view layer processing unit, the sub-application logic layer processing unit responds to the event, and re-rendering is performed by the sub-application view layer processing unit to update the sub-application page, and the acquisition of the event and the rendering of the event response data are separated from the event processing logic, so that convenience in implementation and maintenance of the sub-application is further improved.
In one embodiment, the logic layer module 803 is further configured to respond to an event through the sub-application logic layer processing unit and according to the sub-application page logic code call, an application programming interface provided by the parent application. In this embodiment, the processing of the event triggered in the sub application page is implemented through the application programming interface provided by the parent application, and the sub application page logic code is used to configure the call to the application programming interface provided by the parent application, so that the sub application is implemented more lightweight.
In one embodiment, the logic layer module 803 is further configured to respond to events by the sub-application logic layer processing unit and according to the sub-application page logic code calls an application programming interface provided by the operating system. In this embodiment, the parent application directly calls the application programming interface provided by the operating system to process the event, so that the child application is lighter in weight.
In one embodiment, the logic layer module 803 is further configured to call, through the sub-application logic layer processing unit and according to the sub-application page logic code, an application programming interface provided by the parent application, and to call, through the application programming interface provided by the parent application, an application programming interface provided by the operating system in response to the event.
In this embodiment, the parent application processes the event triggered in the child application page through the application programming interface provided by the operating system, which can reduce the burden of the parent application compared with the case where the event is completely processed by the parent application.
In one embodiment, the sub-application page configuration file is written in a markup language; the page logic code of the sub application program is compiled by adopting a script language; and the child application program logic layer processing unit and the child application program view layer processing unit are in transit communication through a native interface provided by the parent application program.
In the embodiment, the page configuration file of the sub-application program is written by adopting a markup language, so that the page configuration file of the sub-application program can be edited visually and conveniently. The page logic code of the sub application program is written by adopting a script language, so that the logic of the sub application program is convenient to realize. And through the native interface provided by the parent application program, the child application program logic layer processing unit and the child application program view layer processing unit which adopt different computer languages can normally communicate with each other.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only show some embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.