CN109542543B - Application page processing method and device, storage medium and computer equipment - Google Patents

Application page processing method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN109542543B
CN109542543B CN201710860737.4A CN201710860737A CN109542543B CN 109542543 B CN109542543 B CN 109542543B CN 201710860737 A CN201710860737 A CN 201710860737A CN 109542543 B CN109542543 B CN 109542543B
Authority
CN
China
Prior art keywords
component
thread
data
sub
page
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
CN201710860737.4A
Other languages
Chinese (zh)
Other versions
CN109542543A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710860737.4A priority Critical patent/CN109542543B/en
Publication of CN109542543A publication Critical patent/CN109542543A/en
Application granted granted Critical
Publication of CN109542543B publication Critical patent/CN109542543B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention relates to an application program page processing method, an application program page processing device, a storage medium and computer equipment, wherein the method comprises the following steps: acquiring page configuration information of the sub-application program; extracting component identification and component filling data corresponding to the component identification from the page configuration information of the sub application program through a data thread; passing, by the data thread, the component identification and the component fill data to a view thread; acquiring a component template corresponding to the component identifier through the view thread; and generating a sub-application program page according to the component template and the component filling data through the view thread. The scheme provided by the application improves the use efficiency of the application program.

Description

Application page processing method and device, storage medium and computer equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing an application page, a storage medium, and a computer device.
Background
An application is a coded instruction sequence that can be executed by a terminal having an information processing capability such as a computer in order to obtain a certain result, or a symbolic instruction sequence or symbolic statement sequence that can be automatically converted into a coded instruction sequence. Currently, a user may install various applications on a terminal, such as a photographing application, a social application, or a mail application, so that various functions, such as a photographing function, a social function, or an email management function, may be implemented through the applications installed on the terminal.
At present, an application program generates an application program page after being started, and is switched among different application program pages according to a user instruction, and a new application program page is loaded as required during switching. However, each time a new application page is loaded, it takes a long time, resulting in inefficient use of the application.
Disclosure of Invention
In view of the above, it is necessary to provide an application page processing method, an application page processing apparatus, a storage medium, and a computer device for solving the problem that the use efficiency of currently used applications is relatively low.
An application page processing method, comprising:
acquiring page configuration information of the sub-application program;
extracting component identification and component filling data corresponding to the component identification from the page configuration information of the sub application program through a data thread;
passing, by the data thread, the component identification and the component fill data to a view thread;
acquiring a component template corresponding to the component identifier through the view thread;
and generating a sub-application program page according to the component template and the component filling data through the view thread.
An application page processing apparatus comprising:
the first acquisition module is used for acquiring page configuration information of the sub-application program;
the extraction module is used for extracting the component identification and the component filling data corresponding to the component identification from the page configuration information of the sub-application program through a data thread;
a delivery module for delivering the component identification and the component fill data to a view thread via the data thread;
the second acquisition module is used for acquiring the component template corresponding to the component identifier through the view thread;
and the generating module is used for generating a sub-application program page according to the component template and the component filling data through the view thread.
A computer-readable storage medium having stored thereon a computer program which, when executed by a processor, causes the processor to perform the steps of:
acquiring page configuration information of the sub-application program;
extracting component identification and component filling data corresponding to the component identification from the page configuration information of the sub application program through a data thread;
passing, by the data thread, the component identification and the component fill data to a view thread;
acquiring a component template corresponding to the component identifier through the view thread;
and generating a sub-application program page according to the component template and the component filling data through the view thread.
A computer device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
acquiring page configuration information of the sub-application program;
extracting component identification and component filling data corresponding to the component identification from the page configuration information of the sub application program through a data thread;
passing, by the data thread, the component identification and the component fill data to a view thread;
acquiring a component template corresponding to the component identifier through the view thread;
and generating a sub-application program page according to the component template and the component filling data through the view thread.
According to the application program page processing method, the application program page processing device, the storage medium and the computer equipment, after the sub-application program page configuration information is obtained, the process of generating the sub-application program page is completed through the data thread and the view thread together. The data thread is in charge of data logic, and after the component identification and the component filling data corresponding to the component identification are extracted from the page information of the sub application program, the component identification and the component filling data are transmitted to the view thread. And the view thread is responsible for page view, acquires the component template corresponding to the component identifier, and then generates a sub-application page according to the component template and the component filling data. Therefore, the data thread and the view thread can be used for generating the sub-application program page together, and the application program use efficiency is improved. And the data thread and the view thread separate the view layer and the logic layer of the application program, thereby being more convenient for the realization and maintenance of the sub-application program.
Drawings
FIG. 1 is a diagram of an application environment for a method of processing application pages in one embodiment;
FIG. 2 is a flowchart illustrating a method for processing an application page according to an embodiment;
FIG. 3 is a schematic interface diagram of a sub-application page in one embodiment;
FIG. 4 is a diagram illustrating the relationship between an operating system, parent application, and child applications, in one embodiment;
FIG. 5 is a schematic interface diagram of a sub-application page in another embodiment;
FIG. 6 is a schematic diagram of an interface for updating a sub-application page in one embodiment;
FIG. 7 is a flowchart illustrating a method for processing an application page in accordance with another embodiment;
FIG. 8 is a block diagram showing the structure of an application page processing apparatus according to one embodiment;
FIG. 9 is a block diagram showing a structure of an application page processing apparatus in another embodiment;
FIG. 10 is a block diagram showing a structure of an application page processing apparatus according to another embodiment;
FIG. 11 is a diagram illustrating an internal structure of a computer device in one embodiment.
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 a method for processing application pages in one embodiment. Referring to fig. 1, the application page processing method is applied to an application page processing system. The application page processing system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected through a network. An operating system runs on the terminal 110, a parent application runs on the operating system, and the terminal 110 implements an application page processing method through the parent application, so that child application page generation of a child application is realized through the parent application. Among them, the server 120 includes a server 121 corresponding to a parent application and a server 122 corresponding to a child application. After acquiring the page configuration information of the sub-application through the parent application, the terminal 110 extracts the component identifier and the component filling data corresponding to the component identifier from the page configuration information of the sub-application through the data thread provided by the parent application, and transmits the component identifier and the component filling data to the view thread provided by the parent application. The terminal 110 then obtains the component template corresponding to the component identifier through the view thread provided by the parent application, and the component template and the component filling data can be generated into a child application page.
FIG. 2 is a flowchart illustrating a method for processing an application page according to an embodiment. The embodiment is mainly illustrated by applying the method to the terminal 110 in fig. 1. Referring to fig. 2, the method for processing the application page specifically includes the following steps:
s202, acquiring page configuration information of the sub-application program.
The sub-application page configuration information is data for configuring a page presented by a sub-application. The sub-application page configuration information may be source code or data 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.
Specifically, an operating system is run on the terminal, and a parent application is run on the operating system. 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 operating system such as an iOS (apple mobile terminal operating system) or an Android operating system.
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 mail application, or a gaming application, among others. The Social application program includes an instant messaging application, an SNS (Social Network Service) application, or a live application. The parent application may specifically be a WeChat program. 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. The parent application may specifically be a WeChat (WeChat) and the corresponding child application may be referred to as an applet.
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. The terminal can also receive the sharing message through the parent application program, so as to obtain the sub-application program identifier carried in the sharing message. The sharing message is used for sub-application sharing. The terminal can also browse published contents through the parent application program, so as to obtain the sub-application program identification carried in the published contents.
Further, the terminal can obtain the sub-application page configuration information corresponding to the sub-application identifier from the local or the server through the parent application. Specifically, the terminal may determine a corresponding configuration information storage path locally or by the server according to the sub-application identifier, and further obtain the sub-application page configuration information according to the configuration information storage path. The path may specifically be a server or local path, and may be an absolute or relative path. Or the terminal can acquire the sub-application page configuration information corresponding to the sub-application identifier according to the corresponding relationship between the sub-application identifier and the page identifier. The page identifier is used for uniquely identifying a sub-application page included in a sub-application, and different sub-applications can use the same page identifier.
In one embodiment, when the sub-application includes a sub-application page, and there is only one kind of corresponding sub-application page configuration information, the terminal may directly obtain the sub-application page configuration information uniquely corresponding to the sub-application identifier. When the sub-application includes more than one sub-application page, the terminal may acquire default sub-application page configuration information corresponding to the sub-application identifier, or may acquire sub-application page configuration information corresponding to the sub-application identifier and corresponding to a 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.
S204, extracting the component identification and the component filling data corresponding to the component identification from the page configuration information of the sub-application program through a data thread.
Wherein a data thread is a thread of data processing logic for processing a sub-application and a corresponding sub-application page. The component identification is used to uniquely identify the corresponding component. A component is a constituent unit of a sub-application page. The component has a visual form and can be an icon, a text container, a progress bar, a form component, a navigation component, a media component, a map component, or a canvas component. The form components may include buttons, selection boxes, forms, switches, and the like. Component fill data is data used to fill in a component template. In this embodiment, the component uniquely determined by the component identifier is generated from the component template and the component filling data corresponding to the component identifier. For example, if the component is a radio frame component, the component filling data may specifically be the content of the radio option, and after the content of the radio option is filled into the corresponding position in the radio frame component template, the complete presentable radio frame component may be obtained.
Specifically, after the terminal obtains the page configuration information of the sub-application through the parent application, the parent application may create a data thread or enable the created data thread. And extracting the component identification and the component filling data corresponding to the component identification from the page configuration information of the sub application program through the data thread. Where data threads may correspond one-to-one with sub-applications, then each sub-application may be used to process the data processing logic of the entire sub-application through one data thread. The data thread may be in a one-to-many relationship with the sub-applications, so that the parent application may be used to process the data processing logic of multiple sub-applications through one data thread.
FIG. 3 illustrates an interface diagram of a sub-application page in one embodiment. Referring to fig. 3, the interface includes a component 310. The components 310 include a radio frame component 311 and a button component 312. The plurality of radio frame elements 311 and button elements 312 may constitute a form element 313. Two button assemblies 312 may make up a switch assembly 314.
S206, the component identification and the component filling data are transmitted to the view thread through the data thread.
In particular, the view thread is a thread independent of the data thread for organizing page views of sub-applications and rendering. After the terminal extracts the component identifier and the component filling data corresponding to the component identifier from the page configuration information of the sub-application through the data thread provided by the parent application, the parent application can create the view thread or enable the created view thread. The terminal continues to transmit the component identification and the component filling data to the view thread through the data thread, so that the view thread can execute subsequent operations according to the component identification and the component filling data.
The view threads may correspond to the sub-applications one to one, and thus each sub-application may be used to process view rendering of the entire sub-application through one view thread. The view thread may be in a one-to-many relationship with the sub-applications, so that the parent application may be used to handle view rendering of multiple sub-applications through one view thread.
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 provides an environment for the running of the child application, and creates a data thread and a corresponding view thread for realizing the page rendering of the child application. The view thread is used to process views of the sub-applications. The data thread is used to process the data processing logic of the sub-application.
And S208, acquiring the component template corresponding to the component identification through the view thread.
Wherein the component template is a computer program for describing the basic structure of the corresponding component. Specifically, the terminal may obtain the component template corresponding to the component identifier from the component template library through a view thread provided by the parent application. The component template 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 one embodiment, the component template library may be provided by both the parent application and the child application.
In one embodiment, the component templates are written in a markup language. 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 component templates may employ HTML, XML, or custom markup languages based on XML extensions. For example, when the component template is written in HTML, for example, "< div > < span class ═ checked- { { checked } }" > < span > < slot/> < div > ". In this embodiment, the component template is written in a markup language, so that the component template can be edited visually and conveniently.
S210, generating a sub-application program page according to the component template and the component filling data through the view thread.
Specifically, the terminal can obtain component style data carried by the selected component template, so that the selected component template is organized according to the component style data, corresponding template filling data is filled into the component template and then rendered, and a sub-application program page is formed. The component style data is data describing a presentation form of a corresponding component. The component style data may include attributes such as the position, size, color, font, and font size of the corresponding component 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 component.
In one embodiment, the component templates may be in a one-to-one correspondence relationship with the component style data, and only one type of corresponding component style data is available, so that the terminal may directly obtain the unique component style data of the component templates by using a view thread provided by the parent application, organize the selected component templates according to the component style data, fill the corresponding template filling data into the component templates, and render the component templates to form the child application page.
The component template may be in a one-to-many relationship with the component style data, which may correspond one-to-one with the component fill data. The terminal can determine the component style data according to the component filling data through a view thread provided by the parent application program, so that the selected component template is organized according to the determined component style data, and the corresponding template filling data is filled into the component template and then rendered to form a child application program page. For example, for a radio box component, the component fill data includes a data item "checked" that indicates "checked or not. The view thread selects component style data based on the data item. When the data item representation is selected, the selected identification is included in the component style data, and when the data item representation is not selected, the selected identification is not included in the component style data.
For example, FIG. 5 illustrates an interface diagram of a sub-application page in one embodiment. Referring to FIG. 5, the interface includes radio box component 511 and radio box component 512. The component fill data 521 corresponding to the radio box component 511 is "option content: option 1; whether to select: when checked, the component fill data 522 corresponding to the radio frame component 512 is "option content: option 2; whether to select: check false ", then radio box component 511 displays the selected identification 530 and radio box component 512 does not display the selected identification 530.
In one embodiment, the application page processing method further includes: and transmitting the acquired page style information to the view thread through the page style information acquired from the page configuration information of the sub-application program by the data thread, and generating the sub-application program page according to the page style information and the component filling data according to the view thread.
Specifically, the sub-application page configuration information includes corresponding page style information for configuring a presentation form of the corresponding sub-application page. The terminal can obtain the page style information in the page configuration information of the sub-application program through a data thread provided by the parent application program, obtain the component style data corresponding to the component identifiers one to one, and the component style data and the component templates can correspond to each other through the component identifiers, so that when the sub-application program page is constructed according to the selected component templates, the component style data corresponding to the selected component templates are applied to the selected component templates.
The page style information may include component style data corresponding to the component identifier, and may also include page overall style data of the sub-application page. The component style data may include at least one of the attributes of the position, size, color, font, and font size of the corresponding 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.
In this embodiment, through the page style information in the sub-application page configuration information, a differentiated presentation manner can be implemented for different sub-applications and different sub-application pages, so that the sub-applications can achieve use experience substantially consistent with that of the native application, and are lighter than the native application.
According to the application program page processing method, after the sub-application program page configuration information is obtained, the process of generating the sub-application program page is completed through the data thread and the view thread together. The data thread is in charge of data logic, and after the component identification and the component filling data corresponding to the component identification are extracted from the page information of the sub application program, the component identification and the component filling data are transmitted to the view thread. And the view thread is responsible for page view, acquires the component template corresponding to the component identifier, and then generates a sub-application page according to the component template and the component filling data. Therefore, the data thread and the view thread can be used for generating the sub-application program page together, and the application program use efficiency is improved. And the data thread and the view thread separate the view layer and the logic layer of the application program, thereby being more convenient for the realization and maintenance of the sub-application program.
In one embodiment, S208 includes: determining a component type corresponding to the component identifier; the component type is one of a common component type and a dedicated component type; and selecting a component template corresponding to the component identification from the component template library corresponding to the component type through the view thread.
Wherein the component type is data for distinguishing a source of the component template. The common component template corresponding to the type belonging to the common component is a component template provided by the parent application to be shared by different child applications. The specific component template corresponding to the specific component type is a component template provided by the sub-application for use by the sub-application.
Specifically, the component template library corresponding to the common component type may be a common component template library, which is a set of common component templates provided by the parent application. The common component template library may be the only common component template library. Each common component template in the common component template library has a unique common component identification. The common component template library may be downloaded locally by the parent application at runtime from a server (the server to which the parent application corresponds) or may be decompressed by the parent application when installed from a corresponding application installation package. Different sub-applications share a common component template, and specifically, the same common component template may be invoked at the same time or at different times. In one embodiment, the common component template may also be provided by both the parent application and the child application.
The component template library corresponding to the specific component type may be a specific component template library, which is a set of specific component templates provided by the sub-application. The specific component template library may be the only specific component template library. The specific component templates provided by each sub-application form a unique component template library. The specific component template library may be a plurality of specific component template libraries in one-to-one correspondence with the sub-applications. The specific component templates provided by each sub-application form a separate one component template library. The special component template library can be downloaded locally by the parent application from a server (a server corresponding to the child application) when the child application is run, or can be decompressed by the child application from a corresponding child application code package when the child application is run for the first time.
In one embodiment, selecting, by the view thread, a component template corresponding to the component identification from a library of component templates corresponding to the component type includes: when the component type is the special component type, sending a notification for acquiring a component template library corresponding to the special component type to the data thread through the view thread; initiating a component template library acquisition request to a server through a data thread according to the notification; the server corresponds to the sub-application program to which the sub-application program page configuration information belongs; and after the data thread receives the component template library fed back by the server, selecting a component template corresponding to the component identifier from the component template library fed back by the server through the view thread.
Specifically, after the terminal acquires the component identifier through the view thread provided by the parent application, the component type of the acquired component identifier may be determined according to a mapping relationship between the component identifier and the component type, which is established in advance. And when the terminal determines that the component type corresponding to the component identifier is the common component type through the view thread provided by the parent application program, directly selecting the common component template corresponding to the component identifier from a common component template library provided by the parent application program.
And when the terminal determines that the component type corresponding to the component identification is the special component type through the view thread provided by the parent application program, sending a notification for acquiring the component template library corresponding to the special component type to the data thread. And after receiving the notification, the data thread initiates a component template library acquisition request to the server corresponding to the sub-application to which the sub-application page configuration information belongs, further receives a component template library fed back by the server, and stores the sub-application identifier corresponding to the sub-application page configuration information in the received component template library locally. And the terminal selects the component template corresponding to the component identifier from the component template library fed back by the server through the view thread provided by the parent application program.
In this embodiment, the view layer and the logic layer of the sub-application are separated by the data thread and the view thread, the data thread is used for processing the data processing logic of the sub-application, and the view thread is used for processing the view of the sub-application, so that time consumption caused by a large data amount in a single-thread processing process is avoided, and the page generation efficiency of the application is improved.
In the embodiment, the subsequent application program page generation can be continued by selecting the component template corresponding to the component identifier from the component template library, and when the parent application program runs, the child application program page can be quickly constructed by using the component template library provided by the parent program, so that the installation time of the application program is shortened, and the use efficiency of the application program is improved.
In one embodiment, the application page processing method further includes: detecting a trigger event acting on a sub-application page through a view thread; when the view thread detects a trigger event, triggering a page updating instruction corresponding to the trigger event, and transmitting the page updating instruction to a data thread; acquiring updated component filling data according to the page updating instruction through the data thread, and returning the updated component filling data to the view thread; updating the sub-application page according to the updated component fill data by the view thread.
The view thread is used for detecting a trigger event triggered by interface interaction. The data thread is used for executing the data processing operation specified by the trigger event after the view thread detects the trigger event.
Specifically, the terminal may detect or monitor a trigger event triggered by a component displayed in the sub application page through a view thread provided by the parent application, and trigger a page update instruction corresponding to the trigger event when the trigger event is detected. The trigger event triggered by the component is a trigger event triggered by the operation of the component. The trigger event is used for describing trigger operation occurring in the sub application program page. The trigger event may be classified into a variety of event types, such as a touch event, a form Submit (Submit) event, an input event, or a Scroll (Scroll) event, etc. 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.
Further, the terminal can transmit the generated page updating instruction to the data thread through the view thread provided by the parent application program, and the data thread determines the instruction type according to the page updating instruction, so that updated component filling data is obtained through a way corresponding to the instruction type, and the updated component filling data is returned to the view thread; updating the sub-application page according to the updated component fill data by the view thread.
The instruction type may be a local response type or an interactive response type. When the page update instruction is of the local response type, the data thread may directly obtain the updated component fill data locally. For example, for a selection event of an option in a form, the data thread may directly respond to the page update instruction according to the page logic code in the sub-application page configuration information, to obtain updated component fill data. When the page update instruction is of the interactive response type, the data thread may obtain updated component fill data from the instruction interaction object. For example, for a refresh event of the text container component, the data thread may obtain data that needs to be updated and displayed in the text container component from a server corresponding to the sub-application, so as to obtain updated component filling data.
In one embodiment, the page update instruction may carry a component identifier, and when the page update instruction only points to one component identifier, it indicates that only the component corresponding to the component identifier needs to be updated in the current sub-application page. The terminal can directly transmit the updated component filling data to the view thread after acquiring the updated component filling data through the data thread of the parent application program.
In one embodiment, obtaining, by a data thread, updated component fill data according to a page update instruction, and returning the updated component fill data to a view thread, comprises: when the page updating instruction points to the plurality of component identifiers, after updated component filling data corresponding to the plurality of component identifiers are acquired through the data thread, the acquired component filling data are returned to the view thread in a unified mode.
Specifically, there is a logical association between some of the components exposed in the sub-application page. For a plurality of components with logical association relationship, when the trigger event for one component updates the component, other components are updated correspondingly. For example, multiple radio box components in a radio form component have a mutually exclusive logical association relationship. One and only one of the plurality of radio frame elements may be simultaneously selected, and when one radio frame element is selected, another radio frame element that has been selected may be deselected.
When the terminal judges that the page updating instruction points to the plurality of component identifiers through the data thread provided by the parent application program, the terminal judges that a plurality of components need to be updated at present, and after updated component filling data corresponding to the plurality of component identifiers are acquired through the data thread, the acquired component filling data are uniformly returned to the view thread, so that the view thread can update the components at the same time.
For example, FIG. 6 shows an interface diagram of a sub-application page update in one embodiment. Referring to FIG. 6, the interface includes a radio box component 611 and a radio box component 612. The component fill data 621 corresponding to the radio frame component 611 is "option content: option 1; whether to select: when the radio frame component 612 corresponds to "selected" component padding data 622 is "selected content: option 2; whether to select: check false ", then radio box component 611 displays the selected identification 630 and radio box component 612 does not display the selected identification 630. When a trigger event for the radio box component 612 is detected, at this time, the updated component fill data 621 corresponding to the radio box component 611 is "option content: option 1; whether to select: for "false", the updated component padding data 622 corresponding to the radio box component 612 is "option content: option 2; whether to select: check true ", then radio box component 611 no longer displays the selected identification 630 and radio box component 612 displays the selected identification 630.
In this embodiment, when a plurality of components need to be updated, the data thread transmits the updated component filling data corresponding to each component identifier to the view thread once again after acquiring the data, so that the view thread can update each component simultaneously, and the accuracy of the display content of the sub-application page is ensured.
In the embodiment, the interactive event triggered by the user is detected through the view thread, and then the interactive event is notified to the data thread to perform specific data processing logic, so that the view thread and the data thread work in a cooperative manner and each takes its own role, time consumption caused by large data volume in a single thread processing process is avoided, and the application program page updating efficiency is improved. Moreover, the component filling data is transmitted between the view thread and the data thread instead of the whole page information, so that the data volume of the inter-thread synchronization can be effectively reduced.
In one embodiment, the application page processing method further includes: acquiring a component template corresponding to the component identifier through a data thread; generating a first sub application program page node tree according to the component template and the component filling data; generating, by the view thread, a sub-application page from the component template and the component fill data, comprising: generating a second sub application program page node tree according to the component template and the component filling data through the view thread; and rendering the sub-application page according to the second sub-application page node tree.
The sub-application node tree is a representation form of the page content of the sub-application. The child application node tree includes component templates and component fill data filled in the component templates. A component template and component fill data populated in the component template is a node in the child application node tree. The view thread may render the child application page in the environment provided by the parent application directly from the child application node tree. The first sub-application node tree and the second sub-application node tree are both sub-application node trees, but different sub-application node trees.
In one embodiment, the first sub-application node tree and the second sub-application node tree are identical sub-application node trees. Because the sub-application page is maintained by the view thread and the data thread which are independent of each other, the two threads need to ensure that the information of the components is consistent, and the components can be accurately displayed.
In one embodiment, the first sub-application node tree may be a simplified second sub-application node tree. In particular, a component template may include a static portion and a dynamic portion. The static portion is data that is fixed and invariant in the component template. The dynamic part is the variable data in the component template. Because the static part is fixed and unchangeable, the terminal can only obtain the dynamic part in the component template corresponding to the component identifier through a data thread provided by the parent application program, and generate the first sub-application program page node tree according to the dynamic part of the component template and the component filling data, so that the simplified second sub-application program node tree is obtained.
In the above embodiment, the data thread and the view thread respectively generate the sub-application page node tree according to the component template and the component filling data, so that the accuracy of component information is ensured in the subsequent data processing of the data thread and the page generation of the view thread, and the problem that a component for data processing of the data thread is inconsistent with a component for rendering of the view thread is avoided.
In one embodiment, the application page processing method further includes: acquiring a component change instruction through a data thread; changing the first sub application program page node tree according to the component change instruction through the data thread, and sending a synchronous change notification to the view thread; and changing the second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice.
Wherein the component change instruction is an instruction for updating the component. The component update instruction may be a component update instruction generated according to a trigger event triggered by a user, or a component update instruction caused by an event processing result of the trigger event. Specifically, the terminal can detect a trigger event through a view thread provided by the parent application program, generate a component update instruction according to the trigger event, and transmit the component update instruction to the data thread, so that the data thread acquires the component change instruction. The terminal can also generate a component updating instruction according to the event processing result through a data thread provided by the parent application program, and the data thread obtains the component changing instruction.
The synchronous change notification is a notification that the data thread is used for notifying the view thread to update the sub-application page node tree correspondingly. The data thread informs the view thread of corresponding change of the sub application program page node tree through the synchronous change, and the change of the sub application program page node trees corresponding to the same sub application program page in the two threads is ensured to be consistent. The synchronous change notification may carry a component identifier corresponding to the component to be changed and a change operation to be performed on the component to be changed. The change operation may be a new addition operation, a deletion operation, an update operation, or the like. When the change operation is a non-delete operation, the synchronous change notification may also carry changed component fill data.
For example, a user triggers a selection event in a form component displayed on a sub-application page, a view thread generates a component change instruction after detecting the event and transmits the component change instruction to a data thread, and the data thread changes a first sub-application page node tree according to the component change instruction and then notifies the view thread to correspondingly change a second sub-application page node tree. The user continues to trigger a form submission event at the sub-application program page, the view thread generates a form submission instruction and transmits the form submission instruction to the data thread after detecting the event, the data thread submits the form to a server corresponding to the sub-application program, receives new sub-application program page configuration information returned by the server, generates a component updating instruction according to the new sub-application program page configuration information, changes the first sub-application program page node tree according to the component changing instruction, and informs the view thread to correspondingly change the second sub-application program page node tree.
In one embodiment, altering, by a data thread, a first child application page node tree according to a component change instruction and sending a synchronized change notification to a view thread, comprises: when the component change instruction is a component newly-added instruction, determining a first component template pointed by the component newly-added instruction and corresponding first component filling data through a data thread; and newly adding the first component template and the first component filling data to the first sub-application program page node tree through the data thread, and sending a synchronous newly-added notification to the view thread. Changing a second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice, and the method comprises the following steps: and adding the first component template and the first component filling data to a second sub application program page node tree through the view thread according to the synchronous adding notice.
Specifically, after the terminal obtains the component change instruction through the data thread provided by the parent application, the terminal may determine the instruction type to which the component change instruction belongs. When the component change instruction is a component newly-added instruction, the terminal can determine a first component template and corresponding first component filling data pointed by the component newly-added instruction through a data thread provided by the parent application program, then newly add the first component template and the first component filling data to a first sub-application program page node tree, and then send a synchronous newly-added notification to the view thread. And after the terminal receives the synchronous new notification through the view thread provided by the parent application program, adding the first component template and the first component filling data to the second sub-application program page node tree according to the synchronous new notification, and ensuring that the change of the second sub-application program page node tree in the view thread is consistent with the change of the first sub-application program page node tree in the data thread.
In this embodiment, when a new component is added to the sub-application page, the data thread responds to the data processing logic, a node is added to the sub-application page node tree in the data thread, and a node is added to the sub-application page node tree in the view updating thread correspondingly, so that the consistency of changes of the sub-application page node trees in the two threads is ensured, and the display accuracy of the sub-application page component is ensured.
In one embodiment, altering, by a data thread, a first child application page node tree according to a component change instruction and sending a synchronized change notification to a view thread, comprises: when the component changing instruction is a component deleting instruction, determining a second component template and corresponding second component filling data pointed by the component deleting instruction through a data thread; and deleting the second component template and the second component filling data from the first sub application program page node tree through the data thread, and sending a synchronous deletion notification to the view thread. Changing a second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice, and the method comprises the following steps: and deleting the second component template and the second component filling data from the second sub-application page node tree through the view thread according to the synchronous deletion notification.
Specifically, after the terminal obtains the component change instruction through the data thread provided by the parent application, the terminal may determine the instruction type to which the component change instruction belongs. When the component changing instruction is a component deleting instruction, the terminal can determine a second component template and corresponding second component filling data pointed by the component deleting instruction through a data thread provided by the parent application program, delete the second component template and the second component filling data from the first sub-application program page node tree, and then send a synchronous deleting notification to the view thread. And after the terminal receives the synchronous deletion notification through the view thread provided by the parent application program, deleting the second component template and the second component filling data from the second sub-application program page node tree according to the synchronous deletion notification, so that the change of the second sub-application program page node tree in the view thread is ensured to be consistent with the change of the first sub-application program page node tree in the data thread.
In this embodiment, when a component in a sub-application page is deleted, the data thread responds to the data processing logic, and the corresponding node is deleted in the sub-application page node tree in the data thread and correspondingly deleted in the sub-application page node tree in the more-view thread, so that the consistency of changes of the sub-application page node trees in the two threads is ensured, and the display accuracy of the sub-application page component is ensured.
In one embodiment, when the component change instruction is a component padding data update instruction, the terminal may determine, through the data thread, a third component identifier and corresponding third component padding data to which the component padding data update instruction points; and updating the filling data of the third component to a component template corresponding to the third component identifier in the first sub application program page node tree through the data thread, and sending a synchronous updating notice to the view thread. And updating the filling data of the third component to a component template corresponding to the third component identifier in the page node tree of the second sub-application program through the view thread according to the synchronous updating notice.
In this embodiment, component fill data is passed between the view thread and the data thread, rather than the entire sub-application page node tree, which can effectively reduce the amount of data synchronized between threads.
In the above embodiment, when the component in the sub application page is changed, the data thread responds to the data processing logic, the sub application page node tree in the data thread is changed, and the sub application page node tree in the view thread is correspondingly changed, so that the consistency of the change of the sub application page node trees in the two threads is ensured, and the accuracy of displaying the sub application page component is ensured.
As shown in fig. 7, in a specific embodiment, the method for processing the application page specifically includes the following steps:
s702, acquiring page configuration information of the sub-application program.
S704, extracting the component identification and the component filling data corresponding to the component identification from the page configuration information of the sub-application program through a data thread.
S706, determining the component type corresponding to the component identifier through the data thread, selecting the component template corresponding to the component identifier from the component template library corresponding to the component type, and generating a first sub-application page node tree according to the component template and the component filling data.
S708, the component identification and the component filling data are transmitted to the view thread through the data thread.
S710, judging the component type corresponding to the component identifier through the view thread, and if the component type is the common component type, jumping to the step S712; if the component type is the specific component type, the process goes to step S714.
And S712, selecting the component template corresponding to the component identification from the component template library corresponding to the common component type through the view thread.
S714, sending a notice for acquiring the component template library corresponding to the special component type to the data thread through the view thread; initiating a component template library acquisition request to a server through a data thread according to the notification; the server corresponds to the sub-application program to which the sub-application program page configuration information belongs; and after the data thread receives the component template library fed back by the server, selecting a component template corresponding to the component identifier from the component template library fed back by the server through the view thread.
S716, generating a second sub application program page node tree according to the component template and the component filling data through the view thread, and rendering the sub application program page according to the second sub application program page node tree.
S718, detecting a trigger event acting on the sub application program page through the view thread; if the trigger event is detected, jumping to step S720; if the trigger event is not detected, the detection is continued.
S720, triggering a page updating instruction corresponding to the triggering event, and transmitting the page updating instruction to the data thread.
S722, judging the number of the component identifications pointed by the page updating instruction through the data thread; when the page update instruction points to a component identifier, jumping to step S724; when the page update instruction points to multiple component identifications, it jumps to step S726.
And S724, acquiring updated component filling data according to the page updating instruction through the data thread, and directly returning the updated component filling data to the view thread.
And S726, after updated component filling data corresponding to each of the plurality of component identifications is acquired through the data thread, the acquired component filling data is returned to the view thread in a unified manner.
S728, updating the sub-application page according to the updated component fill data through the view thread.
S730, acquiring a component change instruction through the data thread. When the component change instruction is a component addition instruction, jumping to step S732; when the component change instruction is a component delete instruction, the process jumps to step S734.
S732, determining a first component template pointed by a component newly-added instruction and corresponding first component filling data through a data thread; adding the first component template and the first component filling data to a first sub application program page node tree through a data thread, and sending a synchronous adding notification to a view thread; and adding the first component template and the first component filling data to a second sub application program page node tree through the view thread according to the synchronous adding notice.
S734, determining a second component template pointed by the component deleting instruction and corresponding second component filling data through the data thread; deleting the second component template and the second component filling data from the first sub application program page node tree through the data thread, and sending a synchronous deletion notification to the view thread; and deleting the second component template and the second component filling data from the second sub-application page node tree through the view thread according to the synchronous deletion notification.
In this embodiment, after the sub application page configuration information is acquired, the process of generating the sub application page is completed through the data thread and the view thread. The data thread is in charge of data logic, and after the component identification and the component filling data corresponding to the component identification are extracted from the page information of the sub application program, the component identification and the component filling data are transmitted to the view thread. And the view thread is responsible for page view, acquires the component template corresponding to the component identifier, and then generates a sub-application page according to the component template and the component filling data. Therefore, the data thread and the view thread can be used for generating the sub-application program page together, and the application program use efficiency is improved. And the data thread and the view thread separate the view layer and the logic layer of the application program, thereby being more convenient for the realization and maintenance of the sub-application program.
It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above embodiments may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the sub-steps or the stages of other steps.
As shown in fig. 8, in one embodiment, an application page processing apparatus 800 is provided. Referring to fig. 8, the application page processing apparatus 800 includes: the parent application 810.
The parent application 810 is used for acquiring the page configuration information of the child application; extracting a component identifier and component filling data corresponding to the component identifier from the page configuration information of the sub-application program through a data thread; passing, by the data thread, the component identification and the component fill data to the view thread; acquiring a component template corresponding to the component identifier through a view thread; and generating a sub-application page according to the component template and the component filling data through the view thread.
After acquiring the sub-application page configuration information, the application page processing apparatus 800 completes the process of generating the sub-application page through the data thread and the view thread. The data thread is in charge of data logic, and after the component identification and the component filling data corresponding to the component identification are extracted from the page information of the sub application program, the component identification and the component filling data are transmitted to the view thread. And the view thread is responsible for page view, acquires the component template corresponding to the component identifier, and then generates a sub-application page according to the component template and the component filling data. Therefore, the data thread and the view thread can be used for generating the sub-application program page together, and the application program use efficiency is improved. And the data thread and the view thread separate the view layer and the logic layer of the application program, thereby being more convenient for the realization and maintenance of the sub-application program.
In one embodiment, the parent application 810 is further configured to determine a component type corresponding to the component identification; the component type is one of a common component type and a dedicated component type; and selecting a component template corresponding to the component identification from the component template library corresponding to the component type through the view thread.
In one embodiment, the parent application 810 is further configured to send a notification to the data thread via the view thread to acquire a component template library corresponding to the specific component type when the component type is the specific component type; initiating a component template library acquisition request to a server through a data thread according to the notification; the server corresponds to the sub-application program to which the sub-application program page configuration information belongs; and after the data thread receives the component template library fed back by the server, selecting a component template corresponding to the component identifier from the component template library fed back by the server through the view thread.
In one embodiment, the parent application 810 is also used to detect trigger events acting on child application pages through the view thread; when the view thread detects a trigger event, triggering a page updating instruction corresponding to the trigger event, and transmitting the page updating instruction to a data thread; acquiring updated component filling data according to the page updating instruction through the data thread, and returning the updated component filling data to the view thread; updating the sub-application page according to the updated component fill data by the view thread.
In one embodiment, the parent application 810 is further configured to, when the page update instruction points to the multiple component identifiers, obtain, by the data thread, updated component filling data corresponding to each of the multiple component identifiers, and then return the obtained component filling data to the view thread in a unified manner.
In one embodiment, the parent application 810 is further configured to obtain, via the data thread, a component template corresponding to the component identification; generating a first sub application program page node tree according to the component template and the component filling data; generating a second sub application program page node tree according to the component template and the component filling data through the view thread; and rendering the sub-application page according to the second sub-application page node tree.
In one embodiment, the parent application 810 is also used to obtain component change instructions through a data thread; changing the first sub application program page node tree according to the component change instruction through the data thread, and sending a synchronous change notification to the view thread; and changing the second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice.
In one embodiment, the parent application 810 is further configured to determine, by the data thread, a first component template and corresponding first component filler data pointed to by the component addition instruction when the component change instruction is the component addition instruction; adding the first component template and the first component filling data to a first sub application program page node tree through a data thread, and sending a synchronous adding notification to a view thread; and adding the first component template and the first component filling data to a second sub application program page node tree through the view thread according to the synchronous adding notice.
In one embodiment, the parent application 810 is further configured to determine, by the data thread, a second component template and corresponding second component fill data to which the component delete instruction points when the component change instruction is the component delete instruction; deleting the second component template and the second component filling data from the first sub application program page node tree through the data thread, and sending a synchronous deletion notification to the view thread; and deleting the second component template and the second component filling data from the second sub-application page node tree through the view thread according to the synchronous deletion notification.
In one embodiment, the data thread and the view thread are provided by a parent application that obtains child application page configuration information.
As shown in fig. 9, in one embodiment, an application page processing apparatus 900 is provided. Referring to fig. 9, the application page processing apparatus 900 includes: a first acquisition module 801, an extraction module 802, a transfer module 803, a second acquisition module 804, and a generation module 805.
The first obtaining module 801 is configured to obtain page configuration information of a sub application.
An extracting module 802, configured to extract, through a data thread, a component identifier and component filling data corresponding to the component identifier from the sub-application page configuration information.
A passing module 803, configured to pass the component identification and the component fill data to the view thread through the data thread.
A second obtaining module 804, configured to obtain, through the view thread, the component template corresponding to the component identifier.
The generating module 805 is configured to generate, by the view thread, a sub-application page according to the component template and the component fill data.
After the application page processing apparatus 900 obtains the sub-application page configuration information, the process of generating the sub-application page is completed through the data thread and the view thread. The data thread is in charge of data logic, and after the component identification and the component filling data corresponding to the component identification are extracted from the page information of the sub application program, the component identification and the component filling data are transmitted to the view thread. And the view thread is responsible for page view, acquires the component template corresponding to the component identifier, and then generates a sub-application page according to the component template and the component filling data. Therefore, the data thread and the view thread can be used for generating the sub-application program page together, and the application program use efficiency is improved. And the data thread and the view thread separate the view layer and the logic layer of the application program, thereby being more convenient for the realization and maintenance of the sub-application program.
In one embodiment, the second obtaining module 804 is further configured to determine a component type corresponding to the component identifier; the component type is one of a common component type and a dedicated component type; and selecting a component template corresponding to the component identification from the component template library corresponding to the component type through the view thread.
In one embodiment, the second obtaining module 804 is further configured to send, through the view thread, a notification to obtain a component template library corresponding to the specific component type to the data thread when the component type is the specific component type; initiating a component template library acquisition request to a server through a data thread according to the notification; the server corresponds to the sub-application program to which the sub-application program page configuration information belongs; and after the data thread receives the component template library fed back by the server, selecting a component template corresponding to the component identifier from the component template library fed back by the server through the view thread.
In one embodiment, the application page processing apparatus 910 further includes: a first detection module 806.
A first detecting module 806, configured to detect, by the view thread, a trigger event that acts on the sub application page; when the view thread detects a trigger event, triggering a page updating instruction corresponding to the trigger event, and transmitting the page updating instruction to a data thread; acquiring updated component filling data according to the page updating instruction through the data thread, and returning the updated component filling data to the view thread; updating the sub-application page according to the updated component fill data by the view thread.
In an embodiment, the first detecting module 806 is further configured to, when the page update instruction points to multiple component identifiers, obtain, by the data thread, updated component filling data corresponding to the multiple component identifiers, and return the obtained component filling data to the view thread in a unified manner.
In one embodiment, the extraction module 802 is further configured to obtain, through the data thread, a component template corresponding to the component identifier; and generating a first sub application program page node tree according to the component template and the component filling data. The generating module 805 is further configured to generate, by the view thread, a second sub-application page node tree according to the component template and the component padding data; and rendering the sub-application page according to the second sub-application page node tree.
As shown in fig. 10, in one embodiment, the application page processing apparatus 900 further includes: a first detection module 806 and a second detection module 807.
A second detection module 807 for obtaining component change instructions via data threads; changing the first sub application program page node tree according to the component change instruction through the data thread, and sending a synchronous change notification to the view thread; and changing the second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice.
In one embodiment, the second detection module 807 is further configured to determine, by the data thread, a first component template and corresponding first component padding data pointed to by the component addition instruction when the component change instruction is the component addition instruction; adding the first component template and the first component filling data to a first sub application program page node tree through a data thread, and sending a synchronous adding notification to a view thread; and adding the first component template and the first component filling data to a second sub application program page node tree through the view thread according to the synchronous adding notice.
In one embodiment, the second detection module 807 is further configured to determine, by the data thread, a second component template and corresponding second component padding data pointed to by the component delete instruction when the component change instruction is the component delete instruction; deleting the second component template and the second component filling data from the first sub application program page node tree through the data thread, and sending a synchronous deletion notification to the view thread; and deleting the second component template and the second component filling data from the second sub-application page node tree through the view thread according to the synchronous deletion notification.
In one embodiment, the data thread and the view thread are provided by a parent application that obtains child application page configuration information.
It is understood that the first obtaining module 801, the extracting module 802, the transferring module 803, the second obtaining module 804, the generating module 805, the first detecting module 806 and the second detecting module 807 described above can also be included in the parent application 810.
FIG. 11 is a diagram illustrating an internal structure of a computer device in one embodiment. The computer device may specifically be the terminal 110 in fig. 1. As shown in fig. 11, the computer device includes a processor, a memory, a network interface, an input device, and a display screen connected through a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement the application page processing method. The internal memory may also store a computer program, which when executed by the processor, causes the processor to perform the method for processing application pages. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, or an external keyboard, a touch pad or a mouse, and the like. Those skilled in the art will appreciate that the architecture shown in fig. 11 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the application page processing apparatus provided in the present application may be implemented in a form of a computer program, the computer program may be run on a computer device as shown in fig. 11, and a non-volatile storage medium of the computer device may store various program modules constituting the application page processing apparatus, such as a parent application 810 shown in fig. 8, a first obtaining module 801, an extracting module 802, a transferring module 803, a second obtaining module 804, a generating module 805 and the like shown in fig. 9. The computer program composed of the program modules causes the processor to execute the steps of the application page processing method of the embodiments of the present application described in the present specification.
For example, the computer device shown in fig. 11 can acquire the sub-application page configuration information through the parent application 810 in the application page processing apparatus 800 shown in fig. 8; extracting a component identifier and component filling data corresponding to the component identifier from the page configuration information of the sub-application program through a data thread; passing, by the data thread, the component identification and the component fill data to the view thread; acquiring a component template corresponding to the component identifier through a view thread; and generating a sub-application page according to the component template and the component filling data through the view thread.
For another example, the application page processing apparatus 900 acquires the sub-application page configuration information through the first acquisition module 801. The component identification and the component fill data corresponding to the component identification are extracted from the sub-application page configuration information through the data thread by the extraction module 802. The component identification and component fill data is passed to the view thread through the data thread by the pass module 803. The component template corresponding to the component identifier is obtained through the view thread by the second obtaining module 804. The sub-application page is generated by the generation module 805 from the component template and the component fill data through the view thread.
In one embodiment, a computer readable storage medium is provided, having a computer program stored thereon, which, when executed by a processor, causes the processor to perform the steps of: acquiring page configuration information of the sub-application program; extracting a component identifier and component filling data corresponding to the component identifier from the page configuration information of the sub-application program through a data thread; passing, by the data thread, the component identification and the component fill data to the view thread; acquiring a component template corresponding to the component identifier through a view thread; and generating a sub-application page according to the component template and the component filling data through the view thread.
In one embodiment, obtaining, by the view thread, a component template corresponding to the component identification includes: determining a component type corresponding to the component identifier; the component type is one of a common component type and a dedicated component type; and selecting a component template corresponding to the component identification from the component template library corresponding to the component type through the view thread.
In one embodiment, selecting, by the view thread, a component template corresponding to the component identification from a library of component templates corresponding to the component type includes: when the component type is the special component type, sending a notification for acquiring a component template library corresponding to the special component type to the data thread through the view thread; initiating a component template library acquisition request to a server through a data thread according to the notification; the server corresponds to the sub-application program to which the sub-application program page configuration information belongs; and after the data thread receives the component template library fed back by the server, selecting a component template corresponding to the component identifier from the component template library fed back by the server through the view thread.
In one embodiment, the computer program further causes the processor to perform the steps of: detecting a trigger event acting on a sub-application page through a view thread; when the view thread detects a trigger event, triggering a page updating instruction corresponding to the trigger event, and transmitting the page updating instruction to a data thread; acquiring updated component filling data according to the page updating instruction through the data thread, and returning the updated component filling data to the view thread; updating the sub-application page according to the updated component fill data by the view thread.
In one embodiment, obtaining, by a data thread, updated component fill data according to a page update instruction, and returning the updated component fill data to a view thread, comprises: when the page updating instruction points to the plurality of component identifiers, after updated component filling data corresponding to the plurality of component identifiers are acquired through the data thread, the acquired component filling data are returned to the view thread in a unified mode.
In one embodiment, the computer program further causes the processor to perform the steps of: acquiring a component template corresponding to the component identifier through a data thread; and generating a first sub application program page node tree according to the component template and the component filling data. Generating, by the view thread, a sub-application page from the component template and the component fill data, comprising: generating a second sub application program page node tree according to the component template and the component filling data through the view thread; and rendering the sub-application page according to the second sub-application page node tree.
In one embodiment, the computer program further causes the processor to perform the steps of: acquiring a component change instruction through a data thread; changing the first sub application program page node tree according to the component change instruction through the data thread, and sending a synchronous change notification to the view thread; and changing the second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice.
In one embodiment, altering, by a data thread, a first child application page node tree according to a component change instruction and sending a synchronized change notification to a view thread, comprises: when the component change instruction is a component newly-added instruction, determining a first component template pointed by the component newly-added instruction and corresponding first component filling data through a data thread; and newly adding the first component template and the first component filling data to the first sub-application program page node tree through the data thread, and sending a synchronous newly-added notification to the view thread. Changing a second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice, and the method comprises the following steps: and adding the first component template and the first component filling data to a second sub application program page node tree through the view thread according to the synchronous adding notice.
In one embodiment, altering, by a data thread, a first child application page node tree according to a component change instruction and sending a synchronized change notification to a view thread, comprises: when the component changing instruction is a component deleting instruction, determining a second component template and corresponding second component filling data pointed by the component deleting instruction through a data thread; and deleting the second component template and the second component filling data from the first sub application program page node tree through the data thread, and sending a synchronous deletion notification to the view thread. Changing a second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice, and the method comprises the following steps: and deleting the second component template and the second component filling data from the second sub-application page node tree through the view thread according to the synchronous deletion notification.
In one embodiment, the data thread and the view thread are provided by a parent application that obtains child application page configuration information.
After the storage medium acquires the page configuration information of the sub-application program, the process of generating the page of the sub-application program is completed through the data thread and the view thread. The data thread is in charge of data logic, and after the component identification and the component filling data corresponding to the component identification are extracted from the page information of the sub application program, the component identification and the component filling data are transmitted to the view thread. And the view thread is responsible for page view, acquires the component template corresponding to the component identifier, and then generates a sub-application page according to the component template and the component filling data. Therefore, the data thread and the view thread can be used for generating the sub-application program page together, and the application program use efficiency is improved. And the data thread and the view thread separate the view layer and the logic layer of the application program, thereby being more convenient for the realization and maintenance of the sub-application program.
In one embodiment, there is provided a computer device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of: acquiring page configuration information of the sub-application program; extracting a component identifier and component filling data corresponding to the component identifier from the page configuration information of the sub-application program through a data thread; passing, by the data thread, the component identification and the component fill data to the view thread; acquiring a component template corresponding to the component identifier through a view thread; and generating a sub-application page according to the component template and the component filling data through the view thread.
In one embodiment, obtaining, by the view thread, a component template corresponding to the component identification includes: determining a component type corresponding to the component identifier; the component type is one of a common component type and a dedicated component type; and selecting a component template corresponding to the component identification from the component template library corresponding to the component type through the view thread.
In one embodiment, selecting, by the view thread, a component template corresponding to the component identification from a library of component templates corresponding to the component type includes: when the component type is the special component type, sending a notification for acquiring a component template library corresponding to the special component type to the data thread through the view thread; initiating a component template library acquisition request to a server through a data thread according to the notification; the server corresponds to the sub-application program to which the sub-application program page configuration information belongs; and after the data thread receives the component template library fed back by the server, selecting a component template corresponding to the component identifier from the component template library fed back by the server through the view thread.
In one embodiment, the computer program further causes the processor to perform the steps of: detecting a trigger event acting on a sub-application page through a view thread; when the view thread detects a trigger event, triggering a page updating instruction corresponding to the trigger event, and transmitting the page updating instruction to a data thread; acquiring updated component filling data according to the page updating instruction through the data thread, and returning the updated component filling data to the view thread; updating the sub-application page according to the updated component fill data by the view thread.
In one embodiment, obtaining, by a data thread, updated component fill data according to a page update instruction, and returning the updated component fill data to a view thread, comprises: when the page updating instruction points to the plurality of component identifiers, after updated component filling data corresponding to the plurality of component identifiers are acquired through the data thread, the acquired component filling data are returned to the view thread in a unified mode.
In one embodiment, the computer program further causes the processor to perform the steps of: acquiring a component template corresponding to the component identifier through a data thread; and generating a first sub application program page node tree according to the component template and the component filling data. Generating, by the view thread, a sub-application page from the component template and the component fill data, comprising: generating a second sub application program page node tree according to the component template and the component filling data through the view thread; and rendering the sub-application page according to the second sub-application page node tree.
In one embodiment, the computer program further causes the processor to perform the steps of: acquiring a component change instruction through a data thread; changing the first sub application program page node tree according to the component change instruction through the data thread, and sending a synchronous change notification to the view thread; and changing the second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice.
In one embodiment, altering, by a data thread, a first child application page node tree according to a component change instruction and sending a synchronized change notification to a view thread, comprises: when the component change instruction is a component newly-added instruction, determining a first component template pointed by the component newly-added instruction and corresponding first component filling data through a data thread; and newly adding the first component template and the first component filling data to the first sub-application program page node tree through the data thread, and sending a synchronous newly-added notification to the view thread. Changing a second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice, and the method comprises the following steps: and adding the first component template and the first component filling data to a second sub application program page node tree through the view thread according to the synchronous adding notice.
In one embodiment, altering, by a data thread, a first child application page node tree according to a component change instruction and sending a synchronized change notification to a view thread, comprises: when the component changing instruction is a component deleting instruction, determining a second component template and corresponding second component filling data pointed by the component deleting instruction through a data thread; and deleting the second component template and the second component filling data from the first sub application program page node tree through the data thread, and sending a synchronous deletion notification to the view thread. Changing a second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notice, and the method comprises the following steps: and deleting the second component template and the second component filling data from the second sub-application page node tree through the view thread according to the synchronous deletion notification.
In one embodiment, the data thread and the view thread are provided by a parent application that obtains child application page configuration information.
After the computer equipment acquires the page configuration information of the sub-application program, the process of generating the page of the sub-application program is completed through the data thread and the view thread. The data thread is in charge of data logic, and after the component identification and the component filling data corresponding to the component identification are extracted from the page information of the sub application program, the component identification and the component filling data are transmitted to the view thread. And the view thread is responsible for page view, acquires the component template corresponding to the component identifier, and then generates a sub-application page according to the component template and the component filling data. Therefore, the data thread and the view thread can be used for generating the sub-application program page together, and the application program use efficiency is improved. And the data thread and the view thread separate the view layer and the logic layer of the application program, thereby being more convenient for the realization and maintenance of the sub-application program.
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. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
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 present 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.

Claims (18)

1. An application page processing method, characterized in that the method comprises:
acquiring page configuration information of the sub-application program;
extracting component identification and component filling data corresponding to the component identification from the page configuration information of the sub application program through a data thread;
passing, by the data thread, the component identification and the component fill data to a view thread;
determining the component type of the component identifier through the view thread, and sending a notification for acquiring a component template library corresponding to the special component type to the data thread when the component type is the special component type;
through the data thread, after a component template library acquisition request is initiated to a server corresponding to the sub-application program to which the sub-application program page configuration information belongs according to the notification, a special component template library corresponding to the sub-application program and fed back by the server is received, wherein the special component template library is a component template library which is formed by special component templates provided by the sub-application program and used by the sub-application program;
acquiring a special component template corresponding to the component identifier from the special component template library fed back by the server through the view thread;
determining component style data according to the component filling data through the view thread, organizing the special component template according to the component style data, filling the component filling data into the organized special component template, and then rendering to generate a sub-application program page;
when a page updating instruction corresponding to a trigger event used for the sub-application page points to a plurality of component identifiers, after updated component filling data corresponding to the component identifiers are obtained through the data thread, the obtained updated component filling data are uniformly returned to the view thread, so that the view thread updates components corresponding to the pointed component identifiers at the same time, and an updated sub-application page is obtained.
2. The method of claim 1, further comprising:
and when the component type is a common component type, obtaining a common component template corresponding to the component identifier from a common component template library provided by a parent application program, wherein the common component template library is a set formed by common component templates provided by the parent application program and shared by different child application programs.
3. The method of claim 1, further comprising:
detecting, by the view thread, a trigger event acting on the sub-application page;
when the view thread detects the trigger event, triggering a page updating instruction corresponding to the trigger event, and transmitting the page updating instruction to the data thread;
when the page updating instruction only points to one component identifier, acquiring updated component filling data corresponding to the component identifier through the data thread according to the page updating instruction, and returning the updated component filling data to the view thread;
and updating the component corresponding to the component identifier through the view thread according to the updated component filling data to obtain an updated sub-application page.
4. The method of claim 1, further comprising:
acquiring a component template corresponding to the component identifier through the data thread;
generating a first sub application program page node tree according to the component template and the component filling data;
generating a second sub-application page node tree according to the component template and the component filling data through the view thread;
and rendering the sub application program page according to the second sub application program page node tree.
5. The method of claim 4, further comprising:
acquiring a component change instruction through the data thread;
changing the first sub application program page node tree according to the component change instruction through the data thread, and sending a synchronous change notification to the view thread;
and changing the second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notification.
6. The method of claim 5, wherein said altering, by said data thread, said first child application page node tree according to said component change instruction and sending a synchronized change notification to said view thread, comprises:
when the component change instruction is a component adding instruction, determining a first component template and corresponding first component filling data which are pointed by the component adding instruction through the data thread;
adding the first component template and the first component filling data to the first sub application program page node tree through the data thread, and sending a synchronous adding notification to the view thread;
the changing, by the view thread according to the synchronous change notification, the second sub-application page node tree according to the changed first sub-application page node tree includes:
and newly adding the first component template and the first component filling data to the second sub-application program page node tree through the view thread according to the synchronous newly-added notification.
7. The method of claim 5, wherein said altering, by said data thread, said first child application page node tree according to said component change instruction and sending a synchronized change notification to said view thread, comprises:
when the component changing instruction is a component deleting instruction, determining a second component template and corresponding second component filling data pointed by the component deleting instruction through the data thread;
deleting, by the data thread, the second component template and the second component fill data from the first sub-application page node tree, and sending a synchronous deletion notification to the view thread;
the changing, by the view thread according to the synchronous change notification, the second sub-application page node tree according to the changed first sub-application page node tree includes:
deleting, by the view thread, the second component template and the second component fill data from the second child application page node tree according to the synchronous delete notification.
8. The method of any of claims 1 to 7, wherein the data thread and the view thread are provided by a parent application that obtains child application page configuration information.
9. An apparatus for processing an application page, the apparatus comprising:
the first acquisition module is used for acquiring page configuration information of the sub-application program;
the extraction module is used for extracting the component identification and the component filling data corresponding to the component identification from the page configuration information of the sub-application program through a data thread;
a delivery module for delivering the component identification and the component fill data to a view thread via the data thread;
a second obtaining module, configured to determine, through the view thread, a component type of the component identifier, and send, when the component type is a special component type, a notification for obtaining a component template library corresponding to the special component type to the data thread; through the data thread, after a component template library acquisition request is initiated to a server corresponding to the sub-application program to which the sub-application program page configuration information belongs according to the notification, a special component template library corresponding to the sub-application program and fed back by the server is received, wherein the special component template library is a component template library which is formed by special component templates provided by the sub-application program and used by the sub-application program; acquiring a special component template corresponding to the component identifier from the special component template library fed back by the server through the view thread; the generating module is used for determining component style data according to the component filling data through the view thread, organizing the special component template according to the component style data, filling the component filling data into the organized special component template, and then rendering to generate a sub-application program page;
the first detection module is configured to, when a page update instruction corresponding to a trigger event applied to the sub-application page points to multiple component identifiers, obtain updated component filling data corresponding to the multiple component identifiers through the data thread, and then uniformly return the obtained updated component filling data to the view thread, so that the view thread updates components corresponding to the pointed component identifiers at the same time, thereby obtaining an updated sub-application page.
10. The apparatus of claim 9, wherein the second obtaining module is further configured to, when the component type is a common component type, obtain a common component template corresponding to the component identifier from a common component template library provided by a parent application, where the common component template library is a set of common component templates provided by the parent application and shared by different child applications.
11. The apparatus of claim 9, further comprising:
the first detection module is further configured to detect, by the view thread, a trigger event that acts on the sub application page; when the view thread detects the trigger event, triggering a page updating instruction corresponding to the trigger event, and transmitting the page updating instruction to the data thread; when the page updating instruction only points to one component identifier, acquiring updated component filling data corresponding to the component identifier through the data thread according to the page updating instruction, and returning the updated component filling data to the view thread; and updating the component corresponding to the component identifier through the view thread according to the updated component filling data to obtain an updated sub-application page.
12. The apparatus of claim 9, wherein the extraction module is further configured to obtain, by the data thread, a component template corresponding to the component identifier; generating a first sub application program page node tree according to the component template and the component filling data; generating a second sub-application page node tree according to the component template and the component filling data through the view thread; and rendering the sub application program page according to the second sub application program page node tree.
13. The apparatus of claim 12, further comprising:
the second detection module is used for acquiring a component change instruction through the data thread; changing the first sub application program page node tree according to the component change instruction through the data thread, and sending a synchronous change notification to the view thread; and changing the second sub application program page node tree according to the changed first sub application program page node tree through the view thread according to the synchronous change notification.
14. The apparatus of claim 13, wherein the second detection module is further configured to determine, by the data thread, a first component template and corresponding first component filler data pointed to by the component addition instruction when the component change instruction is the component addition instruction; adding the first component template and the first component filling data to the first sub application program page node tree through the data thread, and sending a synchronous adding notification to the view thread; and newly adding the first component template and the first component filling data to the second sub-application program page node tree through the view thread according to the synchronous newly-added notification.
15. The apparatus according to claim 13, wherein the second detection module is further configured to determine, by the data thread, a second component template and corresponding second component padding data pointed to by the component delete instruction when the component change instruction is the component delete instruction; deleting, by the data thread, the second component template and the second component fill data from the first sub-application page node tree, and sending a synchronous deletion notification to the view thread; deleting, by the view thread, the second component template and the second component fill data from the second child application page node tree according to the synchronous delete notification.
16. The apparatus of any of claims 9 to 15, wherein the data thread and the view thread are provided by a parent application that obtains child application page configuration information.
17. A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, causes the processor to carry out the steps of the method according to any one of claims 1 to 8.
18. A computer device comprising a memory and a processor, the memory having stored thereon a computer program, characterized in that the computer program, when executed by the processor, causes the processor to carry out the steps of the method according to any of claims 1 to 8.
CN201710860737.4A 2017-09-21 2017-09-21 Application page processing method and device, storage medium and computer equipment Active CN109542543B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710860737.4A CN109542543B (en) 2017-09-21 2017-09-21 Application page processing method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710860737.4A CN109542543B (en) 2017-09-21 2017-09-21 Application page processing method and device, storage medium and computer equipment

