CN109558225B - Page switching method and device - Google Patents

Page switching method and device Download PDF

Info

Publication number
CN109558225B
CN109558225B CN201811280793.1A CN201811280793A CN109558225B CN 109558225 B CN109558225 B CN 109558225B CN 201811280793 A CN201811280793 A CN 201811280793A CN 109558225 B CN109558225 B CN 109558225B
Authority
CN
China
Prior art keywords
page
target
class information
target page
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811280793.1A
Other languages
Chinese (zh)
Other versions
CN109558225A (en
Inventor
李星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201811280793.1A priority Critical patent/CN109558225B/en
Publication of CN109558225A publication Critical patent/CN109558225A/en
Application granted granted Critical
Publication of CN109558225B publication Critical patent/CN109558225B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

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

Abstract

The invention provides a page switching method and device, and belongs to the technical field of computers. The terminal can obtain a target page ID of a target page from a code segment corresponding to a current page after receiving a page switching instruction for indicating switching from the current page of an application to the target page of the application, then obtain target class information and target page parameters corresponding to the target page according to the target page ID, finally establish a target object corresponding to the target page based on the target class information, and analyze the target page parameters through the target object to obtain the target page, thereby completing page switching. Therefore, page switching can be realized only by defining the page ID of the next page to be switched in the code segment corresponding to the page, and the redundancy degree of the code file corresponding to the application program can be further reduced.

Description

Page switching method and device
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a page switching method and device.
Background
With the increasing demand of users, the functions of the application programs are richer and richer, and correspondingly, the number of pages contained in the application programs is more and more. In the use process of the application program, jump switching between various pages is often required.
In the prior art, class information and parameter information of a next page to be switched are generally defined in a code segment corresponding to each page, and when a page is switched to the next switched page from the page, the next page is created according to the class information and parameter information of the next page defined in the code segment corresponding to the page, so as to implement page switching.
However, if the page switching is complex, that is, when the number of next pages to be switched per page is large, a large amount of class information and parameter information are defined in the code segment corresponding to each page, and further, the code file of the application program is relatively redundant.
Disclosure of Invention
The invention provides a page switching method and a page switching device, which are used for solving the problem that a code file of an application program is relatively redundant.
According to a first aspect of the present invention, there is provided a page switching method, which can be applied to a terminal, the method including:
receiving a page switching instruction; the page switching instruction is used for indicating the terminal to switch from a current page of an application to a target page of the application;
acquiring a page ID of the target page from a code segment corresponding to the current page to obtain a target page ID, and acquiring class information and page parameters corresponding to the target page according to the target page ID to obtain target class information and target page parameters;
and creating a target object corresponding to the target page based on the target class information, and analyzing the target page parameters through the target object to obtain the target page.
Optionally, the application includes at least one type of page;
before the obtaining of the class information and the page parameters corresponding to the target page according to the target page ID, the method further includes:
when the application is started, creating a class information table corresponding to each type;
and for each page, registering the page ID and the class information of the page to a class information table corresponding to the type of the page by using a load function of the page.
Optionally, the obtaining the class information and the page parameter corresponding to the target page according to the target page ID to obtain the target class information and the target page parameter includes:
determining a class information table corresponding to the type of the target page based on the ID of the target page;
searching the class information corresponding to the ID of the target page from a class information table corresponding to the type of the target page to obtain the target class information;
and reading the page parameter corresponding to the target page from the code file of the application according to the target page ID to obtain the target page parameter.
Optionally, the creating a target object corresponding to the target page based on the target class information includes:
and establishing the target object in a reflection creation mode based on the target class information.
Optionally, the target page parameter includes each attribute and attribute value included in the target page; the analyzing the target page parameters through the target object comprises:
transmitting the target page parameters to the target object in a dictionary form;
defining each attribute in the target page parameters in the target object, and assigning values to each attribute defined in the target object according to the attribute value of each attribute.
According to a second aspect of the present invention, there is provided a page switching apparatus, which may be applied to a terminal, the apparatus may include:
the receiving module is used for receiving a page switching instruction; the page switching instruction is used for indicating the terminal to switch from a current page of an application to a target page of the application;
the acquisition module is used for acquiring the page ID of the target page from the code segment corresponding to the current page to obtain the target page ID, and acquiring the class information and the page parameter corresponding to the target page according to the target page ID to obtain the target class information and the target page parameter;
and the first creating module is used for creating a target object corresponding to the target page based on the target class information and analyzing the target page parameters through the target object to obtain the target page.
Optionally, the application includes at least one type of page;
the device further comprises:
the second creating module is used for creating a class information table corresponding to each type when the application is started;
and the registration module is used for registering the page ID and the class information of each page to a class information table corresponding to the type of the page by using the load function of the page.
Optionally, the obtaining module is configured to:
determining a class information table corresponding to the type of the target page based on the ID of the target page;
searching the class information corresponding to the ID of the target page from a class information table corresponding to the type of the target page to obtain the target class information;
and reading the page parameter corresponding to the target page from the code file of the application according to the target page ID to obtain the target page parameter.
Optionally, the first creating module is configured to:
and establishing the target object in a reflection creation mode based on the target class information.
Optionally, the target page parameter includes each attribute and attribute value included in the target page; the first creating module is configured to:
transmitting the target page parameters to the target object in a dictionary form;
defining each attribute in the target page parameters in the target object, and assigning values to each attribute defined in the target object according to the attribute value of each attribute.
In a third aspect, an embodiment of the present invention provides a mobile terminal, including a processor, a memory, and a computer program stored on the memory and operable on the processor, where the computer program, when executed by the processor, implements the steps of the page switching method according to the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the page switching method according to the first aspect.
Aiming at the prior art, the invention has the following advantages:
the terminal can obtain a target page ID of a target page from a code segment corresponding to a current page after receiving a page switching instruction for indicating switching from the current page of an application to the target page of the application, then obtain target class information and target page parameters corresponding to the target page according to the target page ID, finally establish a target object corresponding to the target page based on the target class information, and analyze the target page parameters through the target object, so that the target page can be obtained, and page switching is completed. Therefore, page switching can be realized only by defining the page ID of the next page to be switched in the code segment corresponding to the page, and the redundancy degree of the code file corresponding to the application program can be further reduced.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating steps of a page switching method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating steps of another page switching method according to a second embodiment of the present invention;
fig. 3 is a block diagram of a page switching apparatus according to a third embodiment of the present invention;
fig. 4 is a block diagram of a page switching apparatus according to a fourth embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Example one
Fig. 1 is a flowchart of steps of a page switching method provided in an embodiment of the present invention, which is applied to a terminal, and as shown in fig. 1, the method may include:
step 101, receiving a page switching instruction; the page switching instruction is used for indicating the terminal to switch from a current page of an application to a target page of the application.
In the embodiment of the invention, the current page represents the page currently displayed by the terminal, and the target page represents the next page to be displayed. Further, the page switching instruction may be sent by the user by triggering a page switching function of the terminal, for example, the page switching function may be triggered by a control in the page, for example, the user may send the page switching instruction to the terminal by clicking a page turning button of the current page, so as to control the terminal to switch to a page associated with the page turning button, that is, the target page. Of course, in practical application, the page switching instruction may also be sent to the terminal in other manners, which is not limited in this embodiment of the present invention.
102, acquiring a page ID of the target page from a code segment corresponding to the current page to obtain a target page ID, and acquiring class information and page parameters corresponding to the target page according to the target page ID to obtain target class information and target page parameters.
In the embodiment of the present invention, the page Identifier (ID) in the code segment corresponding to the current page may be predefined in the development phase of the application, specifically, the page ID may be predefined for each page of the application in the development phase of the application, the page ID of the next page to be switched is defined in the code segment corresponding to each page according to the development requirement of the application, and the class information and the page parameter corresponding to each page are defined in the finally obtained code file of the application.
For example, assuming that the application includes page 1, page 2 and page 3, according to the development requirement, it is required to implement the jump from page 1 to page 2 and page 3, the jump from page 2 to page 1 and page 3, and the jump from page 3 to page 1 and page 2, if the prior art method of defining class information and parameters is adopted, it is required to define the class information and parameters of page 2 and the class information and parameters of page 3 in the code segment corresponding to page 1, define the class information and parameters of page 1 and the class information and parameters of page 3 in the code segment corresponding to page 2, and define the class information and parameters of page 1 and the class information and parameters of page 2 in the code segment corresponding to page 3, so that the finally obtained code file of the application will include the class information and parameters of multiple pages 1, the class information and parameters of multiple pages 2 and the class information and parameters of page 3, and then the code file is relatively redundant, and the coupling degree between each code segment is relatively high. In the embodiment of the invention, the page ID is preset for each page, so that the class information and parameters of the pages 1 to 3 are defined in the applied code file only once, then the page IDs of the pages 2 and 3 are defined in the code segment corresponding to the page 1, the page IDs of the pages 1 and 3 are defined in the code segment corresponding to the page 2, and the page IDs of the pages 1 and 2 are defined in the code segment corresponding to the page 3, thereby greatly reducing the redundancy degree of the applied code file. Meanwhile, after the page parameters or the class information of the page are modified, the embodiment of the invention only needs to correspondingly modify the class information and the parameters of the pages 1 to 3 defined in the applied code file, and has small modification amount and simple modification operation.
Further, when the terminal needs to switch from the current page to the target page, the terminal may obtain the page ID of the target page from the code segment corresponding to the current page as the target page ID, and then obtain the class information and the page parameter corresponding to the target page from the code file of the application according to the target page ID to obtain the target class information and the target page parameter, so as to create the target page in the subsequent steps.
Step 103, creating a target object corresponding to the target page based on the target class information, and analyzing the target page parameters through the target object to obtain the target page.
In the embodiment of the present invention, the target class information may be a class name of the target page, and the target page parameter may be each attribute and attribute value included in the target page.
In summary, according to the page switching method provided in the embodiment of the present invention, after receiving a page switching instruction for instructing to switch from a current page of an application to a target page of the application, a terminal may obtain a target page ID of the target page from a code segment corresponding to the current page, then obtain target class information and target page parameters corresponding to the target page according to the target page ID, finally create a target object corresponding to the target page based on the target class information, and analyze the target page parameters through the target object, so as to obtain the target page, thereby completing page switching. Therefore, page switching can be realized only by defining the page ID of the next page to be switched in the code segment corresponding to the page, and the redundancy degree of the code file corresponding to the application program can be further reduced.
Example two
Fig. 2 is a flowchart of steps of another page switching method according to a second embodiment of the present invention, and as shown in fig. 2, the method may include:
step 201, when the application is started, creating a class information table corresponding to each type.
In practical application, with the continuous increase of business requirements, in order to enrich the functions of the application, other related business functions are often integrated in the application, so that a user can conveniently enter the related business functions from the main business function of the application, in an actual application scenario, a code file of the related business functions is often set in a code file of the application in the form of a plug-in, and a page type of the related business functions corresponding to the plug-in is different from a type of an application body page, for example, a baseline registration system is used for the main application and plug-in business "bubbles" therein. For the convenience of management, corresponding operation classes are often set for different types in the development stage. Accordingly, the terminal can create a type of information table in the operation class corresponding to each type when the application is started.
Step 202, for each page, using the load function of the page to register the page ID and the class information of the page to the class information table corresponding to the type of the page.
In this step, the load function may be a function set by a developer for information registration for each page in the application in a development stage, and operation class information may be predefined in each load function, so that the page ID and the class information of the page may be registered in a class information table corresponding to the type of the page through the load function of the page. Specifically, in the application starting stage, after the terminal establishes the class information table corresponding to each type, the page ID and the class information of each page may be registered in the class information table of the page object through the load function of each page, that is, written in the class information, specifically, for convenience of data management, the page ID and the class information of each page may be written as one item in the class information table. For example, assuming that the type of the page 1 is an application ontology page, the page ID and the class information of the page 1 may be written into a class information table corresponding to the application ontology page type, and the type of the page 2 is a plug-in page, the page ID and the class information of the page 2 may be written into a class information table corresponding to the plug-in page type.
Step 203, receiving a page switching instruction; the page switching instruction is used for indicating the terminal to switch from a current page of an application to a target page of the application.
Specifically, the implementation manner of this step may refer to step 101 described above, and details of the embodiment of the present invention are not described herein.
Step 204, obtaining the page ID of the target page from the code segment corresponding to the current page to obtain the target page ID, and obtaining the class information and the page parameter corresponding to the target page according to the target page ID to obtain the target class information and the target page parameter.
Specifically, the terminal can obtain the target class information and the target page parameter corresponding to the target page through the following substeps (1) to (3):
substep (1): and determining a class information table corresponding to the type of the target page based on the ID of the target page.
In the embodiment of the invention, different identifications can be set for different types in advance, then pages in each type are numbered, and the pages in the same type are numbered differently. The page ID of each page may be a combination of an identification of the type of the page and the number of the page. Specifically, in this step, the terminal may first use a preset interface to preset a judgment function for a target page ID input value, then use the preset judgment function to judge the type of the target page based on the target page ID, and finally, may search the class information table corresponding to the type of the target page from the class information table corresponding to each type created in the previous step. The preset judgment function may be preset, and each type and the corresponding identifier thereof may be predefined in the judgment function, so that the type corresponding to the target page can be determined according to the target page ID through the judgment function.
Substep (2): and searching the class information corresponding to the page ID from the class information table corresponding to the type of the target page to obtain the target class information.
In this step, the class information corresponding to the page ID may be searched from the class information table corresponding to the type of the target page, so as to obtain the target class information.
Substep (3): and reading the page parameter corresponding to the target page from the code file of the application according to the target page ID to obtain the target page parameter.
In this step, the page parameter of each page may be stored in the code file of the application in advance at the development stage, so that the terminal may obtain the page parameter corresponding to the target page from the ID of the target page, and specifically, may call a preset parameter transfer method using the current page as a caller to read the page parameter corresponding to the target page from the current page, thereby obtaining the target page parameter, where the preset parameter transfer method may be an initWithParam method, and the initWithParam method may have the target page ID defined therein. In the embodiment of the present invention, the class information table corresponding to each type is established in the operation class corresponding to each type, and the information of the page of the type is registered in the class information table corresponding to the type, so that the operation of querying the class information according to the page ID can be conveniently and quickly implemented by the operation class, and further, the operation efficiency is improved.
Step 205, creating a target object corresponding to the target page based on the target class information, and analyzing the page parameters through the target object to obtain the target page.
In this step, the page parameter may include each attribute and attribute value included in the target page, and the attribute and attribute value in the page parameter may be stored in a key-value pair (key-value) form, where key may represent the attribute, and value may represent the attribute value, further, the attribute represents the type of content included in the page, and the attribute value is a specific value of the type of the content, for example, if the personal data page includes a nickname, a user avatar, and a user personality signature, then the page parameter corresponding to the personal data page may include three attributes: the name represents a nickname of a user in the personal data page, the attribute value of the name can be a specific nickname of the user, the Portrait represents an avatar of the user in the personal data page, the attribute value of the Portrait can be a specific avatar of the user, the sign represents a personal signature of the user in the personal data page, and the attribute value of the sign can be a specific signature of the user. In practical application, the design requirements of each page are different, and the attributes and attribute values included in the page parameters corresponding to each page are different.
Further, the terminal may establish the target object by a reflection creation method based on the target class information, for example, the target class information may be a class name corresponding to the target page, and specifically, the target object may be established by a reflection creation instruction class. For example, assuming the profile page in the above is the target page, then the attributes may be defined in the target object: name, portrait, and sign, and then assigns values to these three attributes. It should be noted that, in practical application, a developer may also pass through parameters of a target page to a target object in a dictionary form in a manual input manner according to a function that is required to be implemented by the target page, which is not limited in the embodiment of the present invention. Further, when the target page is created, the creation may be implemented based on an operation class corresponding to the type of the target page, and if the type of the target page is an application ontology page, the target page may be created according to the target class information and the target page parameter through the operation class corresponding to the application ontology page.
In summary, in the page switching method provided by the second embodiment of the present invention, when an application is started, a terminal may create a class information table corresponding to each type, register, for each page, a page ID and class information of the page to the class information table corresponding to the type of the page by using a load function of the page, then, after receiving a page switching instruction for instructing switching from a current page of the application to a target page of the application, obtain a target page ID of the target page from a code segment corresponding to the current page, then obtain target class information and target page parameters corresponding to the target page according to the target page ID, finally, create a target object corresponding to the target page based on the target class information, and analyze the target page parameters through the target object, so as to obtain the target page, thereby completing page switching. Therefore, page switching can be realized only by defining the page ID of the next page to be switched in the code segment corresponding to the page, and the redundancy degree of the code file corresponding to the application program can be further reduced.
EXAMPLE III
Fig. 3 is a block diagram of a page switching apparatus according to a third embodiment of the present invention, and as shown in fig. 3, the apparatus 30 may include:
a receiving module 301, configured to receive a page switching instruction; the page switching instruction is used for indicating the terminal to switch from a current page of an application to a target page of the application.
The obtaining module 302 is configured to obtain the page ID of the target page from the code segment corresponding to the current page, obtain the target page ID, and obtain the class information and the page parameter corresponding to the target page according to the target page ID, so as to obtain the target class information and the target page parameter.
A first creating module 303, configured to create a target object corresponding to the target page based on the target class information, and analyze the target page parameter through the target object to obtain the target page.
To sum up, in the page switching apparatus provided in the third embodiment of the present invention, the receiving module may receive a page switching instruction for instructing to switch from a current page of the application to a target page of the application, the obtaining module may obtain a target page ID of the target page from a code segment corresponding to the current page, and may obtain target class information and target page parameters corresponding to the target page according to the target page ID, and finally, the first creating module may create a target object corresponding to the target page based on the target class information, and analyze the target page parameters through the target object, so as to obtain the target page, thereby completing the page switching. Therefore, page switching can be realized only by defining the page ID of the next page to be switched in the code segment corresponding to the page, and the redundancy degree of the code file corresponding to the application program can be further reduced.
Example four
Fig. 4 is a block diagram of a page switching apparatus according to a fourth embodiment of the present invention, and as shown in fig. 4, the apparatus 40 may include:
a receiving module 401, configured to receive a page switching instruction; the page switching instruction is used for indicating the terminal to switch from a current page of an application to a target page of the application;
an obtaining module 402, configured to obtain a page ID of the target page from a code segment corresponding to the current page, obtain the target page ID, and obtain class information and page parameters corresponding to the target page according to the target page ID, so as to obtain target class information and target page parameters;
a first creating module 403, configured to create a target object corresponding to the target page based on the target class information, and analyze the target page parameter through the target object to obtain the target page.
Optionally, the application includes at least one type of page;
the apparatus 40 further comprises:
a second creating module 404, configured to create a class information table corresponding to each type when the application is started;
a registering module 405, configured to register, for each page, the page ID and the class information of the page to a class information table corresponding to the type of the page by using the load function of the page.
Optionally, the obtaining module 402 is configured to:
determining a class information table corresponding to the type of the target page based on the ID of the target page;
searching the class information corresponding to the ID of the target page from a class information table corresponding to the type of the target page to obtain the target class information;
and reading the page parameter corresponding to the target page from the code file of the application according to the target page ID to obtain the target page parameter.
Optionally, the first creating module 403 is configured to:
and establishing the target object in a reflection creation mode based on the target class information.
Optionally, the target page parameter includes each attribute and attribute value included in the target page; the first creating module 403 is configured to:
transmitting the target page parameters to the target object in a dictionary form;
defining each attribute in the target page parameters in the target object, and assigning values to each attribute defined in the target object according to the attribute value of each attribute.
To sum up, in the page switching apparatus provided in the fourth embodiment of the present invention, the second creating module may create a class information table corresponding to each type when the application is started, for each page, the registering module may register the page ID and the class information of the page to the class information table corresponding to the type of the page by using a load function of the page, then the receiving module may receive a page switching instruction for instructing to switch from a current page of the application to a target page of the application, the obtaining module may obtain the target page ID of the target page from a code segment corresponding to the current page, obtain the target class information and the target page parameter corresponding to the target page according to the target page ID, and finally, the first creating module may create a target object corresponding to the target page based on the target class information and parse the target page parameter through the target object to obtain the target page, and then the page switching is completed. Therefore, page switching can be realized only by defining the page ID of the next page to be switched in the code segment corresponding to the page, and the redundancy degree of the code file corresponding to the application program can be further reduced.
For the above device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant points, refer to the partial description of the method embodiment.
Preferably, an embodiment of the present invention further provides a mobile terminal, which includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the above-mentioned page switching method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned page switching method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As is readily imaginable to the person skilled in the art: any combination of the above embodiments is possible, and thus any combination between the above embodiments is an embodiment of the present invention, but the present disclosure is not necessarily detailed herein for reasons of space.
The page switching methods provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The structure required to construct a system incorporating aspects of the present invention will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the page switching method according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (6)

1. A page switching method is applied to a terminal, and comprises the following steps:
receiving a page switching instruction; the page switching instruction is used for indicating the terminal to switch from a current page of an application to a target page of the application;
acquiring a page ID of the target page from a code segment corresponding to the current page to obtain a target page ID, and acquiring class information and page parameters corresponding to the target page according to the target page ID to obtain target class information and target page parameters;
creating a target object corresponding to the target page based on the target class information, and analyzing the target page parameters through the target object to obtain the target page;
wherein the application comprises at least one type of page; a class information table is correspondingly created for each type of page; different page types are provided with different identifiers; the target page ID comprises an identification of a target page type and a number of the target page;
the obtaining of the class information and the page parameter corresponding to the target page according to the target page ID to obtain the target class information and the target page parameter includes:
determining a class information table corresponding to the type of the target page based on the ID of the target page;
searching the class information corresponding to the ID of the target page from a class information table corresponding to the type of the target page to obtain the target class information;
reading a page parameter corresponding to the target page from the code file of the application according to the target page ID to obtain the target page parameter; the at least one type of page comprises a plug-in page and an application body page; the plug-in page and the application body page have different corresponding business functions;
before the obtaining of the class information and the page parameters corresponding to the target page according to the target page ID, the method further includes:
when the application is started, creating a class information table corresponding to each type;
and for each page, registering the page ID and the class information of the page to a class information table corresponding to the type of the page by using a load function of the page.
2. The method of claim 1, wherein creating the target object corresponding to the target page based on the target class information comprises:
and establishing the target object in a reflection creation mode based on the target class information.
3. The method according to claim 1, wherein the target page parameters include various attributes and attribute values included in the target page; the analyzing the target page parameters through the target object comprises:
transmitting the target page parameters to the target object in a dictionary form;
defining each attribute in the target page parameters in the target object, and assigning values to each attribute defined in the target object according to the attribute value of each attribute.
4. A page switching device is applied to a terminal, and the device comprises:
the receiving module is used for receiving a page switching instruction; the page switching instruction is used for indicating the terminal to switch from a current page of an application to a target page of the application;
the acquisition module is used for acquiring the page ID of the target page from the code segment corresponding to the current page to obtain the target page ID, and acquiring the class information and the page parameter corresponding to the target page according to the target page ID to obtain the target class information and the target page parameter;
the first creating module is used for creating a target object corresponding to the target page based on the target class information and analyzing the target page parameters through the target object to obtain the target page;
wherein the application comprises at least one type of page; a class information table is correspondingly created for each type of page; different page types are provided with different identifiers; the target page ID comprises an identification of a target page type and a number of the target page;
the obtaining module is specifically configured to:
determining a class information table corresponding to the type of the target page based on the ID of the target page;
searching the class information corresponding to the ID of the target page from a class information table corresponding to the type of the target page to obtain the target class information;
reading a page parameter corresponding to the target page from the code file of the application according to the target page ID to obtain the target page parameter;
the at least one type of page comprises a plug-in page and an application body page; the plug-in page and the application body page have different corresponding business functions;
the device further comprises:
the second creating module is used for creating a class information table corresponding to each type when the application is started;
and the registration module is used for registering the page ID and the class information of each page to a class information table corresponding to the type of the page by using the load function of the page.
5. The apparatus of claim 4, wherein the first creating module is configured to:
and establishing the target object in a reflection creation mode based on the target class information.
6. The apparatus according to claim 4, wherein the target page parameters include attributes and attribute values included in the target page; the first creating module is configured to:
transmitting the target page parameters to the target object in a dictionary form;
defining each attribute in the target page parameters in the target object, and assigning values to each attribute defined in the target object according to the attribute value of each attribute.
CN201811280793.1A 2018-10-30 2018-10-30 Page switching method and device Active CN109558225B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811280793.1A CN109558225B (en) 2018-10-30 2018-10-30 Page switching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811280793.1A CN109558225B (en) 2018-10-30 2018-10-30 Page switching method and device

Publications (2)

Publication Number Publication Date
CN109558225A CN109558225A (en) 2019-04-02
CN109558225B true CN109558225B (en) 2021-04-16

Family

ID=65865696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811280793.1A Active CN109558225B (en) 2018-10-30 2018-10-30 Page switching method and device

Country Status (1)

Country Link
CN (1) CN109558225B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463282B (en) * 2020-12-14 2023-02-24 网易(杭州)网络有限公司 Interface display method, device, storage medium and electronic device
CN113688054A (en) * 2021-08-31 2021-11-23 中国平安人寿保险股份有限公司 Page testing method and device, computer readable storage medium and terminal equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461458A (en) * 2013-09-22 2015-03-25 天津书生投资有限公司 Method and device for describing document page content through multiple page description languages
CN105354034A (en) * 2015-11-17 2016-02-24 贵阳朗玛信息技术股份有限公司 Page jump method and device for application program
CN106126635A (en) * 2016-06-23 2016-11-16 深圳市百米生活股份有限公司 Advertising program arouses mechanism and its implementation automatically
CN108255550A (en) * 2017-11-27 2018-07-06 深圳市小牛在线互联网信息咨询有限公司 Method for page jump, device, storage medium and computer equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050204173A1 (en) * 2004-03-10 2005-09-15 Giga-Byte Technology Co., Ltd. Method for automatically filling in user data using fingerprint identification
US20110185369A1 (en) * 2010-01-25 2011-07-28 Canon Kabushiki Kaisha Refresh of auxiliary display

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461458A (en) * 2013-09-22 2015-03-25 天津书生投资有限公司 Method and device for describing document page content through multiple page description languages
CN105354034A (en) * 2015-11-17 2016-02-24 贵阳朗玛信息技术股份有限公司 Page jump method and device for application program
CN106126635A (en) * 2016-06-23 2016-11-16 深圳市百米生活股份有限公司 Advertising program arouses mechanism and its implementation automatically
CN108255550A (en) * 2017-11-27 2018-07-06 深圳市小牛在线互联网信息咨询有限公司 Method for page jump, device, storage medium and computer equipment

Also Published As

Publication number Publication date
CN109558225A (en) 2019-04-02

Similar Documents

Publication Publication Date Title
CN111814089B (en) Page rendering method and device, rendering server and storage medium
CN108427731B (en) Page code processing method and device, terminal equipment and medium
CN106648685B (en) Intelligent terminal system application processing method and device and intelligent terminal
CN112486451A (en) Voice broadcasting method, computing device and computer storage medium
US20170277526A1 (en) Software categorization method and electronic device
CN109542878B (en) List creation method and device
CN109558225B (en) Page switching method and device
CN112286485B (en) Method and device for controlling application through voice, electronic equipment and storage medium
CN106486118B (en) Voice control method and device for application
CN111225018A (en) Request message processing method and device and electronic equipment
CN114239482A (en) Chip integration method and device
CN110652728B (en) Game resource management method and device, electronic equipment and storage medium
CN112148844B (en) Robot information reply method and device
CN107633080B (en) User task processing method and device
CN112596617A (en) Message content input method and device and electronic equipment
US20170161322A1 (en) Method and electronic device for searching resource
CN110087120B (en) Same-window switching method of online list and local list and computing equipment
CN109740074B (en) Method, device and equipment for processing parameter configuration information
US8655865B1 (en) Method and apparatus for indexing rich internet content using contextual information
CN109753648B (en) Word chain model generation method, device, equipment and computer readable storage medium
CN111444235A (en) Django-based data serialization method and device, computer equipment and storage medium
CN113656549B (en) Content searching method of electronic book, electronic device and computer storage medium
CN109800273A (en) A kind of method, apparatus of data processing, computer storage medium and terminal
CN114116712A (en) Extended field processing method and device, electronic equipment and storage medium
CN107833259B (en) Dynamic cartoon engine processing method and system based on intelligent terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant