CN107038245B - Page switching method, mobile terminal and storage medium - Google Patents

Page switching method, mobile terminal and storage medium Download PDF

Info

Publication number
CN107038245B
CN107038245B CN201710286581.3A CN201710286581A CN107038245B CN 107038245 B CN107038245 B CN 107038245B CN 201710286581 A CN201710286581 A CN 201710286581A CN 107038245 B CN107038245 B CN 107038245B
Authority
CN
China
Prior art keywords
page
state
display rule
rendered
mobile terminal
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
CN201710286581.3A
Other languages
Chinese (zh)
Other versions
CN107038245A (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.)
Granularity innovation technology (Suzhou) Co., Ltd
Original Assignee
Granularity Innovation Technology Suzhou 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 Granularity Innovation Technology Suzhou Co Ltd filed Critical Granularity Innovation Technology Suzhou Co Ltd
Priority to CN201710286581.3A priority Critical patent/CN107038245B/en
Publication of CN107038245A publication Critical patent/CN107038245A/en
Application granted granted Critical
Publication of CN107038245B publication Critical patent/CN107038245B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a page switching method, a mobile terminal and a storage medium, wherein the page switching method comprises the following steps: when a page switching request triggered by a user is received, the page switching request is sent to a server side, so that the server side can verify identity authentication information and state parameters in the page switching request, and return a state code and page data to a mobile terminal according to a verification result; receiving a state code and page data returned by the server based on the page switching request; performing page rendering on the page data to obtain a rendered page; and acquiring a display rule of the rendered page according to the status code, and displaying the rendered page according to the display rule. The invention can reduce the load of the server, reduce the waiting time and improve the page switching speed.

Description

