Method, device, and electronic device for displaying search results on a page
Loading script language templates through asynchronous API requests and asynchronous request methods solves the flickering and waiting problems caused by refresh of the search results page, enables efficient display of search results in the expanded page, and improves user experience.
Patent Information
- Application Number
- CN201910298051.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-04-15
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2039-04-15
AI Technical Summary
In the existing technology, the refresh operation of the search results page causes page flickering and waiting time, which affects the user experience.
Generate an expanded page through asynchronous API requests, obtain and render the required data, avoid page refresh, and use asynchronous requests to load script language templates to display search results.
It is realized that the page is not refreshed when displaying tab data in the expanded page, which reduces the waiting time and improves the display effect and user experience of search results.
Smart Images

Figure CN111831942B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a method, device, electronic device, and computer storage medium for displaying search results on a page. Background Art
[0002] In the prior art, after a user searches for an entity, the search results are displayed by simulating tabs on the page, and the page displaying the search results includes multiple tabs. For example, if the search entity is "Nirvana in Fire", the corresponding tabs on the page displaying the search results include "Episode Story", "Main Creator" and "Interlude".
[0003] The problem with this method of displaying search results is that when a user clicks on a tab in the page displaying search results to view the content in the tab, the page displaying search results will initiate a secondary search request and execute an operation to refresh the page displaying search results. During this process, the refresh operation will cause the page to flicker and require a period of time, resulting in poor display of search results. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a solution for displaying search results on a page to solve some or all of the above problems.
[0005] According to a first aspect of an embodiment of the present invention, a method for displaying a page of search results is provided, comprising: generating an asynchronous API request based on search entity information and tab information indicated by an acquired instruction to display an expanded state; obtaining data required for the expanded state page based on the asynchronous API request, and splicing an API of a script language template corresponding to the tab page with the data required for the expanded state page; loading the API of the script language template through an asynchronous request, and rendering the data of the script language template to display the expanded state page of the search results.
[0006] According to a second aspect of an embodiment of the present invention, a method for displaying a search result page is provided, including: receiving an expansion trigger operation for lifting an expanded page entrance in a current page, and generating an expanded display instruction according to the expansion trigger operation; generating an asynchronous API request according to search entity information and tab information corresponding to the expanded display instruction, and obtaining data required for the expanded page through the asynchronous API request; splicing the API of a script language template corresponding to the tab according to the data required for the expanded page, and rendering the data obtained through the API of the script language template to display the expanded page of the search results.
[0007] According to a third aspect of an embodiment of the present invention, there is provided a device for displaying a page of search results, comprising: a generation module, for generating an asynchronous API request according to the search entity information and tab information indicated by an acquired display expanded state instruction; a splicing module, for obtaining data required for the expanded state page according to the asynchronous API request, and splicing the API of the script language template corresponding to the tab page with the data required for the expanded state page; a loading module, for loading the API of the script language template by means of an asynchronous request, and rendering the data of the script language template to display the expanded state page of the search results.
[0008] According to a fourth aspect of an embodiment of the present invention, there is provided a device for displaying a page of search results, comprising: a first receiving module, for receiving an expansion trigger operation for lifting an expanded page entrance in a current page, and generating an expanded state display instruction according to the expansion trigger operation; a data acquisition module, for generating an asynchronous API request according to search entity information and tab page information corresponding to the expanded state display instruction, and obtaining data required for the expanded state page through the asynchronous API request; a rendering and display module, for splicing an API of a script language template corresponding to a tab page according to the data required for the expanded state page, and rendering with the data obtained through the API of the script language template to display the expanded state page of the search results.
[0009] According to a fifth aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, wherein the executable instruction enables the processor to perform an operation corresponding to the method for displaying a page of search results as described in the first aspect or the second aspect.
[0010] According to a sixth aspect of an embodiment of the present invention, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for displaying a page of search results as described in the first aspect or the second aspect is implemented.
[0011] According to the solution for displaying search results on a page provided by an embodiment of the present invention, an expanded page can be lifted through an asynchronous API request, and the expanded page can be used to display search results. The data required for the expanded page and the data of the script language template corresponding to the tab page are obtained through an asynchronous request method. This can achieve the goal of displaying the data of the tab page in the expanded page without refreshing the page, thus avoiding the problems of refreshing the page causing page flickering and the need to wait that exist in the existing search result display method. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0013] Figure 1 A flowchart of a method for displaying search results on a page according to Embodiment 1 of the present invention;
[0014] Figure 2 is a schematic diagram of an expanded page according to Embodiment 1 of the present invention;
[0015] Figure 3 This is a flowchart of a method for displaying search results on a page according to Embodiment 2 of the present invention;
[0016] Figure 4 This is a flowchart of a method for displaying search results on a page according to Embodiment 3 of the present invention;
[0017] Figure 5 This is a flowchart of a method for displaying search results on a page according to Embodiment 4 of the present invention;
[0018] Figure 6 This is a flowchart of a method for displaying search results on a page according to Embodiment 5 of the present invention; Figure 7 This is a structural block diagram of a device for displaying search results on a page according to Embodiment 6 of the present invention;
[0019] Figure 8 This is a structural block diagram of a device for displaying search results on a page according to Embodiment 7 of the present invention;
[0020] Fig. 9 This is a structural block diagram of a device for displaying search results on a page according to Embodiment 8 of the present invention;
[0021] Fig.10 This is a structural block diagram of a device for displaying search results on a page according to Embodiment 9 of the present invention;
[0022] Fig.11 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present invention;
[0023] Fig.12 A schematic diagram of a page displaying search results in a usage scenario;
[0024] Fig.13 Flowchart of the steps for a server to generate data in response to an asynchronous API request in a usage scenario. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field based on the embodiments in the embodiments of the present invention should fall within the scope of protection of the embodiments of the present invention.
[0026] The specific implementation of the embodiment of the present invention is further described below in conjunction with the accompanying drawings of the embodiment of the present invention.
[0027] Embodiment 1
[0028] Reference Figure 1 , showing a flow chart of the steps of a method for displaying a search result page according to Embodiment 1 of the present invention.
[0029] The method for displaying search results on a page in this embodiment includes the following steps:
[0030] Step S102: Generate an asynchronous API request according to the search entity information and tab page information indicated by the acquired display expansion state instruction.
[0031] The display expanded state instruction is used to instruct to search according to the search entity information, and to display the search results through the expanded state page (max state).
[0032] like Figure 2 As shown, the expanded page includes multiple tabs, and different tabs can be used to display different types of search results to achieve classified display of search results, so that users can view search results more conveniently.
[0033] For different search entities, the tabs included in the corresponding expanded page may be different. For example, when the search entity is a person, the tabs included in the expanded page may be "Home", "Works", "Itinerary" and other tabs; when the search entity is a city, the tabs included in the expanded page may be "Attractions", "History" and other tabs.
[0034] In this embodiment, when obtaining the display expansion state instruction, the asynchronous API (interface) request is generated in an appropriate manner according to the search entity information and the tab page information indicated by the display expansion state instruction, so as to call the API through an asynchronous request method according to the asynchronous API request to obtain the data required for the expanded state page.
[0035] Specifically, the search entity information includes but is not limited to a search entity word (query). The search entity word may be a city (such as Beijing), a person, a TV series, a movie, and the like.
[0036] Of course, in other embodiments, those skilled in the art may increase or decrease the content included in the search entity information as needed. For example, the search entity information may also include a unique identifier (mkey) of the industry entity to which the search entity word belongs, and the unique identifier of the industry entity is used to indicate the industry entity to which the search entity word belongs.
[0037] For different search entity words, technicians in this field can set corresponding industry entity unique identifiers for them as needed. For example, the search entity word is "Beijing", and its corresponding industry entity unique identifier is "city", and so on.
[0038] The tab page information is used to indicate the tab page displayed when entering the expanded state page. Those skilled in the art can obtain the tab page information in an appropriate manner as needed, and this embodiment does not limit this.
[0039] For example, the tab page information may be obtained based on a preset default tab page; or, the tab page information may be obtained based on a clicked control in a page displaying search results, and so on.
[0040] Step S104: obtaining the data required for the expanded page according to the asynchronous API request, and splicing the API of the script language template corresponding to the tab page through the data required for the expanded page.
[0041] In this embodiment, according to the asynchronous API request, the data required for the expanded page is obtained through an asynchronous request method, thereby achieving decoupling between the expanded page and other pages, for example, the coupling between the content data of the expanded page and the content data of other pages, the coupling between the static resources of the expanded page and the static resources of other pages, etc., so that the data required for the expanded page no longer depends on the data and static resources of other pages.
[0042] In this way, technicians in this field can trigger the display expanded state instruction from any page (such as a news headline page, an existing page displaying search results, and an expanded state page, etc.) as needed, and generate the asynchronous API request to suspend the expanded state page, making the suspending method of the expanded state page more diversified and more adaptable.
[0043] For different business scenarios and / or search entities, the data required for the corresponding expanded page may be different.
[0044] In this embodiment, the data required for the expanded page includes but is not limited to settings information. The settings information is used to indicate the tabs included in the expanded page. Of course, in other embodiments, the data required for the expanded page may also include other information, such as color information, log information, etc.
[0045] Those skilled in the art can configure the setting information as needed, as long as the tabs included in the expanded page can be indicated by the setting information. For example, the setting information is configured to indicate the tabs included in the expanded page by means of tab identifiers. For example, if the tab identifier is "home", it indicates that the expanded page includes a tab with the tab name "home page", and if the tab identifier is "work", it indicates that the expanded page includes a tab with the tab name "work", and so on.
[0046] Optionally, the setting information may further indicate the order relationship between the tab pages through the order relationship between the tab page identifiers.
[0047] According to the acquired data required for the expanded page, the API of the script language template corresponding to the tab page may be spliced to acquire the data of the script language template corresponding to the tab page, thereby displaying the expanded page according to the data of the script language template.
[0048] The script language template may be a script language template corresponding to any tab page included in the expanded page. The script language template may be any appropriate template, such as a PHP template, a Ruby template, a Python template, and the like.
[0049] For those skilled in the art, they can adopt an appropriate method to splice the API of the script language template corresponding to the tab page according to the data required by the expanded page according to business needs.
[0050] For example, the data required for the expanded page is obtained according to the asynchronous API request, and the API of the script language template corresponding to the tab page is spliced through the setting information and the preset splicing rules. For example, the preset splicing rules indicate that the API of the script language template corresponding to the tab page is spliced through the tab page identifier, search entity word, industry entity unique identifier, etc. indicated by the setting information.
[0051] Those skilled in the art can preset appropriate splicing rules as needed, and this embodiment does not limit this.
[0052] Step S106: loading the API of the script language template in an asynchronous request manner, and rendering the data of the script language template to display an expanded page of the search results.
[0053] In this embodiment, the API of the script language template is loaded through an asynchronous request method to obtain the data of the script language template corresponding to the tab page. This asynchronous request method can avoid reloading the entire page when rendering according to the acquired data, avoid page flickering and blankness, and reduce the waiting time when displaying the expanded page; in addition, displaying the search results in the form of an expanded page makes it more convenient for users to view the search results and has a better display effect on the search results.
[0054] Through this embodiment, the expanded page can be suspended through an asynchronous API request, and the expanded page can be used to display search results. The data required for the expanded page and the data of the script language template corresponding to the tab page can be obtained through an asynchronous request method. This can achieve the effect of not refreshing the page when displaying the data of the tab page in the expanded page, thereby avoiding the problems of refreshing the page causing page flickering and the need to wait that exist in the existing search result display method.
[0055] The method for displaying search results on a page in this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a tablet computer, a mobile phone, etc.) and a PC, etc.
[0056] Embodiment 2
[0057] Reference Figure 3 , shows a flow chart of the steps of a method for displaying a page of search results according to Embodiment 2 of the present invention.
[0058] The method for displaying search results on a page in this embodiment includes the aforementioned steps S102 to S106.
[0059] In this embodiment, the expanded page includes a floating frame developed for the ILayer interface, and the floating frame includes a label area for displaying the name of the tab and a content area for displaying the content of the tab. The ILayer interface is an abstract ILayer interface, and those skilled in the art can define the methods included therein as needed, such as the creation method create(), the interaction method active(), the background switching method disable(), and the destruction method destroy().
[0060] Since the floating framework included in the expanded page is developed for the ILayer interface, when the floating framework interacts with other Layers (floating pages, each floating page is an implementation of the abstract Layer class), it interacts according to the rules of the ILayer interface. In this way, the developer of the floating framework can customize different floating frameworks (such as the floating framework of the expanded page, the floating framework of the navigation bar, etc.) according to different business scenario requirements, and these floating frameworks can share all the developed Layers (floating pages).
[0061] In addition, those skilled in the art can develop different general Layer components (such as picture walls, etc.) based on the abstract Layer class for different business calls. This design based on the abstract ILayer interface and the Layer class solves the problem of the lack of versatility and flexibility of the floating layer framework, and solves the problem that the same floating layer page may be used in different floating layer frameworks and the same floating layer page may be used in different business scenarios in the development of floating pages in the prior art, resulting in the need for repeated development of both the floating layer page and the floating layer framework.
[0062] Continue to see Figure 3 In this embodiment, step S106 includes the following sub-steps:
[0063] Sub-step S1061: loading the API of the script language template by asynchronous request, rendering the data of the script language template in the content area of the expanded page, and rendering the tab page name of the tab page indicated by the setting information in the tab area of the expanded page.
[0064] In this embodiment, the data of the script language template may be an HTML string, JSON data, a picture, etc. that is easy for the browser to interpret.
[0065] Those skilled in the art may render the data of the scripting language template into the content area of the expanded page in any appropriate manner.
[0066] For example, according to the data and setting information of the script language template, a floating frame and a floating page used in the expanded page are obtained, the floating frame includes the label area and the content area, and the floating page is configured in the content area of the floating frame. The data of the script language template is rendered in the content area, and the tab page name of the tab page indicated by the setting information is rendered in the tab area.
[0067] It should be noted that, when the expanded page includes multiple tab pages, different tab pages may correspond to different floating pages.
[0068] Sub-step S1062: displaying an expanded page of search results according to the rendering data of the tag area and the content area.
[0069] In this embodiment, the expanded page can be displayed by drawing the rendering data of the label area and the content area. Of course, in other embodiments, the expanded page can be displayed in any other appropriate manner.
[0070] Through this embodiment, the expanded page can be suspended through an asynchronous API request, and the expanded page can be used to display search results. The data required for the expanded page and the data of the script language template corresponding to the tab page can be obtained through an asynchronous request method. This can achieve the effect of not refreshing the page when displaying the data of the tab page in the expanded page, thereby avoiding the problems of refreshing the page causing page flickering and the need to wait that exist in the existing search result display method.
[0071] In addition, the floating layer framework and the floating layer page implement a set of ILayer interfaces at the same time. The basic floating layer framework is oriented to the interface rather than the implementation, which makes the floating layer framework and the floating layer page more versatile and flexible.
[0072] The method for displaying search results on a page in this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a tablet computer, a mobile phone, etc.) and a PC, etc.
[0073] Embodiment 3
[0074] Reference Figure 4 , shows a flow chart of the steps of a method for displaying a search result page according to embodiment 3 of the present invention.
[0075] The method for displaying a page of search results in this embodiment includes the aforementioned steps S102 to S106, wherein the step S106 may adopt the implementation method described in the second embodiment or other implementation methods.
[0076] In this embodiment, the method further includes:
[0077] Step S108: According to the tab page in the expanded page, use the front-end routing framework to configure the front-end routing corresponding to the tab page.
[0078] The front-end routing can realize page jumps on the front-end without reloading the page. By configuring the front-end routing, it is possible to realize jumps between tabs in an expanded page and / or jumps between expanded pages of different entities.
[0079] In this embodiment, in order to realize the mutual jump of the expanded page between different entities and different industry entities, the expanded page is completely decoupled from the business scenario. For example, the coupling between the URL (Uniform Resource Locator) of the expanded page and the URL of other pages that suspend the expanded page is released.
[0080] In order to make the URL of the expanded page an independent URL, the front-end routing framework has at least one of the following functions: support regular rule matching, so that the matching rules can be customized according to the business; a complete hook mechanism (hook), so as to expand more complex business logic; the match function helps the business to obtain params (parameters), query (search entity words) and hash value (hash value) in the URL of the expanded page, so as to realize customized business logic based on business scenarios; the front-end routing framework supports both Html5 API and Hash API, and supports seamless switching between the two, so as to operate the browser history or URL in the address bar through Html5API and Hash API, thereby realizing page switching without refresh.
[0081] Those skilled in the art may implement the front-end routing framework in an appropriate manner as needed, and this embodiment does not limit this.
[0082] When the front-end routing framework is used to configure the front-end routing corresponding to the tab page in the expanded page, those skilled in the art can configure the front-end routing corresponding to the tab page in an appropriate manner as needed. For example, according to the tab page identifier of each tab page, the corresponding URL is configured, and according to the function of the front-end routing framework, the front-end routing of each tab page is configured.
[0083] Step S110: acquiring content data of the tab page to be switched according to the received tab page switching request and the front-end route matching the tab page to be switched.
[0084] The tab switching request is used to indicate the tab to be switched in the expanded page. When the tab switching request is received, the matching front-end route is determined according to the tab to be switched indicated by the request, and then the content data of the tab to be switched is obtained to be displayed in the expanded page.
[0085] Optionally, in order to improve the display speed, the content data of the tab to be switched is the content data obtained by calling the API of the script language template corresponding to the tab to be switched in advance through asynchronous request. In this way, the content data of the tab to be switched can be pre-cached, so that when switching between tabs in the expanded page is realized through front-end routing, the delay is smaller, and the user is not aware of the switching.
[0086] It should be noted that in order to reduce the use of resources and traffic, when pre-caching the content data of the tab to be switched, you can set it to pre-cache the content data of all tabs in the expanded page as needed, or pre-cache the content data of the uncached tab associated with the currently displayed tab according to the currently displayed tab.
[0087] Through this embodiment, the expanded page can be suspended through an asynchronous API request, and the expanded page can be used to display search results. The data required for the expanded page and the data of the script language template corresponding to the tab page can be obtained through an asynchronous request method. This can achieve the effect of not refreshing the page when displaying the data of the tab page in the expanded page, thereby avoiding the problems of refreshing the page causing page flickering and the need to wait that exist in the existing search result display method.
[0088] In addition, by configuring the front-end routing corresponding to the tab page, the decoupling between the URL of the expanded page and the URL of other pages can be achieved, so that those skilled in the art can implement the non-refresh switching of the tab page in the expanded page through the front-end routing according to the needs. Since the front-end routing framework has multiple functions, those skilled in the art can expand the business needs according to the needs and improve the adaptability of the front-end routing framework.
[0089] The method for displaying search results on a page in this embodiment can be executed by any appropriate electronic device with data processing capabilities, including but not limited to: a server, a mobile terminal (such as a tablet computer, a mobile phone, etc.) and a PC, etc.
[0090] Embodiment 4
[0091] Reference Figure 5 , shows a step flow chart of a method for displaying search results on a page according to Embodiment 4 of the present invention.
[0092] The method for displaying search results on a page in this embodiment includes the following steps:
[0093] Step S502: receiving an expansion trigger operation for lifting an expansion state page entry in the current page, and generating a display expansion state instruction according to the expansion trigger operation.
[0094] The current page may be any page configured with a suspended expanded page entrance, including but not limited to: a news headline page, an existing page displaying search results, and an expanded page.
[0095] The expanded state page entry can be configured at the required position of the current page. When an expansion trigger operation is received for the expanded state page entry, a display expanded state instruction is generated according to the expansion trigger operation, so as to instruct to search according to the search entity information through the display expanded state instruction, and display the search results through the expanded state page (max state).
[0096] Those skilled in the art can configure the suspended expanded page entrance at an appropriate position in the current page in an appropriate manner, and this embodiment does not limit this. For example, if the current page is a news headline page, a "max" logo can be configured at the character information in the news headline page to make it a suspended expanded page entrance, and when the user clicks on the character information, a display expanded state instruction is generated.
[0097] The display expanded state instruction is used to instruct to search according to the search entity information and display the search results through the expanded state page (max state).
[0098] In this embodiment, the display expansion instruction indicates the search entity information and the tab page information.
[0099] Specifically, the search entity information includes but is not limited to a search entity word (query). The search entity word may be a city (such as Beijing), a person, a TV series, a movie, and the like.
[0100] Of course, in other embodiments, those skilled in the art may increase or decrease the content included in the search entity information as needed. For example, the search entity information may also include a unique identifier (mkey) of the industry entity to which the search entity word belongs, and the unique identifier of the industry entity is used to indicate the industry entity to which the search entity word belongs.
[0101] For different search entity words, technicians in this field can set corresponding industry entity unique identifiers for them as needed. For example, the search entity word is "Beijing", and its corresponding industry entity unique identifier is "city", and so on.
[0102] The tab page information is used to indicate the tab page displayed when entering the expanded state page. Those skilled in the art can obtain the tab page information in an appropriate manner as needed, and this embodiment does not limit this.
[0103] For example, if the display expansion state instruction is generated based on the lifting expansion state page entrance in the news headline page, the tab page information can be obtained based on the preset default tab page. For another example, if the display expansion state instruction is generated based on the lifting expansion state page entrance in the page displaying the search results, the tab page information can be obtained based on the control clicked in the page displaying the search results, etc.
[0104] Step S504: Generate an asynchronous API request according to the search entity information and tab page information corresponding to the display expansion state instruction, and obtain the data required for the expansion state page through the asynchronous API request.
[0105] Those skilled in the art can generate asynchronous API requests in an appropriate manner according to business needs. For example, according to the search entity information and tab page information corresponding to the display expansion state instruction and the preset generation rules, an asynchronous API (interface) request is generated, and according to the asynchronous API request, an API is called through an asynchronous request method to obtain the data required for the expansion state page.
[0106] This achieves decoupling between the expanded page and other pages, for example, the coupling between the expanded page content data and the content data of other pages, the coupling between the expanded page static resources and the static resources of other pages, etc., so that the data required by the expanded page no longer depends on the data and static resources of other pages.
[0107] In this way, technicians in this field can trigger the display expanded state instruction from any page (such as a news headline page, an existing page displaying search results, and an expanded state page, etc.) as needed, and generate the asynchronous API request to suspend the expanded state page, making the suspending method of the expanded state page more diversified and more adaptable.
[0108] For different business scenarios and / or search entities, the data required for the corresponding expanded page may be different.
[0109] In this embodiment, the data required for the expanded page includes but is not limited to settings information. The settings information is used to indicate the tabs included in the expanded page. Of course, in other embodiments, the data required for the expanded page may also include other information, such as color information, log information, etc.
[0110] Those skilled in the art can configure the setting information as needed, as long as the tabs included in the expanded page can be indicated by the setting information. For example, the setting information is configured to indicate the tabs included in the expanded page by means of tab identifiers. For example, if the tab identifier is "home", it indicates that the expanded page includes a tab with the tab name "home page", and if the tab identifier is "work", it indicates that the expanded page includes a tab with the tab name "work", and so on.
[0111] Optionally, the setting information may further indicate the positional relationship between the tab pages (ie, the sequential relationship between the tab pages) through the sequential relationship between the tab page identifiers.
[0112] Step S506: splicing the API of the script language template corresponding to the tab page according to the data required by the expanded page, and rendering the data obtained through the API of the script language template to display the expanded page of the search result.
[0113] According to the acquired data required for the expanded page, the API of the script language template corresponding to the tab page may be spliced to acquire the data of the script language template corresponding to the tab page, thereby displaying the expanded page according to the data of the script language template.
[0114] The script language template may be a script language template corresponding to any tab page included in the expanded page. The script language template may be any appropriate template, such as a PHP template, a Ruby template, a Python template, and the like.
[0115] For those skilled in the art, they can adopt an appropriate method to splice the API of the script language template corresponding to the tab page according to the data required by the expanded page according to business needs.
[0116] For example, the data required for the expanded page is obtained according to the asynchronous API request, and the API of the script language template corresponding to the tab page is spliced through the setting information and the preset splicing rules. For example, the preset splicing rules indicate that the API of the script language template corresponding to the tab page is spliced through the tab page identifier, search entity word, industry entity unique identifier, etc. indicated by the setting information.
[0117] Those skilled in the art can preset appropriate splicing rules as needed, and this embodiment does not limit this.
[0118] The API of the script language template is loaded through an asynchronous request method to obtain the data of the script language template corresponding to the tab page. This asynchronous request method can avoid reloading the entire page when rendering according to the obtained data, avoid page flickering and blankness, and reduce the waiting time when displaying the expanded page; in addition, displaying the search results in the form of an expanded page makes it more convenient for users to view the search results and has a better display effect on the search results.
[0119] Through this embodiment, the expansion trigger operation can be received in any current page configured with an entry for lifting the expanded state page, and an expanded state display instruction can be generated. According to the expanded state display instruction, the expanded state page can be lifted through an asynchronous API request, and the search results can be displayed using the expanded state page. The data required for the expanded state page and the data of the script language template corresponding to the tab page can be obtained through an asynchronous request method, so that the page does not need to be refreshed when the data of the tab page is displayed in the expanded state page, avoiding the problems of refreshing the page causing page flickering and the need to wait in the existing search result display method.
[0120] Embodiment 5
[0121] Reference Figure 6 , shows a step flow chart of a method for displaying search results on a page according to Embodiment 5 of the present invention.
[0122] The method for displaying search results on a page in this embodiment includes the aforementioned steps S502 to S506.
[0123] The method further comprises the following steps:
[0124] Step S508: receiving a switch triggering operation for a tab page to be displayed in the expanded page, and generating a tab page switch request according to the switch triggering operation.
[0125] Those skilled in the art may preset any appropriate operation as a switching trigger operation according to business requirements, for example, a click operation or a sliding operation on a tab to be displayed.
[0126] A tab page switching request is generated according to the received switching trigger operation to instruct to switch the tab page currently displayed in the expanded page to the tab page to be switched indicated by the tab page switching request.
[0127] Step S510: according to the tab page switching request and the front-end route matching the tab page to be switched, the content data of the tab page to be switched is obtained and rendered for display.
[0128] A matching front-end route is determined according to the tab to be switched indicated by the tab switching request, content data of the tab to be switched is obtained through the determined front-end route, and the content data is rendered and displayed.
[0129] Optionally, in order to improve the display speed, the content data of the tab to be switched is the content data obtained by calling the API of the script language template corresponding to the tab to be switched in advance through asynchronous request. In this way, the content data of the tab to be switched can be pre-cached, so that when switching between tabs in the expanded page is realized through front-end routing, the delay is smaller, and the user is not aware of the switching.
[0130] It should be noted that in order to reduce the use of resources and traffic, when pre-caching the content data of the tab to be switched, you can set it to pre-cache the content data of all tabs in the expanded page as needed, or pre-cache the content data of the uncached tab associated with the currently displayed tab according to the currently displayed tab.
[0131] Step S512: determining an associated tab page associated with the displayed tab page according to the positional relationship between the tab pages in the expanded page.
[0132] It should be noted that this step is an optional step, which can be executed at any appropriate time after step S510, or executed in parallel with step S510.
[0133] In a specific implementation, based on the positional relationship between tabs in the expanded page, the previous tab and the next tab adjacent to the displayed tab are determined as candidate associated tabs, and the tab without pre-cached content data among the candidate associated tabs is determined as the associated tab.
[0134] Step S514: pre-acquire content data of the associated tab page according to the API of the script language template corresponding to the associated tab page, so as to render and display the pre-acquired content data of the associated tab page when a switch trigger operation for the associated tab page is received.
[0135] The API of the script language template corresponding to the associated tab page may be obtained in the same manner as in step S506, or in other appropriate manners, which will not be described in detail in this embodiment.
[0136] When pre-acquiring the content data of the associated tab page, the API of the corresponding script language template is loaded through an asynchronous request to obtain the data of the script language template corresponding to the tab page. In this way, when the tab page switching request indicates the associated tab page, it can be directly rendered and displayed according to the acquired content data, thereby further reducing the time consumption during display and improving the response speed.
[0137] Through this embodiment, the expansion trigger operation can be received in any current page configured with an entry for lifting the expanded state page, and an expanded state display instruction can be generated. According to the expanded state display instruction, the expanded state page can be lifted through an asynchronous API request, and the search results can be displayed using the expanded state page. The data required for the expanded state page and the data of the script language template corresponding to the tab page can be obtained through an asynchronous request method, so that the page does not need to be refreshed when the data of the tab page is displayed in the expanded state page, avoiding the problems of refreshing the page causing page flickering and the need to wait in the existing search result display method.
[0138] Embodiment 6
[0139] Reference Figure 7 , shows a structural block diagram of a device for displaying search results on a page according to Embodiment 6 of the present invention.
[0140] The apparatus for displaying search results on a page in this embodiment includes a generating module 602 , a splicing module 604 and a loading module 606 .
[0141] The generating module 602 is used to generate an asynchronous API request according to the search entity information and tab page information indicated by the acquired display expansion state instruction.
[0142] The display expanded state instruction is used to instruct to search according to the search entity information, and to display the search results through the expanded state page (max state).
[0143] like Figure 2 As shown, the expanded page includes multiple tabs, and different tabs can be used to display different types of search results to achieve classified display of search results, so that users can view search results more conveniently.
[0144] For different search entities, the tabs included in the corresponding expanded page may be different. For example, when the search entity is a person, the tabs included in the expanded page may be "Home", "Works", "Itinerary" and other tabs; when the search entity is a city, the tabs included in the expanded page may be "Attractions", "History" and other tabs.
[0145] In this embodiment, when the display expansion state instruction is obtained, the asynchronous API (interface) request is generated according to the search entity information and the tab information indicated by the display expansion state instruction, so as to call the API through an asynchronous request method according to the asynchronous API request to obtain the data required for the expanded state page.
[0146] Specifically, the search entity information includes but is not limited to a search entity word (query). The search entity word may be a city (such as Beijing), a person, a TV series, a movie, and the like.
[0147] Of course, in other embodiments, those skilled in the art may increase or decrease the content included in the search entity information as needed. For example, the search entity information may also include a unique identifier (mkey) of the industry entity to which the search entity word belongs, and the unique identifier of the industry entity is used to indicate the industry entity to which the search entity word belongs.
[0148] For different search entity words, technicians in this field can set corresponding industry entity unique identifiers for them as needed. For example, the search entity word is "Beijing", and its corresponding industry entity unique identifier is "city", and so on.
[0149] The tab page information is used to indicate the tab page displayed when entering the expanded state page. Those skilled in the art can obtain the tab page information in an appropriate manner as needed, and this embodiment does not limit this.
[0150] For example, the tab page information may be obtained based on a preset default tab page; or, the tab page information may be obtained based on a clicked control in a page displaying search results, and so on.
[0151] The splicing module 604 is used to obtain the data required for the expanded page according to the asynchronous API request, and splice the API of the script language template corresponding to the tab page through the data required for the expanded page.
[0152] In this embodiment, according to the asynchronous API request, the data required for the expanded page is obtained through an asynchronous request method, thereby achieving decoupling between the expanded page and other pages, for example, the coupling between the content data of the expanded page and the content data of other pages, the coupling between the static resources of the expanded page and the static resources of other pages, etc., so that the data required for the expanded page no longer depends on the data and static resources of other pages.
[0153] In this way, technicians in this field can trigger the display expanded state instruction from any page (such as a news headline page, an existing page displaying search results, and an expanded state page, etc.) as needed, and generate the asynchronous API request to suspend the expanded state page, making the suspending method of the expanded state page more diversified and more adaptable.
[0154] For different business scenarios and / or search entities, the data required for the corresponding expanded page may be different.
[0155] In this embodiment, the data required for the expanded page includes but is not limited to settings information. The settings information is used to indicate the tabs included in the expanded page. Of course, in other embodiments, the data required for the expanded page may also include other information, such as color information, log information, etc.
[0156] Those skilled in the art can configure the setting information as needed, as long as the tabs included in the expanded page can be indicated by the setting information. For example, the setting information is configured to indicate the tabs included in the expanded page by means of tab identifiers. For example, if the tab identifier is "home", it indicates that the expanded page includes a tab with the tab name "home page", and if the tab identifier is "work", it indicates that the expanded page includes a tab with the tab name "work", and so on.
[0157] Optionally, the setting information may further indicate the order relationship between the tab pages through the order relationship between the tab page identifiers.
[0158] According to the acquired data required for the expanded page, the API of the script language template corresponding to the tab page may be spliced to acquire the data of the script language template corresponding to the tab page, thereby displaying the expanded page according to the data of the script language template.
[0159] The script language template may be a script language template corresponding to any tab page included in the expanded page. The script language template may be any appropriate template, such as a PHP template, a Ruby template, a Python template, and the like.
[0160] For those skilled in the art, they can adopt an appropriate method to splice the API of the script language template corresponding to the tab page according to the data required by the expanded page according to business needs.
[0161] For example, the data required for the expanded page is obtained according to the asynchronous API request, and the API of the script language template corresponding to the tab page is spliced through the setting information and the preset splicing rules. For example, the preset splicing rules indicate that the API of the script language template corresponding to the tab page is spliced through the tab page identifier, search entity word, industry entity unique identifier, etc. indicated by the setting information.
[0162] Those skilled in the art can preset appropriate splicing rules as needed, and this embodiment does not limit this.
[0163] The loading module 606 is used to load the API of the scripting language template through an asynchronous request, and render the data of the scripting language template to display an expanded page of the search results.
[0164] In this embodiment, the API of the script language template is loaded through an asynchronous request method to obtain the data of the script language template corresponding to the tab page. This asynchronous request method can avoid reloading the entire page when rendering according to the acquired data, avoid page flickering and blankness, and reduce the waiting time when displaying the expanded page; in addition, displaying the search results in the form of an expanded page makes it more convenient for users to view the search results and has a better display effect on the search results.
[0165] According to this embodiment, the expanded page can be suspended through an asynchronous API request, and the expanded page can be used to display search results. The data required for the expanded page and the data of the script language template corresponding to the tab page are obtained through an asynchronous request method. This can achieve the goal of displaying the data of the tab page in the expanded page without refreshing the page, thus avoiding the problems of refreshing the page causing page flickering and the need to wait that exist in the existing search result display method.
[0166] Embodiment 7
[0167] Reference Figure 8 , shows a structural block diagram of a device for displaying search results on a page according to Embodiment 7 of the present invention.
[0168] The apparatus for displaying search results on a page in this embodiment includes the aforementioned generating module 602 , splicing module 604 , and loading module 606 .
[0169] Optionally, the expanded page includes a floating layer frame developed for an ILayer interface, and the floating layer frame includes a label area for displaying a label page name and a content area for displaying the label page content.
[0170] The ILayer interface is an abstract ILayer interface, and those skilled in the art may define the methods included therein as needed, such as a creation method create(), an interaction method active(), a background switching method disable(), and a destruction method destroy().
[0171] Since the floating framework included in the expanded page is developed for the ILayer interface, when the floating framework interacts with other Layers (floating pages, each floating page is an implementation of the abstract Layer class), it interacts according to the rules of the ILayer interface. In this way, the developer of the floating framework can customize different floating frameworks (such as the floating framework of the expanded page, the floating framework of the navigation bar, etc.) according to different business scenario requirements, and these floating frameworks can share all the developed Layers (floating pages).
[0172] In addition, those skilled in the art can develop different general Layer components (such as picture walls, etc.) based on the abstract Layer class for different business calls. This design based on the abstract ILayer interface and the Layer class solves the problem of the lack of versatility and flexibility of the floating layer framework, and solves the problem that the same floating layer page may be used in different floating layer frameworks and the same floating layer page may be used in different business scenarios in the development of floating pages in the prior art, resulting in the need for repeated development of both the floating layer page and the floating layer framework.
[0173] Continue to see Figure 8 Optionally, the loading module 606 includes a rendering module 6061 and a display module 6062 .
[0174] The rendering module 6061 is used to load the API of the script language template through an asynchronous request, and render the data of the script language template in the content area of the expanded page, and render the tab name of the tab indicated by the setting information in the tab area of the expanded page.
[0175] In this embodiment, the data of the script language template may be an HTML string, JSON data, a picture, etc. that is easy for the browser to interpret.
[0176] Those skilled in the art may render the data of the scripting language template into the content area of the expanded page in any appropriate manner.
[0177] For example, according to the data and setting information of the script language template, a floating frame and a floating page used in the expanded page are obtained, the floating frame includes the label area and the content area, and the floating page is configured in the content area of the floating frame. The data of the script language template is rendered in the content area, and the tab page name of the tab page indicated by the setting information is rendered in the tab area.
[0178] It should be noted that, when the expanded page includes multiple tab pages, different tab pages may correspond to different floating pages.
[0179] The display module 6062 is used to display the expanded page of the search results according to the rendering data of the tag area and the content area.
[0180] In this embodiment, the expanded page can be displayed by drawing the rendering data of the label area and the content area. Of course, in other embodiments, the expanded page can be displayed in any other appropriate manner.
[0181] Optionally, continue to see Figure 8The device also includes a configuration module 608 and a switching module 610.
[0182] The configuration module 608 is used to configure the front-end routing corresponding to the tab page using the front-end routing framework according to the tab page in the expanded page.
[0183] The front-end routing can realize page jumps on the front-end without reloading the page. By configuring the front-end routing, it is possible to realize jumps between tabs in an expanded page and / or jumps between expanded pages of different entities.
[0184] In this embodiment, in order to realize the mutual jump of the expanded page between different entities and different industry entities, the expanded page is completely decoupled from the business scenario. For example, the coupling between the URL (Uniform Resource Locator) of the expanded page and the URL of other pages that suspend the expanded page is released.
[0185] In order to make the URL of the expanded page an independent URL, the front-end routing framework has at least one of the following functions: support regular rule matching, so that the matching rules can be customized according to the business; a complete hook mechanism (hook), so as to expand more complex business logic; the match function helps the business to obtain params (parameters), query (search entity words) and hash value (hash value) in the URL of the expanded page, so as to realize customized business logic based on business scenarios; the front-end routing framework supports both Html5API and HashAPI, and supports seamless switching between the two, so as to operate the browser history or URL in the address bar through Html5API and HashAPI, thereby realizing page switching without refresh.
[0186] Those skilled in the art may implement the front-end routing framework in an appropriate manner as needed, and this embodiment does not limit this.
[0187] When the front-end routing framework is used to configure the front-end routing corresponding to the tab page in the expanded page, those skilled in the art can configure the front-end routing corresponding to the tab page in an appropriate manner as needed. For example, according to the tab page identifier of each tab page, the corresponding URL is configured, and according to the function of the front-end routing framework, the front-end routing of each tab page is configured.
[0188] The switching module 610 is used to obtain content data of the tab to be switched according to the received tab switching request and the front-end route matching the tab to be switched.
[0189] The tab switching request is used to indicate the tab to be switched in the expanded page. When the tab switching request is received, the matching front-end route is determined according to the tab to be switched indicated by the request, and then the content data of the tab to be switched is obtained to be displayed in the expanded page.
[0190] Optionally, in order to improve the display speed, the content data of the tab to be switched is the content data obtained by calling the API of the script language template corresponding to the tab to be switched in advance through asynchronous request. In this way, the content data of the tab to be switched can be pre-cached, so that when switching between tabs in the expanded page is realized through front-end routing, the delay is smaller, and the user is not aware of the switching.
[0191] It should be noted that in order to reduce the use of resources and traffic, when pre-caching the content data of the tab to be switched, you can set it to pre-cache the content data of all tabs in the expanded page as needed, or pre-cache the content data of the uncached tab associated with the currently displayed tab according to the currently displayed tab.
[0192] Through this embodiment, the expanded page can be suspended through an asynchronous API request, and the expanded page can be used to display search results. The data required for the expanded page and the data of the script language template corresponding to the tab page can be obtained through an asynchronous request method. This can achieve the effect of not refreshing the page when displaying the data of the tab page in the expanded page, thereby avoiding the problems of refreshing the page causing page flickering and the need to wait that exist in the existing search result display method.
[0193] In addition, the floating layer framework and the floating layer page implement a set of ILayer interfaces at the same time. The basic floating layer framework is oriented to the interface rather than the implementation, which makes the floating layer framework and the floating layer page more versatile and flexible.
[0194] Moreover, by configuring the front-end routing corresponding to the tab page, the decoupling between the URL of the expanded page and the URL of other pages can be achieved, so that those skilled in the art can implement the non-refresh switching of the tab page in the expanded page through the front-end routing according to the needs. Since the front-end routing framework has multiple functions, those skilled in the art can expand the business needs according to the needs and improve the adaptability of the front-end routing framework.
[0195] Embodiment 8
[0196] Reference Fig. 9 , shows a structural block diagram of a device for displaying search results on a page according to Embodiment 8 of the present invention.
[0197] The apparatus for displaying search results on a page in this embodiment includes a first receiving module 902 , a data acquiring module 904 and a rendering and displaying module 906 .
[0198] The first receiving module 902 is used to receive an expansion triggering operation for lifting an expansion state page entry in the current page, and generate an expansion state display instruction according to the expansion triggering operation.
[0199] The current page may be any page configured with a suspended expanded page entrance, including but not limited to: a news headline page, an existing page displaying search results, and an expanded page.
[0200] The expanded state page entry can be configured at the required position of the current page. When an expansion trigger operation is received for the expanded state page entry, a display expanded state instruction is generated according to the expansion trigger operation, so as to instruct to search according to the search entity information through the display expanded state instruction, and display the search results through the expanded state page (max state).
[0201] Those skilled in the art can configure the suspended expanded page entrance at an appropriate position in the current page in an appropriate manner, and this embodiment does not limit this. For example, if the current page is a news headline page, a "max" logo can be configured at the character information in the news headline page to make it a suspended expanded page entrance, and when the user clicks on the character information, a display expanded state instruction is generated.
[0202] The display expanded state instruction is used to instruct to search according to the search entity information and display the search results through the expanded state page (max state).
[0203] In this embodiment, the display expansion instruction indicates the search entity information and the tab page information.
[0204] Specifically, the search entity information includes but is not limited to a search entity word (query). The search entity word may be a city (such as Beijing), a person, a TV series, a movie, and the like.
[0205] Of course, in other embodiments, those skilled in the art may increase or decrease the content included in the search entity information as needed. For example, the search entity information may also include a unique identifier (mkey) of the industry entity to which the search entity word belongs, and the unique identifier of the industry entity is used to indicate the industry entity to which the search entity word belongs.
[0206] For different search entity words, technicians in this field can set corresponding industry entity unique identifiers for them as needed. For example, the search entity word is "Beijing", and its corresponding industry entity unique identifier is "city", and so on.
[0207] The tab page information is used to indicate the tab page displayed when entering the expanded state page. Those skilled in the art can obtain the tab page information in an appropriate manner as needed, and this embodiment does not limit this.
[0208] For example, if the display expansion state instruction is generated based on the lifting expansion state page entrance in the news headline page, the tab page information can be obtained based on the preset default tab page. For another example, if the display expansion state instruction is generated based on the lifting expansion state page entrance in the page displaying the search results, the tab page information can be obtained based on the control clicked in the page displaying the search results, etc.
[0209] Data acquisition module 904: used to generate an asynchronous API request according to the search entity information and tab page information corresponding to the display expansion state instruction, and obtain the data required for the expansion state page through the asynchronous API request.
[0210] Those skilled in the art can generate asynchronous API requests in an appropriate manner according to business needs. For example, according to the search entity information and tab page information corresponding to the display expansion state instruction and the preset generation rules, an asynchronous API (interface) request is generated, and according to the asynchronous API request, an API is called through an asynchronous request method to obtain the data required for the expansion state page.
[0211] This achieves decoupling between the expanded page and other pages, for example, the coupling between the expanded page content data and the content data of other pages, the coupling between the expanded page static resources and the static resources of other pages, etc., so that the data required by the expanded page no longer depends on the data and static resources of other pages.
[0212] In this way, technicians in this field can trigger the display expanded state instruction from any page (such as a news headline page, an existing page displaying search results, and an expanded state page, etc.) as needed, and generate the asynchronous API request to suspend the expanded state page, making the suspending method of the expanded state page more diversified and more adaptable.
[0213] For different business scenarios and / or search entities, the data required for the corresponding expanded page may be different.
[0214] In this embodiment, the data required for the expanded page includes but is not limited to settings information. The settings information is used to indicate the tabs included in the expanded page. Of course, in other embodiments, the data required for the expanded page may also include other information, such as color information, log information, etc.
[0215] Those skilled in the art can configure the setting information as needed, as long as the tabs included in the expanded page can be indicated by the setting information. For example, the setting information is configured to indicate the tabs included in the expanded page by means of tab identifiers. For example, if the tab identifier is "home", it indicates that the expanded page includes a tab with the tab name "home page", and if the tab identifier is "work", it indicates that the expanded page includes a tab with the tab name "work", and so on.
[0216] Optionally, the setting information may further indicate the positional relationship between the tab pages (ie, the sequential relationship between the tab pages) through the sequential relationship between the tab page identifiers.
[0217] Rendering and display module 906: used to splice the API of the script language template corresponding to the tab page according to the data required by the expanded page, and render the data obtained through the API of the script language template to display the expanded page of the search result.
[0218] According to the acquired data required for the expanded page, the API of the script language template corresponding to the tab page may be spliced to acquire the data of the script language template corresponding to the tab page, thereby displaying the expanded page according to the data of the script language template.
[0219] The script language template may be a script language template corresponding to any tab page included in the expanded page. The script language template may be any appropriate template, such as a PHP template, a Ruby template, a Python template, and the like.
[0220] For those skilled in the art, they can adopt an appropriate method to splice the API of the script language template corresponding to the tab page according to the data required by the expanded page according to business needs.
[0221] For example, the data required for the expanded page is obtained according to the asynchronous API request, and the API of the script language template corresponding to the tab page is spliced through the setting information and the preset splicing rules. For example, the preset splicing rules indicate that the API of the script language template corresponding to the tab page is spliced through the tab page identifier, search entity word, industry entity unique identifier, etc. indicated by the setting information.
[0222] Those skilled in the art can preset appropriate splicing rules as needed, and this embodiment does not limit this.
[0223] The API of the script language template is loaded through an asynchronous request method to obtain the data of the script language template corresponding to the tab page. This asynchronous request method can avoid reloading the entire page when rendering according to the obtained data, avoid page flickering and blankness, and reduce the waiting time when displaying the expanded page; in addition, displaying the search results in the form of an expanded page makes it more convenient for users to view the search results and has a better display effect on the search results.
[0224] Through this embodiment, the expansion trigger operation can be received in any current page configured with an entry for lifting the expanded state page, and an expanded state display instruction can be generated. According to the expanded state display instruction, the expanded state page can be lifted through an asynchronous API request, and the search results can be displayed using the expanded state page. The data required for the expanded state page and the data of the script language template corresponding to the tab page can be obtained through an asynchronous request method, so that the page does not need to be refreshed when the data of the tab page is displayed in the expanded state page, avoiding the problems of refreshing the page causing page flickering and the need to wait in the existing search result display method.
[0225] Embodiment 9
[0226] Reference Fig.10 , shows a structural block diagram of a device for displaying search results on a page according to Embodiment 9 of the present invention.
[0227] The apparatus for displaying search results on a page in this embodiment includes the aforementioned first receiving module 902 , data acquisition module 904 , and rendering and display module 906 .
[0228] Optionally, the device further includes a second receiving module 908 and a switching display module 910 .
[0229] The second receiving module 908 is configured to receive a switching trigger operation on a tab page to be displayed in the expanded page, and generate a tab page switching request according to the switching trigger operation.
[0230] Those skilled in the art may preset any appropriate operation as a switching trigger operation according to business requirements, for example, a click operation or a sliding operation on a tab to be displayed.
[0231] A tab page switching request is generated according to the received switching trigger operation to instruct to switch the tab page currently displayed in the expanded page to the tab page to be switched indicated by the tab page switching request.
[0232] The switching display module 910 is used to obtain and render the content data of the tab page to be switched according to the tab page switching request and the front-end route matching the tab page to be switched.
[0233] A matching front-end route is determined according to the tab to be switched indicated by the tab switching request, content data of the tab to be switched is obtained through the determined front-end route, and the content data is rendered and displayed.
[0234] Optionally, in order to improve the display speed, the content data of the tab to be switched is the content data obtained by calling the API of the script language template corresponding to the tab to be switched in advance through asynchronous request. In this way, the content data of the tab to be switched can be pre-cached, so that when switching between tabs in the expanded page is realized through front-end routing, the delay is smaller, and the user is not aware of the switching.
[0235] It should be noted that in order to reduce the use of resources and traffic, when pre-caching the content data of the tab to be switched, you can set it to pre-cache the content data of all tabs in the expanded page as needed, or pre-cache the content data of the uncached tab associated with the currently displayed tab according to the currently displayed tab.
[0236] Optionally, the device further includes an association determination module 912 and a preloading module 914 .
[0237] The association determination module 912 is used to determine the associated tab page associated with the displayed tab page according to the positional relationship between the tab pages in the expanded page.
[0238] It should be noted that this module is an optional module, which can be activated at any appropriate time after the switching display module 910, or can be activated in parallel with the switching display module 910.
[0239] In a specific implementation, based on the positional relationship between tabs in the expanded page, the previous tab and the next tab adjacent to the displayed tab are determined as candidate associated tabs, and the tab without pre-cached content data among the candidate associated tabs is determined as the associated tab.
[0240] Preloading module 914: used to pre-acquire content data of the associated tab page according to the API of the script language template corresponding to the associated tab page, so as to render and display the pre-acquired content data of the associated tab page when a switch trigger operation for the associated tab page is received.
[0241] The API of the script language template corresponding to the associated tab page may be obtained in the same manner as in the rendering and display module 506 , or in other appropriate manners, which will not be described in detail in this embodiment.
[0242] When pre-acquiring the content data of the associated tab page, the API of the corresponding script language template is loaded through an asynchronous request to obtain the data of the script language template corresponding to the tab page. In this way, when the tab page switching request indicates the associated tab page, it can be directly rendered and displayed according to the acquired content data, thereby further reducing the time consumption during display and improving the response speed.
[0243] Through this embodiment, the expansion trigger operation can be received in any current page configured with an entry for lifting the expanded state page, and an expanded state display instruction can be generated. According to the expanded state display instruction, the expanded state page can be lifted through an asynchronous API request, and the search results can be displayed using the expanded state page. The data required for the expanded state page and the data of the script language template corresponding to the tab page can be obtained through an asynchronous request method, so that the page does not need to be refreshed when the data of the tab page is displayed in the expanded state page, avoiding the problems of refreshing the page causing page flickering and the need to wait in the existing search result display method.
[0244] Embodiment 10
[0245] Reference Fig.11 , shows a schematic diagram of the structure of an electronic device according to Embodiment 10 of the present invention. The specific embodiment of the present invention does not limit the specific implementation of the electronic device.
[0246] like Fig.11 As shown, the electronic device may include: a processor (processor) 1102 , a communication interface (Communications Interface) 1104 , a memory (memory) 1106 , and a communication bus 1108 .
[0247] in:
[0248] The processor 1102 , the communication interface 1104 , and the memory 1106 communicate with each other via a communication bus 1108 .
[0249] The communication interface 1104 is used to communicate with other electronic devices such as terminal devices or servers.
[0250] The processor 1102 is used to execute the program 1110, and specifically can execute the relevant steps in the above-mentioned method embodiment for displaying a page of search results.
[0251] Specifically, the program 1110 may include program codes, which include computer operation instructions.
[0252] The processor 1102 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0253] The memory 1106 is used to store the program 1110. The memory 1106 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0254] Program 1110 can be specifically used to enable processor 1102 to perform the following operations: generate an asynchronous API request based on the search entity information and tab information indicated by the acquired display expanded state instruction; obtain the data required for the expanded state page based on the asynchronous API request, and splice the API of the script language template corresponding to the tab page with the data required for the expanded state page; load the API of the script language template through an asynchronous request, and render the data of the script language template to display the expanded state page of the search results.
[0255] In an optional implementation, the data required for the expanded page includes setting information, and the setting information is used to indicate the tab pages included in the expanded page.
[0256] In an optional embodiment, program 1110 is also used to enable processor 1102 to obtain the data required for the expanded page according to the asynchronous API request, and splice the API of the script language template corresponding to the tab page through the data required for the expanded page, when obtaining the data required for the expanded page according to the asynchronous API request, and splicing the API of the script language template corresponding to the tab page through the setting information and preset splicing rules.
[0257] In an optional implementation, the expanded page includes a floating layer framework developed for an ILayer interface, and the floating layer framework includes a label area for displaying a label page name and a content area for displaying the label page content.
[0258] In an optional embodiment, program 1110 is also used to enable processor 1102 to load the API of the script language template through an asynchronous request manner, and render the data of the script language template in the content area of the expanded page when loading the API of the script language template through an asynchronous request manner, and render the data of the script language template in the content area of the expanded page, and render the tab name of the tab indicated by the setting information in the tab area of the expanded page; and display the expanded page of the search results based on the rendered data of the tab area and the content area.
[0259] In an optional embodiment, program 1110 is also used to enable processor 1102 to configure the front-end route corresponding to the tab in the expanded page using the front-end routing framework; and obtain content data of the tab to be switched based on the received tab switching request and the front-end route that matches the tab to be switched.
[0260] In an optional implementation, the content data of the tab page to be switched is content data obtained by calling an API of a spliced script language template corresponding to the tab page to be switched in advance in an asynchronous request manner.
[0261] Alternatively, program 1110 can be specifically used to enable processor 1102 to perform the following operations: receive an expansion trigger operation for lifting an expanded page entry in the current page, and generate a display expanded state instruction based on the expansion trigger operation; generate an asynchronous API request based on the search entity information and tab information corresponding to the display expanded state instruction, and obtain data required for the expanded state page through the asynchronous API request; splice the API of the script language template corresponding to the tab page based on the data required for the expanded state page, and render the data obtained through the API of the script language template to display the expanded state page of the search results.
[0262] In an optional embodiment, program 1110 is also used to enable processor 1102 to receive a switch trigger operation for a tab to be displayed in an expanded page, and generate a tab switch request based on the switch trigger operation; based on the tab switch request and the front-end route matching the tab to be switched, obtain and render and display the content data of the tab to be switched.
[0263] In an optional embodiment, program 1110 is also used to enable processor 1102 to determine an associated tab page associated with the displayed tab page based on the positional relationship between the tab pages in the expanded page; and pre-acquire content data of the associated tab page based on the API of the script language template corresponding to the associated tab page, so as to render and display the pre-acquired content data of the associated tab page when a switch trigger operation for the associated tab page is received.
[0264] The specific implementation of each step in program 1110 can refer to the corresponding description of the corresponding steps and units in the above-mentioned method embodiment for displaying the search results on a page, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above-mentioned method embodiment, which will not be repeated here.
[0265] Through the electronic device of this embodiment, the expanded page can be suspended through an asynchronous API request, and the expanded page can be used to display search results. The data required for the expanded page and the data of the script language template corresponding to the tab page are obtained through an asynchronous request method. This can achieve the effect of not refreshing the page when displaying the data of the tab page in the expanded page, thereby avoiding the problems of refreshing the page causing page flickering and the need to wait that exist in the existing search result display method.
[0266] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present invention can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present invention.
[0267] The above-described method according to an embodiment of the present invention may be implemented in hardware, firmware, or as software or computer code that can be stored in a recording medium (such as a CDROM, RAM, floppy disk, hard disk, or magneto-optical disk), or as computer code that is originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and will be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor, or hardware, the method for displaying a page of search results described herein is implemented. In addition, when a general-purpose computer accesses code for implementing the method for displaying a page of search results shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method for displaying a page of search results shown herein.
[0268] Usage scenarios
[0269] In this usage scenario, an example is taken to explain how to suspend an expanded page on a page displaying search results and display the search results. Fig.12 A page for displaying search results is shown, which includes simulated tab pages 1-5, and the process of lifting the expanded page and displaying the search results includes:
[0270] Step A: Generate an asynchronous API request based on the search entity information and tab information indicated by the acquired display expansion state instruction.
[0271] For example, when a user clicks on tab 2 in the page displaying search results, since tab 2 is the entry to the expanded page, a display expanded page instruction is generated and obtained. The display expanded page instruction is used to indicate search entity information (such as search entity words, industry entity unique identifiers, etc.) and tab information (such as the tab identifier of tab 2), etc.
[0272] Those skilled in the art may generate matching asynchronous API requests using search entity information and tab page information according to business settings of different business scenarios.
[0273] Step B: obtaining the data required for the expanded page according to the asynchronous API request, and splicing the API of the script language template corresponding to the tab page through the data required for the expanded page.
[0274] Send an asynchronous API request to the server through asynchronous request mode. In this usage scenario, the server executes the following according to the received asynchronous API request: Fig.13 The process shown in the figure includes:
[0275] If the asynchronous API request suspends the expanded page frame (max.php), the parameters (parseParams) in the asynchronous API request are parsed according to the configuration of max.php to obtain search entity words, industry entity unique identifiers, etc.
[0276] Process the parsing results to obtain the API parameters (apiParams) that meet the requirements of the business database, so that flexible control interface parameter configuration can be achieved. The API parameters are the parameters required when requesting data from the business database. For different business databases, the API parameters may be different.
[0277] According to the obtained API parameters and business database configuration, max.php uses the data acquisition method configured in the business database to request data from the business database and send the API parameters (such as search entity words, etc.) to the business database. In this usage scenario, three business database data acquisition methods are listed, such as the unified acquisition method (getArbiterData), the API method (getApiData), and the secondary search method (getUrlData).
[0278] Get the original data (maxdata) returned by the business database. Parse the original data (parseMaxdata), obtain data that complies with the HTML specification (getMaxHtml), and generate the data of the expanded page (pageData) based on the data that complies with the HTML specification. The data of the expanded page includes data (data), errors (err), and messages (msg), among which the data (data) includes the color information (color), log information (log), settings information (settings), and tpl data of the expanded page.
[0279] As required, those skilled in the art may configure to execute debug when parsing the original data and display the debug result (showDebug).
[0280] The data required for the expanded page returned by the server and obtained by the browser may be all or part of the data of the expanded page mentioned above. In this usage scenario, the data required for the expanded page includes setting information, and the setting information includes the tab page identifier of the tab page included in the expanded page. The browser can splice the API of the script language template corresponding to the tab page according to the obtained tab page identifier.
[0281] It should be noted that when splicing the APIs of the script language templates corresponding to the tabs, the APIs of the script language templates of all the tabs may be spliced, or only the APIs of the script language templates of the required tabs may be spliced.
[0282] Step C: loading the API of the script language template in an asynchronous request manner, and rendering the data of the script language template to display an expanded page of the search results.
[0283] The API of the script language template is loaded in an asynchronous request mode to obtain the data of the script language template, including the content data of the tab page, such as the floating page of the tab page, text content, etc. According to the obtained data of the script language template, the corresponding API is called to obtain the corresponding floating frame and floating page, and the floating frame, floating page and the content therein are rendered to display the expanded page of the search result.
[0284] Step D: Configure front-end routing.
[0285] The browser can also configure the front-end routing according to the data required by the received expanded page. For example, according to business needs, add regular matching rules, set hooks, use the matching method match() to obtain parameters (Params) in the URL, search for entity words (query), hash values (hash) and paths (path), etc., or operate the browser history through the navigation method navigate(), push method push(), replace method replace() or listen method listen() in Html5API or HashAPI.
[0286] Step E: Acquire content data of the tab page to be switched according to the received tab page switching request and the front-end route matching the tab page to be switched.
[0287] When the user clicks on a tab page in the displayed expanded state page, a tab page switching request is generated and received. According to the received tab page switching request and the front-end route matching the tab page to be switched, the content data of the tab page to be switched is obtained.
[0288] If the user clicks on some other entity (such as a song or movie) in the displayed expanded page, the expanded page of the clicked entity can be lifted and displayed through the current expanded page. This process is the same or similar to the aforementioned process of lifting and displaying the expanded page, so it will not be repeated here.
[0289] Since the expanded page of one entity can directly link up the expanded page of another entity, and the switching between the expanded pages of the two entities is achieved through front-end routing, there is no need to refresh the page, and this method has better return to the source and guides user clicks.
[0290] In this usage scenario, the expanded page can be suspended from any page, and any tab can be switched in the expanded page without refreshing the page. It can also be achieved that the expanded page of any entity can be suspended from the expanded page of another entity without refreshing the page. This avoids the problem in the prior art that a page refresh operation is performed when switching between pages displaying search results or floating layer simulated tabs, which causes the browser to wait and the screen to flash, affecting the user experience.
[0291] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present invention.
[0292] The above implementation methods are only used to illustrate the embodiments of the present invention, and are not limitations of the embodiments of the present invention. Ordinary technicians in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the embodiments of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present invention. The patent protection scope of the embodiments of the present invention should be defined by the claims.
Claims
1. A method for displaying a search result page, characterized in that: include: Generate an asynchronous API request according to the search entity information and tab page information indicated by the acquired display expansion state instruction, wherein the display expansion state instruction is used to instruct to search according to the search entity information and display the search results through the expansion state page; Obtain the data required for the expanded page according to the asynchronous API request, and splice the API of the script language template corresponding to the tab page with the data required for the expanded page; Loading the API of the scripting language template in an asynchronous request manner, and rendering the data of the scripting language template to display an expanded page of the search results; According to the tab page in the expanded page, use the front-end routing framework to configure the front-end routing corresponding to the tab page; According to the received tab page switching request and the front-end route matching the tab page to be switched, the content data of the tab page to be switched is obtained.
2. The method according to claim 1, characterized in that The data required for the expanded page includes setting information, and the setting information is used to indicate the tab pages included in the expanded page.
3. The method according to claim 2, characterized in that The API for obtaining the data required for the expanded page according to the asynchronous API request, and splicing the script language template corresponding to the tab page with the data required for the expanded page, is specifically: The data required by the expanded page is obtained according to the asynchronous API request, and the API of the script language template corresponding to the tab page is spliced through the setting information and the preset splicing rule.
4. The method according to claim 3, characterized in that The expanded page includes a floating layer framework developed for the ILayer interface, and the floating layer framework includes a label area for displaying the name of the label page and a content area for displaying the content of the label page.
5. The method according to claim 4, characterized in that The step of loading the API of the scripting language template in an asynchronous request manner and rendering the data of the scripting language template to display an expanded page of the search results includes: Loading the API of the script language template in an asynchronous request manner, rendering the data of the script language template in the content area of the expanded page, and rendering the tab page name of the tab page indicated by the setting information in the tab area of the expanded page; An expanded page of the search results is displayed according to the rendering data of the tag area and the content area.
6. The method according to claim 1, characterized in that The content data of the tab page to be switched is the content data obtained in advance by calling the API of the spliced script language template corresponding to the tab page to be switched in an asynchronous request manner.
7. A method for displaying a search result page, characterized in that: include: Receiving an expansion trigger operation for lifting an expansion state page entry in the current page, and generating a display expansion state instruction according to the expansion trigger operation, wherein the display expansion state instruction is used to instruct to search according to the search entity information and display the search results through the expansion state page; Generate an asynchronous API request according to the search entity information and tab page information corresponding to the display expansion state instruction, and obtain the data required for the expansion state page through the asynchronous API request; According to the data required for the expanded page, the API of the script language template corresponding to the tab page is spliced, and the data obtained through the API of the script language template is rendered to display the expanded page of the search result; Receiving a switch triggering operation for a tab page to be displayed in the expanded page, and generating a tab page switch request according to the switch triggering operation; According to the tab page switching request and the front-end route matching the tab page to be switched, the content data of the tab page to be switched is obtained and rendered and displayed.
8. The method according to claim 7, characterized in that The method further comprises: Determining an associated tab page associated with the displayed tab page according to a positional relationship between the tab pages in the expanded page; Pre-acquire content data of the associated tab page according to the API of the script language template corresponding to the associated tab page, so as to render and display the pre-acquired content data of the associated tab page when a switch trigger operation for the associated tab page is received.
9. A device for displaying search results on a page, characterized in that: include: A generating module, configured to generate an asynchronous API request according to the search entity information and the tab page information indicated by the acquired display expansion state instruction, wherein the display expansion state instruction is used to instruct to search according to the search entity information and display the search results through the expansion state page; A splicing module, used to obtain the data required for the expanded page according to the asynchronous API request, and splice the API of the script language template corresponding to the tab page through the data required for the expanded page; A loading module, used to load the API of the scripting language template through an asynchronous request, and render the data of the scripting language template to display an expanded page of the search results; A configuration module, configured to configure a front-end route corresponding to the tab page using a front-end routing framework according to the tab page in the expanded page; The switching module is used to obtain content data of the tab page to be switched according to the received tab page switching request and the front-end route matching the tab page to be switched.
10. The device according to claim 9, characterized in that The data required for the expanded page includes setting information, and the setting information is used to indicate the tab pages included in the expanded page.
11. The device according to claim 10, characterized in that The splicing module is used to obtain the data required by the expanded page according to the asynchronous API request, and splice the API of the script language template corresponding to the tab page according to the setting information and the preset splicing rule.
12. The device according to claim 11, characterized in that The expanded page includes a floating layer framework developed for the ILayer interface, and the floating layer framework includes a label area for displaying the name of the label page and a content area for displaying the content of the label page.
13. The device according to claim 12, characterized in that The loading module includes: a rendering module, configured to load the API of the script language template by asynchronous request, render the data of the script language template in the content area of the expanded page, and render the tab page name of the tab page indicated by the setting information in the tab area of the expanded page; The display module is used to display the expanded page of the search results according to the rendering data of the label area and the content area.
14. The device according to claim 9, characterized in that The content data of the tab page to be switched is the content data obtained by calling the API of the spliced script language template corresponding to the tab page to be switched in advance in an asynchronous request manner.
15. A device for displaying search results on a page, characterized in that: include: A first receiving module is used to receive an expansion trigger operation for lifting an expansion state page entrance in the current page, and generate a display expansion state instruction according to the expansion trigger operation, wherein the display expansion state instruction is used to instruct to search according to the search entity information and display the search results through the expansion state page; A data acquisition module, used to generate an asynchronous API request according to the search entity information and tab page information corresponding to the display expansion state instruction, and obtain the data required for the expansion state page through the asynchronous API request; A rendering and display module, used to splice the API of the script language template corresponding to the tab page according to the data required by the expanded page, and render the data obtained through the API of the script language template to display the expanded page of the search result; A second receiving module is used to receive a switching trigger operation for a tab page to be displayed in the search result page, and generate a tab page switching request according to the switching trigger operation; The switching display module is used to obtain and render the content data of the tab page to be switched according to the tab page switching request and the front-end route matching the tab page to be switched.
16. The device according to claim 15, characterized in that The device also includes: an association determination module, which determines an associated tab page associated with the displayed tab page according to a positional relationship between tab pages in the search result page; The preloading module is used to pre-acquire the content data of the associated tab page according to the API of the script language template corresponding to the associated tab page, so as to render and display the pre-acquired content data of the associated tab page when a switching trigger operation for the associated tab page is received.
17. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the method for displaying search results on a page as described in any one of claims 1-6, or to perform operations corresponding to the method for displaying search results on a page as described in any one of claims 7-8.
18. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for displaying a search result on a page as claimed in any one of claims 1 to 6 is implemented, or when the program is executed, the method for displaying a search result on a page as claimed in any one of claims 7 to 8 is implemented.
Citation Information
Patent Citations
New tab pages and bookmark toolbars in a browser
CN102349066A
Information searching method and device
CN104951491A
