CN114969579A - Breadcrumb navigation generation method and device and computer readable storage medium - Google Patents
Breadcrumb navigation generation method and device and computer readable storage medium Download PDFInfo
- Publication number
- CN114969579A CN114969579A CN202210405491.2A CN202210405491A CN114969579A CN 114969579 A CN114969579 A CN 114969579A CN 202210405491 A CN202210405491 A CN 202210405491A CN 114969579 A CN114969579 A CN 114969579A
- Authority
- CN
- China
- Prior art keywords
- page
- information
- routing information
- navigation
- routing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 235000012813 breadcrumbs Nutrition 0.000 title claims abstract description 204
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000004590 computer program Methods 0.000 claims description 8
- 230000007547 defect Effects 0.000 abstract description 4
- 238000007726 management method Methods 0.000 description 22
- 230000000694 effects Effects 0.000 description 14
- 230000006870 function Effects 0.000 description 13
- 238000004891 communication Methods 0.000 description 11
- 238000012545 processing Methods 0.000 description 11
- 230000002093 peripheral effect Effects 0.000 description 10
- 230000001133 acceleration Effects 0.000 description 9
- 238000012423 maintenance Methods 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000013459 approach Methods 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 2
- 239000000919 ceramic Substances 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000033228 biological regulation Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/954—Navigation, e.g. using categorised browsing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9566—URL specific, e.g. using aliases, detecting broken or misspelled links
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Navigation (AREA)
Abstract
The application discloses a breadcrumb navigation generation method and device and a computer readable storage medium, and belongs to the technical field of computers. The technical scheme can automatically generate the breadcrumb navigation and reduce the defects of manual arrangement. In addition, in the present solution, the page level of the corresponding page is indicated to be consistent with the routing level through the indication tag, and if the current page does not have the indication tag, which indicates that the page level of the current page may not be consistent with the routing level, the breadcrumbs navigation of the current page is generated based on the historical navigation information. That is, since the routing hierarchy between the pages is strict, the page hierarchy is not strict, and the routing hierarchy may not be completely consistent with the page hierarchy, the present solution is not limited to generating the breadcrumb navigation strictly according to the routing hierarchy of the pages, and the generated breadcrumb navigation can more accurately represent the page hierarchy.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for generating breadcrumb navigation, and a computer-readable storage medium.
Background
At present, for some websites with complex structures, breadcrumb navigation can be generated for each page in the website, and the position of the page in the website can be more clearly known by visitors by using the breadcrumb navigation, so that the visitors can quickly jump among pages of different levels.
For example, the name of the current page browsed by the visitor is 'activity detail', and the breadcrumbs navigation of the current page is 'home page > activity management > activity list > activity detail', and it can be seen that the breadcrumbs navigation embodies the hierarchical relationship of four pages in the website and also embodies the position of the current page in the website. In addition, the visitor can jump to the corresponding page by clicking the name of any level of page in the breadcrumb navigation, for example, the visitor can return to the home page of the website by clicking the 'home page'.
In the related art, a technician is required to manually arrange configuration data of the breadcrumb navigation of each page, and generate the breadcrumb navigation of each page based on the configuration data. However, the manual arrangement has the disadvantages of large workload, low efficiency, easy error and inconvenience for later maintenance.
Disclosure of Invention
The application provides a breadcrumb navigation generation method and device and a computer readable storage medium, which can automatically generate breadcrumb navigation, reduce workload, improve efficiency, are not easy to make mistakes, and are convenient for later maintenance, and the generated breadcrumb navigation can also more accurately reflect a page level relation. The technical scheme is as follows:
in one aspect, a method for generating breadcrumb navigation is provided, the method comprising:
determining target routing information, wherein the target routing information is the routing information of the current page;
if the target routing information does not have an indication tag, acquiring historical navigation information, wherein the indication tag is used for indicating that the page level of the corresponding page is consistent with the routing level, and the historical navigation information is used for indicating breadcrumb navigation of the last page visited before the current page;
generating a breadcrumb navigation for the current page based on the historical navigation information and the target routing information.
Optionally, the historical navigation information includes routing information of one or more pages, and the routing information of the one or more pages is arranged in an order from high to low according to a page level;
generating the breadcrumb navigation of the current page based on the historical navigation information and the target routing information, comprising:
and if the historical navigation information comprises the target routing information, generating the breadcrumb navigation of the current page based on the routing information from the first page to the current page in the historical navigation information.
Optionally, the method further comprises:
and updating the historical navigation information into the routing information from the first page to the current page in the historical navigation information.
Optionally, the historical navigation information includes routing information of one or more pages, and the routing information of the one or more pages is arranged in an order from high to low according to a page level;
generating the breadcrumb navigation of the current page based on the historical navigation information and the target routing information, comprising:
if the historical navigation information does not include the target routing information, splicing the target routing information to the last page of the historical navigation information to obtain the navigation information of the current page;
and generating the breadcrumb navigation of the current page based on the navigation information of the current page.
Optionally, the method further comprises:
and updating the historical navigation information into the navigation information of the current page.
Optionally, after determining the target routing information, the method further includes:
if the target routing information has the indication label, acquiring routing information from a root node to all nodes of a target node in a routing tree, wherein the routing tree is used for describing a routing hierarchy relation of each page in a website to which the current page belongs, the target node is a node corresponding to the current page, and the root node is a node corresponding to a root page of the website;
and generating the breadcrumb navigation of the current page based on the acquired routing information of all the nodes.
Optionally, the obtaining of the routing information of all nodes from the root node to the target node in the routing tree includes:
and searching the routing information of each node from the root node of the routing tree downwards step by step in a recursive mode until the target routing information is searched, and obtaining the routing information of all nodes from the root node to the target node.
Optionally, after obtaining the routing information from the root node to all nodes of the target node in the routing tree, the method further includes:
and storing the routing information of all nodes from the root node to the target node as historical navigation information.
In another aspect, there is provided a breadcrumb navigation generating apparatus comprising:
the determining module is used for determining target routing information, and the target routing information is the routing information of the current page;
a first obtaining module, configured to obtain historical navigation information if the target routing information does not have an indication tag, where the indication tag is used to indicate that a page level of a corresponding page is consistent with a routing level, and the historical navigation information is used to indicate breadcrumb navigation of a previous page visited before the current page;
and the generating module is used for generating the breadcrumb navigation of the current page based on the historical navigation information and the target routing information.
Optionally, the historical navigation information includes routing information of one or more pages, and the routing information of the one or more pages is arranged in an order from high to low according to a page level;
the generation module comprises:
and the first generation sub-module is used for generating the breadcrumbs navigation of the current page based on the routing information from the first page to the current page in the historical navigation information if the historical navigation information comprises the target routing information.
Optionally, the apparatus further comprises:
and the first updating module is used for updating the historical navigation information into the routing information from the first page to the current page in the historical navigation information.
Optionally, the historical navigation information includes routing information of one or more pages, and the routing information of the one or more pages is arranged in an order from high to low according to a page level;
the generation module comprises:
the splicing sub-module is used for splicing the target routing information to the routing information of the last page in the historical navigation information to obtain the navigation information of the current page if the historical navigation information does not include the target routing information;
and the second generation submodule is used for generating the breadcrumb navigation of the current page based on the navigation information of the current page.
Optionally, the apparatus further comprises:
and the second updating module is used for updating the historical navigation information into the navigation information of the current page.
Optionally, the apparatus further comprises:
a second obtaining module, configured to obtain, if the target routing information has the indication tag, routing information of all nodes from a root node to a target node in a routing tree, where the routing tree is used to describe a routing hierarchy relationship of each page in a website to which the current page belongs, the target node is a node corresponding to the current page, and the root node is a node corresponding to a root page of the website;
and the second generation module is used for generating the breadcrumb navigation of the current page based on the acquired routing information of all the nodes.
Optionally, the second obtaining module includes:
and the obtaining submodule is used for searching the routing information of each node from the root node of the routing tree downwards step by step in a recursive mode until the target routing information is searched, and obtaining the routing information of all nodes from the root node to the target node.
Optionally, the apparatus further comprises:
and the storage module is used for storing the routing information of all the nodes from the root node to the target node as historical navigation information.
In another aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus, the memory is used for storing computer programs, and the processor is used for executing the programs stored in the memory to implement the steps of the breadcrumbs navigation generation method. The electronic device also includes a display screen to display the generated breadcrumb navigation.
In another aspect, a computer-readable storage medium is provided, in which a computer program is stored, which, when being executed by a processor, implements the steps of the method for generating a breadcrumb navigation described above.
In another aspect, a computer program product is provided comprising instructions which, when run on a computer, cause the computer to perform the steps of the method for generating breadcrumb navigation described above.
The technical scheme provided by the embodiment of the application can at least bring the following beneficial effects:
the technical scheme can automatically generate the breadcrumb navigation, reduces the defects of manual arrangement, namely reduces the workload, improves the efficiency, is not easy to make mistakes and is convenient for later maintenance. In addition, in the scheme, the page level of the corresponding page is indicated to be consistent with the routing level through the indication tag, and if the current page does not have the indication tag, the page level of the current page is possibly inconsistent with the routing level, and then the breadcrumbs navigation of the current page is generated based on the historical navigation information. That is, since the routing hierarchy between the pages is strict, the page hierarchy is not strict, and the routing hierarchy may not be completely consistent with the page hierarchy, the present solution is not limited to generating the breadcrumb navigation strictly according to the routing hierarchy of the pages, and the generated breadcrumb navigation can more accurately represent the page hierarchy.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a method for generating breadcrumb navigation according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a device for generating breadcrumb navigation according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application more clear, the embodiments of the present application will be further described in detail with reference to the accompanying drawings.
In a related technique of generating a breadcrumb navigation, a technician is required to manually arrange configuration data of the breadcrumb navigation of each page, and generate the breadcrumb navigation of each page based on the configuration data. In another related technique for generating breadcrumb navigations, the breadcrumb navigations are automatically generated strictly in accordance with the routing hierarchy of the various pages in the web site.
However, the routing hierarchy of each page in the website is embodied by the source code of the website written by the technical staff, and the routing hierarchy of each page is strict, that is, any child node in the routing tree can only have one parent node. The routing tree is used for describing the routing hierarchical relation of each page in the website. Illustratively, a routing tree includes two paths, 'file management > file list > preview' and, 'file management > file list > edit'. Then 'preview' and 'edit' are only possible as third level navigation in breadcrumb navigation if the breadcrumb navigation is generated strictly in terms of the routing hierarchy.
But the skilled person may also desire to generate breadcrumb navigations such as 'file management > file list > edit > preview', 'file management > file list > preview > edit', which are not possible in the related art in terms of routing hierarchy. It can be seen that the page directory tree and the routing tree constructed in the related art are completely consistent, that is, the page hierarchy and the routing hierarchy of each page are completely consistent. The page directory tree that the technician desires to build is not completely consistent with the routing tree. The page directory tree is used for describing the page hierarchical relationship of each page in the website.
In other words, the page hierarchy of each page is not strict in actual demand, and any child node in the page directory tree may have one or more parent nodes. For example, the page directory tree includes several paths of 'file management > file list > preview', 'file management > file list > edit > preview', 'file management > file list > preview > edit'. It can be seen that 'preview' and 'edit' each have two parents, both as a third level navigation in breadcrumb navigation and as a fourth level navigation. The breadcrumb navigation generated by the breadcrumb navigation generation method provided by the embodiment of the application can more accurately describe the page hierarchical relationship and meet the actual requirements.
It should be noted that the system architecture and the service scenario described in the embodiment of the present application are for more clearly illustrating the technical solution of the embodiment of the present application, and do not constitute a limitation to the technical solution provided in the embodiment of the present application, and as a person having ordinary skill in the art knows that along with the evolution of the system architecture and the appearance of a new service scenario, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems.
Next, a detailed explanation is given to a method for generating breadcrumb navigation provided in the embodiment of the present application. Fig. 1 is a flowchart of a method for generating breadcrumb navigation according to an embodiment of the present application. The method is described as applied to an electronic device. Referring to fig. 1, the method includes the following steps.
Step 101: and determining target routing information, wherein the target routing information is the routing information of the current page.
In the embodiment of the application, after receiving a page loading instruction, the electronic device determines target routing information, that is, routing information of a current page, based on the page loading instruction, where the current page is a page requested to be loaded by the page loading instruction. The page loading instruction can be generated by clicking a page name in the breadcrumb navigation, inputting a website by a user, searching keywords and the like.
Optionally, the electronic device obtains the target routing information from the source code of the current page. Illustratively, the electronic device searches a code segment with a reference character, which is defined in advance, such as a 'path' character, from the source code of the current page to obtain the target routing information, i.e., the code segment includes the target routing information defined by the technician. The electronic device may also determine the target routing information in other manners, which is not limited in this embodiment of the present application.
It should be noted that the routing information of the page represents a path mapping relationship of the page, and the electronic device may obtain resources required for generating the page based on the routing information of the page, so as to generate the page. In this embodiment of the present application, the routing information of the page is used to generate the breadcrumb navigation, and the generated breadcrumb navigation includes the page jump address of each page, that is, the visitor can jump to the corresponding page according to the page jump address by clicking the page name of any one page in the breadcrumb navigation.
In the embodiment of the present application, the destination routing information includes a page name and a Uniform Resource Locator (URL) of the current page. The page name of the current page is used for being displayed in the breadcrumbs navigation bar, the URL of the current page is used for generating a link of the current page, the link of the current page is used for being displayed in the link bar of the browser and serves as an attached attribute of the page name of the current page in the breadcrumbs navigation, and therefore page skipping is conducted when the electronic equipment detects clicking operation on the page name in the breadcrumbs navigation, namely the current page is refreshed.
Optionally, the destination routing information further includes one or more of a routing name, a routing parameter, a path parameter, and a redirect address of the current page. And under the condition that the target routing information does not comprise the redirection address, the routing parameter and the path parameter of the current page are used for being spliced behind the URL of the current page to obtain the link of the current page. In the case where the destination routing information includes a redirect address, the redirect address is a link to the current page. The electronic equipment is used for generating the corresponding page according to the link of the current page.
Stated another way, if the routing information of a page includes both the URL of the page and the redirection address of the page, then the link of the page is actually the redirection address, and each time the electronic device receives a page loading instruction about the page, the page corresponding to the redirection address is displayed, and the current page is substantially the page corresponding to the redirection address. For example, when the electronic device receives a page loading instruction about the page for the first time, the generated page is a page corresponding to the redirection address. And the electronic equipment also jumps to the page corresponding to the redirection address under the condition of detecting the clicking operation on the page name of the page in the breadcrumbs navigation.
In short, if the routing information of a page includes a URL and does not include a redirect address, the electronic devices generate pages based on the URL and the page jump address is based on the URL. If the routing information of a page includes both the URL of the page and the redirection address of the page, the electronic equipment displays the page according to the redirection address, and the page jump address and the redirection address are also according to the redirection address.
Optionally, the destination routing information further includes a return parameter, and the return parameter includes display instruction information of a return button. The display indication information is used to indicate whether a return button is displayed in the breadcrumbs navigation of the current page. Wherein the return button may be displayed on the right side of the breadcrumbs navigation bar and the page names of the respective pages in the breadcrumbs navigation bar may be displayed on the left side of the breadcrumbs navigation bar.
Optionally, in a case that the display instruction information indicates that the return button is displayed in the breadcrumbs navigation of the current page, the return parameter further includes a return address, and the return address is used for jumping to a page corresponding to the return address in a case that a click operation of the return button in the breadcrumbs navigation of the current page is detected. It should be noted that, in a case where the display instruction information indicates that the return button is displayed in the breadcrumbs navigation of the current page and the return parameter does not include the return address, if the click operation of the return button in the breadcrumbs navigation of the current page is detected, the previous page visited before the current page is returned.
Illustratively, the routing information of the current page includes label, URL, params, queryParams, redirect, and data, including breakcolumn, showBack, and backPath. The label, the URL, the params, the queryParams, the redirect and the data respectively represent a route name, a uniform resource locator, a path parameter, a route parameter, a redirection address and a self-defined parameter of the current page. The breakstem, showBack, and backPath represent a page name of the current page, display instruction information of the back button, and a return address, respectively. Wherein, the values of params, queryParams, redirect, showBack and backPath can be null.
In the embodiment of the present application, the routing information of one page may have an indication tag in addition to the above-described content, and the indication tag is used to indicate that the page level of the corresponding page is consistent with the routing level. It should be noted that the relationship between the page level and the routing level of the page in the solution is divided into two cases, in one case, the page level of one page is completely consistent with the routing level, and in another case, the page level of one page may not be consistent with the routing level, so that the two cases are distinguished by using the indication tag in the solution, so that the generated breadcrumbs navigation can more accurately represent the page level relationship.
Optionally, the routing information of one page has an indication tag, that is, the routing information of the page includes the indication tag. For example, the routing information of a page includes a custom parameter, which includes an indicator tag. Or, the routing information of one page has an indication tag, that is, the routing information of the page corresponds to the indication tag. For example, the source code of a page includes the routing information and the indication tag of the page. Wherein, the indication label can be' node: true ',' root: true 'or' node: 1', etc.
Step 102: if the target routing information does not have an indication tag, historical navigation information is obtained, the indication tag is used for indicating that the page level of the corresponding page is consistent with the routing level, and the historical navigation information is used for indicating breadcrumb navigation of the last page visited before the current page.
In the embodiment of the application, if the target routing information does not have the indication tag, which indicates that the page level of the current page may be inconsistent with the routing level, the electronic device acquires the historical navigation information so as to generate the breadcrumbs navigation of the current page based on the historical navigation information. Wherein the historical navigation information is used to indicate breadcrumb navigation of a last page visited before the current page.
Optionally, the historical navigation information is stored in the electronic device, and the electronic device obtains the historical navigation information from the local storage space. Or, the historical navigation information is stored in a server of the website to which the current page belongs, and the electronic equipment acquires the historical navigation information from the server.
In the embodiment of the application, the historical navigation information comprises routing information of one or more pages, and the routing information of the one or more pages is arranged in the order of the page hierarchy from high to low. Illustratively, the breadcrumbs of the last page visited before the current page are navigated to 'home > activity management > activity list', then the historical navigation information includes the routing information for three pages, which are arranged in order in accordance with 'home, activity management, activity list'.
In other embodiments, the routing information for one or more pages in the historical navigation information is arranged in order from lower to higher page levels. Illustratively, the routing information of the three pages is arranged in order consistent with 'activity list, activity management, home page'.
In still other embodiments, the routing information of each page in the historical navigation information corresponds to a sequence number, the sequence number corresponding to the routing information of each page is consistent with the page level of the corresponding page, and the routing information of one or more pages may not be arranged in the order from high to low of the page level, or may not be arranged in the order from low to high of the page level, but may be arranged randomly. Illustratively, the ' home page ', ' campaign management ', and ' campaign list ' correspond to the sequence numbers ' 1 ', ' 2 ', and ' 3 ', respectively, and then the routing information of these three pages may be sequentially arranged in an order consistent with the ' home page, ' campaign list, and campaign management ', may also be sequentially arranged in an order consistent with the ' campaign list, home page, and campaign management ', and may also be sequentially arranged in other orders.
Optionally, the electronic device stores historical navigation information through a first array, and the routing information of each page in the historical navigation information is an element in the first array. Assuming that the routing information of the one or more pages is arranged in order from the high to the low of the page hierarchy, taking the breadcrumbs navigation of the last page visited before the current page as 'home > activity management > activity list' as an example, the first element in the first array is the routing information of the page with the page name 'home', the second element is the routing information of the page with the page name 'activity management', and the third element is the routing information of the page with the page name 'activity list'.
Step 103: generating a breadcrumb navigation for the current page based on the historical navigation information and the target routing information.
In the embodiment of the application, in the case that the routing information of the current page does not have the indication tag, the electronic device generates the breadcrumb navigation of the current page based on the historical navigation information and the target routing information.
It should be noted that, in this solution, the historical navigation information acquired by the electronic device may or may not include the target route information. Based on this, the electronic device may first determine whether the historical navigation information includes the target routing information, so as to facilitate case-by-case processing.
Next, an implementation process of generating breadcrumb navigation by an electronic device in a case where target routing information is included in history navigation information will be described first.
And if the historical navigation information comprises the target routing information, the electronic equipment determines the navigation information of the current page from the historical navigation information, and generates the breadcrumb navigation of the current page based on the navigation information of the current page. In other words, the historical navigation information includes the navigation information of the current page, and the electronic device generates the breadcrumb navigation of the current page according to the navigation information of the current page in the historical navigation information.
As can be seen from the foregoing, the arrangement of each routing information in the historical navigation information is various, and based on this, when the target routing information is included in the historical navigation information, there are also various implementations of breadcrumbs navigation that the electronic device generates the current page, and three implementations thereof will be described next.
In a first implementation, the historical navigation information includes routing information of one or more pages, and the routing information of the one or more pages is arranged in an order from high to low in a page hierarchy. And if the historical navigation information comprises the target routing information, the electronic equipment generates the breadcrumb navigation of the current page based on the routing information from the first page to the current page in the historical navigation information. And the routing information from the first page to the current page in the historical navigation information is the navigation information of the current page determined by the electronic equipment from the historical navigation information.
In this implementation, the electronic device generates the respective page names in the breadcrumb navigation in the same order as the routing information from the first page to the current page in the historical navigation information, such that the respective page names in the generated breadcrumb navigation are arranged in the order of page level from high to low.
The electronic device generates breadcrumb navigation of the current page based on the routing information from the first page to the current page in the historical navigation information in various ways. Three of these ways are described next.
Mode 1.1: the electronic equipment intercepts the routing information from the first page to the current page in the historical navigation information, and generates the breadcrumbs navigation of the current page based on the intercepted routing information.
Exemplarily, assuming that the historical navigation information is stored in the first array, the electronic device intercepts the routing information from the first page to the current page in the first array to obtain the second array. The electronic device generates a breadcrumb navigation for the current page based on the routing information for each page in the second array. And the routing information stored in the second group is the navigation information of the current page.
Mode 1.2: the electronic device deletes routing information arranged after the routing information of the current page in the historical navigation information to update the historical navigation information. The electronic device generates a breadcrumb navigation for the current page based on the updated historical navigation information. And the updated historical navigation information is the navigation information of the current page.
Mode 1.3: and the electronic equipment generates the breadcrumb navigation of the current page directly according to the routing information from the first page to the current page in the historical navigation information. It should be appreciated that in approach 1.3, the electronic device does not generate breadcrumb navigation of the current page by intercepting or deleting routing information.
Optionally, in order to facilitate the subsequent generation of the breadcrumb navigation quickly and accurately by using the historical navigation information, the electronic device updates the historical navigation information once every time the breadcrumb navigation is generated. Based on the method, the electronic equipment updates the historical navigation information into the routing information from the first page to the current page in the historical navigation information under the condition that the historical navigation information comprises the target routing information.
Illustratively, in the case of generating a breadcrumb navigation of the current page in the above manner 1.1, the electronic device updates the historical navigation information to the truncated routing information. For example, the electronic device assigns the value of the second array to the first array. In the case of generating a breadcrumb navigation of the current page in the above manner 1.2, the electronic device has updated the historical navigation information in the course of generating the breadcrumb of the current page. In the case of generating the breadcrumb navigation of the current page in the above manner 1.3, the electronic equipment deletes the route information arranged after the route information of the current page in the history navigation information to update the history navigation information. Or, the electronic device may also intercept the route information from the first page to the current page in the historical navigation information, and update the historical navigation information to the intercepted route information.
Next, a second implementation of the electronic device generating breadcrumb navigation of the current page based on the historical navigation information and the target routing information in a case where the historical navigation information includes the target routing information will be described.
In a second implementation, the historical navigation information includes routing information for one or more pages, and the routing information for the one or more pages is arranged in an order from a lower page level to a higher page level. And if the historical navigation information comprises the target routing information, the electronic equipment generates the breadcrumb navigation of the current page based on the routing information from the current page to the last page in the historical navigation information. And the routing information from the current page to the last page in the historical navigation information is the navigation information of the current page determined by the electronic equipment from the historical navigation information.
In this implementation, the electronic device generates the respective page names in the breadcrumb navigation in an order opposite to the routing information from the current page to the last page in the historical navigation information, such that the respective page names in the generated breadcrumb navigation are arranged in an order from the high to the low of the page hierarchy.
The electronic device generates breadcrumb navigation of the current page based on the routing information from the current page to the last page in the historical navigation information in various ways. Three of these ways are described next.
Mode 2.1: and the electronic equipment intercepts the routing information from the current page to the last page in the historical navigation information, and generates the breadcrumbs navigation of the current page based on the intercepted routing information.
For example, assuming that the historical navigation information is stored in the first array, the electronic device intercepts the routing information from the ith page to the last page in the first array to obtain the second array. The electronic device generates a breadcrumb navigation for the current page based on the routing information for each page in the second array. The ith page is the current page, and the routing information stored in the second array is the navigation information of the current page.
Mode 2.2: the electronic device deletes routing information arranged before the routing information of the current page in the historical navigation information to update the historical navigation information. The electronic device generates a breadcrumb navigation for the current page based on the updated historical navigation information. And the updated historical navigation information is the navigation information of the current page.
Mode 2.3: and the electronic equipment directly generates the breadcrumb navigation of the current page according to the routing information from the current page to the last page in the historical navigation information. It should be appreciated that in approach 2.3, the electronic device does not generate breadcrumb navigation of the current page by intercepting or deleting routing information.
Optionally, similar to the first implementation described above, in a second implementation, the electronic device updates the historical navigation information each time the breadcrumb navigation is generated by the electronic device. Based on the above, the electronic device updates the historical navigation information to the routing information from the current page to the last page in the historical navigation information when determining that the historical navigation information includes the target routing information.
Illustratively, in the case of generating the breadcrumb navigation of the current page in the above manner 2.1, the electronic device updates the historical navigation information to the truncated routing information. For example, the electronic device assigns the value of the second array to the first array. In the case of generating a breadcrumb navigation for the current page in the manner 2.2 described above, the electronic device has updated the historical navigation information in the course of generating the breadcrumb for the current page. In the case of generating the breadcrumb navigation of the current page in the above manner 2.3, the electronic equipment deletes the route information arranged before the route information of the current page in the history navigation information to update the history navigation information. Or, the electronic device may also intercept the routing information from the first page to the current page to the last page in the historical navigation information, and update the historical navigation information to the intercepted routing information.
Next, a third implementation of generating breadcrumb navigation of a current page by the electronic device based on the historical navigation information and the target routing information in a case where the historical navigation information includes the target routing information will be described.
In a third implementation manner, the historical navigation information includes routing information of one or more pages, the routing information of each page in the historical navigation information corresponds to a sequence number, the sequence number corresponding to the routing information of each page is consistent with a page level of the corresponding page, and the routing information of the one or more pages can be arranged randomly. And if the historical navigation information comprises target routing information, the electronic equipment determines a target serial number, wherein the target serial number is a serial number corresponding to the routing information of the current page, acquires the routing information of the page, of which the corresponding serial number is smaller than or equal to the target serial number, in the historical navigation information, and generates breadcrumbs navigation of the current page based on the acquired routing information. The obtained routing information is navigation information of a current page determined by the electronic equipment from historical navigation information.
In this implementation, the electronic device generates the respective page names in the breadcrumb navigation in an order from the smaller to the larger of the corresponding sequence numbers, such that the respective page names in the generated breadcrumb navigation are arranged in an order from the higher to the lower of the page hierarchy.
Optionally, similar to the first implementation manner, in a third implementation manner, the electronic device updates the historical navigation information once every time the breadcrumb navigation is generated. Based on the method, the electronic equipment updates the historical navigation information into the route information of the page with the corresponding sequence number smaller than or equal to the target sequence number in the historical navigation information under the condition that the target route information is determined to be included in the historical navigation information. Illustratively, the electronic device updates the historical navigation information to the acquired routing information after acquiring the routing information of pages with corresponding sequence numbers smaller than and equal to the target sequence number in the historical navigation information.
Three implementations of generating breadcrumb navigation of a current page by an electronic device based on historical navigation information and target routing information in the case where the historical navigation information includes the target routing information have been introduced above. Three implementations of generating breadcrumb navigation of a current page by an electronic device based on historical navigation information and target routing information in the case where the historical navigation information does not include the target routing information are described next.
In a first implementation, the routing information of one or more pages in the historical navigation information is arranged in order from high to low in the page hierarchy. And if the historical navigation information does not include the target routing information, the electronic equipment splices the target routing information to the last page of the historical navigation information to obtain the navigation information of the current page. The electronic device generates a breadcrumb navigation for the current page based on the navigation information for the current page.
In this implementation, the electronic device generates the respective page names in the breadcrumb navigation in the same order as the routing information from the first page to the current page in the navigation information of the current page, such that the respective page names in the generated breadcrumb navigation are arranged in the order from the top to the bottom of the page hierarchy.
In a second implementation, the routing information of one or more pages in the historical navigation information is arranged in an order from lower to higher page levels. And if the historical navigation information does not include the target routing information, the electronic equipment splices the target routing information to the front of the routing information of the first page in the historical navigation information to obtain the navigation information of the current page. The electronic device generates a breadcrumb navigation for the current page based on the navigation information for the current page.
In this implementation, the electronic device generates the respective page names in the breadcrumb navigation in an order opposite to the routing information from the current page to the last page in the navigation information of the current page such that the respective page names in the generated breadcrumb navigation are arranged in an order from the high to the low of the page hierarchy.
In a third implementation manner, the routing information of each page in the historical navigation information corresponds to a sequence number, the sequence number corresponding to the routing information of each page is consistent with the page hierarchy of the corresponding page, and the routing information of one or more pages can be arranged at will. And if the historical navigation information does not comprise the target routing information, the electronic equipment determines a reference serial number, the reference serial number is the maximum serial number corresponding to the routing information in the historical navigation information, the target routing information is added into the historical navigation information to update the historical navigation information, and the reference serial number plus 1 is used as the serial number corresponding to the target routing information in the historical navigation information. The electronic device generates a breadcrumb navigation for the current page based on the updated historical navigation information. And the updated historical navigation information is the navigation information of the current page.
In this implementation, the electronic device generates the respective page names in the breadcrumb navigation in an order from the smaller to the larger of the corresponding sequence numbers, such that the respective page names in the generated breadcrumb navigation are arranged in an order from the higher to the lower of the page hierarchy.
Optionally, the electronic device updates the historical navigation information each time the breadcrumb navigation is generated. Based on this, the electronic device updates the historical navigation information to the navigation information of the current page when determining that the target routing information is not included in the historical navigation information.
The above embodiment describes the implementation process of breadcrumb navigation in which the electronic device generates the current page in the case that the target routing information does not have an indication tag through step 102 and step 103. Next, an implementation process of generating breadcrumb navigation of the current page by the electronic equipment in the case that the target routing information has the indication tag will be described.
In the embodiment of the application, after determining the target routing information, if the target routing information has the indication tag, the electronic device acquires the routing information from the root node to all nodes of the target node in the routing tree, and generates the breadcrumb navigation of the current page based on the acquired routing information of all nodes. The routing tree is used for describing the routing hierarchy relation of each page in the website to which the current page belongs, the target node is a node corresponding to the current page, and the root node is a node corresponding to a root page of the website. Briefly, if the destination routing information has an indication tag, the electronic device generates breadcrumb navigation in accordance with the routing hierarchy.
The electronic device obtains routing information of all nodes from a root node to a target node in a routing tree, and one implementation manner of the method is as follows: and searching the routing information of each node from the root node of the routing tree downwards step by step in a recursion mode until the target routing information is searched, and obtaining the routing information of all nodes from the root node to the target node.
Optionally, the electronic device obtains a target link, where the target link is a link of the current page. The electronic equipment determines path labels of all nodes from the root node to the target node from the target link, and sequentially acquires routing information of all nodes from the root node to the target node from the source code of the website according to the path labels of all nodes from the root node to the target node.
Exemplarily, assuming that the target link is http:// a/b/c.com ', the electronic device determines that the path labels from the root node to the target node are '/a ', '/b ' and '/c ' in sequence from the target link, and the electronic device first searches a code segment with a path label '/a ' from the source code of the root page to obtain the routing information of the root node. The electronic equipment searches the path labels of all child nodes of the root node from the source code of the root page, searches child nodes with path labels of '/b' from all child nodes, and acquires the positions of the source codes of the pages corresponding to the child nodes with the path labels of '/b' from the source code of the root node. The electronic equipment acquires the source code of the page corresponding to the child node with the path label of '/b' based on the position, and searches the code segment with the path label of '/b' from the source code of the page so as to acquire the routing information of the node with the path label of '/b'. And repeating the steps until the electronic equipment acquires the routing information of the node with the path label of '/c'.
It should be noted that, in addition to obtaining the routing information of each node in the routing tree by the foregoing method, the electronic device may also obtain the routing information of each node by another method, which is not limited in this embodiment of the present application.
Optionally, in the process of searching for the routing information of each node step by step in a recursive manner from the root node of the routing tree, the electronic device stores the obtained routing information in the third array every time the routing information of one node is obtained. When the electronic device acquires the routing information of one node, the acquired routing information is inserted into the last element in the third array, that is, the routing information of each node is sequentially stored according to the same sequence as the acquisition sequence of the routing information. Or, each time the electronic device acquires the routing information of one node, the acquired routing information is inserted before the first element in the third array, that is, the routing information of each node is sequentially stored in an order opposite to the acquiring order of the routing information. Or, the electronic device randomly inserts the acquired routing information into the third array every time the electronic device acquires the routing information of one node.
In the embodiment of the application, after the electronic device acquires the routing information of all the nodes from the root node to the target node in the routing tree, the electronic device stores the routing information of all the nodes from the root node to the target node as historical navigation information, so that breadcrumb navigation can be generated based on the historical navigation information. Illustratively, in the case where the historical navigation information is stored in the first array, and the route information of each node to be acquired is stored in the third array, the electronic device assigns the value of the third array to the first array after storing the target route information in the third array.
It should be noted that, in the embodiment of the present application, the present solution may be implemented by a breadcrumb assembly. For example, during a visitor's browsing of a page in a website, the electronic device renders a breadcrumb navigation of the page by invoking a breadcrumb component. The logic for implementing the breadcrumb component will be described next.
First, in order to implement the function of the breadcrumb component based on the indication tag, routing information of each page is defined in source code of a website, a page name of the corresponding page, i.e., a name of the corresponding page in breadcrumb navigation, is defined in the routing information, and whether the routing information of the corresponding page has the indication tag is also defined in the routing information. For example, if a root is defined in the routing information of a certain page: true', the routing information representing the page has an indication tag. If' root is not defined in the routing information of a certain page: true' indicates that the routing information of the page does not have an indication tag.
For example, the routing information of a page defined in the source code of the page is as follows, the routing information representing the page has an indication tag.
Second, a breadcrumb component for generating breadcrumb navigations is defined and packaged in the source code of the web site. And, in order for the electronic device to invoke the breadcrumbs component if breadcrumbs navigation needs to be generated, the breadcrumbs component is referenced in the source code of the page for which breadcrumbs navigation needs to be generated. For example, assuming that a reference to a breadcrumb component is represented by '< breadcrumbcolumn > </breadcrumbcolumn >' in the source code of a page, the electronic device invokes the breadcrumb component to generate a breadcrumb navigation for the page upon detecting the segment of '< breadcolumn > </breadcrumbcolumn >' in the source code of the page.
Variables required for generating the breadcrumb navigation, such as a plurality of breakcrumbs, are defined in the breadcrumb component and used for storing navigation information of the current page so as to render the breadcrumb navigation. A constructor function (e.g., a constructor function) is also defined in the breadcrumbs component, and is used for generating the breadcrumbs navigation of the current page according to the scheme, i.e., rendering the breadcrumbs navigation in the current page. The implementation of generating breadcrumb navigation through the constructor is described next.
And monitoring a route navigation event in the constructor, wherein the route navigation event can be an event triggered by a page loading instruction, when the route navigation event is monitored to be completed, transmitting a link of a current page into a breadcrumbs acquisition function (such as a getBackurms function), acquiring route information from a root node to all nodes of a target node in a route tree step by step downwards in a recursive manner through the breadcrumbs acquisition function, and sequentially putting the acquired route information of each node into a third array according to an acquisition sequence.
After the constructor acquires the third array, taking out the last element in the third array, wherein the element is the routing information of the current page, and judging whether the routing information of the current page comprises' root: true'. If the routing information of the current page includes' root: and true', deleting the first array stored locally, wherein the first array is used for storing historical navigation information, and assigning the value of the third array to the array breakbytes in the breadcrumb assembly. If the routing information of the current page does not include' root: and true', judging whether the first array stored locally comprises the routing information of the current page. If the first array comprises the routing information of the current page, the routing information of the 1 st to ith pages in the first array is directly intercepted to obtain a second array, the value of the second array is assigned to the array breakcolumns in the breadcrumb assembly, and the ith page is the current page. If the first array does not comprise the routing information of the current page, after the routing information of the current page is spliced to the last element in the first array, the value of the spliced first array is assigned to the array breakcounts in the breadcrumbs component.
After assigning the array breakaccums in the breadcrumbs component, the breadcrumbs component may generate the breadcrumbs navigation for the current page based on the routing information in the array breakaccums. In addition, the breadcrumb component also stores the array breakaccumbs locally as the most recent historical navigation information for the next render breadcrumb navigation.
The breadcrumb navigation generated by applying the present solution is exemplified next. In this example, taking the website includes four pages with page names of 'document management', 'document list', 'preview' and 'edit', respectively, the routing information of the pages corresponding to 'document management' and 'document list' has an indication tag, and the routing information corresponding to 'preview' and 'edit' has no indication tag. Assuming that the breadcrumbs navigation displayed in the page being browsed by the visitor is 'file management > file list', if the page corresponding to 'file list' jumps to the page corresponding to 'preview' at the first moment, the generated breadcrumbs navigation is 'file management > file list > preview'. If the page corresponding to the 'file list' is jumped to the page corresponding to the 'edit' at the first moment, the generated breadcrumbs navigation is 'file management > file list > edit'. If the page corresponding to 'edit' jumps to the page corresponding to 'preview' at the second moment, the generated breadcrumb navigation is 'file management > file list > edit > preview'.
In conclusion, the breadcrumb navigation can be automatically generated, the defects of manual arrangement are reduced, namely, the workload is reduced, the efficiency is improved, mistakes are not easy to make, and the later maintenance is convenient. In addition, in the scheme, the page level of the corresponding page is indicated to be consistent with the routing level through the indication tag, and if the current page does not have the indication tag, the page level of the current page is possibly inconsistent with the routing level, and then the breadcrumbs navigation of the current page is generated based on the historical navigation information. That is, since the routing hierarchy between the pages is strict, the page hierarchy is not strict, and the routing hierarchy may not be completely consistent with the page hierarchy, the present solution is not limited to generating the breadcrumb navigation strictly according to the routing hierarchy of the pages, and the generated breadcrumb navigation can more accurately represent the page hierarchy.
All the above optional technical solutions can be combined arbitrarily to form an optional embodiment of the present application, and the present application embodiment is not described in detail again.
Fig. 2 is a schematic structural diagram of a breadcrumbs navigation generation apparatus 200 provided in an embodiment of the present application, which may be implemented by software, hardware, or a combination of the two as part of or all of an electronic device. The electronic device is any one of the electronic devices in the above embodiments. Referring to fig. 2, the apparatus 200 includes: a determination module 201, a first acquisition module 202 and a generation module 203.
A determining module 201, configured to determine target routing information, where the target routing information is routing information of a current page;
a first obtaining module 202, configured to obtain historical navigation information if the target routing information does not have an indication tag, where the indication tag is used to indicate that a page level of a corresponding page is consistent with a routing level, and the historical navigation information is used to indicate breadcrumb navigation of a last page visited before a current page;
and the generating module 203 is used for generating the breadcrumb navigation of the current page based on the historical navigation information and the target routing information.
Optionally, the historical navigation information includes routing information of one or more pages, and the routing information of the one or more pages is arranged in the order of page hierarchy from high to low;
the generation module 203 includes:
and the first generation submodule is used for generating the breadcrumb navigation of the current page based on the routing information from the first page to the current page in the historical navigation information if the historical navigation information comprises the target routing information.
Optionally, the apparatus 200 further comprises:
and the first updating module is used for updating the historical navigation information into the routing information from the first page to the current page in the historical navigation information.
Optionally, the historical navigation information includes routing information of one or more pages, and the routing information of the one or more pages is arranged in the order of page hierarchy from high to low;
the generation module 203 includes:
the splicing submodule is used for splicing the target routing information to the routing information of the last page in the historical navigation information to obtain the navigation information of the current page if the historical navigation information does not include the target routing information;
and the second generation submodule is used for generating the breadcrumb navigation of the current page based on the navigation information of the current page.
Optionally, the apparatus 200 further comprises:
and the second updating module is used for updating the historical navigation information into the navigation information of the current page.
Optionally, the apparatus 200 further comprises:
a second obtaining module, configured to obtain, if the target routing information has an indication tag, routing information of all nodes from a root node to a target node in a routing tree, where the routing tree is used to describe a routing hierarchy relationship of each page in a website to which a current page belongs, the target node is a node corresponding to the current page, and the root node is a node corresponding to a root page of the website;
and the second generation module is used for generating the breadcrumb navigation of the current page based on the acquired routing information of all the nodes.
Optionally, the second obtaining module includes:
and the obtaining submodule is used for searching the routing information of each node from the root node of the routing tree downwards step by step in a recursive mode until the target routing information is searched, and obtaining the routing information of all nodes from the root node to the target node.
Optionally, the apparatus 200 further comprises:
and the storage module is used for storing the routing information of all nodes from the root node to the target node in the routing tree as historical navigation information.
In conclusion, the breadcrumb navigation can be automatically generated, the defects of manual arrangement are reduced, namely the workload is reduced, the efficiency is improved, errors are not easy to occur, and the later maintenance is facilitated. In addition, in the scheme, the page level of the corresponding page is indicated to be consistent with the routing level through the indication tag, and if the current page does not have the indication tag, the page level of the current page is possibly inconsistent with the routing level, and then the breadcrumbs navigation of the current page is generated based on the historical navigation information. That is, since the routing hierarchy between the pages is strict, the page hierarchy is not strict, and the routing hierarchy may not be completely consistent with the page hierarchy, the present solution is not limited to generating the breadcrumb navigation strictly according to the routing hierarchy of the pages, and the generated breadcrumb navigation can more accurately represent the page hierarchy.
It should be noted that: in the device for generating breadcrumb navigation according to the above embodiment, only the division of the above functional modules is taken as an example when the breadcrumb navigation is generated, and in practical application, the above function distribution can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules so as to complete all or part of the above described functions. In addition, the apparatus for generating breadcrumb navigation and the method for generating breadcrumb navigation provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail, and are not described herein again.
Fig. 3 shows a block diagram of an electronic device 300 according to an exemplary embodiment of the present application. The electronic device 300 may be: a smart phone, a tablet computer, a notebook computer or a desktop computer, etc. Electronic device 300 may also be referred to by other names such as computer device, terminal device, user device, portable electronic device, laptop electronic device, desktop electronic device, and so forth.
In general, the electronic device 300 includes: a processor 301 and a memory 302.
The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 301 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, the processor 301 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
In some embodiments, the electronic device 300 may further include: a peripheral interface 303 and at least one peripheral. The processor 301, memory 302 and peripheral interface 303 may be connected by a bus or signal lines. Each peripheral may be connected to the peripheral interface 303 by a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 304, display screen 305, camera assembly 306, audio circuitry 307, positioning assembly 308, and power supply 309.
The peripheral interface 303 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 301 and the memory 302. In some embodiments, processor 301, memory 302, and peripheral interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302 and the peripheral interface 303 may be implemented on a separate chip or circuit board, which is not limited by the embodiment.
The Radio Frequency circuit 304 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 304 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 304 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 304 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 304 may communicate with other electronic devices via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 304 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 305 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 305 is a touch display screen, the display screen 305 also has the ability to capture touch signals on or above the surface of the display screen 305. The touch signal may be input to the processor 301 as a control signal for processing. At this point, the display screen 305 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 305 may be one, disposed on the front panel of the electronic device 300; in other embodiments, the display screens 305 may be at least two, respectively disposed on different surfaces of the electronic device 300 or in a folded design; in other embodiments, the display 305 may be a flexible display disposed on a curved surface or a folded surface of the electronic device 300. Even further, the display screen 305 may be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display screen 305 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The camera assembly 306 is used to capture images or video. Optionally, camera assembly 306 includes a front camera and a rear camera. Generally, a front camera is disposed on a front panel of an electronic apparatus, and a rear camera is disposed on a rear surface of the electronic apparatus. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 306 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The positioning component 308 is used to locate the current geographic Location of the electronic device 300 to implement navigation or LBS (Location Based Service). The Positioning component 308 may be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, the graves System in russia, or the galileo System in the european union.
The power supply 309 is used to supply power to various components in the electronic device 300. The power source 309 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power source 309 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery can also be used to support fast charge technology.
In some embodiments, the electronic device 300 also includes one or more sensors 310. The one or more sensors 310 include, but are not limited to: acceleration sensor 311, gyro sensor 312, pressure sensor 313, fingerprint sensor 314, optical sensor 315, and proximity sensor 316.
The acceleration sensor 311 may detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the electronic device 300. For example, the acceleration sensor 311 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 301 may control the display screen 305 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 311. The acceleration sensor 311 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 312 may detect a body direction and a rotation angle of the electronic device 300, and the gyro sensor 312 and the acceleration sensor 311 may cooperate to acquire a 3D motion of the user on the electronic device 300. The processor 301 may implement the following functions according to the data collected by the gyro sensor 312: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensor 313 may be disposed on a side bezel of the electronic device 300 and/or underneath the display screen 305. When the pressure sensor 313 is disposed on the side frame of the electronic device 300, the holding signal of the user to the electronic device 300 can be detected, and the processor 301 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 313. When the pressure sensor 313 is disposed at the lower layer of the display screen 305, the processor 301 controls the operability control on the UI interface according to the pressure operation of the user on the display screen 305. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 314 is used for collecting a fingerprint of the user, and the processor 301 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 314, or the fingerprint sensor 314 identifies the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, processor 301 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 314 may be disposed on the front, back, or side of the electronic device 300. When a physical button or vendor Logo is provided on the electronic device 300, the fingerprint sensor 314 may be integrated with the physical button or vendor Logo.
The optical sensor 315 is used to collect the ambient light intensity. In one embodiment, the processor 301 may control the display brightness of the display screen 305 based on the ambient light intensity collected by the optical sensor 315. Specifically, when the ambient light intensity is high, the display brightness of the display screen 305 is increased; when the ambient light intensity is low, the display brightness of the display screen 305 is reduced. In another embodiment, the processor 301 may also dynamically adjust the shooting parameters of the camera head assembly 306 according to the ambient light intensity collected by the optical sensor 315.
The proximity sensor 316, also referred to as a distance sensor, is typically disposed on the front panel of the electronic device 300. The proximity sensor 316 is used to capture the distance between the user and the front of the electronic device 300. In one embodiment, the processor 301 controls the display screen 305 to switch from the bright screen state to the dark screen state when the proximity sensor 316 detects that the distance between the user and the front surface of the electronic device 300 is gradually decreased; when the proximity sensor 316 detects that the distance between the user and the front surface of the electronic device 300 is gradually increased, the processor 301 controls the display screen 305 to switch from the breath-screen state to the bright-screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 3 is not intended to be limiting of electronic device 300, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
In some embodiments, a computer-readable storage medium is also provided, in which a computer program is stored, which when executed by a processor implements the steps of the method for generating breadcrumb navigation in the above embodiments. For example, the computer readable storage medium may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It is noted that the computer-readable storage medium referred to in the embodiments of the present application may be a non-volatile storage medium, in other words, a non-transitory storage medium.
It should be understood that all or part of the steps to implement the above embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions may be stored in the computer-readable storage medium described above.
That is, in some embodiments, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the steps of the method of generating breadcrumb navigation described above.
It is to be understood that reference herein to "at least one" means one or more and "a plurality" means two or more. In the description of the embodiments of the present application, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in order to facilitate clear description of technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish the same items or similar items having substantially the same functions and actions. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
It should be noted that the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.) and signals referred to in the embodiments of the present application are authorized by the user or fully authorized by various parties, and the collection, use and processing of the relevant data need to comply with relevant laws and regulations and standards in relevant countries and regions. For example, the routing information, source code, etc. of the page referred to in the embodiments of the present application are obtained under sufficient authorization.
The above-mentioned embodiments are provided not to limit the present application, and any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (10)
1. A method of generating breadcrumb navigations, the method comprising:
determining target routing information, wherein the target routing information is the routing information of the current page;
if the target routing information does not have an indication tag, acquiring historical navigation information, wherein the indication tag is used for indicating that the page level of the corresponding page is consistent with the routing level, and the historical navigation information is used for indicating breadcrumb navigation of the last page visited before the current page;
generating a breadcrumb navigation for the current page based on the historical navigation information and the target routing information.
2. The method of claim 1, wherein the historical navigation information comprises routing information of one or more pages, and the routing information of the one or more pages is arranged in a page level order from high to low;
generating the breadcrumb navigation of the current page based on the historical navigation information and the target routing information, comprising:
and if the historical navigation information comprises the target routing information, generating the breadcrumb navigation of the current page based on the routing information from the first page to the current page in the historical navigation information.
3. The method of claim 2, further comprising:
and updating the historical navigation information into the routing information from the first page to the current page in the historical navigation information.
4. The method of claim 1, wherein the historical navigation information comprises routing information of one or more pages, and the routing information of the one or more pages is arranged in a page level order from high to low;
generating the breadcrumb navigation of the current page based on the historical navigation information and the target routing information, comprising:
if the historical navigation information does not include the target routing information, splicing the target routing information to the last page of the historical navigation information to obtain the navigation information of the current page;
and generating the breadcrumb navigation of the current page based on the navigation information of the current page.
5. The method of claim 4, further comprising:
and updating the historical navigation information into the navigation information of the current page.
6. The method according to any of claims 1-5, wherein after determining the target routing information, further comprising:
if the target routing information has the indication label, acquiring routing information from a root node to all nodes of a target node in a routing tree, wherein the routing tree is used for describing a routing hierarchy relation of each page in a website to which the current page belongs, the target node is a node corresponding to the current page, and the root node is a node corresponding to a root page of the website;
and generating the breadcrumb navigation of the current page based on the acquired routing information of all the nodes.
7. The method of claim 6, wherein the obtaining routing information of all nodes from a root node to a target node in a routing tree comprises:
and searching the routing information of each node from the root node of the routing tree downwards step by step in a recursive mode until the target routing information is searched, and obtaining the routing information of all nodes from the root node to the target node.
8. The method according to claim 6 or 7, wherein after obtaining the routing information of all nodes from the root node to the target node in the routing tree, the method further comprises:
and storing the routing information of all nodes from the root node to the target node as historical navigation information.
9. An apparatus for generating breadcrumb navigation, the apparatus comprising:
the determining module is used for determining target routing information, and the target routing information is the routing information of the current page;
a first obtaining module, configured to obtain historical navigation information if the target routing information does not have an indication tag, where the indication tag is used to indicate that a page level of a corresponding page is consistent with a routing level, and the historical navigation information is used to indicate breadcrumb navigation of a previous page visited before the current page;
and the generating module is used for generating the breadcrumb navigation of the current page based on the historical navigation information and the target routing information.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210405491.2A CN114969579A (en) | 2022-04-18 | 2022-04-18 | Breadcrumb navigation generation method and device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210405491.2A CN114969579A (en) | 2022-04-18 | 2022-04-18 | Breadcrumb navigation generation method and device and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114969579A true CN114969579A (en) | 2022-08-30 |
Family
ID=82978301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210405491.2A Pending CN114969579A (en) | 2022-04-18 | 2022-04-18 | Breadcrumb navigation generation method and device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114969579A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030018665A1 (en) * | 2001-07-11 | 2003-01-23 | International Business Machines Corporation | Method and system for dynamic web page breadcrumbing using javascript |
US20170102839A1 (en) * | 2015-10-09 | 2017-04-13 | Wal-Mart Stores, Inc. | Graphical user interface and method and apparatus of navigating using same |
CN108710630A (en) * | 2018-04-02 | 2018-10-26 | 阿里巴巴集团控股有限公司 | A kind of page navigation method, device and equipment |
US20200351382A1 (en) * | 2019-05-03 | 2020-11-05 | Servicenow, Inc. | Server-side control over navigation mode in web application |
CN113127776A (en) * | 2019-12-31 | 2021-07-16 | 深圳云天励飞技术有限公司 | Breadcrumb path generation method and device and terminal equipment |
CN113626747A (en) * | 2021-08-16 | 2021-11-09 | 北京沃东天骏信息技术有限公司 | Method and device for generating breadcrumb navigation |
US11520459B1 (en) * | 2022-03-30 | 2022-12-06 | Salesforce.Com, Inc. | Managing circular navigation of a multipage user interface |
-
2022
- 2022-04-18 CN CN202210405491.2A patent/CN114969579A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20030018665A1 (en) * | 2001-07-11 | 2003-01-23 | International Business Machines Corporation | Method and system for dynamic web page breadcrumbing using javascript |
US20170102839A1 (en) * | 2015-10-09 | 2017-04-13 | Wal-Mart Stores, Inc. | Graphical user interface and method and apparatus of navigating using same |
CN108710630A (en) * | 2018-04-02 | 2018-10-26 | 阿里巴巴集团控股有限公司 | A kind of page navigation method, device and equipment |
US20200351382A1 (en) * | 2019-05-03 | 2020-11-05 | Servicenow, Inc. | Server-side control over navigation mode in web application |
CN113127776A (en) * | 2019-12-31 | 2021-07-16 | 深圳云天励飞技术有限公司 | Breadcrumb path generation method and device and terminal equipment |
CN113626747A (en) * | 2021-08-16 | 2021-11-09 | 北京沃东天骏信息技术有限公司 | Method and device for generating breadcrumb navigation |
US11520459B1 (en) * | 2022-03-30 | 2022-12-06 | Salesforce.Com, Inc. | Managing circular navigation of a multipage user interface |
Non-Patent Citations (1)
Title |
---|
START2019: ""element实现动态路由+面包"", pages 1 - 8, Retrieved from the Internet <URL:《https://blog.csdn.net/Start2019/article/details/100032203》> * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109828802B (en) | List view display method, device and readable medium | |
CN108959361B (en) | Form management method and device | |
CN112256425B (en) | Load balancing method and system, computer cluster, information editing method and terminal | |
CN112527287A (en) | Article detail information display method, device, terminal and storage medium | |
CN111897525A (en) | Big data processing method and system | |
CN111459466B (en) | Code generation method, device, equipment and storage medium | |
CN109902089B (en) | Query method and device using heterogeneous index, electronic equipment and medium | |
CN111159604A (en) | Picture resource loading method and device | |
CN111737100A (en) | Data acquisition method, device, equipment and storage medium | |
CN112052354A (en) | Video recommendation method, video display method and device and computer equipment | |
CN112749362A (en) | Control creating method, device, equipment and storage medium | |
CN108038232B (en) | Webpage editing method, device and system and storage medium | |
CN111125602B (en) | Page construction method, device, equipment and storage medium | |
CN110569064B (en) | Interface identifier generation method, device, equipment and storage medium | |
CN112052419A (en) | Picture loading method, device and equipment and readable storage medium | |
CN113837709A (en) | Online processing method and device of business process, terminal and readable storage medium | |
CN113469360A (en) | Inference method and device | |
CN111275607A (en) | Interface display method and device, computer equipment and storage medium | |
CN111580892A (en) | Method, device, terminal and storage medium for calling service component | |
CN113051485B (en) | Group searching method, device, terminal and storage medium | |
CN109918566B (en) | Query method, query device, electronic equipment and medium | |
CN110390065B (en) | Webpage acquisition method, device and system | |
CN111294320B (en) | Data conversion method and device | |
CN114969579A (en) | Breadcrumb navigation generation method and device and computer readable storage medium | |
CN112596810A (en) | Loading prompt information display method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB03 | Change of inventor or designer information |
Inventor after: Chen Min Inventor after: Wu Xiang Inventor before: Wu Xiang |
|
CB03 | Change of inventor or designer information |