Page switching method, mobile terminal and storage medium
Technical Field
The present invention relates to the field of mobile terminal technologies, and in particular, to a page switching method, a mobile terminal, and a storage medium.
Background
The current popular front-end and back-end development is based on MVVM (Model-View-ViewModel) framework, and the front-end and back-end development are separated. The front end and the back end are separated, various data interaction is carried out through the well-agreed API, the development can be carried out by simulating data synchronization, and the waiting time is saved. The back end is responsible for processing data logic, and the front end is responsible for processing service logic.
The front-end and back-end separation development is to acquire data through asynchronous requests, namely, the front end controls page switching to realize refreshing switching of pages. The existing switching mode is to switch pages according to the URL address of the page, that is, after the mobile terminal triggers a page switching request, the entire page currently displayed by the mobile terminal is refreshed, so that the entire page currently displayed is switched to another page. However, when the page is switched through the URL address of the page, the whole page needs to be refreshed, the waiting time is long, and the page switching speed is slow.
Therefore, the conventional page switching method has the problems of long waiting time and low switching speed.
Disclosure of Invention
The invention mainly aims to provide a page switching method, a mobile terminal and a storage medium, and aims to solve the technical problems of long waiting time and low switching speed of the conventional page switching mode.
In order to achieve the above object, the present invention provides a page switching method, which includes the following steps:
when a page switching request triggered by a user is received, the page switching request is sent to a server side, so that the server side can verify identity authentication information and state parameters in the page switching request, and return a state code and page data to a mobile terminal according to a verification result;
receiving a state code and page data returned by the server based on the page switching request;
performing page rendering on the page data to obtain a rendered page;
and acquiring a display rule of the rendered page according to the status code, and displaying the rendered page according to the display rule.
Optionally, the step of displaying the rendered page according to the display rule includes:
judging whether the display rule is a first display rule or a second display rule;
if the display rule is a first display rule, switching the whole currently displayed page into the rendering page;
and if the display rule is a second display rule, acquiring a page area to be replaced in the current display page, and replacing the page area to be replaced in the current display page with the rendering page.
Optionally, before the step of performing page rendering on the page data and obtaining a rendered page, the page switching method further includes:
judging whether the current state of the user is a login state or not according to the state code;
if the current state of the user is the login state, performing page rendering on the page data to obtain a rendered page;
and if the current state of the user is the login unsuccessful state, switching the currently displayed whole page into a user login page.
Optionally, when receiving a page switching request sent by a mobile terminal, the server acquires a page URL address in the page switching request, and when the page URL address is in a preset URL address group, returns a status code and a rendered page to the mobile terminal according to the page switching request, and the step of receiving the status code and page data returned by the server based on the page switching request may be replaced with the following steps:
the method comprises the following steps that when a page switching request sent by a mobile terminal is received by a server, a page URL address in the page switching request is obtained, and when the page URL address is in a preset URL address group, a state code and a rendered page are returned to the mobile terminal according to the page switching request, wherein the step of receiving the state code and page data returned by the server based on the route switching request comprises the following steps:
receiving a state code and a rendering page returned by the server based on the page switching request;
and executing the step of obtaining the display rule of the rendered page according to the state code and displaying the rendered page according to the display rule.
Optionally, before the step of obtaining the display rule of the rendered page according to the status code and displaying the rendered page according to the display rule, the page switching method further includes:
judging whether the state code is the same as the state code of the state parameter or not;
if the state code is the same as the state code of the state parameter, executing the step of obtaining the display rule of the rendered page according to the state code and displaying the rendered page according to the display rule;
and if the state code is different from the state code of the state parameter, acquiring a preset display rule, and displaying the rendered page according to the preset display rule.
In addition, to achieve the above object, the present invention also provides a mobile terminal, including: a memory, a processor, and a page switching program stored on the memory and executable on the processor, the page switching program when executed by the processor implementing the steps of:
when a page switching request triggered by a user is received, the page switching request is sent to a server side, so that the server side can verify identity authentication information and state parameters in the page switching request, and return a state code and page data to a mobile terminal according to a verification result;
receiving a state code and page data returned by the server based on the page switching request;
performing page rendering on the page data to obtain a rendered page;
and acquiring a display rule of the rendered page according to the status code, and displaying the rendered page according to the display rule.
Further, when executed by the processor, the page switching program further implements the steps of:
judging whether the display rule is a first display rule or a second display rule;
if the display rule is a first display rule, switching the whole currently displayed page into the rendering page;
and if the display rule is a second display rule, acquiring a page area to be replaced in the current display page, and replacing the page area to be replaced in the current display page with the rendering page.
Further, when executed by the processor, the page switching program further implements the steps of:
judging whether the current state of the user is a login state or not according to the state code;
if the current state of the user is the login state, performing page rendering on the page data to obtain a rendered page;
and if the current state of the user is the login unsuccessful state, switching the currently displayed whole page into a user login page.
Further, when executed by the processor, the page switching program further implements the steps of:
receiving a state code and a rendering page returned by the server based on the page switching request;
and executing the step of obtaining the display rule of the rendered page according to the state code and displaying the rendered page according to the display rule.
The present invention also provides a computer-readable storage medium having stored thereon a page switching program, which when executed by a processor implements the steps of the page switching method as described above.
The mobile terminal sends a page switching request triggered by a user to a server, so that the server can verify identity authentication information and state parameters in the page switching request, returns a state code and page data to the mobile terminal according to a verification result, receives the state code and the page data returned by the server based on the page switching request, renders the page data to obtain a rendered page, acquires a display rule of the rendered page according to the state code, and displays the rendered page according to the display rule, the scheme controls the page switching of the mobile terminal through the state code, realizes the replacement and switching of a page area corresponding to the state code in the same page, does not need to refresh the whole page, switches, improves the page switching speed, and simultaneously, performs state verification when triggering the page switching request each time, the real-time performance of page switching can be effectively guaranteed.
Drawings
Fig. 1 is a schematic diagram of an alternative hardware configuration of a mobile terminal implementing various embodiments of the present invention;
FIG. 2 is a diagram of a wireless communication device of the mobile terminal shown in FIG. 1;
FIG. 3 is a flowchart illustrating a page switching method according to a first embodiment of the present invention;
FIG. 4 is a detailed flowchart of the step of displaying the rendered page according to the display rule in FIG. 3;
FIG. 5 is a flowchart illustrating a page switching method according to a second embodiment of the present invention;
FIG. 6 is a flowchart illustrating a page switching method according to a third embodiment of the present invention;
fig. 7 is a flowchart illustrating a page switching method according to a fourth embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: RF (Radio Frequency) unit 101, WiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
The memory 109, as shown in fig. 1, stores a page switching program, which when executed by the processor 110, performs the following steps:
when a page switching request triggered by a user is received, the page switching request is sent to a server side, so that the server side can verify identity authentication information and state parameters in the page switching request, and return a state code and page data to a mobile terminal according to a verification result;
receiving a state code and page data returned by the server based on the page switching request;
performing page rendering on the page data to obtain a rendered page;
and acquiring a display rule of the rendered page according to the status code, and displaying the rendered page according to the display rule.
Further, when executed by the processor 110, the page switching program further implements the following steps:
judging whether the display rule is a first display rule or a second display rule;
if the display rule is a first display rule, switching the whole currently displayed page into the rendering page;
and if the display rule is a second display rule, acquiring a page area to be replaced in the current display page, and replacing the page area to be replaced in the current display page with the rendering page.
Further, when executed by the processor 110, the page switching program further implements the following steps:
judging whether the current state of the user is a login state or not according to the state code;
if the current state of the user is the login state, performing page rendering on the page data to obtain a rendered page;
and if the current state of the user is the login unsuccessful state, switching the currently displayed whole page into a user login page.
Further, when executed by the processor 110, the page switching program further implements the following steps:
receiving a state code and a rendering page returned by the server based on the page switching request;
and executing the step of obtaining the display rule of the rendered page according to the state code and displaying the rendered page according to the display rule.
Based on the hardware structure of the mobile terminal and the structure of the communication device, the page switching method and the page switching device are provided in various embodiments.
The invention provides a page switching method.
Referring to fig. 3, fig. 3 is a flowchart illustrating a page switching method according to a first embodiment of the present invention.
In this embodiment, the page switching method includes:
step S10, when a page switching request triggered by a user is received, the page switching request is sent to a server side, so that the server side can verify the identity authentication information and the state parameters in the page switching request, and return a state code and page data to the mobile terminal according to the verification result;
the page switching method is applied to a mobile terminal, and the mobile terminal comprises a smart phone, a tablet computer and the like. The identity authentication information is stored in a local memory of the mobile terminal, when a user triggers a page switching request, the identity authentication information is read from the local memory, the identity authentication information is path-oriented, and when a default path attribute exists, the server automatically transmits the current path to the mobile terminal. The identity authentication information comprises information such as a life cycle, a user name, terminal equipment identification information, browsed webpages and stay time, and is cleared when the identity authentication information exceeds the life cycle, the life cycle of some pages in the identity authentication information is zero or negative, and the identity authentication information is cleared when quitting. In the concrete implementation, can set up this authentication information can not be read by the script, encrypt authentication information, embed the timestamp before encrypting, guarantee that the ciphertext after encrypting every time is all different, when mobile terminal requests, every time or regularly update authentication information (from new encryption), every time write in the timestamp to authentication information, the database need record last time timestamp, when mobile terminal submits authentication information, decipher earlier, then check up the timestamp, if the timestamp is less than record in the data database, mean to attack promptly, through the above-mentioned processing to authentication information, can effectual improvement authentication information's security.
When a user triggers a page switching request in a mobile terminal, the mobile terminal acquires identity authentication information of a current page and simultaneously acquires state parameters corresponding to the page switching request, namely when the page switching request is triggered, the mobile terminal acquires corresponding state parameters, then writes the state parameters and the identity authentication information into the page switching request, then when the mobile terminal receives the page switching request triggered by the user, the mobile terminal sends the page switching request to a server, the server receives the page switching request sent by the mobile terminal, acquires the identity authentication information and the state parameters in the page switching request, then verifies the identity authentication information and the state parameters, and returns state codes and page data to the mobile terminal according to a verification result, wherein the state parameters and the state codes have a one-to-one correspondence relationship. And the mobile terminal and the server carry out data interaction according to the appointed network interface to realize data synchronization.
In the specific implementation, after the server obtains the state code corresponding to the state parameter, whether the state code is in a preset state code group is judged, if the state code is in the state code group, the server performs page rendering on page data to obtain a rendered page, then the rendered page and the state code are returned to the mobile terminal, and when the mobile terminal simultaneously sends page switching requests to a plurality of servers, each server returns the corresponding rendered page according to the page switching requests.
Step S20, receiving the status code and page data returned by the server based on the page switching request;
step S30, page rendering is carried out on the page data to obtain a rendered page;
the method comprises the steps that a mobile terminal receives page data and state codes returned by a server and performs page rendering on the page data, namely, the page data are analyzed through an HTML analyzer to form a document object model, style information is added to each element object in the document object model through a CSS analyzer to form a CSS object model, a rendering tree composed of a group of objects to be rendered is created according to the document object model and the CSS object model, the same style information of the element objects is integrated, layout information of the element objects is calculated, the element objects are laid out according to the layout information to generate corresponding images, and the generated images are integrated to obtain a rendered page corresponding to the page data.
Step S40, obtaining the display rule of the rendering page according to the status code, and displaying the rendering page according to the display rule.
After the mobile terminal obtains the rendered page through the rendering module 30, the display rule of the rendered page is obtained according to the status code, and the rendered page is displayed according to the display rule, where the display rule includes a first display rule and a second display rule, and the first display rule is a refresh rule of the whole page, and the second display rule is a replacement rule of a part of the page area in one page. Specifically, referring to fig. 4, fig. 4 is a detailed flowchart of step S40 in fig. 3, where the step S40 includes:
step S41, judging whether the display rule is a first display rule or a second display rule;
step S42, if the display rule is the first display rule, switching the whole page displayed currently to the rendering page;
step S43, if the display rule is the second display rule, acquiring a page area to be replaced in the current display page, and replacing the page area to be replaced in the current display page with the rendered page.
The mobile terminal judges whether the display rule is a first display rule or a second display rule, if the display rule is the first display rule (the refresh rule of the whole page), the whole page currently displayed by the mobile terminal is switched to the rendering page, and if the display rule is the second display rule (the replacement rule of a part of page areas in the page), the page area to be replaced in the current display page is replaced by the rendering page.
In specific implementation, when a plurality of generated rendering pages exist, the to-be-replaced page area of each rendering page is acquired, and then each to-be-replaced page area is replaced by the corresponding rendering page. In another specific implementation, when the mobile terminal sends a page switching request to multiple servers at the same time, each server returns page data according to the page switching request, the mobile terminal caches the page data returned by each server, the mobile terminal receives and caches the page data returned by each server, then integrates the cached page data, and performs page rendering on the integrated page data to obtain a rendered page corresponding to the integrated page data, so that the rendered page is displayed, page rendering is performed on the mobile terminal, the load of the server is reduced, and data integration of the mobile terminal is facilitated. Naturally, a plurality of server sides also exist for sending rendering pages corresponding to the routing request to the mobile terminal, at this time, the mobile terminal receives and caches the rendering pages, and then the rendering pages are displayed according to the display rule of each rendering page.
In this embodiment, the mobile terminal of the present invention sends a page switch request triggered by a user to a server, so that the server checks the identity authentication information and status parameters in the page switch request, returns a status code and page data to the mobile terminal according to the check result, receives the status code and page data returned by the server based on the page switch request, renders the page data to obtain a rendered page, obtains a display rule of the rendered page according to the status code, and displays the rendered page according to the display rule, and the mobile terminal controls the page switch by the status code, so as to replace and switch a page area corresponding to the status code in the same page, without refreshing the whole page, perform the switch, improve the page switch speed, and when the page switch request is triggered each time, the state is checked, and the real-time performance of page switching can be effectively guaranteed.
Further, referring to fig. 5, a second embodiment of the page switching method according to the present invention is proposed based on the first embodiment, and the difference from the foregoing embodiment is that the step S30 is preceded by:
step S50, judging whether the current state of the user is the login state according to the state code;
if the current state of the user is the login state, executing step S30, namely, performing page rendering on the page data to obtain a rendered page;
in step S60, if the current state of the user is the login state, the currently displayed entire page is switched to the user login page.
After receiving the state code and the page data sent by the server, the mobile terminal judges whether the current state of the user is a login state according to the state code, if the current state of the user is the login state, the page data is subjected to page rendering to obtain a rendered page, a display rule of the rendered page is obtained according to the state code, then the rendered page is correspondingly displayed according to the display rule, and if the current state of the user is a login unsuccessful state, the mobile terminal is controlled to switch the current displayed page to a user login interface.
In specific implementation, if the current user state is the login state, whether the current user state is the verified login state is further judged, namely, user login verification is performed through a reserved mobile phone number or a mailbox, if the current user state is the verified login state, page rendering is performed on page data to obtain a rendered page, and if the current user state is the unverified login state, the mobile terminal is controlled to switch the current displayed page into a user login verification page, so that login verification of a user is facilitated.
In the embodiment, whether the user is in the login state or not is verified, so that corresponding operation can be executed in the login state, and the information security is improved.
Further, referring to fig. 6, a third embodiment of the page switching method of the present invention is proposed based on the first or second embodiment, and the difference from the previous embodiment is that the step S20 includes:
step S21, receiving the state code and the rendering page returned by the server based on the page switching request;
and step S40 is executed, namely, the display rule of the rendered page is obtained according to the status code, and the rendered page is displayed according to the display rule.
The method comprises the steps that when a mobile terminal receives a page switching request triggered by a user, the page switching request is transmitted to a server through a network interface, the server receives the page switching request transmitted by the mobile terminal, obtains a page URL address in the page switching request, returns a state code and a rendering page to the mobile terminal according to the page switching request when the page URL address is in a preset URL address group, the mobile terminal receives the state code and the rendering page returned by the server based on the page switching request, obtains a display rule of the rendering page according to the state code, and displays the rendering page according to the display rule.
According to the invention, the dynamic switching between the rendering of the server side and the rendering of the mobile terminal is realized by combining the rendering of the page of the server side and the rendering of the page of the mobile terminal, so that the rendering efficiency can be effectively improved, and the waiting time of a user is reduced.
Further, referring to fig. 7, a fourth embodiment of the page switching method of the present invention is proposed based on the first, second or third embodiment, and is different from the previous embodiments in that before step S40, the page switching method further includes:
step S70, determining whether the status code is the same as the status code of the status parameter;
if the status code is the same as the status code of the status parameter, executing step S40, namely obtaining a display rule of the rendered page according to the status code, and displaying the rendered page according to the display rule;
step S80, if the status code is different from the status code of the status parameter, acquiring a preset display rule, and displaying the rendered page according to the preset display rule.
When the mobile terminal receives the status code returned by the server, the second determining module 60 determines whether the status code is the same as the status code of the status parameter, if the status code is the same as the status code of the status parameter, the display rule of the rendered page is obtained according to the status code, the rendered page is displayed according to the display rule, and if the status code is not the same as the status code of the status parameter, the preset display rule is obtained, and the rendered page is displayed according to the preset display rule.
In this embodiment, the method and the device for switching the rendering pages can effectively verify the accuracy of the state codes through checking the state codes, facilitate the mobile terminal to accurately switch the pages, and simultaneously can switch the rendering pages according to the preset display rule when the state codes are wrong.
The present invention also provides a mobile terminal, comprising: a memory, a processor, and a page switching program stored on the memory and executable on the processor, the page switching program when executed by the processor implementing the steps of:
when a page switching request triggered by a user is received, the page switching request is sent to a server side, so that the server side can verify identity authentication information and state parameters in the page switching request, and return a state code and page data to a mobile terminal according to a verification result;
receiving a state code and page data returned by the server based on the page switching request;
performing page rendering on the page data to obtain a rendered page;
and acquiring a display rule of the rendered page according to the status code, and displaying the rendered page according to the display rule.
Further, when executed by the processor, the page switching program further implements the steps of:
judging whether the display rule is a first display rule or a second display rule;
if the display rule is a first display rule, switching the whole currently displayed page into the rendering page;
and if the display rule is a second display rule, acquiring a page area to be replaced in the current display page, and replacing the page area to be replaced in the current display page with the rendering page.
Further, when executed by the processor, the page switching program further implements the steps of:
judging whether the current state of the user is a login state or not according to the state code;
if the current state of the user is the login state, performing page rendering on the page data to obtain a rendered page;
and if the current state of the user is the login unsuccessful state, switching the currently displayed whole page into a user login page.
Further, when executed by the processor, the page switching program further implements the steps of:
receiving a state code and a rendering page returned by the server based on the page switching request;
and executing the step of obtaining the display rule of the rendered page according to the state code and displaying the rendered page according to the display rule.
The specific embodiment of the mobile terminal of the present invention is basically the same as the embodiment of the page switching method, and is not described herein again.
The present invention also provides a computer-readable storage medium having stored thereon a page switching program, which when executed by a processor implements the steps of the page switching method as described above.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the embodiment of the page switching method, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A page switching method is characterized in that the page switching method is applied to a mobile terminal, and comprises the following steps:
when a page switching request triggered by a user is received, the page switching request is sent to a server side, so that the server side can verify encrypted identity authentication information and state parameters in the page switching request, and return a state code and page data to a mobile terminal according to a verification result, wherein the state parameters and the state code have a one-to-one correspondence relationship;
receiving a state code and page data returned by the server based on the page switching request;
performing page rendering on the page data to obtain a rendered page;
acquiring a display rule of the rendered page according to the status code, and displaying the rendered page according to the display rule;
the step of obtaining a display rule of the rendered page according to the status code and displaying the rendered page according to the display rule includes:
judging whether the state code is the same as the state code of the state parameter or not;
if the state code is the same as the state code of the state parameter, acquiring a display rule of the rendered page according to the state code, and displaying the rendered page according to the display rule;
and if the state code is different from the state code of the state parameter, acquiring a preset display rule, and displaying the rendered page according to the preset display rule.
2. The page switching method according to claim 1, wherein the step of displaying the rendered page according to the display rule comprises:
judging whether the display rule is a first display rule or a second display rule;
if the display rule is a first display rule, switching the whole currently displayed page into the rendering page;
and if the display rule is a second display rule, acquiring a page area to be replaced in the current display page, and replacing the page area to be replaced in the current display page with the rendering page.
3. The page switching method according to claim 1, wherein before the step of performing page rendering on the page data to obtain a rendered page, the page switching method further comprises:
judging whether the current state of the user is a login state or not according to the state code;
if the current state of the user is the login state, performing page rendering on the page data to obtain a rendered page;
and if the current state of the user is the login unsuccessful state, switching the currently displayed whole page into a user login page.
4. The page switching method according to claim 1, wherein the server obtains a page URL address in the page switching request when receiving the page switching request sent by the mobile terminal, and returns a status code and a rendered page to the mobile terminal according to the page switching request when the page URL address is in a preset URL address group, and the step of receiving the status code and page data returned by the server based on the page switching request includes:
receiving a state code and a rendering page returned by the server based on the page switching request;
and executing the step of obtaining the display rule of the rendered page according to the state code and displaying the rendered page according to the display rule.
5. A mobile terminal, characterized in that the mobile terminal comprises: a memory, a processor, and a page switching program stored on the memory and executable on the processor, the page switching program when executed by the processor implementing the steps of:
when a page switching request triggered by a user is received, the page switching request is sent to a server side, so that the server side can verify encrypted identity authentication information and state parameters in the page switching request, and return a state code and page data to a mobile terminal according to a verification result, wherein the state parameters and the state code have a one-to-one correspondence relationship;
receiving a state code and page data returned by the server based on the page switching request;
performing page rendering on the page data to obtain a rendered page;
acquiring a display rule of the rendered page according to the status code, and displaying the rendered page according to the display rule;
the step of obtaining a display rule of the rendered page according to the status code and displaying the rendered page according to the display rule includes:
judging whether the state code is the same as the state code of the state parameter or not;
if the state code is the same as the state code of the state parameter, acquiring a display rule of the rendered page according to the state code, and displaying the rendered page according to the display rule;
and if the state code is different from the state code of the state parameter, acquiring a preset display rule, and displaying the rendered page according to the preset display rule.
6. The mobile terminal of claim 5, wherein the page switching program, when executed by the processor, further performs the steps of:
judging whether the display rule is a first display rule or a second display rule;
if the display rule is a first display rule, switching the whole currently displayed page into the rendering page;
and if the display rule is a second display rule, acquiring a page area to be replaced in the current display page, and replacing the page area to be replaced in the current display page with the rendering page.
7. The mobile terminal of claim 5, wherein the page switching program, when executed by the processor, further performs the steps of:
judging whether the current state of the user is a login state or not according to the state code;
if the current state of the user is the login state, performing page rendering on the page data to obtain a rendered page;
and if the current state of the user is the login unsuccessful state, switching the currently displayed whole page into a user login page.
8. The mobile terminal of claim 5, wherein the page switching program, when executed by the processor, further performs the steps of:
receiving a state code and a rendering page returned by the server based on the page switching request;
and executing the step of obtaining the display rule of the rendered page according to the state code and displaying the rendered page according to the display rule.
9. A computer-readable storage medium, having stored thereon a page switching program which, when executed by a processor, implements the steps of the page switching method of any one of claims 1 to 4.
CN201710286581.3A 2017-04-25 2017-04-25 Page switching method, mobile terminal and storage medium Active CN107038245B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710286581.3A CN107038245B (en) 2017-04-25 2017-04-25 Page switching method, mobile terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710286581.3A CN107038245B (en) 2017-04-25 2017-04-25 Page switching method, mobile terminal and storage medium

