CN117435827A - Page switching method and device, electronic equipment and storage medium - Google Patents

Page switching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117435827A
CN117435827A CN202311243503.7A CN202311243503A CN117435827A CN 117435827 A CN117435827 A CN 117435827A CN 202311243503 A CN202311243503 A CN 202311243503A CN 117435827 A CN117435827 A CN 117435827A
Authority
CN
China
Prior art keywords
page
switching
mode
page switching
determining
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.)
Pending
Application number
CN202311243503.7A
Other languages
Chinese (zh)
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.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information 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 Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202311243503.7A priority Critical patent/CN117435827A/en
Publication of CN117435827A publication Critical patent/CN117435827A/en
Pending legal-status Critical Current

Links

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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure provides a page switching method, a page switching device, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving a page switching instruction sent by a client of an application program, wherein the page switching instruction comprises: and determining a page switching mode according to the page uniform resource locator and the page routing parameter of the target page, wherein the page switching mode is used for switching the client from the current page to the target page and indicating the page switching mode to the client. According to the method and the device for automatically judging the page jump function, a unified page jump method can be set, the page jump function used by the target page is automatically judged according to the page route parameters, a proper page switching mode is selected for the internal page and the external page of the application program, the page route jump is not required to be carried out in the route hook, the route failure is effectively avoided, and the successful jump of the single page application page is ensured.

Description