Publications (2)

Publication Number Publication Date
CN109542543A CN109542543A (en) 2019-03-29
CN109542543B true CN109542543B (en) 2021-12-14

Family

ID=65828297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710860737.4A Active CN109542543B (en) 2017-09-21 2017-09-21 Application page processing method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN109542543B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112230909B (en) * 2019-07-15 2023-05-23 腾讯科技(深圳)有限公司 Method, device, equipment and storage medium for binding data of applet
CN110554885A (en) * 2019-08-29 2019-12-10 五八有限公司 Sub-application generation method and device, electronic equipment and storage medium
CN110598476A (en) * 2019-09-19 2019-12-20 腾讯科技(深圳)有限公司 Block chain-based work evidence storing method and device and computer readable storage medium
CN110837534A (en) * 2019-11-07 2020-02-25 北京字节跳动网络技术有限公司 Data list display method, device, equipment and storage medium
CN110865760A (en) * 2019-11-18 2020-03-06 北京小米移动软件有限公司 Electronic equipment operation method and device, electronic equipment and storage medium
CN110990008B (en) * 2019-11-28 2023-06-30 北京三快在线科技有限公司 Page updating method and device, storage medium and electronic equipment
CN111142863B (en) * 2019-12-19 2023-06-30 深圳市金证科技股份有限公司 Page generation method and device
CN111522552B (en) * 2020-07-06 2020-11-20 腾讯科技(深圳)有限公司 Sub-application generation method and device, computer equipment and storage medium
CN111880889B (en) * 2020-08-11 2023-08-08 成都极米科技股份有限公司 Interface display method and device, electronic equipment and storage medium
CN112114804A (en) * 2020-08-26 2020-12-22 长沙市到家悠享网络科技有限公司 Application program generation method, device and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502736A (en) * 2016-10-18 2017-03-15 腾讯科技(深圳)有限公司 Applied program processing method and device
CN106569900A (en) * 2016-10-28 2017-04-19 腾讯科技(深圳)有限公司 Application processing method and device
CN106598655A (en) * 2016-12-05 2017-04-26 腾讯科技(深圳)有限公司 Application page processing method and apparatus
CN106873991A (en) * 2017-01-20 2017-06-20 腾讯科技(深圳)有限公司 Page generation method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9524150B2 (en) * 2014-12-15 2016-12-20 Kirsten Ingmar Heiss System and method for software development using graphical tree structures
CN106021617B (en) * 2016-07-12 2018-09-28 腾讯科技(深圳)有限公司 The method and apparatus that the page generates
CN106294816B (en) * 2016-08-16 2022-03-25 腾讯科技(深圳)有限公司 Page information processing method and device
CN107179923B (en) * 2017-03-31 2018-12-11 腾讯科技(深圳)有限公司 Applied program processing method, device and computer equipment
CN107102880B (en) * 2017-05-11 2018-11-23 腾讯科技(深圳)有限公司 Message treatment method, device, storage medium and computer equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502736A (en) * 2016-10-18 2017-03-15 腾讯科技(深圳)有限公司 Applied program processing method and device
CN106569900A (en) * 2016-10-28 2017-04-19 腾讯科技(深圳)有限公司 Application processing method and device
CN106598655A (en) * 2016-12-05 2017-04-26 腾讯科技(深圳)有限公司 Application page processing method and apparatus
CN106873991A (en) * 2017-01-20 2017-06-20 腾讯科技(深圳)有限公司 Page generation method and device

Also Published As

Publication number Publication date
CN109542543A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN109542543B (en) Application page processing method and device, storage medium and computer equipment
US11119812B2 (en) Method and device for processing application program page according to a common interface container
CN108196930B (en) Application program processing method and device, storage medium and computer equipment
KR102105261B1 (en) Method and device for displaying interface data
CN110244984B (en) Application processing method, device, storage medium and computer equipment
US20190197068A1 (en) Page rendering method, device, and data storage medium
CN110008455B (en) Table editing method, apparatus, computer device and storage medium
KR101892702B1 (en) Server, apparatus and method for authoring app of supporting multiple platform
CN102043618B (en) Method and device for controlling display style of window object
CN108829485A (en) Update method, device, storage medium and the computer equipment of application interface layout
CN111984902A (en) Visual page configuration method, system, computer equipment and storage medium
CN110765379A (en) Method and device for loading resource file, computer equipment and storage medium
CN113268226A (en) Page data generation method and device, storage medium and equipment
CN112596714A (en) Webpage development method, device, terminal, server and storage medium
CN112631591B (en) Method, apparatus, device and computer readable storage medium for table element linkage
CN112395848A (en) Rich text display method and device, computer equipment and storage medium
CN115309470B (en) Method, device, equipment and storage medium for loading widget
CN112835809A (en) Test data setting method, device, equipment and medium based on browser
KR101892699B1 (en) Apparatus and method for authoring app of providing itergrated development environment
CN109582401B (en) Promotion picture generation method and device, storage medium and computer equipment
CN110780939A (en) Method and device for loading resource file, computer equipment and storage medium
CN112035113A (en) Navigation bar loading method, device, equipment and medium of H5 page
CN110020280A (en) Application page methods of exhibiting, device, storage medium and computer equipment
CN110728736A (en) Picture labeling method and device, computer equipment and storage medium
CN114168875A (en) Page program generation method and device, computer equipment and storage 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