Publications (2)

Publication Number Publication Date
CN107038245A CN107038245A (en) 2017-08-11
CN107038245B true CN107038245B (en) 2020-12-11

Family

ID=59535258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710286581.3A Active CN107038245B (en) 2017-04-25 2017-04-25 Page switching method, mobile terminal and storage medium

Country Status (1)

Country Link
CN (1) CN107038245B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362766B (en) * 2018-04-02 2023-05-12 腾讯科技(深圳)有限公司 Page display control method and terminal
CN108882232B (en) * 2018-06-26 2021-11-12 北方工业大学 Authentication code embedded message transmission method between Internet of things devices
CN111831942A (en) * 2019-04-15 2020-10-27 阿里巴巴集团控股有限公司 Method and device for displaying search results on page and electronic equipment
CN110647698B (en) * 2019-08-12 2022-01-14 视联动力信息技术股份有限公司 Page loading method and device, electronic equipment and readable storage medium
CN110609728A (en) * 2019-09-25 2019-12-24 北京字节跳动网络技术有限公司 Page generation method and device and electronic equipment
CN111752968B (en) * 2020-06-12 2021-11-23 支付宝(杭州)信息技术有限公司 Identity file processing method, device, equipment and storage medium
CN113312163B (en) * 2021-06-10 2022-07-29 腾讯数码(深圳)有限公司 Page switching state monitoring method and device, electronic equipment and storage medium
CN114741149B (en) * 2022-04-15 2024-02-27 北京懿医云科技有限公司 Page switching method and device for single-page application, storage medium and electronic equipment
CN115223727A (en) * 2022-08-10 2022-10-21 润芯微科技(江苏)有限公司 Method and system for rapidly switching health code and travel code
CN115514650A (en) * 2022-09-21 2022-12-23 杭州网易再顾科技有限公司 Bandwidth management method, device, medium and electronic equipment in current limiting scene

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008027049A (en) * 2006-07-19 2008-02-07 Sony Corp Information processing system, information processor, method, and program
CN105897723A (en) * 2016-05-04 2016-08-24 深圳市永兴元科技有限公司 Method and system for page display processing and server
CN106293311A (en) * 2015-05-26 2017-01-04 阿里巴巴集团控股有限公司 Page display method based on Mobile solution, client, server and platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7266550B2 (en) * 2004-01-29 2007-09-04 Sap Aktiengesellschaft Managing application status information for a computer application

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008027049A (en) * 2006-07-19 2008-02-07 Sony Corp Information processing system, information processor, method, and program
CN106293311A (en) * 2015-05-26 2017-01-04 阿里巴巴集团控股有限公司 Page display method based on Mobile solution, client, server and platform
CN105897723A (en) * 2016-05-04 2016-08-24 深圳市永兴元科技有限公司 Method and system for page display processing and server

