WO2019100985A1 - 页面处理方法及移动终端 - Google Patents
页面处理方法及移动终端 Download PDFInfo
- Publication number
- WO2019100985A1 WO2019100985A1 PCT/CN2018/115384 CN2018115384W WO2019100985A1 WO 2019100985 A1 WO2019100985 A1 WO 2019100985A1 CN 2018115384 W CN2018115384 W CN 2018115384W WO 2019100985 A1 WO2019100985 A1 WO 2019100985A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- page
- loading
- component
- mobile terminal
- source file
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- the present application relates to the field of terminal technologies, and in particular, to a page processing method and a mobile terminal.
- An application can usually be installed in a mobile terminal, and in order to provide application performance and user experience, the application can be an application based on a mobile cross-platform development framework (such as the WEEX technology framework). Since an application usually displays data related to the application to the user in the form of a page, and there are many data related to the application, for example, a large number of users display the purchased product, etc., therefore, a page processing method is needed.
- a mobile cross-platform development framework such as the WEEX technology framework
- an application based on the mobile cross-platform development framework includes a page, and all contents of the application that need to be displayed are uniformly stored in the page source file of the page.
- the mobile terminal loads the page content in the page according to the page source file, and when it is required to display the new page content on the page, the page content needs to be reloaded in the page according to the page source file.
- the application since the application only includes one page, and all the content that needs to be displayed in the application is stored in the page source file of the page, when the function of the application is complicated or needs to be displayed, the page may be bulky and costly. A large amount of memory, even causing problems such as difficulty in displaying properly, that is, the limitation of displaying the content of the page is large, and it is difficult to adapt to increasingly complex display requirements.
- the present application has been made in order to provide a page processing method and mobile terminal that overcome the above problems or at least partially solve the above problems.
- a page processing method including:
- the loading the second page in the page frame of the first page includes:
- the page source file of the first page is pre-configured with at least one embedded component, and the corresponding display position of the embedded component is disposed on the first page layer of the first page;
- the setting the second page layer on the first page layer of the first page comprises:
- the second page layer is added to the embedded component of the page source file of the first page.
- the loading the second page in the page frame of the first page further includes:
- the loading the second page in the page frame of the first page includes:
- the content of the first page further includes a target component
- the loading the second page in the page frame of the first page includes:
- the target component includes a page navigation component
- the indication of loading the second page includes a page switching indication based on the page navigation component.
- the providing the first page includes:
- the first page includes a page frame
- a page processing method including:
- a page processing apparatus including:
- the first page provides a module for providing the first page
- a second page generating module configured to generate the second page according to an instruction to load the second page
- a second page loading module configured to load the second page in a page frame of the first page.
- the second page loading module includes:
- a second page layer loading submodule configured to generate a second page layer for loading the second page in a page source file of the first page, and set the second page layer to be located on the first page Above the first page layer;
- the first page source file loading submodule is configured to reload the page source file corresponding to the first page.
- the page source file of the first page is pre-configured with at least one embedded component, and the corresponding display position of the embedded component is disposed on the first page layer of the first page;
- the second page layer loading submodule is further configured to:
- the second page layer is added to the embedded component of the page source file of the first page.
- the second page loading module includes:
- the display parameter setting sub-module is configured to set display parameters corresponding to the border of the embedded component, so that the border of the embedded component is not displayed.
- the content of the first page further includes a target component
- the second page loading module includes:
- the second page loading submodule is configured to load the second page in a page area other than the target component in the first page.
- the target component includes a page navigation component
- the indication of loading the second page includes a page switching indication based on the page navigation component.
- a page processing apparatus including:
- main page providing module for providing a main page, wherein the main page includes a sub-page display area
- a first subpage generating module configured to generate a first subpage according to an instruction to load the first subpage
- the first subpage loading module is configured to load the first subpage in the subpage display area.
- a computing device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor executing the computer program as described above Or multiple methods.
- a computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the method of one or more of the foregoing.
- the first page can be provided, and in order to avoid the problem that all the content to be displayed in the single page application is stored in the page source file of the single page, the second page may be generated according to the instruction of the second page.
- the page loads the second page in the page frame of the first page, thereby reducing the page size and memory overhead, and also reduces the flicker phenomenon that may be caused by completely replacing the first page with the second page, thereby improving the display effect.
- FIG. 1 is a flowchart of a page processing method according to a first embodiment of the present application
- FIG. 2 is a flowchart of a page processing method according to a second embodiment of the present application.
- FIG. 3 is a flowchart of a page processing method according to a third embodiment of the present application.
- FIG. 4 shows a schematic diagram of a page according to an embodiment of the present application
- FIG. 5 shows another schematic diagram of a page according to an embodiment of the present application
- FIG. 6 shows another schematic diagram of a page according to an embodiment of the present application.
- FIG. 7 is a structural block diagram of a page processing apparatus according to a sixth embodiment of the present application.
- FIG. 8 is a structural block diagram of a page processing apparatus according to a seventh embodiment of the present application.
- FIG. 9 shows a block diagram of an exemplary system in accordance with one embodiment of the present application.
- the page can correspond to a page instance.
- the page is composed of the page content and the page frame.
- the page content is the part of the page displayed by the main body, and can include content components such as text, picture or video, and can also include access control, input box, scroll bar, etc. Functional components.
- Each page component is arranged according to the arrangement of the pages.
- the navigation component is a kind of access control for jumping from the current page to another page.
- the page frame includes the rest of the page content of the page except the body display, including the page border, the menu bar at the top of the page, the scroll bar on the side of the page, the function bar at the bottom of the page, etc., in multiple pages of the same software, usually Apply the same page border.
- the mobile terminal may include a mobile phone, a smart watch, a VR (Virtual Reality) device, a tablet computer, an e-book reader, and a MP3 (Moving Picture Experts Group Audio Layer III) player.
- MP4 Motion Picture Experts Group Audio Layer IV
- the mobile terminal can be installed with an operating system, including an IOS (Apple operating system), an Android operating system, or a YunOS (Ali operating system).
- the mobile terminal is capable of interacting with a remote server, acquiring a client, a plug-in, and a page processing service, and includes the apparatus of FIG. 7-9 below, and implementing the manner of 1-3 to process the page.
- the client can include at least one application application based on a mobile cross-platform development framework.
- the client can be run in the mobile terminal to implement the page processing method provided by the embodiment of the present application.
- the plug-in may be included in an application running in the mobile terminal, thereby implementing the page processing method provided by the embodiment of the present application.
- the applications running in the mobile terminal are required to have corresponding characteristics, for example, the mobile terminal based on the above different operating systems may require the installed Applications are written in a specific programming language or have a special file format. Therefore, in order to make the application have good compatibility, the application can be developed through the mobile cross-platform development framework, and the obtained application is an application based on the mobile cross-platform development framework, and the application can usually be Running in different mobile terminals.
- a developer can write a generated page source file, and deploy the source file of the page to a remote server, and then deliver the page source file to the mobile terminal through a network request or a pre-delivery method.
- the mobile terminal can load a page in an application or a webpage based on the page source file to display the page content to the user.
- the embodiment of the present application can be applied to a scenario in which a mobile terminal displays a page in an application based on a WEEX technology framework.
- a mobile terminal displays a page in an application based on a WEEX technology framework.
- only one page is included in the application, and all the content that needs to be displayed in the application is stored in the page source file of the page, which causes the page to occupy a large memory, and it is difficult to meet an increasingly complex application display page.
- the content needs are more limited.
- the first page may be provided, and the second page may be generated according to the instruction to load the second page, and the second page is loaded in the page frame of the first page, that is, the page that can be in one page Loading another page in the framework to display the page content through multiple pages, taking full advantage of the flexibility of the multi-page sample architecture in the WEEX technology framework, avoiding the need to store all the content that needs to be displayed in one page of the page source file.
- the problem is that the page size and the memory overhead are reduced, so that it is possible to adapt to the needs of the application that needs to display more content or more complex functions for page processing, so that the pages of large applications are connected in a more real-time and smooth, and it is also convenient to control each page.
- the embodiment of the present application can be implemented as a client or a plug-in, and the mobile terminal can obtain and install the client or the plug-in from the remote server, so that the page processing method provided by the embodiment of the present application is implemented by the client or the plug-in.
- the embodiment of the present application may also be deployed on the remote server in the form of page processing software, and the mobile terminal may obtain the page processing service by accessing the remote server.
- FIG. 1 a flowchart of a page processing method according to an embodiment of the present application is shown. The specific steps include:
- step 101 a first page is provided.
- a shopping application displays information such as purchased products to the user
- the mobile terminal can provide the first web page.
- the mobile terminal may obtain the page source file of the first page from the local or the remote server in the foregoing, and perform page loading or rendering according to the page source file, including constructing the page frame, and displaying the corresponding page content in the page frame.
- the page source file includes data required to load the page, and is used to describe the components included in the page, the arrangement of each component, and the content of each component.
- Step 102 Generate the second page according to an instruction to load a second page.
- the mobile terminal can generate the second page.
- the instruction to load the second page may be triggered by the user by performing a preset operation such as a click operation, a slide operation, or a key operation, thereby instructing the mobile terminal to generate the second page on the basis that the first page currently exists.
- a preset operation such as a click operation, a slide operation, or a key operation
- the mobile terminal may acquire the page source file of the second page in the same manner as the page source file of the first page obtained in the foregoing, and generate a second page according to the page source file.
- Step 103 Load the second page in a page frame of the first page.
- the mobile terminal may load the second page in the page frame of the first page, that is, equivalent to using the second page as The subpage of the first page is displayed in the form of a subpage.
- the mobile terminal may add a container type component or other special components in the page source file of the first page in advance, thereby adding an area required for loading the second page in the page frame of the first page, and loading the second area in the area. page.
- the first page can be provided, and in order to avoid the problem that all the content to be displayed in the single page application is stored in the page source file of the single page, the second page may be generated according to the instruction of the second page.
- the page loads the second page in the page frame of the first page, thereby reducing the page size and memory overhead, and also reduces the flicker phenomenon that may be caused by completely replacing the first page with the second page, thereby improving the display effect.
- FIG. 2 a flowchart of a page processing method according to an embodiment of the present application is shown. The specific steps include:
- Step 201 The mobile terminal provides the first page.
- the mobile terminal acquires the application when the application is started.
- the first page includes a page frame, generates a third page, and loads the third page in a page frame of the first page. That is, at least one area for displaying other pages may be included in the first page.
- the manner in which the mobile terminal loads the third page in the page frame of the first page may be the same as the method of loading the second page in the page frame of the first page, and details are not described herein again.
- the mobile terminal may switch the display of the page corresponding to the area in the area, for example, by replacing the displayed third page with the second page by the following steps.
- Step 202 The mobile terminal generates the second page according to an instruction to load a second page.
- the indication for loading the second page includes a page based on the page navigation. Switch instructions.
- page row navigation is used to globally control the application, including switching to a page.
- the page row navigation may include a plurality of switch entries respectively for different pages, and the switch entry may include an identifier such as a button or an icon, and corresponds to one page, and when receiving the preset operation of the user in the foregoing based on any of the switch entries, determining Receiving a page switching instruction based on the navigation of the page, thereby switching to a page corresponding to the switching entry.
- Step 203 The mobile terminal loads the second page in a page frame of the first page.
- the mobile terminal may generate the page source file of the first page for generating Loading a second page layer of the second page, and setting the second page layer to be located above the first page layer of the first page, and reloading the page source file corresponding to the first page. That is, the second page is displayed on the upper layer of the page content displayed on the first page, and the page content in the first page below the second page is overwritten by the page content of the second page.
- the page source file of the first page describes the components included in the first page and the arrangement manner of each component. Therefore, the page source file of the first page may be added to display the second page. Component, and set the component above the first page layer to generate a second page layer. Of course, in practical applications, the component may also be set in the page source file of the first page in advance.
- the mobile terminal may associate the page source file of the second page with the component, for example, setting an address of the page source file of the second page in the component, and then, when reloading the source file of the first page, according to the The address associated with the component loads the second page at the second page level.
- the mobile terminal may also add data included in the page source file of the second page to the component, and the mobile terminal may directly load the second page in the second page layer according to the data included in the component.
- the embedded component embed ie, the embed tag
- the embedded component embed can initialize a new page instance on the upper layer of the current page instance on the basis of the current page instance, in order to ensure that the first page can be Displaying the second page on the basis of the second page, improving the reliability of the loaded page, reducing the possibility that the user perceives that the first page and the second page are two pages, that is, improving the integrity of the page, and the page source file of the first page is pre- Having at least one embedding component, the corresponding display position of the embedding component is disposed on the first page layer of the first page, and correspondingly, the mobile terminal may add the second page layer to the first page
- the page source file is embedded in the component.
- the mobile terminal may associate the page source file of the second page with the component by using the related description in the foregoing, thereby adding the second page layer to the embedded component.
- multiple embedded components with the same display parameters may be preset in the page source file, and each embedded component may correspond to one page respectively, so that the multiple embedded components are in the same page area of the first page,
- the multiple pages are switched and displayed, wherein the page corresponding to the uppermost embedded component is the currently displayed page, and the page corresponding to the embedded component below the uppermost layer is the currently hidden page.
- the display parameters of the embedded component are used to control the style in which the embedded component is displayed, including the position of the embedded component in the page, the size of the occupied area, and the border.
- the mobile terminal may Setting display parameters corresponding to the border of the embedded component, so that the border of the embedded component is not displayed.
- the mobile terminal can set the display parameter corresponding to the frame to which the embedded component is located, thereby controlling the border of the embedded component to be in a non-display state.
- the display parameter corresponding to the border of the embedded component may also be set, so that the color of the border of the embedded component is the same as the background color of the first page, thereby ensuring that the user does not perceive the first page and the second page.
- the mobile terminal may replace the first page content of the second page by using the page content of the second page, in order to avoid the problem that the switching may not be smooth when the page is switched, thereby improving the display effect and the user experience.
- the mobile terminal may replace the data in the page source file of the first page with the data in the page source file of the second page.
- the mobile terminal may The data associated with each component included in the first page is replaced with the data associated with the component in the second page, thereby replacing the page content of the first page with the page content of the second page.
- a part of the content in the first page may be displayed, or the first page may include a part of the content
- the content of the first page further includes a target component.
- the mobile terminal may load the second page in a page area other than the target component in the first page.
- the target component may include any component other than the embedded component in the foregoing.
- the mobile terminal can embed the second page in the embedded component to load the second page in an area other than the target component in the first page.
- the first page includes three components, wherein component 1 is a text component, component 2 is a list component, and component 3 is an embedded component. Therefore, if the mobile terminal needs to load the second page in the page frame of the first page, the second page may be loaded in the component 3. After the loading is completed, the first page includes components 1 and 2, and the second page is loaded. Component 3.
- the page may include page navigation, and the page navigation is used to receive a preset operation of the user to determine a page loaded in the first page frame, and therefore, Quickly and accurately control the page loaded in the page frame of the first page, including loading other pages on the first page or switching the loaded page, improving the reliability and display effect of the loaded page, the target component Includes page navigation components.
- the mobile terminal can provide the first page, and in order to avoid the problem that all the content to be displayed is stored in the page source file of the single page in the single-page application, the mobile terminal can The indication of the page generates a second page, and the second page is loaded in the page frame of the first page, thereby reducing the page volume and memory overhead, and also reducing the flicker phenomenon that may be caused by completely replacing the first page with the second page. Improve the display.
- the mobile terminal can initialize the page instance of the information on the upper layer of the first page by embedding the component, so that the second page can be downloaded in the embedded component by adding the second page layer to the embedded component, the second page That is, the upper layer of the first page ensures that the second page can be displayed on the basis of the first page, which improves the reliability of loading the page, and also reduces the user's perception that the first page and the second page are two pages. Possibly, the integrity of the page is improved.
- the mobile terminal may load the second page in a page area other than the target component in the first page, and the target component may include a page navigation component, ensuring that the mobile terminal may receive an indication that the user loads the new page based on the page navigation component. Fast and accurate loading of other pages on the first page or switching of loaded pages improves the reliability and display of the loaded pages.
- FIG. 3 a flowchart of a page processing method according to an embodiment of the present application is shown. The specific steps include:
- Step 301 providing a main page, where the main page includes a sub-page display area.
- the method for providing the main page by the mobile terminal may be the same as the method for providing the first page in the foregoing, and details are not described herein again.
- the sub-page display area is for displaying a sub-page, and the sub-page display area may include an area corresponding to at least one of the foregoing embedded components.
- Step 302 Generate a first subpage according to the instruction to load the first subpage.
- the manner in which the mobile terminal receives the instruction to load the first sub-page and the method of generating the first sub-page may be the same as the manner of receiving the indication to be on the second page and generating the second page, and the details are not described herein. .
- Step 303 Load the first subpage in the subpage display area.
- the mobile terminal may add the page layer of the first subpage to the embedded component corresponding to the subpage display area.
- the mobile terminal can provide the main page, and in order to avoid the problem that all the content to be displayed is stored in the single-page page source file in the single-page application, the mobile terminal can record the first sub-page according to the description. Instructing to generate the first subpage, loading the first subpage in the subpage display area of the main page, thereby reducing the page size and memory overhead, and also reducing the flicker phenomenon that may be caused by completely replacing the main page with another page. Improve the display.
- the mobile terminal can display a page as shown in FIG. 4 , wherein the main page includes a page navigation and a sub-page display area, the sub-page display area can correspond to multiple embedded components, the embedded component is used to load the corresponding sub-page, and the sub-page does not include the page. Navigation, but used to display page content.
- the mobile terminal can receive the preset operation of the user through the page navigation, thereby obtaining an indication of loading the sub-page, and displaying the corresponding sub-page in the sub-page display area, so as to achieve the purpose of switching only the page content without switching the page navigation. As shown in FIG.
- the button corresponding to the subpage 1 is in the selected state, the subpage display area displays the subpage 1, and the subpage further includes the hidden (ie, the page layer in the subpage 1). Bottom) Subpage 2, Subpage 3, and Subpage 4.
- the mobile terminal may display a page as shown in FIG. 6, wherein the main page includes only the sub-page display area, and does not include the page navigation.
- the above embodiment has been described for the mobile terminal to implement multi-page placement in an application based on the WEEX technical framework, and in the process of running the application, between multiple pages of the application (such as the foregoing Data may be required to be synchronized between the first page, the second page, and the third page, or between the main page and the sub-page, between the sub-page and the sub-page, etc., so the application is applied to the other two embodiments.
- a method of synchronizing data between a plurality of pages of a program will be described.
- step S1 the page sharing data is updated according to the content change of the first page, and the page sharing data is stored in a storage space shared by multiple pages.
- the mobile terminal can update the page sharing data according to the content change of the first page, thereby facilitating the subsequent steps according to the updated page. Shared data updates other pages to achieve multi-page data synchronization.
- Page sharing data is shared between multiple pages in the application, that is, as a global variable of multiple pages in the application, to indicate the login status (for example, logged in or not logged in, logged in user name and password, etc.) Statistics or attribute information for an object (such as the number of comments or likes for the same item or the same article), of course, in the actual application, the page sharing data can also include other needs between multiple pages Shared information.
- the page sharing data may include at least one key and a corresponding key value, and the key included in the page sharing data may be determined in advance by the mobile terminal, such as from a profile of the application sharing data with respect to the page.
- the key is the data identifier, which is used to identify the data, and the function or purpose of the data.
- the key value is the specific content of the data. For example, the shared data including the username: asd001 is taken as an example, and the username indicates that the key is the user name. Asd001 means the user name.
- the mobile terminal may interact with the user based on the first page, including receiving a user operation instruction, and if a preset interaction event is detected, determining a content change of the first page, thereby updating the page sharing data.
- the preset interaction event may be determined in advance by the mobile terminal. For example, the developer of the application that belongs to the first page sets a preset interaction event according to the function and the application scenario of the application, and presets the interaction event. It is delivered to the mobile terminal through a remote server.
- the preset interaction event may include a login event, a comment event, a forwarding event, a like event, a scoring event, and the like.
- the login operation instruction of the user it may be determined that the login event is detected; when the user's comment operation instruction is received, it may be determined that the comment event is detected; when the user's forwarding operation instruction is received, it may be determined that the login event is detected.
- the storage space shared by multiple pages can be allocated by the mobile terminal, including local storage (ie, Local Storage) or application cache.
- local storage ie, Local Storage
- application cache ie, Local Storage
- Step S2 Update the page content of the second page according to the updated page sharing data.
- the second page may be shared according to the updated page sharing data.
- the page content is updated.
- the second page may include any page other than the first page in the application that needs to be synchronized with the first page.
- the mobile terminal may obtain the updated page sharing data from the storage space shared by the multiple pages, so as to update the page content of the second page according to the acquired page sharing data.
- the updating, by the mobile terminal, the page content of the second page may include updating an account login status (for example, a logged in or not logged in, a logged-in user name and password, etc.) or statistical data or attribute information of the same object (for example, for the same product or the number of comments or likes of the same article, of course, in practical applications, the mobile terminal can also update other kinds of content that needs to be synchronized between multiple pages.
- an account login status for example, a logged in or not logged in, a logged-in user name and password, etc.
- statistical data or attribute information of the same object For example, for the same product or the number of comments or likes of the same article, of course, in practical applications, the mobile terminal can also update other kinds of content that needs to be synchronized between multiple pages.
- the storage space shared by the multiple pages may store the page sharing data of the application, so that the shared data of the page may be updated according to the content change of the content of the first page, and the data is shared according to the updated page.
- Update the page content of the second page to realize data synchronization between multiple pages, ensuring that the application can reliably display the page content to the user through multiple pages, and fully utilize the multi-page in the cross-platform development framework of the mobile terminal such as WEEX.
- the advantage is to reduce the development cost caused by single-page applications and the high risk of the application, and improve the efficiency of the application.
- step S1 the mobile terminal starts the application and registers the relevant interface.
- the mobile terminal can perform interface registration when launching the application.
- the application is the application to which the first page or the second page belongs.
- the related interface may include at least one interface for the page generation page to share data, update the existing page share data, or obtain updated page share data, or determine whether the page share data has been updated and data synchronization is required.
- the WEEX technology framework provides an interface to JSService (the script service, JS is the abbreviation of scripting language JavaScript), which can run in parallel with the page instance in the application based on the WEEX technology framework in JS Runtime (the JavaScript runtime environment). Therefore, the variables defined by the JSService interface can be accessed by the page instance, that is, multiple pages in the application based on the WEEX technical framework can sense and acquire variables registered by the JSService interface to update the page content.
- the mobile terminal can initialize the WEEX container (that is, the environment in which the page is loaded in the application) when the application is started, and call the WEEX SDK (Software Development Kit) to register the interface.
- the code for registering the interface may be "[WeexSDKEngine registerService:@"SERVICE_NAME"withScript:@"SERVICE_JS_CODE”withOptions:@ ⁇ ];”.
- SERVICE_JS_CODE is the code used to register the relevant interface, so that the page can sense and use the code, that is, expose the relevant interface to the page by registration, so as to facilitate data synchronization between the pages based on the above interface.
- the mobile terminal may register the data writing interface when the application is started.
- the data writing interface is used to add a new page sharing data to the page, update the existing page sharing data, and perform the above adding or updating operation on the page, that is, when the page sharing data changes, the shared data is subscribed to the page.
- the other pages of the change send event notifications so that other pages sense that the current page share data has changed and data synchronization is required.
- the mobile terminal may register a data acquisition interface.
- the data acquisition interface is used for the page to obtain page sharing data.
- the mobile terminal in order to ensure that the pages that need to be synchronized in the data can be synchronized in time when the page sharing data changes, the reliability of data synchronization between the pages is improved, and the application is started.
- the mobile terminal In the program, the mobile terminal can register an update subscription interface.
- the update subscription interface is used for the page subscription page to share data update events. If the page subscribes to the page sharing data update event through the update subscription interface, the other pages change the page sharing data, and feed back the event notification to the page, so that the page determines that the page sharing data update event is triggered, and the service is performed through the callback function. Logical processing for data synchronization.
- the page sharing data update event is used to indicate that the current page sharing data has changed, and data synchronization is required between the pages.
- the event notification of the page sharing data update event is used to notify the page that the current page sharing data has changed, that is, the page sharing data update event occurs, and data synchronization can be performed.
- Step S2 the mobile terminal loads the first page in the application.
- the first page can be the first page loaded after the application is launched.
- the mobile terminal may automatically load the first page after the application is started.
- the first page may be loaded according to the instruction to load the first page.
- the indication to load the first page can be triggered by the user by performing a preset operation such as a click operation, a slide operation, or a key operation.
- the mobile terminal may provide a main page including a page navigation and a sub-page display area, and the page navigation includes a plurality of switch entries respectively for different pages, and the switch entry may include an identifier such as a button or an icon, and corresponds to a sub-page.
- the first page may be one of the sub-pages), when receiving the preset operation of the user in the foregoing based on any of the switching entries, that is, determining that the page loading indication based on the page navigation is received, thereby loading in the sub-page display area Corresponding subpage.
- the main page and each subpage can correspond to a page instance.
- the mobile terminal can obtain the data required to load the first page from the local or remote server, such as the page source file corresponding to the first page, and load the first page according to the acquired data, thereby displaying the page content to the user.
- the data required to load the first page from the local or remote server, such as the page source file corresponding to the first page, and load the first page according to the acquired data, thereby displaying the page content to the user.
- step S3 the mobile terminal initializes page sharing data.
- the page sharing data can be accessed, the reliability of data synchronization between the pages is improved, and the normal operation of the application is ensured, and the mobile terminal can initialize the page sharing data.
- the mobile terminal can obtain the page sharing data from the application cache through the data obtaining interface in the foregoing, so as to determine whether the page sharing data has been initialized according to the obtained result, and if the obtained data is empty, it is determined that the page sharing data is not currently initialized.
- the page shared data included in the current page is stored in the application cache to complete initialization, otherwise it is determined that the page shared data has been initialized.
- the mobile terminal may update the current page, that is, the page content of the first page, according to the acquired page sharing data.
- any page that can be loaded by the application may be the first page loaded after the application is started, for example, the mobile terminal loads the page shared by other users through the application, so The page sharing data may not be initialized. Therefore, in order to further improve the reliability of data synchronization between pages and ensure the normal operation of the application, the mobile terminal can perform the above steps when opening any page through the application. Page sharing data is initialized.
- the step of initializing the page sharing data may not be performed, but in the next step, the page sharing data is directly performed according to the page content change. storage.
- Step S4 The mobile terminal updates the page sharing data according to the content change of the first page, where the page sharing data is stored in an application cache of an application to which the first page belongs.
- the page sharing data may include at least one key and a corresponding key value, and the content change of a certain page may change part or all of the page sharing data, so the mobile terminal may change according to the content of the first page. And updating the key value of at least one key included in the page sharing data.
- an application is a buyer show application that allows users to publicly display items purchased by that user.
- the application includes two pages, wherein the page 1 is used to display concise information of each item, such as a picture of the item, a favorite and a number of users who do not like the item, and the like; the page 2 is used to display detailed information of the item, such as the The functional use of the product, the merchant, etc., and the page 2 also includes a "like" button for each item, the user can mark the item as a favorite through the "like” button, thereby increasing the number of users who like the item; the page sharing data includes For the item number and the number of users who like the item, the page sharing data is ⁇ a:1, b:2 ⁇ as an example, a: 1 indicates that the item number is 1, and b: 2 indicates that the number of users who like the item is 2.
- the mobile terminal can update the number of users who like the item numbered 2 in the page sharing data according to the content change of the page 2, and the updated page
- the shared data can be ⁇ a:1,b:3 ⁇ .
- the problem of inconvenient access and occupying more system resources caused by storing the page shared data to the local storage is avoided, and the efficiency of data synchronization by multiple pages is improved, thereby improving the page.
- the processing efficiency while also saving the system resources of the mobile terminal, improves the performance of the mobile terminal, and the page sharing data is stored in an application cache of the application to which the first page belongs.
- the page shared data when data synchronization between multiple pages is performed by local storage, before the page shared data is stored to the local storage, the page shared data needs to be serialized, and when the locally stored page shared data is updated, Cross-page communication is required to be broadcasted to each page through a broadcast channel interface (ie, BroadcastChannel API), and each page obtains updated page shared data from the storage, including when the stored page shared data is obtained from the local storage, and is acquired. The obtained data is deserialized, and then the page content of the page is updated according to the acquired page sharing data. Because serialization and deserialization are required in the process of sharing data in the access page, the access efficiency is low, and it is difficult to adapt to the frequent synchronization requirements of multiple pages. At the same time, the local storage space is usually limited, and may be limited. The problem that caused data loss.
- BroadcastChannel API BroadcastChannel API
- the mobile terminal may invoke the data writing interface through the first page to update the page sharing data according to the changed page content.
- the data writing interface registered in the foregoing is setStore, and the mobile terminal can update b in the page sharing data ⁇ a:1, b:2 ⁇ through setStore ( ⁇ b:3 ⁇ ), thereby obtaining the updated page.
- the mobile terminal may pass The first page invokes a data write interface to send an event notification to a page that has subscribed to the page share data update time.
- the first page is the first page loaded after the application is started, there may be no other pages currently subscribed to the page shared data update event, so the event notification may not be sent.
- the mobile terminal can invoke the update subscription interface through the first page to subscribe to the page sharing data update event.
- step S5 the mobile terminal loads the second page.
- the manner in which the mobile terminal records the second page may be the same as the manner in which the first page is loaded, and details are not described herein again.
- the mobile terminal may also initialize the page sharing data by the same steps as described above, or update the page sharing data.
- the mobile terminal may pass the second page. Invoke the update subscription interface to subscribe to the page share data update event.
- Step S6 The mobile terminal acquires a page sharing data update event for the second page.
- the mobile terminal may acquire a page sharing data update event for the second page.
- the mobile terminal can obtain the page sharing data update event by using the foregoing second page subscription page to share the data update event.
- the mobile terminal can also obtain the page sharing data event by other means, for example, The mobile terminal may acquire the page sharing data every preset time interval, and compare the presence of the second page and the plurality of keys included in the page sharing data and the corresponding key value with the corresponding key value included in the page sharing data, if If there are keys with different key values, it can be determined that the page sharing data update event for the second page is obtained.
- the preset duration can be determined in advance by the mobile terminal, for example, receiving a numerical value submitted by the user.
- the mobile terminal can call the data acquisition interface through the second page to obtain the page sharing data.
- an event notification is sent to the page subscribed to the page sharing data update event, so
- the page sharing data can be sensed to be updated, so that the page content of the page is updated to synchronize data between the pages, and the mobile terminal can receive the page sent by the data writing interface for the page through the second page.
- Event notifications for shared data update events are sent to the page subscribed to the page sharing data update event.
- Step S7 The mobile terminal updates the page content of the second page according to the updated page sharing data.
- the page sharing data of the application may be stored in the application cache. Therefore, in order to accurately obtain the page sharing data, the reliability of acquiring the page sharing data is improved, and further The reliability of the data synchronization between the multiple pages is improved, and the mobile terminal may obtain the updated page sharing data from the application cache, and update the page content of the second page according to the updated page sharing data. .
- the mobile terminal may detect a key included in the second page and the page sharing data, and replace the key value of the detected key in the second page with the key value of the key in the page sharing data.
- the mobile terminal acquires the page sharing data including ⁇ a:1, b:3, c:4 ⁇ , and the keys included in the second page are a and b, therefore, the mobile terminal updates the key value of a in the second page. Is 1, update the key value of b to 3.
- the mobile terminal in order to accurately obtain the page sharing data, that is, to improve the reliability of acquiring the shared data of the page, thereby improving the reliability of data synchronization between the multiple pages, the mobile terminal may
- the second page invokes a data acquisition interface to obtain the updated page sharing data from the application cache.
- the data acquisition interface registered in the foregoing is getStore, and the mobile terminal can obtain the page shared data as ⁇ a:1, b:3, c:4 ⁇ through getStore().
- the page sharing data of the application may be stored, and the mobile terminal is capable of updating the page sharing data according to the content change of the first page content, and according to the updated page sharing data, the second
- the page content of the page is updated to realize data synchronization between multiple pages, ensuring that the application can reliably display the page content to the user through multiple pages, and fully utilizing the advantages of multiple pages in the cross-platform development framework of the mobile terminal such as WEEX, reducing The development cost and the risk of the application caused by the single-page application increase the efficiency of the application.
- the mobile terminal can register the relevant interface for data synchronization between the pages when starting the application, including the data writing interface, the data obtaining interface and the update subscription interface, ensuring that the mobile terminal can apply to the application from the data writing interface through the page.
- the page sharing data in the cache is updated, the update of the shared data of the page is sensed by the update subscription interface, and the updated page share data is updated from the data acquisition interface to update the page content of the page, thereby improving the application.
- the mobile terminal may initialize the page sharing data, including determining whether the current page sharing data is initialized, and initializing the page sharing data when determining that the page is not initialized, further ensuring that the application cache is available. Page sharing data improves the reliability of data synchronization between pages.
- step S1 the mobile terminal launches the application; in step S2, the mobile terminal initializes the WEEX container; in step S3, the mobile terminal passes native (a computer function for calling the service in the WEEX SDK) Calling JSService; in step S4, interface registration is performed through JSService to expose global variables (ie, page sharing data) and management interface to the application's page, including the data writing interface, data acquisition interface, and update subscription interface in the foregoing.
- native a computer function for calling the service in the WEEX SDK
- JSService Calling JSService
- step S4 interface registration is performed through JSService to expose global variables (ie, page sharing data) and management interface to the application's page, including the data writing interface, data acquisition interface, and update subscription interface in the foregoing.
- step S5 the interface registration is completed, and a setStore (data write interface), a getStore (data acquisition interface), and a subscribe (update subscription interface) are obtained; in step 306, the mobile terminal performs page initialization; in step S7, the interface is registered.
- the page in the application can manage the global variables of the application through the related interface registered above.
- step S1 the mobile terminal launches an application; in step S2, the mobile terminal creates an empty global variable, exposing related interfaces to the pages in the application, including setStore, getStore, and subscribe; in step S3, the mobile The terminal loads the first page in the application; in step S4, the mobile terminal initializes the global variable of the application through the first page, updates the page variable through the setStore, subscribes to the event through the subscribe, and monitors whether the global variable changes;
- step S5 the mobile terminal loads the page A in the application, and then can perform the initialization of the global variables in steps S6 and S7, and of course, directly performs step S8; in step S6, the mobile terminal determines whether the global variable has been Initialization, if otherwise step S7 is performed, if yes, step S8 is performed; in step S7, the mobile terminal initializes the global variable through page A; in step S8, the mobile terminal acquires global variables and listens to global
- the page processing apparatus includes:
- the first page provides a module 701, configured to provide a first page
- the second page generating module 702 is configured to generate the second page according to the instruction to load the second page;
- the second page loading module 703 is configured to load the second page in a page frame of the first page.
- the second page loading module includes:
- a second page layer loading submodule configured to generate a second page layer for loading the second page in a page source file of the first page, and set the second page layer to be located on the first page Above the first page layer;
- the first page source file loading submodule is configured to reload the page source file corresponding to the first page.
- the page source file of the first page is pre-configured with at least one embedded component, and the corresponding display position of the embedded component is disposed on the first page layer of the first page;
- the second page layer loading submodule is further configured to:
- the second page layer is added to the embedded component of the page source file of the first page.
- the second page loading module includes:
- the display parameter setting sub-module is configured to set display parameters corresponding to the border of the embedded component, so that the border of the embedded component is not displayed.
- the second page loading module includes:
- a page content replacement submodule configured to replace page content of the first page in the page source file of the first page by using the page content of the second page;
- the second page source file loading submodule is configured to reload the page source file corresponding to the first page.
- the content of the first page further includes a target component
- the second page loading module includes:
- the second page loading submodule is configured to load the second page in a page area other than the target component in the first page.
- the target component includes a page navigation component
- the indication of loading the second page includes a page switching indication based on the page navigation component.
- the first page providing module includes:
- a first page obtaining submodule configured to acquire the first page when the application is launched, where the first page includes a page frame
- the third page generates a sub-module for generating a third page
- the third page loading submodule is configured to load the third page in a page frame of the first page.
- the mobile terminal can provide the first page, and in order to avoid the problem that all the content to be displayed is stored in the page source file of the single page in the single page application, the mobile terminal can Instructing to generate a second page, loading the second page in the page frame of the first page, thereby reducing the page size and memory overhead, and reducing the flicker phenomenon that may be caused by completely replacing the first page with the second page, and improving display effect.
- the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
- the page processing apparatus includes:
- the main page providing module 801 is configured to provide a main page, where the main page includes a sub-page display area;
- the first sub-page generating module 802 is configured to generate a first sub-page according to the instruction to load the first sub-page;
- the first subpage loading module 803 is configured to load the first subpage in the subpage display area.
- the mobile terminal can provide the main page, and in order to avoid the problem that all the content to be displayed is stored in the single-page page source file in the single-page application, the mobile terminal can record the first sub-page according to the description. Instructing to generate the first subpage, loading the first subpage in the subpage display area of the main page, thereby reducing the page size and memory overhead, and also reducing the flicker phenomenon that may be caused by completely replacing the main page with another page. Improve the display.
- the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
- Embodiments of the present application can be implemented as a system for performing a desired configuration using any suitable hardware, firmware, software, or any combination thereof.
- FIG. 9 schematically illustrates an exemplary system (or apparatus) 900 that can be used to implement various embodiments described in this application.
- FIG. 9 illustrates an exemplary system 900 having one or more processors 902, a system control module (chipset) coupled to at least one of the processor(s) 902. 904.
- System memory 906 coupled to system control module 904, non-volatile memory (NVM)/storage device 908 coupled to system control module 904, one or more inputs/outputs coupled to system control module 904 Device 910, and a network interface 912 that is coupled to system control module 906.
- NVM non-volatile memory
- Processor 902 can include one or more single-core or multi-core processors, and processor 902 can include any combination of general purpose or special purpose processors (eg, graphics processors, application processors, baseband processors, etc.).
- system 900 can be implemented as a page process as described in embodiments of the present application.
- system 900 can include and be integrated with one or more computer readable media (eg, system memory 906 or NVM/storage device 908) with instructions configured to One or more processors 902 that execute the instructions to implement the modules to perform the actions described herein.
- computer readable media eg, system memory 906 or NVM/storage device 908
- processors 902 execute the instructions to implement the modules to perform the actions described herein.
- system control module 904 can include any suitable interface controller to provide to at least one of processor(s) 902 and/or any suitable device or component in communication with system control module 904. Any suitable interface.
- System control module 904 can include a memory controller module to provide an interface to system memory 906.
- the memory controller module can be a hardware module, a software module, and/or a firmware module.
- System memory 906 can be used, for example, to load and store data and/or instructions for system 900.
- system memory 906 can include any suitable volatile memory, such as a suitable DRAM.
- system memory 906 can include double data rate type quad synchronous dynamic random access memory (DDR4 SDRAM).
- system control module 904 can include one or more input/output controllers to provide an interface to NVM/storage device 908 and input/output device(s) 910.
- NVM/storage device 908 can be used to store data and/or instructions.
- NVM/storage device 908 may comprise any suitable non-volatile memory (eg, flash memory) and/or may include any suitable non-volatile storage device(s) (eg, one or more hard disk drives (HDD), one or more compact disc (CD) drives and/or one or more digital versatile disc (DVD) drives).
- HDD hard disk drives
- CD compact disc
- DVD digital versatile disc
- NVM/storage device 908 can include storage resources that are physically part of the device on which system 900 is installed, or that can be accessed by the device without having to be part of the device.
- the NVM/storage device 908 can be accessed via the network via the input/output device(s) 910.
- the input/output device(s) 910 can provide an interface to the system 900 to communicate with any other suitable device, and the input/output device 910 can include a communication component, an audio component, a sensor component, and the like.
- Network interface 912 can provide an interface for system 900 to communicate over one or more networks, and system 900 can interact with one or more of the wireless networks in accordance with any of one or more wireless network standards and/or protocols.
- the component performs wireless communication, such as accessing a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof for wireless communication.
- At least one of the processor(s) 902 can be packaged with logic of one or more controllers (eg, memory controller modules) of the system control module 904.
- at least one of the processor(s) 902 can be packaged with the logic of one or more controllers of the system control module 904 to form a system in package (SiP).
- at least one of the processor(s) 902 can be integrated with the logic of one or more controllers of the system control module 904 on the same mold.
- at least one of the processor(s) 902 can be integrated with the logic of one or more controllers of the system control module 904 on the same mold to form a system on a chip (SoC).
- SoC system on a chip
- system 900 can be, but is not limited to, a workstation, a desktop computing device, or a mobile computing device (eg, a laptop computing device, a handheld computing device, a tablet, a netbook, etc.).
- system 900 can have more or fewer components and/or different architectures.
- system 900 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application specific integrated circuit ( ASIC) and speakers.
- LCD liquid crystal display
- ASIC application specific integrated circuit
- the display screen can be implemented as a touch screen display to receive an input signal from the user.
- the touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel.
- the touch sensor may sense not only the boundary of the touch or sliding action, but also the duration and pressure associated with the touch or slide operation.
- the embodiment of the present application further provides a non-volatile readable storage medium, where the storage medium stores one or more programs, and when the one or more modules are applied to the terminal device, the terminal may be The device executes the instructions of the method steps in the embodiment of the present application.
- An apparatus comprising: one or more processors; and one or more machine-readable media having instructions stored thereon, when executed by the one or more processors, The apparatus is caused to perform a method performed by a mobile terminal as in the embodiment of the present application.
- Also provided in one example is one or more machine readable medium having stored thereon instructions that, when executed by one or more processors, cause the apparatus to perform a method as performed by a mobile terminal in embodiments of the present application.
- the embodiment of the application discloses a page processing method and device.
- Example 1 A page processing method, including:
- Example 2 may include the method of example 1, the loading the second page in a page frame of the first page comprises:
- Example 3 may include the method of example 2, the page source file of the first page is pre-configured with at least one embedding component, and the corresponding display position of the embedding component is set above the first page layer of the first page ;
- the setting the second page layer on the first page layer of the first page comprises:
- the second page layer is added to the embedded component of the page source file of the first page.
- Example 4 may include the method of example 3, wherein loading the second page in a page frame of the first page further comprises:
- Example 5 may include the method of example 1, the loading the second page in a page frame of the first page comprises:
- Example 6 may include the method of example 1, wherein the content of the first page further includes a target component;
- the loading the second page in the page frame of the first page includes:
- Example 7 can include the method of example 6, the target component comprising a page navigation component;
- the indication of loading the second page includes a page switching indication based on the page navigation component.
- Example 8 can include the method of example 1, the providing the first page comprising:
- the first page includes a page frame
- Example 9 a page processing method, comprising:
- Example 10 A page processing apparatus comprising:
- the first page provides a module for providing the first page
- a second page generating module configured to generate the second page according to an instruction to load the second page
- a second page loading module configured to load the second page in a page frame of the first page.
- Example 11 may include the apparatus of example 10, the second page loading module comprising:
- a second page layer loading submodule configured to generate a second page layer for loading the second page in a page source file of the first page, and set the second page layer to be located on the first page Above the first page layer;
- the first page source file loading submodule is configured to reload the page source file corresponding to the first page.
- the example 12 may include the apparatus of example 11, the page source file of the first page is pre-configured with at least one embedding component, and the corresponding display position of the embedding component is set above the first page layer of the first page ;
- the second page layer loading submodule is further configured to:
- the second page layer is added to the embedded component of the page source file of the first page.
- Example 13 may include the apparatus of example 12, the second page loading module comprising:
- the display parameter setting sub-module is configured to set display parameters corresponding to the border of the embedded component, so that the border of the embedded component is not displayed.
- Example 14 may include the apparatus of example 10, wherein the content of the first page further includes a target component;
- the second page loading module includes:
- the second page loading submodule is configured to load the second page in a page area other than the target component in the first page.
- Example 15 can include the apparatus of example 14, the target component comprising a page navigation component;
- the indication of loading the second page includes a page switching indication based on the page navigation component.
- Example 16 a page processing apparatus, comprising:
- main page providing module for providing a main page, wherein the main page includes a sub-page display area
- a first subpage generating module configured to generate a first subpage according to an instruction to load the first subpage
- the first subpage loading module is configured to load the first subpage in the subpage display area.
- Example 17 an apparatus comprising: one or more processors; and one or more machine-readable media having instructions stored thereon, when executed by the one or more processors, causing the device A method of one or more of claims 1 - 9 is performed.
- Example 18 one or more machine-readable media having stored thereon instructions that, when executed by one or more processors, cause the apparatus to perform the method of one or more of claims 1 - 9 .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Information Transfer Between Computers (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本申请实施例提供了一种页面处理方法,涉及终端技术领域。所述方法包括:提供第一页面,根据加载第二页面的指示,生成所述第二页面,在所述第一页面的页面框架中加载所述第二页面。本申请能够减少页面体积和内存开销,同时也减少将第一页面完全替换为第二页面可能导致的闪烁现象,提高显示效果。
Description
本申请要求2017年11月24日递交的申请号为201711192281.5、发明名称为“页面处理方法及移动终端”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及终端技术领域,特别是涉及一种页面处理方法及移动终端。
随着终端技术的发展,移动终端已经逐渐成为用户生活中不可分割一部分。移动终端中通常可以安装应用,且为了提供应用的性能以及用户体验,该应用可以为基于移动端跨平台开发框架(比如WEEX技术框架)的应用。由于应用通常通过页面的形式向用户展示与该应用相关的数据,且与该应用相关的数据较多,比如,海量用户对以购买的商品展示等,因此,亟需一种页面处理方法。
现有技术中,基于移动端跨平台开发框架的应用中包括一个页面,该应用所有需要显示的内容都统一存储在该页面的页面源文件中。移动终端根据该页面源文件,在该页面中加载页面内容,且当需要对在该页面展示新的页面内容时,需要根据该页面源文件,重新在该页面中加载页面内容。
由于应用中只包括一个页面,且该应用所有需要显示的内容都存储在该页面的页面源文件中,当该应用的功能较为复杂或者需要显示的内容较多时,可能会导致页面体积大,耗费大量内存,甚至造成难以正常显示等问题,即显示页面内容的局限性较大,难以适于日益复杂的显示需求。
发明内容
鉴于上述问题,提出了本申请以便提供一种克服上述问题或者至少部分地解决上述问题的页面处理方法及移动终端。
根据本申请的第一方面,提供了一种页面处理方法,包括:
提供第一页面;
根据加载第二页面的指示,生成所述第二页面;
在所述第一页面的页面框架中加载所述第二页面。
可选的,所述在所述第一页面的页面框架中加载所述第二页面包括:
在所述第一页面的页面源文件中生成用于加载所述第二页面的第二页面层,并设置所述第二页面层位于所述第一页面的第一页面层之上;
重新加载所述第一页面对应的页面源文件。
可选的,所述第一页面的页面源文件预设有至少一个嵌入组件,所述嵌入组件对应的显示位置设置在所述第一页面的第一页面层之上;
所述设置所述第二页面层位于所述第一页面的第一页面层之上包括:
将所述第二页面层添加至所述第一页面的页面源文件的嵌入组件中。
可选的,所述在所述第一页面的页面框架中加载所述第二页面还包括:
设置所述嵌入组件的边框对应的显示参数,以使所述嵌入组件的边框为不显示状态。
可选的,所述在所述第一页面的页面框架中加载所述第二页面包括:
采用所述第二页面的页面内容替换所述第一页面的页面源文件中第一页面的页面内容;
重新加载所述第一页面对应的页面源文件。
可选的,所述第一页面的内容中还包括目标组件;
所述在所述第一页面的页面框架中加载所述第二页面包括:
在所述第一页面中除所述目标组件以外的页面区域加载所述第二页面。
可选的,所述目标组件包括页面导航组件;
所述加载第二页面的指示包括基于所述页面导航组件的页面切换指示。
可选的,所述提供第一页面包括:
在启动应用程序时,获取所述第一页面,所述第一页面包括页面框架;
生成第三页面;
在所述第一页面的页面框架中加载所述第三页面。
根据本申请的第二方面,提供了一种页面处理方法,包括:
提供主页面,所述主页面中包括子页面显示区域;
根据加载第一子页面的指示,生成第一子页面;
在所述子页面显示区域中加载所述第一子页面。
根据本申请的第三方面,提供了一种页面处理装置,包括:
第一页面提供模块,用于提供第一页面;
第二页面生成模块,用于根据加载第二页面的指示,生成所述第二页面;
第二页面加载模块,用于在所述第一页面的页面框架中加载所述第二页面。
可选的,所述第二页面加载模块包括:
第二页面层加载子模块,用于在所述第一页面的页面源文件中生成用于加载所述第二页面的第二页面层,并设置所述第二页面层位于所述第一页面的第一页面层之上;
第一页面源文件加载子模块,用于重新加载所述第一页面对应的页面源文件。
可选的,所述第一页面的页面源文件预设有至少一个嵌入组件,所述嵌入组件对应的显示位置设置在所述第一页面的第一页面层之上;
所述第二页面层加载子模块还用于:
将所述第二页面层添加至所述第一页面的页面源文件的嵌入组件中。
可选的,所述第二页面加载模块包括:
显示参数设置子模块,用于设置所述嵌入组件的边框对应的显示参数,以使所述嵌入组件的边框为不显示状态。
可选的,所述第一页面的内容中还包括目标组件;
所述第二页面加载模块包括:
第二页面加载子模块,用于在所述第一页面中除所述目标组件以外的页面区域加载所述第二页面。
可选的,所述目标组件包括页面导航组件;
所述加载第二页面的指示包括基于所述页面导航组件的页面切换指示。
根据本申请的第四方面,提供了一种页面处理装置,包括:
主页面提供模块,用于提供主页面,所述主页面中包括子页面显示区域;
第一子页面生成模块,用于根据加载第一子页面的指示,生成第一子页面;
第一子页面加载模块,用于在所述子页面显示区域中加载所述第一子页面。
根据本申请的第五方面,提供了一种计算设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如前述一个或多个的方法。
根据本申请的第六方面,提供了计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如前述一个或多个的方法。
在本申请实施例中,能够提供第一页面,且为了避免单页面应用中将所有需要显示的内容都存储在单页面的页面源文件中的问题,可以根据记载第二页面的指示生成第二页面,在第一页面的页面框架中加载第二页面,从而减少了页面体积和内存开销,同时也减少了将第一页面完全替换为第二页面可能导致的闪烁现象,提高了显示效果。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
通过阅读下文优选实施方式的详细描述,各种其它的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了根据本申请一个实施例一的一种页面处理方法流程图;
图2示出了根据本申请一个实施例二的一种页面处理方法流程图;
图3示出了根据本申请一个实施例三的一种页面处理方法流程图;
图4示出了根据本申请一个实施例的一种页面示意图;
图5示出了根据本申请一个实施例的另一种页面示意图;
图6示出了根据本申请一个实施例的另一种页面示意图;
图7示出了根据本申请一个实施例六的一种页面处理装置的结构框图;
图8示出了根据本申请一个实施例七的一种页面处理装置的结构框图;
图9示出了根据本申请一个实施例的一种示例性系统的结构框图。
下面将参照附图更详细地描述本申请示例性实施例。虽然附图中显示了本申请示例性实施例,然而应当理解,可以以各种形式实现本申请而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本申请,并且能够将本申请的范围完整的传达给本领域的技术人员。
为了便于本领域技术人员深入理解本申请实施例,以下将首先介绍本申请实施例中所涉及的专业术语的定义。
页面可以对应一个页面实例,页面由页面内容和页面框架构成,页面内容是页面中主体显示的部分,可以包括文字、图片或视频等内容型组件,还可以包括访问控件、输入框、滚动条等功能型组件。各页面组件按照页面的排布方式排列。其中,导航组件为访问控件的一种,用于从当前页面跳转至另一页面。
页面框架包括页面中除主体显示的页面内容的剩余部分,包括页面边框,页面顶部 的菜单栏,页面侧面的滚动条,页面底部的功能栏等等,在同一个软件的多个页面,通常是套用同一个页面边框。
移动终端可以包括手机、智能手表、VR(Virtual Reality,虚拟现实)设备、平板电脑、电子书阅读器、MP3(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3,)播放器、MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器、膝上型便携计算机、车载电脑、台式计算机、机顶盒、智能电视机、可穿戴设备等等。该移动终端可以安装有操作系统,包括IOS(苹果操作系统)、安卓操作系统或YunOS(阿里操作系统)等。该移动终端能够与远程服务器进行交互,获取客户端、插件、页面处理服务,且包括下图7-9的装置,实施1-3的方式,从而对页面进行处理。
客户端可以包括至少一个基于移动端跨平台开发框架的应用应用程序。该客户端能够运行在移动终端中,从而实现本申请实施例提供的页面处理方法。
插件可以包括在运行于移动终端的应用中,从而实现本申请实施例提供的页面处理方法。
由于移动终端之间的软件环境和硬件环境通常差异较大,从而要求在该移动终端中运行的应用程序也具有对应的某些特点,比如基于上述不同操作系统的移动终端可能会要求所安装的应用程序通过特定的程序语言编写或者具有特殊的文件格式。因此,为了使应用程序具有良好的兼容性,可以通过移动端跨平台开发框架来开发应用程序,所得到的应用程序即为基于移动端跨平台开发框架的应用程序,该类应用程序通常能够在不同的移动终端中运行。以WEEX技术框架为例,开发人员可以编写生成页面源文件,并将该页面源本文件部署在远程服务器中,然后通过网络请求或者预下发的方式,将该页面源文件传递给移动终端,该移动终端可以基于该页面源文件,在应用或网页中加载页面,向用户展示页面内容。
以下将以WEEX技术框架为例,对本申请实施例所提供的页面处理方法及移动终端进行说明。
本申请实施例可以应用于移动终端在基于WEEX技术框架的应用中显示页面的场景。由于在现有技术中,应用中只包括一个页面,且该应用所有需要显示的内容都存储在该页面的页面源文件中,导致该页面占用内存较大,难以满足功能日益复杂的应用显示页面内容的需求,局限性较大。因此,在本申请实施例中,可以提供第一页面,并能够根据加载第二页面的指示,生成第二页面,在第一页面的页面框架中加载第二页面, 即能够在一个页面的页面框架中加载另一页面,从而通过多个页面展示页面内容,充分利用WEEX技术框架中多页面示例架构的灵活性,避免了将应用所有需要显示的内容都存储在一个页面的页面源文件这一问题,减少了页面体积和内存开销,因此能够适应需要显示的内容较多或者功能较为复杂的应用进行页面处理的需求,使大型应用的页面串联更加实时流畅,也便于对各页面进行管控。
本申请实施例可以实现为客户端或插件,移动终端可以从远程服务器获取并安装该客户端或插件,从而通过该客户端或插件来实施本申请实施例所提供的页面处理方法。当然,本申请实施例也可以以页面处理软件的形式部署在远程服务器上,移动终端可以通过访问该远程服务器从而获取页面处理服务。
实施例一
参照图1,示出了根据本申请一个实施例的一种页面处理方法流程图,具体步骤包括:
步骤101,提供第一页面。
为了通过应用向用户展示某些内容,比如某购物类应用向用户展示已购买的商品等信息,移动终端可以提供第一网页。
移动终端可以从本地或者前述中的远程服务器中,获取第一页面的页面源文件,根据该页面源文件进行页面加载或渲染,包括构建页面框架,并在页面框架中显示相应的页面内容。
页面源文件包括有加载页面所需的数据,用于说明该页面包括的各组件、各组件的排布方式、以及各组件所对应的内容。
步骤102,根据加载第二页面的指示,生成所述第二页面。
为了避免单页面应用中,将所有需要显示的内容都存储在一个页面对应的页面源文件所导致的页面体积大和占用内存较大这一问题,移动终端可以生成第二页面。
加载第二页面的指示可以由用户通过执行点击操作、滑动操作或按键操作等预设操作触发,从而指示移动终端在当前已存在第一页面的基础上,生成第二页面。
移动终端可以按照与前述中获取第一页面的页面源文件相同的方式,获取第二页面的页面源文件,并根据该页面源文件生成第二页面。
步骤103,在所述第一页面的页面框架中加载所述第二页面。
为了减少将第一页面完全替换为第二页面可能导致的闪烁现象,从而提高显示效果 和用户体验,移动终端可以在第一页面的页面框架中加载第二页面,即相当于将第二页面作为第一页面的子页面的形式进行显示。
移动终端可以事先在第一页面的页面源文件中添加容器型的组件或者其它特殊的组件,从而在第一页面的页面框架中添加加载第二页面所需的区域,并在该区域加载第二页面。
当然,在实际应用中,也可以不先生成第二页面,再将第二页面加载在第一页面的页面框架中,而是直接根据第二页面的页面源文件,在第一页面的页面框架中,加载第二页面。
在本申请实施例中,能够提供第一页面,且为了避免单页面应用中将所有需要显示的内容都存储在单页面的页面源文件中的问题,可以根据记载第二页面的指示生成第二页面,在第一页面的页面框架中加载第二页面,从而减少了页面体积和内存开销,同时也减少了将第一页面完全替换为第二页面可能导致的闪烁现象,提高了显示效果。
实施例二
参照图2,示出了根据本申请一个实施例的一种页面处理方法流程图,具体步骤包括:
步骤201,移动终端提供第一页面。
其中,移动终端提供第一页面的方式,可以参见前述中的相关描述,此处不再一一赘述。
在本申请实施例中,可选的,由于应用中可能需要切换显示的内容较多,所以为了提高显示效果,并进一步降低页面体积和占用的内存,移动终端在启动应用程序时,获取所述第一页面,所述第一页面包括页面框架,生成第三页面,在所述第一页面的页面框架中加载所述第三页面。也即是,第一页面中可以包括至少一个用于显示其它页面的区域。
其中,移动终端在第一页面的页面框架中加载第三页面的方式,可以与前述在第一页面的页面框架中加载第二页面的方式相同,此处不再一一赘述。
对于第一页面中用于显示其它页面的各区域,移动终端可以在该区域中对与区域对应的页面进行切换显示,比如通过下述步骤,将显示的第三页面替换为第二页面。
另外,在实际应用中,第一页面中可以不显示其它内容,而是只显示第二页面或第三页面等其它页面。
步骤202,所述移动终端根据加载第二页面的指示,生成所述第二页面。
其中,移动终端根据加载第二页面的指示生成第二页面的方式,可以参见前述中的相关描述,此处不再一一赘述。
在本申请实施例中,可选的,由于应用可能会包括多个页面因此,为了便于根据用户的需求在多个页面之间进行切换,所述加载第二页面的指示包括基于页面导航的页面切换指示。
其中,页面行导航用于对应用进行全局控制,包括切换至某个页面等。页面行导航可以包括多个分别针对不同页面的切换入口,该切换入口可以包括按钮或图标等标识,并对应一个页面,当基于任一切换入口接收到前述中用户的预设操作时,即确定接收到基于该页面导航的页面切换指示,从而切换至该切换入口所对应的页面。
步骤203,所述移动终端在所述第一页面的页面框架中加载所述第二页面。
在本申请实施例中,可选的,为了避免切换页面时可能导致的切换不流畅的问题,进而提高显示效果以及用户体验,移动终端可以在所述第一页面的页面源文件中生成用于加载所述第二页面的第二页面层,并设置所述第二页面层位于所述第一页面的第一页面层之上,重新加载所述第一页面对应的页面源文件。也即是,在第一页面所显示的页面内容的上层显示第二页面,通过第二页面的页面内容覆盖第一页面中处于该第二页面下层的页面内容。
由前述可知,第一页面的页面源文件中说明了第一页面所包括的各组件以及各组件的排布方式,因此,可以在第一页面的页面源文件中,添加用于显示第二页面的组件,并将该组件设置在第一页面层的之上,从而生成第二页面层。当然,在实际应用中,该组件也可以是事先设置在第一页面的页面源文件中的。
移动终端可以将第二页面的页面源文件与该组件进行关联,比如,在该组件中设置第二页面的页面源文件的地址,之后,在重新加载第一页面的源文件时,根据与该组件关联的地址,在第二页面层加载第二页面。当然,移动终端也可以将第二页面的页面源文件中包括的数据添加至该组件中,移动终端可以直接根据该组件中包括的数据,在第二页面层加载第二页面。
在本申请实施例中,可选的,由于嵌入组件embed(即embed标签)能够在当前页面实例的基础上,初始化一个新的处于当前页面实例上层的页面实例,所以为了确保能够在第一页面的基础上显示第二页面,提高加载页面的可靠性,减少用户感知到第一页面与第二页面为两个页面的可能,即提高页面的完整性,所述第一页面的页面源文件预 设有至少一个嵌入组件,所述嵌入组件对应的显示位置设置在所述第一页面的第一页面层之上,相应的,移动终端可以将所述第二页面层添加至所述第一页面的页面源文件的嵌入组件中。
其中,移动终端可以通过前述中的相关描述,将第二页面的页面源文件与该组件进行关联,从而将第二页面层添加至嵌入组件中。
当然,在实际应用中,页面源文件中可以预设多个显示参数相同的嵌入组件,各嵌入组件可以分别对应一个页面,从而通过该多个嵌入组件,在第一页面的同一页面区域,对多个页面进行切换显示,其中,处于最上层的嵌入组件所对应的页面即为当前显示的页面,处于该最上层之下的嵌入组件对应的页面即为当前隐藏的页面。
嵌入组件的显示参数用于控制显示该嵌入组件的样式,包括该嵌入组件在页面中的位置、所占区域大小和边框等。
在本申请实施例中,可选的,为了避免用户感知到第一页面与第二页面之间的边界,从而使显示的第一页面和第二页面具有整体性,提高显示效果,移动终端可以设置所述嵌入组件的边框对应的显示参数,以使所述嵌入组件的边框为不显示状态。
其中,移动终端可以设置该嵌入组件到的边框对应的显示参数,从而控制该嵌入组件的边框为不显示状态。
当然,在实际应用中,也可以设置嵌入组件的边框对应的显示参数,使该嵌入组件的边框的颜色与第一页面的背景颜色相同,从而确保用户不会感知到第一页面与第二页面之间的边界。
在本申请实施例中,可选的,为了避免切换页面时可能导致的切换不流畅的问题,进而提高显示效果以及用户体验,移动终端可以采用所述第二页面的页面内容替换所述第一页面的页面源文件中第一页面的页面内容,重新加载所述第一页面对应的页面源文件。
移动终端可以将第一页面的页面源文件中的数据替换为第二页面的页面源文件中的数据,当然,若第一页面的页面框架与第二页面的页面框架相同时,该移动终端可以将第一页面中包括的各组件所关联的数据,替换为第二页面中该组件所关联的数据,从而将第一页面的页面内容替换为第二页面的页面内容。
在本申请实施例中,可选的,由于可能在显示第二页面的页面内容的过程中,可能还需要对第一页面中的部分内容进行显示,或者,第一页面中可能包括部分需要与其它页面共同显示的页面内容,因此,为了进一步提高显示效果以及显示页面的可靠性,所 述第一页面的内容中还包括目标组件。相应的,移动终端可以在所述第一页面中除所述目标组件以外的页面区域加载所述第二页面。
其中,目标组件可以包括前述中除嵌入组件之外的任意组件。
移动终端可以嵌入组件中加载第二页面,从而在第一页面中出目标组件以外的区域加载第二页面。
例如,第一页面包括3个组件,其中,组件1为文字组件,组件2为列表组件,组件3为嵌入组件。因此,若移动终端需要在第一页面的页面框架中加载第二页面,可以在组件3中加载第二页面,加载完成后,第一页面中包括组件1和2,以及加载有第二页面的组件3。
在本申请实施例中,可选的,由前述可知,页面中可以包括页面导航,且该页面导航用于接收用户的预设操作来确定在第一页面框架中加载的页面,因此,为了便于快速准确地对在第一页面的页面框架中加载的页面进行控制,包括在第一页面上层加载其它页面或对已加载的页面进行切换,提高加载页面的可靠性和显示效果,所述目标组件包括页面导航组件。
另外,由于不必将所有的页面内容都写到一个页面示例中,能够充分利用WEEX技术框架中多页面架构的灵活性,克服了单页面实例中需要重新加载页面导航组件等多个组件的问题,降低了应用的开发成本。
在本申请实施例中,首先,移动终端能够提供第一页面,且为了避免单页面应用中将所有需要显示的内容都存储在单页面的页面源文件中的问题,移动终端可以根据记载第二页面的指示生成第二页面,在第一页面的页面框架中加载第二页面,从而减少了页面体积和内存开销,同时也减少了将第一页面完全替换为第二页面可能导致的闪烁现象,提高了显示效果。
其次,移动终端能够通过嵌入组件,在第一页面的上层初始化信息的页面实例,从而可以通过将第二页面层添加至该嵌入组件,以在该嵌入组件中下载第二页面,该第二页面即处于第一页面的上层,确保了能够在第一页面的基础上显示第二页面,提高了加载页面的可靠性,同时也减少了用户感知到第一页面与第二页面为两个页面的可能,提高了页面的完整性。
另外,移动终端可以在第一页面中目标组件之外的页面区域加载第二页面,且该目标组件可以包括页面导航组件,确保了移动终端可以基于页面导航组件接收用户加载新的页面的指示,快速准确地在第一页面上层加载其它页面或对已加载的页面进行切换, 提高了加载页面的可靠性和显示效果。
本领域的技术人员应可理解,上述实施例中的方法步骤并非每一个都必不可少,在具体状况下,可以省略其中的一个或多个步骤,只要能够实现页面处理的技术目的。本发明并不限定的实施例中步骤的数量及其顺序,本发明的保护范围当以权利要求书的限定为准。
实施例三
参照图3,示出了根据本申请一个实施例的一种页面处理方法流程图,具体步骤包括:
步骤301,提供主页面,所述主页面中包括子页面显示区域。
其中,移动终端提供主页面的方法,可以与前述中提供第一页面的方式相同,此处不再一一赘述。
子页面显示区域用于显示子页面,该子页面显示区域可以包括前述中至少一个嵌入组件所对应的区域。
步骤302,根据加载第一子页面的指示,生成第一子页面。
其中,移动终端根据接收加载第一子页面的指示以及生成第一子页面的方式,可以与前述中接收待在第二页面的指示以及生成第二页面的方式相同,此处不再一一赘述。
步骤303,在所述子页面显示区域中加载所述第一子页面。
其中,移动终端可以将第一子页面的页面层添加至子页面显示区域所对应的嵌入组件中。
在本申请实施例中,移动终端能够提供主页面,且为了避免单页面应用中将所有需要显示的内容都存储在单页面的页面源文件中的问题,移动终端可以根据记载第一子页面的指示生成第一子页面,在主页面的子页面显示区域中加载第一子页面,从而减少了页面体积和内存开销,同时也减少了将主页面完全替换为另一页面可能导致的闪烁现象,提高了显示效果。
本领域的技术人员应可理解,上述实施例中的方法步骤并非每一个都必不可少,在具体状况下,可以省略其中的一个或多个步骤,只要能够实现页面处理的技术目的。本发明并不限定的实施例中步骤的数量及其顺序,本发明的保护范围当以权利要求书的限定为准。
为了便于本领域技术人员更好地理解本申请,以下通过一个具体的示例对本申请实施例的一种页面处理方法进行说明:
移动终端可以显示页面如图4所示,其中,主页面包括页面导航和子页面显示区域,子页面显示区域可以对应多个嵌入组件,嵌入组件用于加载对应的子页面,子页面中不包括页面导航,而是用于显示页面内容。移动终端可以通过页面导航接收用户的预设操作,从而获取加载子页面的指示,在子页面显示区域中显示对应的子页面,以实现只切换页面内容而不切换页面导航的目的。如图5所示,在当前页面中,子页面1对应的按钮处于被选中状态,子页面显示区域显示了子页面1,且该子页面还包括了隐藏的(即处于子页面1的页面层之下)子页面2、子页面3和子页面4。
或者,在本申请另一种可选的实施例中,移动终端可以显示页面如图6所示,其中,主页面只包括子页面显示区域,而不包括页面导航。
通过上述实施例已经对移动终端在基于WEEX技术框架的应用程序中实现多页面的放法进行了说明,而由于在运行该应用程序的过程中,该应用程序的多个页面之间(比如前述中的第一页面、第二页面和第三页面之间,或者主页面和子页面之间、子页面和子页面之间等)可能需要进行数据同步,因此,一下通过另外两个实施例对该应用程序的多个页面之间进行数据同步的方式进行说明。
实施例四
示出了根据本申请一个实施例的一种页面处理方法流程,具体步骤包括:
步骤S1,依据第一页面的内容变更,更新页面共享数据,所述页面共享数据存储于多页面共用的存储空间。
为了实现多页面之间的数据同步,从而确保应用程序能够通过多个页面向用户展示页面内容,充分利用WEEX技术框架等移动端移动端跨平台开发框架中多页面的优势,减少由单页面应用所导致的开发成本和应用程序的风险性较高的问题,提高应用程序的效率,移动终端可以根据第一页面的内容变更,对页面共享数据进行更新,从而便于后续步骤中根据更新后的页面共享数据对其它页面进行更新,达到多页面数据同步的目的。
页面共享数据由所属应用程序中多个页面之间共享,即作为该应用程序中多个页面的全局变量,以说明登录状态(比如,已登录或未登录,已登录的用户名和密码等)、针对某个对象的统计数据或属性信息(比如针对同一商品或同一篇文章的评论数量或点 赞数量),当然,在实际应用程序中,该页面共享数据还可以包括其它需要多个页面之间共享的信息。页面共享数据可以包括至少一个键和对应的键值,该页面共享数据所包括的键可以有移动终端事先确定,比如从该应用程序的关于页面共享数据的配置文件中获取等。其中,键即为数据标识,用于标识数据,说明数据的功能或用途,键值为数据的具体内容,比如,以面共享数据包括username:asd001为例,username即表示该键为用户名,asd001即表示用户名为。
移动终端可以基于第一页面与用户进行交互,包括接收用户操作指令,若检测到预设交互事件,即可确定第一页面的内容变更,从而对页面共享数据进行更新。
其中,预设交互事件可以由移动终端事先确定,比如,由第一页面归属的应用程序的开发人员,根据该应用程序的功能和应用场景,设定预设交互事件,并将预设交互事件通过远程服务器下发给该移动终端。
例如,该预设交互事件可以包括登录事件、评论事件、转发事件、点赞事件、评分事件等。其中,当接收到用户的登录操作指令,可以确定检测到该登录事件;当接收到用户的评论操作指令,可以确定检测到该评论事件;当接收到用户的转发操作指令,可以确定检测到该转发事件;当接收到用户的点赞操作指令,可以确定检测到该点赞事件;当接收到用户的评分操作指令,可以确定检测到该评分事件;当然,在实际应用中,预设交互事件可以根据应用程序的功能和应用场景,包括更多或更少的事件。
其中,多页面共用的存储空间可以由移动终端分配得到,包括本地存储(即Local Storage)或应用缓存。
步骤S2,根据更新后的所述页面共享数据更新第二页面的页面内容。
由于当前的页面共享数据已经更新,第二页面中的某些数据可能与其它页面不一致,因此,为了对多个页面之间进行数据同步,可以根据更新后的页面共享数据,对第二页面的页面内容进行更新。
第二页面可以包括应用中出第一页面之外的任意需要与第一页面进行数据同步的页面。
移动终端可以从前述的多页面共用的存储空间中获取已更新的页面共享数据,从而根据获取到的页面共享数据,对第二页面的页面内容进行更新。
其中,移动终端对第二页面的页面内容进行更新可以包括对账户登录状态(比如,已登录或未登录,已登录的用户名和密码等)的更新、或对同一对象的统计数据或属性信息(比如针对同一商品或同一篇文章的评论数量或点赞数量)的更新,当然,在实际 应用中,移动终端还可以对其它种类的需要在多页面之间进行同步的内容进行更新。
在本申请实施例中,多页面共用的存储空间可以存储该应用程序的页面共享数据,因此能够根据第一页面内容的内容变更,对该页面共享数据进行更新,并根据更新后的页面共享数据对第二页面的页面内容进行更新,实现多页面之间的数据同步,确保了应用程序能够可靠地通过多个页面向用户展示页面内容,充分利用WEEX等移动端跨平台开发框架中多页面的优势,减少由单页面应用所导致的开发成本和应用程序的风险性较高的问题,提高应用程序的效率。
实施例五
示出了根据本申请一个实施例的一种页面处理方法流程,具体步骤包括:
步骤S1,移动终端启动应用程序,注册相关接口。
为了便于后续页面页面共享数据进行更新、感知该更新以及获取该更新,移动终端可以在启动应用程序时,进行接口注册。
其中,应用程序即为第一页面或第二页面所归属的应用程序。
相关接口可以包括至少一个接口,用于页面生成页面共享数据、对已有的页面共享数据进行更新,或者获取已更新的页面共享数据,或者确定页面共享数据是否已被更新而需要进行数据同步。
WEEX技术框架提供有JSService(即脚本服务,JS为脚本语言JavaScript的缩写)接口,该JSService接口能够与基于WEEX技术框架的应用程序中的页面实例在JS Runtime(即JavaScript运行环境)中并行运行,因此,通过该JSService接口定义的变量能够被页面实例访问,也即是,基于WEEX技术框架的应用程序中的多个页面能够感知并获取到由JSService接口注册的变量,以对页面内容进行更新。移动终端可以在启动应用程序时,对WEEX容器(即应用程序中加载页面的环境)进行初始化,调用WEEX SDK(Software Development Kit,软件开发工具包)进行接口注册。
例如,若移动终端的操作系统为IOS(苹果操作系统),则进行接口注册的代码可以为“[WeexSDKEngine registerService:@"SERVICE_NAME"withScript:@"SERVICE_JS_CODE"withOptions:@{}];”。
在上述示例中,SERVICE_JS_CODE即为用于注册相关接口的代码,从而使页面能够感知并使用该代码,即通过注册向页面暴露相关接口,以便于后续基于上述接口进行页面之间的数据同步。
在本申请实施例中,可选的,为了便于页面对页面共享数据进行更新,以确保后续能够对多页面进行数据同步,当启动所述应用程序时,移动终端可以注册数据写入接口。
其中,数据写入接口用于页面添加新的页面共享数据、对已有的页面共享数据进行更新,并在页面执行上述添加或更新操作,即页面共享数据发生变化时,向订阅了页面共享数据变化的其它页面发送事件通知,以使其它页面感知到当前的页面共享数据已经发生改变,需要进行数据同步。
在本申请实施例中,可选的,为了便于页面获取到已更新的页面共享数据,以确保后续能够对多页面进行数据同步,当启动所述应用程序时,移动终端可以注册数据获取接口
其中,数据获取接口用于页面获取页面共享数据。
在本申请实施例中,可选的,为了确保需要进行数据同步的页面都能及时在页面共享数据发生改变时进行数据同步,以提高页面之间进行数据同步的可靠性,当启动所述应用程序时,移动终端可以注册更新订阅接口。
其中,更新订阅接口用于页面订阅页面共享数据更新事件。若页面通过该更新订阅接口订阅了页面共享数据更新事件,则其它页面在对页面共享数据进行更改,向该页面反馈事件通知,使该页面确定页面共享数据更新事件被触发,通过回调函数进行业务逻辑处理,以进行数据同步。
页面共享数据更新事件用于说明当前页面共享数据已发生改变,页面之间需要进行数据同步。相应的,页面共享数据更新事件的事件通知用于通知页面当前页面共享数据已发生改变,即发生该页面共享数据更新事件,可以进行数据同步。
步骤S2,所述移动终端在所述应用程序中加载第一页面。
其中,第一页面可以为应用程序启动后加载的第一个页面。移动终端可以在该应用程序启动后,自动加载第一页面,当然,也可以是根据加载第一页面的指示,加载第一页面。
加载第一页面的指示可以由用户通过执行点击操作、滑动操作或按键操作等预设操作触发。移动终端可以在启动时,提供一个包括页面导航和子页面显示区域的主页面,该页面导航包括多个分别针对不同页面的切换入口,该切换入口可以包括按钮或图标等标识,并对应一个子页面(第一页面即可以为其中一个子页面),当基于任一切换入口接收到前述中用户的预设操作时,即确定接收到基于该页面导航的页面加载指示,从而在子页面显示区域加载对应的子页面。
主页面以及各子页面可以分别对应一个页面实例。
移动终端可以从本地或者远程服务器,获取加载第一页面所需的数据,比如第一页面对应的页面源文件等,根据获取到的数据对第一页面进行加载,从而向用户展示页面内容。
步骤S3,所述移动终端初始化页面共享数据。
为了确保应用缓存中存在页面共享数据,从而能够对页面共享数据进行存取,提高进行页面之间的数据同步的可靠性,确保应用程序的正常运行,移动终端可以对页面共享数据进行初始化。
移动终端可以通过前述中的数据获取接口,从应用缓存中获取页面共享数据,从而根据获取的结果判断页面共享数据是否已进行初始化,若获取到的数据为空,则确定页面共享数据当前未初始化,通过前述中的数据写入接口,将当前页面所包括的页面共享数据存储至应用缓存,完成初始化,否则确定该页面共享数据已初始化。
当然,在确定当前页面共享数据进行初始化,即获取到了页面共享数据,移动终端可以根据获取的页面共享数据,对当前页面,即第一页面的页面内容进行更新。
在本申请实施例中,可选的,由于应用程序可以加载的任一页面都可能作为该应用程序启动后首次加载的页面,比如移动终端通过该应用程序加载其它用户分享的页面,所以此时可能并未对页面共享数据进行初始化,因此,为了进一步提高进行页面之间的数据同步的可靠性,确保应用程序的正常运行,移动终端在通过应用程序打开任意页面时,都可以通过上述步骤对页面共享数据进行初始化。
另外,在本申请的另一可选实施例中,为了提高页面处理的效率,也可以不执行对页面共享数据进行初始化的步骤,而是在下步骤中根据页面内容变更,直接对页面共享数据进行存储。
步骤S4,所述移动终端依据所述第一页面的内容变更,更新所述页面共享数据,所述页面共享数据存储于所述第一页面归属的应用程序的应用缓存。
其中,移动终端根据第一页面的内容变更,对页面共享数据进行更新的方式,可以参见前述中的相关描述,此处不再一一赘述。
由前述可知,页面共享数据可能会包括至少一个键和对应的键值,而某个页面的内容变更可能会使部分或全部的页面共享数据发生改变,所以移动终端可以根据第一页面的内容变更,对页面共享数据包括的至少一个键的键值进行更新。
例如,应用程序为某买家秀应用,用户可以通过在应用程序公开展示该用户所购买 的商品。该应用程序包括两个页面,其中,页面1用于展示各商品的简明信息,比如该商品的图片、喜欢以及不喜欢该商品的用户数目等;页面2用于展示商品的详细信息,比如该商品的功能用途和商家等,且页面2还包括针对各商品的“喜欢”按钮,用户可以通过“喜欢”按钮将该商品标记为喜欢,从而使喜欢该商品的用户数目增加;页面共享数据包括商品编号和喜欢该商品的用户数目,以页面共享数据为{a:1,b:2}为例,a:1表示商品的编号为1,b:2表示喜欢该商品的用户数目为2。若该用户在页面2对编号为2的商品点击“喜欢”按钮,则移动终端可以根据页面2的内容变更,对页面共享数据中喜欢编号为2的商品的用户数目进行更新,更新后的页面共享数据可以为{a:1,b:3}。
在本申请实施例中,可选的,避免了将该页面共享数据存储至本地存储所导致的存取不便和占用较多系统资源的问题,提高多页面进行数据同步的效率,从而提高了页面处理的效率,同时也节省移动终端的系统资源,提高了该移动终端性能,所述页面共享数据存储于所述第一页面归属的应用程序的应用缓存。
其中,当通过本地存储进行多页面之间的数据同步时,在将页面共享数据存储至该本地存储之前,需要对该页面共享数据进行序列化处理,当该本地存储的页面共享数据更新后,需要通过广播频道接口(即BroadcastChannel API)进行跨页面通信,广播给各页面,各页面从该本存储获取更新后的页面共享数据,包括从该本地存储获取存储的页面共享数据时,并对获取到的数据进行反序列化处理,然后根据获取的页面共享数据对该页面的页面内容进行更新。由于在存取页面共享数据的过程中,需要进行序列化和反序列化处理,导致存取的效率较低,难以适应多页面较为频繁的同步需求,同时该本地存储的空间通常有限,可能会导致数据丢失的问题。
在本申请实施例中,可选的,为了提高对页面共享数据进行更新的可靠性,移动终端可以通过所述第一页面调用数据写入接口,根据变更的页面内容更新所述页面共享数据。
例如,前述中注册的数据写入接口为setStore,移动终端可以通过setStore({b:3})对页面共享数据{a:1,b:2}中的b进行更新,从而得到更新后的页面共享数据{a:1,b:3}。
在本申请实施例中,可选的,为了确保其它页面能够及时感知到页面共享数据已经发生改变,从而对该页面的页面内容进行更新,以进行页面之间的数据实时同步,移动终端可以通过所述第一页面调用数据写入接口,向已订阅页面共享数据更新时间的页面发送事件通知。当然,若第一页面为应用程序启动后加载的第一个页面,则可能当前并没有其它页面订阅该页面共享数据更新事件,所以可以不必发送该事件通知。
在本申请实施例中,可选的,为了确保第一页面能够将第一页面与其它页面的页面数据进行同步,以对第一页面的内容进行更新,提高页面之间进行数据同步的可靠性,移动终端可以通过第一页面调用更新订阅接口,订阅页面共享数据更新事件。
步骤S5,所述移动终端加载第二页面。
其中,移动终端记载第二页面的方式,可以与加载第一页面的方式相同,此处不再一一赘述。
当然,移动终端在加载第二页面之后,还可以通过前述相同的步骤对页面共享数据进行初始化,或者对页面共享数据进行更新。
在本申请实施例中,可选的,为了能够感知到页面共享数据已经发生改变,从而对该页面的页面内容进行更新,以进行页面之间的数据同步,移动终端可以通过所述第二页面调用更新订阅接口,订阅所述页面共享数据更新事件。
步骤S6,所述移动终端获取针对所述第二页面的页面共享数据更新事件。
为了能够感知到页面共享数据已经发生改变,从而对该页面的页面内容进行更新,以进行页面之间的数据同步,移动终端可以获取针对第二页面的页面共享数据更新事件。
其中,移动终端可以通过前述中第二页面订阅页面共享数据更新事件的方式,来获取页面共享数据更新事件,当然,在实际应用中,移动终端也可以通过其它方式获取页面共享数据事件,比如,移动终端可以每间隔预设时长,获取页面共享数据,并将第二页面包括的存在与页面共享数据包括的多个键以及对应键值,与页面共享数据包括的对应的键值进行比较,如果存在键值不同的键,则可以确定获取到针对第二页面的页面共享数据更新事件。
预设时长可以由移动终端事先确定,比如,接收用户提交的数值确定。
移动终端可以通过第二页面调用数据获取接口,从而获取得到页面共享数据。
在本申请实施例中,可选的,由前述可知,当第一页面通过数据写入接口对页面共享数据进行更新时,会向订阅了页面共享数据更新事件的页面发送事件通知,因此,为了能够感知到页面共享数据已经发生改变,从而对该页面的页面内容进行更新,以进行页面之间的数据同步,移动终端可以通过所述第二页面,接收数据写入接口发送的针对所述页面共享数据更新事件的事件通知。
步骤S7,所述移动终端根据更新后的所述页面共享数据更新第二页面的页面内容。
其中,移动终端根据更新后的页面共享数据,对第二页面的页面内容进行更新的方式,可以参见前述中的相关描述,此处不再一一赘述。
在本申请实施例中,可选的,由前述可知,应用程序的页面共享数据可以存储在应用缓存中,因此,为了能够准确获取到页面共享数据,即提高获取页面共享数据的可靠性,进而提高多个页面之间进行数据同步的可靠性,移动终端可以从所述应用缓存获取更新后的所述页面共享数据,根据更新后的所述页面共享数据,更新所述第二页面的页面内容。
移动终端可以检测第二页面与页面共享数据共同包括的键,将检测到的键在第二页面的键值替换为该键在页面共享数据中的键值。
例如,移动终端获取到页面共享数据包括{a:1,b:3,c:4},且第二页面包括的键为a和b,因此,移动终端将第二页面中a的键值更新为1,将b的键值更新为3。
在本申请实施例中,可选的,为了能够准确获取到页面共享数据,即提高获取页面共享数据的可靠性,进而提高多个页面之间进行数据同步的可靠性,移动终端可以通过所述第二页面调用数据获取接口,从所述应用缓存获取更新后的所述页面共享数据。
例如,前述中注册的数据获取接口为getStore,移动终端可以通过getStore()获取到页面共享数据为{a:1,b:3,c:4}。
在本申请实施例中,首先,可以存储该应用程序的页面共享数据,移动终端能够根据第一页面内容的内容变更,对该页面共享数据进行更新,并根据更新后的页面共享数据对第二页面的页面内容进行更新,实现多页面之间的数据同步,确保了应用程序能够可靠地通过多个页面向用户展示页面内容,充分利用WEEX等移动端跨平台开发框架中多页面的优势,减少由单页面应用所导致的开发成本和应用程序的风险性较高的问题,提高应用程序的效率。
其次,移动终端可以在启动应用程序时,注册进行页面之间数据同步的相关接口,包括数据写入接口、数据获取接口和更新订阅接口,确保了移动终端能够通过页面从数据写入接口对应用缓存中的页面共享数据进行更新、基于更新订阅接口感知其它页面对该页面共享数据的更新、以及从数据获取接口获取更新后的页面共享数据对该页面的页面内容进行更新,提高了该应用程序中多页面之间进行数据同步的可靠性。
另外,移动终端在加载页面之后,可以对页面共享数据进行初始化,包括判断当前该页面共享数据是否初始化,并在确定未初始化时对该页面共享数据进行初始化,进一步确保了应用缓存中存在可用的页面共享数据,提高了页面之间进行数据同步的可靠性。
本领域的技术人员应可理解,上述实施例中的方法步骤并非每一个都必不可少,在具体状况下,可以省略其中的一个或多个步骤,只要能够实现页面处理以进行页面之间 的数据同步的技术目的。本发明并不限定的实施例中步骤的数量及其顺序,本发明的保护范围当以权利要求书的限定为准。
为了便于本领域技术人员更好地理解本申请,以下通过一个具体的示例对本申请实施例的注册相关接口以及基于注册的接口进行页面之间数据同步的方法进行说明,具体包括如下:
首先,示出了根据本申请一个实施例的一种通过应用程序注册接口的方法流程。在步骤S1中,移动终端启动应用程序;在步骤S2中,该移动终端对WEEX容器进行初始化;在步骤S3中,该移动终端通过native(一种计算机函数,用于调用WEEX SDK中的服务)调用JSService;在步骤S4中,通过JSService进行接口注册,以向该应用程序的页面暴露全局变量(即页面共享数据)以及管理接口,包括前述中的数据写入接口、数据获取接口和更新订阅接口;在步骤S5中,完成接口注册,得到setStore(数据写入接口)、getStore(数据获取接口)和subscribe(更新订阅接口);在步骤306,移动终端进行页面初始化;在步骤S7中,注册接口结束,此时该应用中的页面可以通过上述注册的相关接口,对该应用程序的全局变量进行管理。
其次,示出了根据本申请一个实施例的一种页面之间进行数据同步的方法流程图。在步骤S1中,移动终端启动应用程序;在步骤S2中,该移动终端创建空的全局变量,向该应用程序中的页面暴露相关接口,包括setStore、getStore和subscribe;在步骤S3中,该移动终端在该应用程序中加载首页;在步骤S4中,该移动终端通过首页对该应用程序的全局变量进行初始化,以及通过setStore对页面变量进行更新、通过subscribe订阅事件,监听全局变量是否发生变化;在步骤S5中,该移动终端在该应用程序中加载页面A,之后可以执行步骤S6和S7已全局变量进行初始化,当然也直接执行步骤S8;在步骤S6中,该移动终端判断全局变量是否已初始化,如果否则执行步骤S7,如果是则执行步骤S8;在步骤S7中,该移动终端通过页面A对全局变量进行初始化;在步骤S8中,该移动终端通过页面A获取全局变量、监听全局变量是否发生变化;在步骤S9中,该移动终端基于页面A的内容变更,通过setStore对全局变量进行更新;在步骤S10中,移终端通过页面A分发更新事件,即向已订阅更新事件的页面发送事件通知;在步骤S11中,首页等页面监听到该更新事件并进行相关处理,包括根据全局变量的变化,对页面内容进行更新。
实施例六
参照图7,示出了根据本申请一个实施例的一种页面处理装置的结构框图,该页面处理装置包括:
第一页面提供模块701,用于提供第一页面;
第二页面生成模块702,用于根据加载第二页面的指示,生成所述第二页面;
第二页面加载模块703,用于在所述第一页面的页面框架中加载所述第二页面。
可选的,所述第二页面加载模块包括:
第二页面层加载子模块,用于在所述第一页面的页面源文件中生成用于加载所述第二页面的第二页面层,并设置所述第二页面层位于所述第一页面的第一页面层之上;
第一页面源文件加载子模块,用于重新加载所述第一页面对应的页面源文件。
可选的,所述第一页面的页面源文件预设有至少一个嵌入组件,所述嵌入组件对应的显示位置设置在所述第一页面的第一页面层之上;
所述第二页面层加载子模块还用于:
将所述第二页面层添加至所述第一页面的页面源文件的嵌入组件中。
可选的,所述第二页面加载模块包括:
显示参数设置子模块,用于设置所述嵌入组件的边框对应的显示参数,以使所述嵌入组件的边框为不显示状态。
可选的,所述第二页面加载模块包括:
页面内容替换子模块,用于采用所述第二页面的页面内容替换所述第一页面的页面源文件中第一页面的页面内容;
第二页面源文件加载子模块,用于重新加载所述第一页面对应的页面源文件。
可选的,所述第一页面的内容中还包括目标组件;
所述第二页面加载模块包括:
第二页面加载子模块,用于在所述第一页面中除所述目标组件以外的页面区域加载所述第二页面。
可选的,所述目标组件包括页面导航组件;
所述加载第二页面的指示包括基于所述页面导航组件的页面切换指示。
可选的,所述第一页面提供模块包括:
第一页面获取子模块,用于在启动应用程序时,获取所述第一页面,所述第一页面包括页面框架;
第三页面生成子模块,用于生成第三页面;
第三页面加载子模块,用于在所述第一页面的页面框架中加载所述第三页面。
在本申请实施例中,移动终端能够提供第一页面,且为了避免单页面应用中将所有需要显示的内容都存储在单页面的页面源文件中的问题,移动终端可以根据记载第二页面的指示生成第二页面,在第一页面的页面框架中加载第二页面,从而减少了页面体积和内存开销,同时也减少了将第一页面完全替换为第二页面可能导致的闪烁现象,提高了显示效果。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
实施例七
参照图8,示出了根据本申请一个实施例的一种页面处理装置的结构框图,该页面处理装置包括:
主页面提供模块801,用于提供主页面,所述主页面中包括子页面显示区域;
第一子页面生成模块802,用于根据加载第一子页面的指示,生成第一子页面;
第一子页面加载模块803,用于在所述子页面显示区域中加载所述第一子页面。
在本申请实施例中,移动终端能够提供主页面,且为了避免单页面应用中将所有需要显示的内容都存储在单页面的页面源文件中的问题,移动终端可以根据记载第一子页面的指示生成第一子页面,在主页面的子页面显示区域中加载第一子页面,从而减少了页面体积和内存开销,同时也减少了将主页面完全替换为另一页面可能导致的闪烁现象,提高了显示效果。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本申请实施例可被实现为使用任意适当的硬件,固件,软件,或及其任意组合进行想要的配置的系统。图9示意性地示出了可被用于实现本申请中所述的各个实施例的示例性系统(或装置)900。
对于一个实施例,图9示出了示例性系统900,该系统具有一个或多个处理器902、被耦合到(一个或多个)处理器902中的至少一个的系统控制模块(芯片组)904、被耦合到系统控制模块904的系统存储器906、被耦合到系统控制模块904的非易失性存储器 (NVM)/存储设备908、被耦合到系统控制模块904的一个或多个输入/输出设备910,以及被耦合到系统控制模块906的网络接口912。
处理器902可包括一个或多个单核或多核处理器,处理器902可包括通用处理器或专用处理器(例如图形处理器、应用处理器、基频处理器等)的任意组合。在一些实施例中,系统900能够作为本申请实施例中所述的页面处理。
在一些实施例中,系统900可包括具有指令的一个或多个计算机可读介质(例如,系统存储器906或NVM/存储设备908)以及与该一个或多个计算机可读介质相合并被配置为执行指令以实现模块从而执行本申请中所述的动作的一个或多个处理器902。
对于一个实施例,系统控制模块904可包括任意适当的接口控制器,以向(一个或多个)处理器902中的至少一个和/或与系统控制模块904通信的任意适当的设备或组件提供任意适当的接口。
系统控制模块904可包括存储器控制器模块,以向系统存储器906提供接口。存储器控制器模块可以是硬件模块、软件模块和/或固件模块。
系统存储器906可被用于例如为系统900加载和存储数据和/或指令。对于一个实施例,系统存储器906可包括任意适当的易失性存储器,例如,适当的DRAM。在一些实施例中,系统存储器906可包括双倍数据速率类型四同步动态随机存取存储器(DDR4SDRAM)。
对于一个实施例,系统控制模块904可包括一个或多个输入/输出控制器,以向NVM/存储设备908及(一个或多个)输入/输出设备910提供接口。
例如,NVM/存储设备908可被用于存储数据和/或指令。NVM/存储设备908可包括任意适当的非易失性存储器(例如,闪存)和/或可包括任意适当的(一个或多个)非易失性存储设备(例如,一个或多个硬盘驱动器(HDD)、一个或多个光盘(CD)驱动器和/或一个或多个数字通用光盘(DVD)驱动器)。
NVM/存储设备908可包括在物理上作为系统900被安装在其上的设备的一部分的存储资源,或者其可被该设备访问而不必作为该设备的一部分。例如,NVM/存储设备908可通过网络经由(一个或多个)输入/输出设备910进行访问。
(一个或多个)输入/输出设备910可为系统900提供接口以与任意其他适当的设备通信,输入/输出设备910可以包括通信组件、音频组件、传感器组件等。网络接口912可为系统900提供接口以通过一个或多个网络通信,系统900可根据一个或多个无线网络标准和/或协议中的任意标准和/或协议来与无线网络的一个或多个组件进行无线通信, 例如接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合进行无线通信。
对于一个实施例,(一个或多个)处理器902中的至少一个可与系统控制模块904的一个或多个控制器(例如,存储器控制器模块)的逻辑封装在一起。对于一个实施例,(一个或多个)处理器902中的至少一个可与系统控制模块904的一个或多个控制器的逻辑封装在一起以形成系统级封装(SiP)。对于一个实施例,(一个或多个)处理器902中的至少一个可与系统控制模块904的一个或多个控制器的逻辑集成在同一模具上。对于一个实施例,(一个或多个)处理器902中的至少一个可与系统控制模块904的一个或多个控制器的逻辑集成在同一模具上以形成片上系统(SoC)。
在各个实施例中,系统900可以但不限于是:工作站、台式计算设备或移动计算设备(例如,膝上型计算设备、手持计算设备、平板电脑、上网本等)。在各个实施例中,系统900可具有更多或更少的组件和/或不同的架构。例如,在一些实施例中,系统900包括一个或多个摄像机、键盘、液晶显示器(LCD)屏幕(包括触屏显示器)、非易失性存储器端口、多个天线、图形芯片、专用集成电路(ASIC)和扬声器。
其中,如果显示器包括触摸面板,显示屏可以被实现为触屏显示器,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。
本申请实施例还提供了一种非易失性可读存储介质,该存储介质中存储有一个或多个模块(programs),该一个或多个模块被应用在终端设备时,可以使得该终端设备执行本申请实施例中各方法步骤的指令(instructions)。
在一个示例中提供了一种装置,包括:一个或多个处理器;和,其上存储的有指令的一个或多个机器可读介质,当由所述一个或多个处理器执行时,使得所述装置执行如本申请实施例中移动终端执行的方法。
在一个示例中还提供了一个或多个机器可读介质,其上存储有指令,当由一个或多个处理器执行时,使得装置执行如本申请实施例中移动终端执行的方法。
本申请实施例公开了一种页面处理方法和装置。
示例1、一种页面处理方法,包括:
提供第一页面;
根据加载第二页面的指示,生成所述第二页面;
在所述第一页面的页面框架中加载所述第二页面。
示例2可包括示例1所述的方法,所述在所述第一页面的页面框架中加载所述第二页面包括:
在所述第一页面的页面源文件中生成用于加载所述第二页面的第二页面层,并设置所述第二页面层位于所述第一页面的第一页面层之上;
重新加载所述第一页面对应的页面源文件。
示例3可包括示例2所述的方法,所述第一页面的页面源文件预设有至少一个嵌入组件,所述嵌入组件对应的显示位置设置在所述第一页面的第一页面层之上;
所述设置所述第二页面层位于所述第一页面的第一页面层之上包括:
将所述第二页面层添加至所述第一页面的页面源文件的嵌入组件中。
示例4可包括示例3所述的方法,所述在所述第一页面的页面框架中加载所述第二页面还包括:
设置所述嵌入组件的边框对应的显示参数,以使所述嵌入组件的边框为不显示状态。
示例5可包括示例1所述的方法,所述在所述第一页面的页面框架中加载所述第二页面包括:
采用所述第二页面的页面内容替换所述第一页面的页面源文件中第一页面的页面内容;
重新加载所述第一页面对应的页面源文件。
示例6可包括示例1所述的方法,所述第一页面的内容中还包括目标组件;
所述在所述第一页面的页面框架中加载所述第二页面包括:
在所述第一页面中除所述目标组件以外的页面区域加载所述第二页面。
示例7可包括示例6所述的方法,所述目标组件包括页面导航组件;
所述加载第二页面的指示包括基于所述页面导航组件的页面切换指示。
示例8可包括示例1所述的方法,所述提供第一页面包括:
在启动应用程序时,获取所述第一页面,所述第一页面包括页面框架;
生成第三页面;
在所述第一页面的页面框架中加载所述第三页面。
示例9、一种页面处理方法,包括:
提供主页面,所述主页面中包括子页面显示区域;
根据加载第一子页面的指示,生成第一子页面;
在所述子页面显示区域中加载所述第一子页面。
示例10、一种页面处理装置,包括:
第一页面提供模块,用于提供第一页面;
第二页面生成模块,用于根据加载第二页面的指示,生成所述第二页面;
第二页面加载模块,用于在所述第一页面的页面框架中加载所述第二页面。
示例11可包括示例10所述的装置,所述第二页面加载模块包括:
第二页面层加载子模块,用于在所述第一页面的页面源文件中生成用于加载所述第二页面的第二页面层,并设置所述第二页面层位于所述第一页面的第一页面层之上;
第一页面源文件加载子模块,用于重新加载所述第一页面对应的页面源文件。
示例12可包括示例11所述的装置,所述第一页面的页面源文件预设有至少一个嵌入组件,所述嵌入组件对应的显示位置设置在所述第一页面的第一页面层之上;
所述第二页面层加载子模块还用于:
将所述第二页面层添加至所述第一页面的页面源文件的嵌入组件中。
示例13可包括示例12所述的装置,所述第二页面加载模块包括:
显示参数设置子模块,用于设置所述嵌入组件的边框对应的显示参数,以使所述嵌入组件的边框为不显示状态。
示例14可包括示例10所述的装置,所述第一页面的内容中还包括目标组件;
所述第二页面加载模块包括:
第二页面加载子模块,用于在所述第一页面中除所述目标组件以外的页面区域加载所述第二页面。
示例15可包括示例14所述的装置,所述目标组件包括页面导航组件;
所述加载第二页面的指示包括基于所述页面导航组件的页面切换指示。
示例16、一种页面处理装置,包括:
主页面提供模块,用于提供主页面,所述主页面中包括子页面显示区域;
第一子页面生成模块,用于根据加载第一子页面的指示,生成第一子页面;
第一子页面加载模块,用于在所述子页面显示区域中加载所述第一子页面。
示例17、一种装置,包括:一个或多个处理器;和其上存储的有指令的一个或多个机器可读介质,当由所述一个或多个处理器执行时,使得所述装置执行如权利要求示例1-示例9一个或多个的方法。
示例18、一个或多个机器可读介质,其上存储有指令,当由一个或多个处理器执行 时,使得装置执行如权利要求示例1-示例9一个或多个的方法。
虽然某些实施例是以说明和描述为目的的,各种各样的替代、和/或、等效的实施方案、或计算来达到同样的目的实施例示出和描述的实现,不脱离本申请的实施范围。本申请旨在覆盖本文讨论的实施例的任何修改或变化。因此,显然本文描述的实施例仅由权利要求和它们的等同物来限定。
Claims (18)
- 一种页面处理方法,其特征在于,包括:提供第一页面;根据加载第二页面的指示,生成所述第二页面;在所述第一页面的页面框架中加载所述第二页面。
- 根据权利要求1所述的方法,其特征在于,所述在所述第一页面的页面框架中加载所述第二页面包括:在所述第一页面的页面源文件中生成用于加载所述第二页面的第二页面层,并设置所述第二页面层位于所述第一页面的第一页面层之上;重新加载所述第一页面对应的页面源文件。
- 根据权利要求2所述的方法,其特征在于,所述第一页面的页面源文件预设有至少一个嵌入组件,所述嵌入组件对应的显示位置设置在所述第一页面的第一页面层之上;所述设置所述第二页面层位于所述第一页面的第一页面层之上包括:将所述第二页面层添加至所述第一页面的页面源文件的嵌入组件中。
- 根据权利要求3所述的方法,其特征在于,所述在所述第一页面的页面框架中加载所述第二页面还包括:设置所述嵌入组件的边框对应的显示参数,以使所述嵌入组件的边框为不显示状态。
- 根据权利要求1所述的方法,其特征在于,所述在所述第一页面的页面框架中加载所述第二页面包括:采用所述第二页面的页面内容替换所述第一页面的页面源文件中第一页面的页面内容;重新加载所述第一页面对应的页面源文件。
- 根据权利要求1所述的方法,其特征在于,所述第一页面的内容中还包括目标组件;所述在所述第一页面的页面框架中加载所述第二页面包括:在所述第一页面中除所述目标组件以外的页面区域加载所述第二页面。
- 根据权利要求6所述的方法,其特征在于,所述目标组件包括页面导航组件;所述加载第二页面的指示包括基于所述页面导航组件的页面切换指示。
- 根据权利要求1所述的方法,其特征在于,所述提供第一页面包括:在启动应用程序时,获取所述第一页面,所述第一页面包括页面框架;生成第三页面;在所述第一页面的页面框架中加载所述第三页面。
- 一种页面处理方法,其特征在于,包括:提供主页面,所述主页面中包括子页面显示区域;根据加载第一子页面的指示,生成第一子页面;在所述子页面显示区域中加载所述第一子页面。
- 一种页面处理装置,其特征在于,包括:第一页面提供模块,用于提供第一页面;第二页面生成模块,用于根据加载第二页面的指示,生成所述第二页面;第二页面加载模块,用于在所述第一页面的页面框架中加载所述第二页面。
- 根据权利要求10所述的装置,其特征在于,所述第二页面加载模块包括:第二页面层加载子模块,用于在所述第一页面的页面源文件中生成用于加载所述第二页面的第二页面层,并设置所述第二页面层位于所述第一页面的第一页面层之上;第一页面源文件加载子模块,用于重新加载所述第一页面对应的页面源文件。
- 根据权利要求11所述的装置,其特征在于,所述第一页面的页面源文件预设有至少一个嵌入组件,所述嵌入组件对应的显示位置设置在所述第一页面的第一页面层之上;所述第二页面层加载子模块还用于:将所述第二页面层添加至所述第一页面的页面源文件的嵌入组件中。
- 根据权利要求12所述的装置,其特征在于,所述第二页面加载模块包括:显示参数设置子模块,用于设置所述嵌入组件的边框对应的显示参数,以使所述嵌入组件的边框为不显示状态。
- 根据权利要求10所述的装置,其特征在于,所述第一页面的内容中还包括目标组件;所述第二页面加载模块包括:第二页面加载子模块,用于在所述第一页面中除所述目标组件以外的页面区域加载 所述第二页面。
- 根据权利要求14所述的装置,其特征在于,所述目标组件包括页面导航组件;所述加载第二页面的指示包括基于所述页面导航组件的页面切换指示。
- 一种页面处理装置,其特征在于,包括:主页面提供模块,用于提供主页面,所述主页面中包括子页面显示区域;第一子页面生成模块,用于根据加载第一子页面的指示,生成第一子页面;第一子页面加载模块,用于在所述子页面显示区域中加载所述第一子页面。
- 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1-9一个或多个的方法。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-9一个或多个的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711192281.5A CN109840114A (zh) | 2017-11-24 | 2017-11-24 | 页面处理方法及移动终端 |
| CN201711192281.5 | 2017-11-24 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019100985A1 true WO2019100985A1 (zh) | 2019-05-31 |
Family
ID=66630885
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/115384 Ceased WO2019100985A1 (zh) | 2017-11-24 | 2018-11-14 | 页面处理方法及移动终端 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109840114A (zh) |
| WO (1) | WO2019100985A1 (zh) |
Families Citing this family (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110619096B (zh) * | 2019-06-12 | 2022-08-23 | 北京无限光场科技有限公司 | 用于同步数据的方法和装置 |
| CN110909278A (zh) * | 2019-11-07 | 2020-03-24 | 北京浪潮数据技术有限公司 | 一种页面加载的方法、系统、设备及可读存储介质 |
| CN111581561A (zh) * | 2020-04-29 | 2020-08-25 | 北京达佳互联信息技术有限公司 | 页面的显示控制方法、装置、客户端及存储介质 |
| CN112784201B (zh) * | 2021-01-29 | 2024-05-14 | 游艺星际(北京)科技有限公司 | 网页显示方法、装置、终端及存储介质 |
| CN113378085B (zh) * | 2021-05-31 | 2023-11-14 | 游艺星际(北京)科技有限公司 | 页面加载方法、装置、终端及存储介质 |
| CN113312119B (zh) * | 2021-06-04 | 2024-03-15 | 广州博冠信息科技有限公司 | 信息同步方法及装置、计算机可读存储介质、电子设备 |
| CN113504927A (zh) * | 2021-07-26 | 2021-10-15 | 平安普惠企业管理有限公司 | 用户信息更新的方法、装置、设备及存储介质 |
| CN114139072B (zh) * | 2021-10-29 | 2024-06-21 | 北京达佳互联信息技术有限公司 | 页面数据处理方法、装置、电子设备及存储介质 |
| CN114138393B (zh) * | 2021-11-30 | 2024-06-11 | 中国工商银行股份有限公司 | 业务数据录入方法及装置 |
| CN114996601B (zh) * | 2022-04-29 | 2026-03-20 | 阿里巴巴(中国)有限公司 | 页面布局方法、装置、设备及存储介质 |
| CN115237502B (zh) * | 2022-07-30 | 2023-08-29 | 中邮消费金融有限公司 | 一种用于加载动画防止频繁闪烁的方法 |
| CN117172216B (zh) * | 2023-09-18 | 2024-10-01 | 上海鸿翼软件技术股份有限公司 | 一种文档处理方法、装置、介质和电子设备 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105677658A (zh) * | 2014-11-19 | 2016-06-15 | 阿里巴巴集团控股有限公司 | 页面展现方法及装置 |
| CN105760527A (zh) * | 2016-03-02 | 2016-07-13 | 百度在线网络技术(北京)有限公司 | 第三方页面展示方法和装置 |
| CN106294379A (zh) * | 2015-05-18 | 2017-01-04 | 阿里巴巴集团控股有限公司 | 一种页面的加载方法、装置和系统 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP4356925B2 (ja) * | 2002-03-28 | 2009-11-04 | インターナショナル・ビジネス・マシーンズ・コーポレーション | 階層的レイアウト特殊化のためのシステムおよび方法 |
| CN103365855B (zh) * | 2012-03-28 | 2017-05-10 | 腾讯科技(深圳)有限公司 | 生成网页的方法及服务器 |
| CN104301379A (zh) * | 2014-08-28 | 2015-01-21 | 北京奇虎科技有限公司 | 一种网页跨域通信方法和装置 |
| CN105491129A (zh) * | 2015-12-07 | 2016-04-13 | 天津车之家科技有限公司 | 页面加载进度显示方法、装置及移动终端 |
| CN106547844B (zh) * | 2016-10-17 | 2019-11-15 | 腾讯科技(深圳)有限公司 | 一种用户界面的处理方法和装置 |
-
2017
- 2017-11-24 CN CN201711192281.5A patent/CN109840114A/zh active Pending
-
2018
- 2018-11-14 WO PCT/CN2018/115384 patent/WO2019100985A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105677658A (zh) * | 2014-11-19 | 2016-06-15 | 阿里巴巴集团控股有限公司 | 页面展现方法及装置 |
| CN106294379A (zh) * | 2015-05-18 | 2017-01-04 | 阿里巴巴集团控股有限公司 | 一种页面的加载方法、装置和系统 |
| CN105760527A (zh) * | 2016-03-02 | 2016-07-13 | 百度在线网络技术(北京)有限公司 | 第三方页面展示方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109840114A (zh) | 2019-06-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019100985A1 (zh) | 页面处理方法及移动终端 | |
| CN110019464B (zh) | 页面处理方法及装置 | |
| US10877826B2 (en) | Message processing method and apparatus, storage medium, and computer device | |
| CN108628652B (zh) | 用户界面渲染方法、装置及终端 | |
| US10956008B2 (en) | Automatic home screen determination based on display device | |
| US20170235435A1 (en) | Electronic device and method of application data display therefor | |
| CN112181554B (zh) | 一种交互界面显示方法、设备、电子设备及存储介质 | |
| CN113542851B (zh) | 一种菜单刷新方法及显示设备 | |
| US20150193185A1 (en) | Data processing method and electronic device | |
| CN111309216B (zh) | 列表页面的显示方法、装置、计算机设备及存储介质 | |
| US11314391B2 (en) | Navigation bar controlling method and terminal | |
| CN106572139A (zh) | 多终端控制方法、终端、服务器和系统 | |
| CN112817718A (zh) | 双系统设备及其应用展示方法、存储介质 | |
| WO2019007409A1 (zh) | 一种显示方法、装置、智能终端及计算机可读存储介质 | |
| CN110780871A (zh) | 一种负一屏加载方法、装置、终端及计算机可读存储介质 | |
| CN113126741B (zh) | 移动终端帧率的控制方法、装置、计算机设备和存储介质 | |
| CN105955833A (zh) | 引擎调用方法和装置 | |
| CN110798521B (zh) | 分享文件的方法、装置、电子设备及存储介质 | |
| CN113610699B (zh) | 一种硬件图层渲染调度方法、装置、设备及储存介质 | |
| CN103514924A (zh) | 移动终端微件Widget内播放视频的方法、装置及播放器 | |
| CN114065072A (zh) | 图表展示方法及装置、电子设备、存储介质 | |
| WO2023179183A1 (zh) | 子程序同步处理 | |
| CN105307018A (zh) | 一种磁盘卷标的显示方法及装置 | |
| CN110798743A (zh) | 视频播放方法、装置及计算机可读存储介质 | |
| CN109753198A (zh) | 界面访问方法、显示方法、设备、介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18881569 Country of ref document: EP Kind code of ref document: A1 |