Page switching method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a page switching method, a page switching device, electronic equipment and a storage medium.
Background
Currently, the construction mode of browser application is generally divided into a single application program and a multi-application program, wherein the single application program does not generate new page creation when the route is changed, a user does not feel, and page experience is superior to that of the multi-application program and is widely applied.
In the related art, a page switching method of a single application program generally adopts a routing hook built in an application project framework to realize page switching.
In this way, when the application item relates to the page switching of the external address, the routing switching method of the built-in routing hook is invalid, the page cannot be loaded, a part of life cycle functions are set in the built-in routing switching method, and certain operations of a developer in the life cycle functions may lead to the route invalidation during the page switching, so that the page switching failure is caused.
Disclosure of Invention
The present disclosure aims to solve, at least to some extent, one of the technical problems in the related art.
To this end, the present disclosure aims to propose a page switching method, an apparatus, an electronic device, a storage medium and a computer program product.
An embodiment of a first aspect of the present disclosure provides a page switching method, which is executed by a server of an application program, and the method includes: receiving a page switching instruction sent by a client of an application program, wherein the page switching instruction comprises: a page uniform resource locator and a page routing parameter of the target page; determining a page switching mode according to the page uniform resource locator and the page routing parameter, wherein the page switching mode is used for switching a client from a current page to a target page; and indicating the page switching mode to the client.
An embodiment of a second aspect of the present disclosure provides a page switching method, which is executed by a client of an application program, the method including: sending a page switching instruction to a server side of an application program, wherein the page switching instruction comprises: the method comprises the steps that a page uniform resource locator and a page routing parameter of a target page are used for determining a page switching mode by a server; receiving a page switching mode indicated by a server; and switching the current page to the target page according to the page switching mode.
An embodiment of a third aspect of the present disclosure provides a page switching device, executed by a server of an application, where the device includes: the first receiving module is configured to receive a page switching instruction sent by a client of an application program, where the page switching instruction includes: a page uniform resource locator and a page routing parameter of the target page; the determining module is used for determining a page switching mode according to the page uniform resource locator and the page routing parameter, wherein the page switching mode is used for switching the client from the current page to the target page; and the first processing module is used for indicating the page switching mode to the client.
An embodiment of a fourth aspect of the present disclosure provides a page switching apparatus, executed by a client of an application, the apparatus including: the sending module is used for sending a page switching instruction to the server side of the application program, wherein the page switching instruction comprises: the method comprises the steps that a page uniform resource locator and a page routing parameter of a target page are used for determining a page switching mode by a server; the second receiving module is used for receiving the page switching mode indicated by the server; and the second processing module is used for switching the current page to the target page according to the page switching mode.
An embodiment of a fifth aspect of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor executes the program to implement a page switching method as set forth in an embodiment of the first aspect of the present disclosure, or implement a page switching method as set forth in an embodiment of the second aspect of the present disclosure.
An embodiment of a sixth aspect of the present disclosure proposes a non-transitory computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements a page switching method as proposed by an embodiment of the first aspect of the present disclosure, or implements a page switching method as proposed by an embodiment of the second aspect of the present disclosure.
An embodiment of a seventh aspect of the present disclosure proposes a computer program product which, when executed by a processor, performs a page switching method as proposed by an embodiment of the first aspect of the present disclosure, or performs a page switching method as proposed by an embodiment of the second aspect of the present disclosure.
The page switching method, device, electronic equipment, storage medium and computer program product provided in the embodiments of the present disclosure receive a page switching instruction sent by a client of an application program, where the page switching instruction includes: the method comprises the steps that a page uniform resource locator and page routing parameters of a target page are determined according to the page uniform resource locator and the page routing parameters, the page switching mode is used for switching a client from a current page to the target page, the page switching mode is indicated to the client, a unified page jump method can be set, a page jump function used by the target page is automatically judged according to the page routing parameters, a proper page switching mode is selected for an internal page and an external page of an application program, page route jump in a routing hook is not needed, route invalidation is effectively avoided, and successful jump of a single page application page is ensured.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart illustrating a page switching method according to an embodiment of the disclosure;
FIG. 2 is a flow chart illustrating selection of a page jump method in an embodiment of the disclosure;
FIG. 3 is a flow chart illustrating a page switching method according to another embodiment of the present disclosure;
FIG. 4 is a flow chart illustrating a page switching method according to another embodiment of the present disclosure;
FIG. 5 is a flow chart illustrating a page switching method according to another embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a page switching apparatus according to an embodiment of the disclosure;
fig. 7 is a schematic structural diagram of a page switching apparatus according to another embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a page switching apparatus according to another embodiment of the present disclosure;
fig. 9 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for explaining the present disclosure and are not to be construed as limiting the present disclosure. On the contrary, the embodiments of the disclosure include all alternatives, modifications, and equivalents as may be included within the spirit and scope of the appended claims.
Fig. 1 is a flowchart of a page switching method according to an embodiment of the disclosure.
It should be noted that, the main execution body of the page switching method in this embodiment is a page switching device, and the device may be implemented in software and/or hardware, and the device may be configured in an electronic device, which is not limited thereto.
As shown in fig. 1, the page switching method is executed by a server of an application program, and includes:
the server of the application program refers to a background operation end for processing page processing logic of the application program.
S101: receiving a page switching instruction sent by a client of an application program, wherein the page switching instruction comprises: the page uniform resource locator and the page routing parameters of the target page.
The page switching instruction is an instruction for triggering to perform page switching jump, and when the page switching instruction can be clicked by a client, the client is triggered to send to a server, and the page switching instruction comprises: the page uniform resource locator and the page routing parameters of the target page.
The target page refers to a page to be switched to by the client through page switching processing of the application program, the target page is provided with a corresponding page uniform resource locator (Uniform Resource Locator, URL), and the page uniform resource locator refers to an address of a standard resource on the Internet, which can be used for identifying a position of a target webpage acquisition resource and an access method.
The page routing parameter refers to a data parameter that can be used to participate in determining a page switching method of a client, and the page routing parameter can be used, for example, to determine a page jump triggering mode built in an application program, and can also be used to determine a page jump function encapsulated in the application program, or the page routing parameter can also be used for any purpose related to determining the page switching method, which is not limited.
In the implementation of the disclosure, when the client is triggered to switch the page skip, for example, a user clicks a page skip button in an application program, the client may obtain a page uniform resource locator of a target page, obtain a data parameter that may be used to participate in determining a page switching method of the client as a page routing parameter, generate a page skip instruction according to the page uniform resource locator and the page routing parameter, send the page skip instruction to a server of the application program, and receive the page switching instruction sent by the client of the application program by the server.
S102: and determining a page switching mode according to the page uniform resource locator and the page routing parameter, wherein the page switching mode is used for switching the client from the current page to the target page.
The current page refers to a page before the client triggers page skip switching.
The page switching mode refers to a page jump mode that a client switches from a current page to a target page, and the page switching mode can be, for example, various page jump functions encapsulated in an application program.
After receiving the page switching instruction sent by the client of the application program, the embodiment of the disclosure can determine the page switching mode according to the page uniform resource locator and the page routing parameter.
In the embodiment of the disclosure, when determining a page switching manner according to a page uniform resource locator and a page routing parameter, the page routing parameter may be first analyzed to determine whether the current page switching jump operation has a routing hook interception operation in an application program building frame, if the current page switching jump operation has a routing hook interception operation in an application program building frame, the service logic determination processing may be performed on a target page in the routing hook, the adjustment processing may be performed on the page routing parameter and the page uniform resource locator of the target page according to the service logic determination result, then the subsequent page switching method selection processing may be performed, if the current page switching jump operation does not have the routing hook interception operation in the application program building frame, then the subsequent page switching method selection processing may be directly performed, and then the page jump function used in the building frame of the target page may be determined according to the processed page routing parameter, and whether the target page is an internal link or an external link of the application program may be determined according to the page resource locator, and the source of different page jump functions and different page switching manners may be agreed.
For example, as shown in fig. 2, fig. 2 is a flow chart of selecting a page skip method in the embodiment of the present disclosure, when a user performs an operation on a client to trigger a skip page related logic, the client may send a page skip instruction to a server, the server obtains a page uniform resource locator and a page routing parameter in the page skip instruction, determines whether the target page uses a push method or a replace method according to service logic of the target page in the page routing parameter, if the skip uses the push method, determines whether the page uniform resource locator of the target page to be skipped is an internal link or an external link of an application, uses an application frame built-in method for internal links of the application to skip, and uses a cache.
S103: and indicating the page switching mode to the client.
According to the embodiment of the disclosure, after the page switching mode is determined according to the page uniform resource locator and the page routing parameter in the page switching instruction and the page switching instruction sent by the client of the application program, the server indicates the page switching mode to the client, so that the server switches from the current page to the target page according to the corresponding page switching mode.
According to the page switching method provided by the embodiment of the disclosure, the web route jump method is further upgraded and packaged to obtain a general page jump method, the page route parameters are used for judging the specific page switching method, the route jump can be carried out on a single page application, so that a unified method can be used for jumping whether an internal page or an external page is used in an application program, a user is only exposed with one method, separation is concerned, development logic and interaction are concerned, no need of paying attention to which method should be used for current logic to jump, operations in a route hook only need to be subjected to logic judgment for projects built by using vue and a reaction frame, and operations related to the route jump are processed by the packaged function method, thereby effectively avoiding confusion in use in the development process and influence caused by routing hops when the frame is used for development.
In this embodiment, a page switching instruction sent by a client of an application program is received, where the page switching instruction includes: the method comprises the steps that a page uniform resource locator and page routing parameters of a target page are determined according to the page uniform resource locator and the page routing parameters, the page switching mode is used for switching a client from a current page to the target page, the page switching mode is indicated to the client, a unified page jump method can be set, a page jump function used by the target page is automatically judged according to the page routing parameters, a proper page switching mode is selected for an internal page and an external page of an application program, page route jump in a routing hook is not needed, route invalidation is effectively avoided, and successful jump of a single page application page is ensured.
Fig. 3 is a flowchart of a page switching method according to another embodiment of the disclosure.
As shown in fig. 3, the page switching method is executed by a server of an application program, and includes:
s301: receiving a page switching instruction sent by a client of an application program, wherein the page switching instruction comprises: the page uniform resource locator and the page routing parameters of the target page.
The specific description of S301 may be reasonable with reference to the foregoing, and will not be repeated here.
S302: and analyzing the page routing parameters to determine a switching triggering mode for triggering switching from the current page to the target page.
The switching triggering mode refers to a triggering mode for triggering occurrence of page switching, and the switching triggering mode may include, for example, page switching triggered based on a routing hook and page switching triggered by a non-routing hook.
In the implementation of the disclosure, the page routing parameter may be used to determine a switching triggering manner of triggering switching from a current page to a target page, and the page routing parameter may be analyzed to obtain whether a routing hook exists in a program frame of the target page indicated by the page routing parameter, if the routing hook exists in the program frame of the target page, the switching triggering manner is based on the page switching triggered by the routing hook, and if the routing hook does not exist in the program frame of the target page, the page switching triggered by the non-routing hook is indicated by the routing hook.
S303: and determining reference route information according to the switching triggering mode and the page route parameter, wherein the reference route information is used for determining the page switching mode.
The reference routing information refers to routing parameter information obtained after service logic judgment processing is performed on the page routing parameter, and the reference routing information can be used for determining a page switching mode.
In the embodiment of the disclosure, when determining the reference routing information according to the switching trigger mode and the page routing parameter, whether the page routing parameter needs to be adjusted or not may be determined according to the switching trigger mode, if the switching trigger mode is triggering the page based on the routing hook, in the routing hook, the content of a part of parameters to be adjusted in the page routing parameter is adjusted based on the page processing logic of the target page, and the adjusted page routing parameter is used as the reference routing information.
Optionally, in some embodiments, the reference route information is determined according to the switching trigger mode and the page route parameter, if the switching trigger mode is based on the route hook to trigger the page switching, the page route parameter is adjusted according to the page processing logic information of the target page to obtain the reference route information, if the switching trigger mode is not based on the route hook to trigger the page switching, the page route parameter is used as the reference route information, so that when the route hook interception exists in the page jump, the service logic judgment processing is performed in the route hook, and the page route judgment jump is not performed in the route hook, so that the page jump is prevented from being influenced by the life cycle function in the route hook, and the page jump success rate is effectively improved.
In the embodiment of the disclosure, when determining the reference route information according to the switch trigger mode and the page route parameter, the switch trigger mode may be judged first, if the page route parameter indicates that there is a route hook interception during the page switch jump, it indicates that the switch trigger mode is based on the route hook to trigger the page switch, the page route parameter may be adjusted according to the page processing logic information of the target page, a part of resource indication fields in the page route information may be adjusted according to the page processing logic information, a part of parameters may be added or deleted in the page route parameter, and the adjusted page route parameter may be used as the reference route information.
S304: and determining a page switching mode according to the reference route information and the page uniform resource locator.
According to the embodiment of the disclosure, the reference route information is determined according to the switching trigger mode and the page route parameter, wherein the reference route information is used for determining the page switching mode, and the page switching mode can be determined according to the reference route information and the page uniform resource locator.
In the embodiment of the disclosure, when determining the page switching mode according to the reference routing information and the page uniform resource locator, a page jump function used in a program frame of the target page may be determined according to the reference routing information, and a page source of the target page may be determined according to the page uniform resource locator, where the page source is used to indicate that the target page is an internal page of an application program or indicates that the target page is an external page from other application programs, and then a page switching method usable in the program frame may be selected according to the page jump function and the page source of the target page.
Optionally, in some embodiments, when determining the page switching mode according to the reference routing information and the page uniform resource locator, the page source type of the target page may be determined according to the page uniform resource locator, and the page switching mode may be determined according to the reference routing information and the page source type.
The page source type refers to an internal page that can be used to indicate that a target page is an application program, or an external page from other application programs.
In the embodiment of the disclosure, when determining the page source type of the target page according to the page uniform resource locator, whether the page link of the target page is an internal link of the application function program or not may be determined according to the page type field in the page uniform resource locator, so as to obtain a corresponding determination result, so as to obtain the page source type of the target page, then the page switching mode may be determined according to the reference route information and the page source type, the page jump function used in the program frame of the target page may be determined according to the reference route information, and then the page switching mode packaged under the page jump function corresponds to the page jump function is selected as the page switching mode corresponding to the target page according to the page source type.
S305: and indicating the page switching mode to the client.
The specific description of S305 may be referred to the above embodiments, and will not be repeated here.
In this embodiment, a page switching instruction sent by a client of an application program is received, where the page switching instruction includes: the method comprises the steps that a page uniform resource locator and page route parameters of a target page are determined according to the page uniform resource locator and the page route parameters, the page switch mode is used for a client to switch from a current page to the target page, the page switch mode is indicated to the client, a unified page jump method can be set, a page jump function used by the target page is automatically judged according to the page route parameters, a proper page switch mode is selected for an internal page and an external page of an application program, page route jump is not needed in a route hook, route failure is effectively avoided, successful jump of a single page application page is guaranteed, the page route parameters are adjusted according to page processing logic information of the target page when the page switch trigger mode is based on the route hook to trigger the page switch, and the page route parameters are used as reference route information when the page switch trigger mode is not based on the route hook to trigger the page switch, so that business logic judgment processing is carried out in the route hook when the page jump is intercepted, the page route jump hook is not carried out, the page route judgment jump is carried out in the route hook, the life cycle of the page jump function is effectively prevented from being influenced by the page jump hook.
Fig. 4 is a flowchart of a page switching method according to another embodiment of the disclosure.
As shown in fig. 4, the page switching method is executed by a server of an application program, and includes:
s401: receiving a page switching instruction sent by a client of an application program, wherein the page switching instruction comprises: the page uniform resource locator and the page routing parameters of the target page.
S402: and analyzing the page routing parameters to determine a switching triggering mode for triggering switching from the current page to the target page.
S403: and determining reference route information according to the switching triggering mode and the page route parameter, wherein the reference route information is used for determining the page switching mode.
S404: and determining the page source type of the target page according to the page uniform resource locator.
The specific description of S401 and S404 may be referred to the above embodiments, and will not be repeated here.
S405: and determining a page switching type corresponding to the target page according to the reference routing information, wherein the page switching type is used for determining whether a page switching mode supports storing a current page link of the current page.
The page switching type refers to a type of a page jump function used in a program framework of a target page, and the page switching type can be used for determining whether a page switching mode supports storing a current page link of a current page.
In the embodiment of the disclosure, when determining the page switching type corresponding to the target page according to the reference routing information, the reference routing information may be analyzed to obtain the page jump function type used by the target page indicated by the partial parameter in the reference routing information, where the page jump function may include a push function and a replace function.
S406: and determining a page switching mode according to the page switching type and the page source type.
In the embodiment of the disclosure, when determining the page switching mode according to the page switching type and the page source type, if the page source type is an internal page, a page jump method for an internal page package in different page switching types is used as the page switching mode, and if the page source is an external page, a page jump method for an external page package in different page switching types is used as the page switching mode.
Optionally, in some embodiments, when determining the page switching manner according to the page switching type and the page source type, if the page switching type is a first page switching type and the page source type is an internal page of the application program, determining the page switching manner to be a first page switching manner, if the page switching type is a second page switching type and the page source type is an internal page of the application program, determining the page switching manner to be a second page switching manner, wherein the first page switching type is different from the second page switching type, if the page switching type is the first page switching type and the page source type is an external page of the application program, determining the page switching manner to be a third page switching manner, and if the page switching type is the second page switching type and the page source type is an external page of the application program, determining the page switching manner to be a fourth page switching manner, wherein the first page switching manner, the second page switching manner, the third page switching manner and the fourth page switching manner are different.
The first page switching type refers to a page switching type using a push page jump function.
The second page switching type refers to a page switching type using a replace page jump function.
The first page switching mode refers to an internal page jump method using a push page jump function, and the first page switching mode can be a program framework built-in method history () of a target page.
The second page switching mode refers to an internal page jump method using a replay page jump function, and the second page switching mode may be a frame built-in method history () of the target page.
The third page switching mode refers to an external page jump method using a push page jump function, and the third page switching mode may be window.
The fourth page switching mode refers to an external page jump method using a replace page jump function, and the fourth page switching mode may be window.
In the embodiment of the disclosure, when determining the page switching mode according to the page switching type and the page source type, determining that the page switching mode is a first page switching mode history.push (), if the page switching type is a second page switching mode history.replace (), if the page switching type is a first page switching type and the page source type is an external page of the application, determining that the page switching mode is a third page switching mode window.location.href, and if the page switching type is a second page switching type and the page source type is an external page of the application, determining that the page switching mode is a fourth page switching mode window.history.replace ().
Optionally, in some embodiments, under the first page switching type, the page switching mode supports saving the current page link, and under the second page switching type, the page switching mode does not save the current page link, and by using multiple page skip functions, the page switching mode is enriched, so that the function setting of the application program is more flexible.
In the embodiment of the disclosure, the first page switching type push supports saving the page link before the page switching, and when the page before the page switching needs to be backed down, the second page switching type replace does not support saving the page link before the page switching and does not support backing down to the page before the page switching.
In this embodiment, a page switching instruction sent by a client of an application program is received, where the page switching instruction includes: the method comprises the steps that a page uniform resource locator and page routing parameters of a target page are determined according to the page uniform resource locator and the page routing parameters, the page switching mode is used for switching a client from a current page to the target page, the page switching mode is indicated to the client, a unified page jump method can be set, a page jump function used by the target page is automatically judged according to the page routing parameters, a proper page switching mode is selected for an internal page and an external page of an application program, page routing jump is not needed in a routing hook, route failure is effectively avoided, successful jump of a single page application page is guaranteed, the page switching mode supports to store a current page link under a first page switching type, the page switching mode does not store the current page link under a second page switching type, and the page switching mode is enriched by using various page jump functions, so that function setting of the application program is more flexible.
Fig. 5 is a flowchart of a page switching method according to another embodiment of the disclosure.
As shown in fig. 5, the page switching method, which is executed by the client of the application program, includes:
s501: sending a page switching instruction to a server side of an application program, wherein the page switching instruction comprises: the page uniform resource locator and the page routing parameter of the target page are used for determining a page switching mode by the server.
In the implementation of the disclosure, when a user clicks a page jump button in an application program, a client is triggered to perform page jump switching, at this time, a client can acquire a page uniform resource locator of a target page, acquire data parameters which can be used for participating in determining a page switching method of the client as page routing parameters, generate a page jump instruction according to the page uniform resource locator and the page routing parameters, send the page jump instruction to a server of the application program, and the server receives the page switching instruction sent by the client of the application program.
S502: and receiving a page switching mode indicated by the server.
In the embodiment of the disclosure, a client sends a page switching instruction to a server of an application, the server receives the page switching instruction sent by the client of the application, determines a page switching mode corresponding to a target page according to a page uniform resource locator and a page routing parameter, then indicates the page switching mode to the client,
S503: and switching the current page to the target page according to the page switching mode.
After the above-mentioned page switching instruction is sent to the server of the application program and the page switching mode indicated by the server is received, the embodiment of the disclosure may switch the application program from the current page to the target page according to the page switching mode.
In this embodiment, a page switching instruction is sent to a server of an application program, where the page switching instruction includes: the method comprises the steps that a page uniform resource locator and page routing parameters of a target page are used for determining a page switching mode by a server, the page switching mode indicated by the server is received, the current page is switched to the target page according to the page switching mode, the page hopping function used by the target page can be automatically judged by the server according to the page routing parameters, a proper page hopping mode is selected for an internal page and an external page of an application program, a client hops to the target page from the current page according to the page hopping mode, the page routing hopping in a routing hook is not needed, route invalidation is effectively avoided, and successful hopping of a single page application page is ensured.
Fig. 6 is a schematic structural diagram of a page switching device according to an embodiment of the disclosure.
As shown in fig. 6, the page switching device 60, executed by the server of the application, includes:
the first receiving module 601 is configured to receive a page switching instruction sent by a client of an application program, where the page switching instruction includes: a page uniform resource locator and a page routing parameter of the target page;
the determining module 602 is configured to determine a page switching manner according to the page uniform resource locator and the page routing parameter, where the page switching manner is used for switching the client from the current page to the target page; and
the first processing module 603 is configured to instruct the client to switch the page.
In some embodiments of the present disclosure, as shown in fig. 7, fig. 7 is a schematic structural diagram of a page switching apparatus according to another embodiment of the present disclosure, where the determining module 602 includes:
the parsing submodule 6021 is used for parsing the page routing parameters to determine a switching triggering mode for triggering switching from the current page to the target page;
a first determining submodule 6022, configured to determine reference routing information according to a handover triggering manner and a page routing parameter, where the reference routing information is used to determine a page handover manner;
The second determining submodule 6023 is configured to determine a page switching mode according to the reference routing information and the page uniform resource locator.
In some embodiments of the present disclosure, the first determining submodule 6022 is specifically configured to:
if the switching triggering mode is based on the route hook triggering page switching, adjusting page route parameters according to the page processing logic information of the target page to obtain reference route information;
if the switching triggering mode is not based on the route hook triggering the page switching, the page routing parameter is used as the reference routing information.
In some embodiments of the present disclosure, the second determining submodule 6023 is specifically configured to:
determining the page source type of the target page according to the page uniform resource locator;
and determining a page switching mode according to the reference route information and the page source type.
In some embodiments of the present disclosure, wherein the second determining submodule 6023 is further configured to:
determining a page switching type corresponding to a target page according to the reference routing information, wherein the page switching type is used for determining whether a page switching mode supports storing a current page link of a current page;
and determining a page switching mode according to the page switching type and the page source type.
In some embodiments of the present disclosure, wherein the second determining submodule 6023 is further configured to:
if the page switching type is the first page switching type and the page source type is an internal page of the application program, determining that the page switching mode is the first page switching mode;
if the page switching type is the second page switching type and the page source type is the internal page of the application program, determining that the page switching mode is the second page switching mode, wherein the first page switching type is different from the second page switching type;
if the page switching type is the first page switching type and the page source type is an external page of the application program, determining that the page switching mode is a third page switching mode;
if the page switching type is the second page switching type and the page source type is an external page of the application program, determining that the page switching mode is a fourth page switching mode, wherein the first page switching mode, the second page switching mode, the third page switching mode and the fourth page switching mode are different.
In some embodiments of the present disclosure, the page switch mode supports saving the current page link in the first page switch type and does not save the current page link in the second page switch type.
Corresponding to the above-mentioned page switching method provided by the embodiments of fig. 1 to 4, the present disclosure further provides a page switching device, and since the page switching device provided by the embodiments of the present disclosure corresponds to the page switching method provided by the embodiments of fig. 1 to 4, the implementation of the page switching method is also applicable to the page switching device provided by the embodiments of the present disclosure, and will not be described in detail in the embodiments of the present disclosure.
In this embodiment, a page switching instruction sent by a client of an application program is received, where the page switching instruction includes: the method comprises the steps that a page uniform resource locator and page routing parameters of a target page are determined according to the page uniform resource locator and the page routing parameters, the page switching mode is used for switching a client from a current page to the target page, the page switching mode is indicated to the client, a unified page jump method can be set, a page jump function used by the target page is automatically judged according to the page routing parameters, a proper page switching mode is selected for an internal page and an external page of an application program, page route jump in a routing hook is not needed, route invalidation is effectively avoided, and successful jump of a single page application page is ensured.
Fig. 8 is a schematic structural diagram of a page switching apparatus according to another embodiment of the disclosure.
As shown in fig. 8, the page switching device 80 is executed by a client of an application program, and includes:
a sending module 801, configured to send a page switching instruction to a server of an application program, where the page switching instruction includes: the method comprises the steps that a page uniform resource locator and a page routing parameter of a target page are used for determining a page switching mode by a server;
a second receiving module 802, configured to receive a page switching manner indicated by the server; and
and the second processing module 803 is configured to switch the current page to the target page according to the page switching manner.
Corresponding to the page switching method provided by the embodiment of fig. 5, the present disclosure further provides a page switching device, and since the page switching device provided by the embodiment of the present disclosure corresponds to the page switching method provided by the embodiment of fig. 5, the implementation of the page switching method is also applicable to the page switching device provided by the embodiment of the present disclosure, which is not described in detail in the embodiment of the present disclosure.
In this embodiment, a page switching instruction is sent to a server of an application program, where the page switching instruction includes: the method comprises the steps that a page uniform resource locator and page routing parameters of a target page are used for determining a page switching mode by a server, the page switching mode indicated by the server is received, the current page is switched to the target page according to the page switching mode, the page hopping function used by the target page can be automatically judged by the server according to the page routing parameters, a proper page hopping mode is selected for an internal page and an external page of an application program, a client hops to the target page from the current page according to the page hopping mode, the page routing hopping in a routing hook is not needed, route invalidation is effectively avoided, and successful hopping of a single page application page is ensured.
In order to implement the above-described embodiments, the present disclosure also proposes a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a page switching method as proposed by the foregoing embodiments of the present disclosure.
To achieve the above embodiments, the present disclosure also proposes a computer program product which, when executed by an instruction processor in the computer program product, performs a page switching method as proposed by the foregoing embodiments of the present disclosure.
Fig. 9 illustrates a block diagram of an exemplary electronic device suitable for use in implementing embodiments of the present disclosure.
The electronic device 9 shown in fig. 9 is only an example and should not be construed as limiting the functionality and scope of use of the disclosed embodiments.
As shown in fig. 9, the electronic device 9 is in the form of a general purpose computing device. The components of the electronic device 9 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that connects the various system components, including the memory 28 and the processing unit 16.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include industry Standard architecture (Industry Standard Architecture; hereinafter ISA) bus, micro channel architecture (Micro Channel Architecture; hereinafter MAC) bus, enhanced ISA bus, video electronics standards Association (Video Electronics Standards Association; hereinafter VESA) local bus, and peripheral component interconnect (Peripheral Component Interconnection; hereinafter PCI) bus.
The electronic device 9 typically includes a variety of computer system readable media. Such media can be any available media that can be accessed by the electronic device 9 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (Random Access Memory; hereinafter: RAM) 30 and/or cache memory 32. The electronic device 9 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 9, commonly referred to as a "hard disk drive").
Although not shown in fig. 9, a magnetic disk drive for reading from and writing to a removable nonvolatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable nonvolatile optical disk (e.g., a compact disk read only memory (Compact Disc Read Only Memory; hereinafter CD-ROM), digital versatile read only optical disk (Digital Video Disc Read Only Memory; hereinafter DVD-ROM), or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the various embodiments of the disclosure.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods in the embodiments described in this disclosure.
The electronic device 9 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a person to interact with the electronic device 9, and/or any devices (e.g., network card, modem, etc.) that enable the electronic device 9 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 22. Also, the electronic device 9 may communicate with one or more networks, such as a local area network (Local Area Network; hereinafter: LAN), a wide area network (Wide Area Network; hereinafter: WAN) and/or a public network, such as the Internet, via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 9 via the bus 18. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in connection with the electronic device 9, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and parameter information determination by running a program stored in the memory 28, for example, implementing the page switching method mentioned in the foregoing embodiment.
It should be noted that in the description of the present disclosure, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Furthermore, in the description of the present disclosure, unless otherwise indicated, the meaning of "a plurality" is two or more.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and further implementations are included within the scope of the preferred embodiment of the present disclosure in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present disclosure.
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
Furthermore, each functional unit in the embodiments of the present disclosure may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present disclosure. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present disclosure have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the present disclosure, and that variations, modifications, alternatives, and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the present disclosure.

Claims (19)

1. A method for switching pages, which is executed by a server of an application program, the method comprising:
receiving a page switching instruction sent by a client of the application program, wherein the page switching instruction comprises: a page uniform resource locator and a page routing parameter of the target page;
determining a page switching mode according to the page uniform resource locator and the page routing parameter, wherein the page switching mode is used for switching the client from a current page to the target page; and
and indicating the page switching mode to the client.
2. The method of claim 1, wherein determining a page switch mode based on the page uniform resource locator and the page routing parameter comprises:
analyzing the page routing parameters to determine a switching triggering mode for triggering the switching from the current page to the target page;
Determining reference routing information according to the switching triggering mode and the page routing parameter, wherein the reference routing information is used for determining the page switching mode;
and determining the page switching mode according to the reference routing information and the page uniform resource locator.
3. The method of claim 2, wherein the determining the reference routing information according to the handover triggering manner and the page routing parameter comprises:
if the switching triggering mode is based on the route hook triggering page switching, the page route parameters are adjusted according to the page processing logic information of the target page, and the reference route information is obtained;
and if the switching triggering mode is not based on the route hook triggering page switching, taking the page route parameter as the reference route information.
4. The method of claim 2, wherein the determining the page switch mode based on the reference routing information and the page uniform resource locator comprises:
determining the page source type of the target page according to the page uniform resource locator;
and determining the page switching mode according to the reference routing information and the page source type.
5. The method of claim 4, wherein determining the page switch mode based on the reference routing information and the page source type comprises:
determining a page switching type corresponding to the target page according to the reference route information, wherein the page switching type is used for determining whether the page switching mode supports storing the current page link of the current page;
and determining the page switching mode according to the page switching type and the page source type.
6. The method of claim 5, wherein determining the page switch mode based on the page switch type and the page source type comprises:
if the page switching type is a first page switching type and the page source type is an internal page of the application program, determining that the page switching mode is a first page switching mode;
if the page switching type is a second page switching type and the page source type is an internal page of the application program, determining that the page switching mode is a second page switching mode, wherein the first page switching type is different from the second page switching type;
If the page switching type is a first page switching type and the page source type is an external page of the application program, determining that the page switching mode is a third page switching mode;
if the page switching type is a second page switching type and the page source type is an external page of the application program, determining that the page switching mode is a fourth page switching mode, wherein the first page switching mode, the second page switching mode, the third page switching mode and the fourth page switching mode are different.
7. The method of claim 6, wherein in the first page switch type, the page switch mode supports saving the current page link, and in the second page switch type, the page switch mode does not save the current page link.
8. A method of page switching performed by a client of an application, the method comprising:
sending a page switching instruction to a server side of the application program, wherein the page switching instruction comprises: the method comprises the steps that a page uniform resource locator and a page routing parameter of a target page are used for determining a page switching mode by the server side;
Receiving the page switching mode indicated by the server; and
and switching the current page to the target page according to the page switching mode.
9. A page switching apparatus, for execution by a server of an application program, the apparatus comprising:
the first receiving module is configured to receive a page switching instruction sent by a client of the application program, where the page switching instruction includes: a page uniform resource locator and a page routing parameter of the target page;
the determining module is used for determining a page switching mode according to the page uniform resource locator and the page routing parameter, wherein the page switching mode is used for switching the client from a current page to the target page; and
the first processing module is used for indicating the page switching mode to the client.
10. The apparatus of claim 9, wherein the determination module comprises:
the analysis sub-module is used for analyzing the page routing parameters to determine a switching triggering mode for triggering the switching from the current page to the target page;
the first determining submodule is used for determining reference route information according to the switching triggering mode and the page route parameter, wherein the reference route information is used for determining the page switching mode;
And the second determining submodule is used for determining the page switching mode according to the reference routing information and the page uniform resource locator.
11. The apparatus of claim 10, wherein the first determination submodule is specifically configured to:
if the switching triggering mode is based on the route hook triggering page switching, the page route parameters are adjusted according to the page processing logic information of the target page, and the reference route information is obtained;
and if the switching triggering mode is not based on the route hook triggering page switching, taking the page route parameter as the reference route information.
12. The apparatus of claim 10, wherein the second determination submodule is specifically configured to:
determining the page source type of the target page according to the page uniform resource locator;
and determining the page switching mode according to the reference routing information and the page source type.
13. The apparatus of claim 12, wherein the second determination submodule is further to:
determining a page switching type corresponding to the target page according to the reference route information, wherein the page switching type is used for determining whether the page switching mode supports storing the current page link of the current page;
And determining the page switching mode according to the page switching type and the page source type.
14. The apparatus of claim 13, wherein the second determination submodule is further to:
if the page switching type is a first page switching type and the page source type is an internal page of the application program, determining that the page switching mode is a first page switching mode;
if the page switching type is a second page switching type and the page source type is an internal page of the application program, determining that the page switching mode is a second page switching mode, wherein the first page switching type is different from the second page switching type;
if the page switching type is a first page switching type and the page source type is an external page of the application program, determining that the page switching mode is a third page switching mode;
if the page switching type is a second page switching type and the page source type is an external page of the application program, determining that the page switching mode is a fourth page switching mode, wherein the first page switching mode, the second page switching mode, the third page switching mode and the fourth page switching mode are different.
15. The apparatus of claim 14, wherein in the first page switch type the page switch mode supports saving the current page link, and in the second page switch type the page switch mode does not save the current page link.
16. A page switching apparatus, for execution by a client of an application program, the apparatus comprising:
the sending module is used for sending a page switching instruction to the server side of the application program, wherein the page switching instruction comprises: the method comprises the steps that a page uniform resource locator and a page routing parameter of a target page are used for determining a page switching mode by the server side;
the second receiving module is used for receiving the page switching mode indicated by the server side; and
and the second processing module is used for switching the current page to the target page according to the page switching mode.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the page switching method of any one of claims 1-7 or to perform the page switching method of claim 8.
18. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are for causing the computer to perform the page switching method of any one of claims 1-7, or to perform the page switching method of claim 8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the page switching method according to any one of claims 1-7, or implements the steps of the page switching method according to claim 8.
CN202311243503.7A 2023-09-25 2023-09-25 Page switching method and device, electronic equipment and storage medium Pending CN117435827A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311243503.7A CN117435827A (en) 2023-09-25 2023-09-25 Page switching method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311243503.7A CN117435827A (en) 2023-09-25 2023-09-25 Page switching method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117435827A true CN117435827A (en) 2024-01-23

Family

ID=89545274

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311243503.7A Pending CN117435827A (en) 2023-09-25 2023-09-25 Page switching method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117435827A (en)

Similar Documents

Publication Publication Date Title
EP3493059B1 (en) Application data migration method and device
US8843895B2 (en) Debugger connection
US10298469B2 (en) Automatic asynchronous handoff identification
CN107463500B (en) Debugging method, medium, system and computing device of test script
KR20200070085A (en) Method and apparatus for processing information
US10789111B2 (en) Message oriented middleware with integrated rules engine
CN109101228B (en) Application program execution method and device
CN111880879B (en) Playing method, device, equipment and storage medium of dynamic wallpaper
WO2013182051A1 (en) Software installation method, terminal, system and computer storage medium
CN109783345B (en) Method and system for testing small program performance
CN103914312A (en) Application processing method, application processing device and electronic device
CN111290797A (en) Page switching method, client, server, electronic equipment and system
CN109857537B (en) Background service starting method, device, medium and electronic equipment
US20170034030A1 (en) Monitoring single content page application transitions
US10191844B2 (en) Automatic garbage collection thrashing monitoring
CN111538922A (en) Link skip method, application client, device and storage medium
CN117435827A (en) Page switching method and device, electronic equipment and storage medium
CN115576737B (en) Abnormality detection method, abnormality detection device, electronic device, and storage medium
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
JP2001331342A (en) Method for displaying information processor error and recording medium with error display program recorded thereon
JP2006039763A (en) Guest os debug supporting method and virtual computer manager
CN111611510A (en) Cache clearing method, device and system
US9942361B2 (en) Reporting page composition data
CN112416698A (en) Monitoring system expansion method and device, storage medium and electronic equipment
CN111124795A (en) Application start monitoring method, device and equipment

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