Also Published As

Publication number Publication date
CN107038245A (en) 2017-08-11

Similar Documents

Publication Publication Date Title
CN107038245B (en) Page switching method, mobile terminal and storage medium
CN108572764B (en) Character input control method and device and computer readable storage medium
CN112799577B (en) Method, terminal and storage medium for projecting small window
CN107040543B (en) Single sign-on method, terminal and storage medium
CN110180181B (en) Method and device for capturing wonderful moment video and computer readable storage medium
CN107862217B (en) Position information acquisition method, mobile terminal and computer storage medium
CN109040808B (en) Video interaction regulation and control method, device and computer readable storage medium
CN107172605B (en) Emergency call method, mobile terminal and computer readable storage medium
CN107124466B (en) Method and device for preventing cache from penetrating and computer readable storage medium
CN111190559A (en) Screen projection control synchronization method, mobile terminal and computer readable storage medium
CN108040116B (en) Message pushing method, router and computer readable storage medium
CN107239208B (en) Method, apparatus, and computer-readable storage medium for processing screenshot
CN112437472B (en) Network switching method, equipment and computer readable storage medium
CN112866685A (en) Screen projection delay measuring method, mobile terminal and computer readable storage medium
CN112423211A (en) Multi-audio transmission control method, equipment and computer readable storage medium
CN111970738A (en) Network switching control method, equipment and computer readable storage medium
CN108183833B (en) Response processing method and device and computer readable storage medium
CN109818967B (en) Notification method, server, mobile terminal and computer readable storage medium
CN109462829B (en) Call transfer method, device and computer readable storage medium
CN111931155A (en) Verification code input method, verification code input equipment and storage medium
CN107404568B (en) Control switch management method and mobile terminal
CN110955397A (en) Method for setting frame rate of game terminal, game terminal and storage medium
CN107678622B (en) Application icon display method, terminal and storage medium
CN112333326B (en) Screen projection display control method and device and computer readable storage medium
CN109495948B (en) Communication connection method, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20201124

Address after: Unit 04, 5 / F, building 24, Tengfei Innovation Park, 388 Xinping street, Suzhou Industrial Park, Jiangsu Province

Applicant after: Granularity innovation technology (Suzhou) Co., Ltd

Address before: 518057 Guangdong Province, Shenzhen high tech Zone of Nanshan District City, No. 9018 North Central Avenue's innovation building A, 6-8 layer, 10-11 layer, B layer, C District 6-10 District 6 floor

Applicant before: NUBIA TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant