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.)
- Granted
Links
- 235000012813 breadcrumbs Nutrition 0.000 title claims abstract description 217
- 238000000034 method Methods 0.000 title claims abstract description 59
- 238000004590 computer program Methods 0.000 claims description 10
- 238000007726 management method Methods 0.000 description 22
- 230000006870 function Effects 0.000 description 14
- 230000000694 effects 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
- 230000008569 process 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
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000009191 jumping Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 2
- 239000000919 ceramic Substances 0.000 description 2
- 230000009977 dual effect Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000033001 locomotion Effects 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
- 238000013480 data collection Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007423 decrease Effects 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
- 238000010801 machine learning Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000005259 measurement Methods 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
- 230000009467 reduction Effects 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 239000010409 thin film Substances 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 present application discloses a method, device and computer-readable storage medium for generating breadcrumb navigation, belonging to the technical field of computers. This solution can automatically generate breadcrumb navigation, reducing the drawbacks of manual arrangement. In addition, in this solution, an indication label is used to indicate that the page level of the corresponding page is consistent with the routing level. If the current page does not have an indication label, it means that the page level of the current page may be inconsistent with the routing level, then the current page is generated based on historical navigation information. Breadcrumb navigation for the page. That is, since the routing hierarchy between pages is strict, but the page hierarchy is not strict, the routing hierarchy may not be completely consistent with the page hierarchy. Therefore, this solution is not limited to strictly follow the routing hierarchy of pages. Generate breadcrumb navigation, the generated breadcrumb navigation can more accurately reflect the page hierarchy.
Description
技术领域technical field
本申请涉及计算机技术领域,特别涉及一种面包屑导航的生成方法、装置及计算机可读存储介质。The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, and a computer-readable storage medium for generating breadcrumb navigation.
背景技术Background technique
目前,对于一些结构很复杂的网站来说,可以为该网站中的各个页面生成面包屑导航,利用面包屑导航可以使访问者更加清晰地了解页面在网站中的位置,也便于访问者在不同层级的页面之间快速跳转。At present, for some websites with complex structures, breadcrumb navigation can be generated for each page in the website. Using breadcrumb navigation can make the visitor know the position of the page in the website more clearly, and it is also convenient for the visitor to navigate between different pages. Quickly jump between pages of a hierarchy.
例如,访问者所浏览的当前页面的名称为‘活动详情’,当前页面的面包屑导航为‘首页>活动管理>活动列表>活动详情’,可以看出,该面包屑导航体现了网站中四个页面的层级关系,还体现了当前页面在网站中的位置。另外,访问者通过点击该面包屑导航中任意一级页面的名称即可跳转到相应页面,例如,通过点击‘首页’即可返回到网站的首页。For example, the name of the current page browsed by the visitor is 'event details', and the breadcrumb navigation of the current page is 'home>event management>event list>event details', it can be seen that the breadcrumb navigation reflects the four aspects of the website. The hierarchical relationship of each page also reflects 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 page in the breadcrumb navigation, for example, by clicking on the 'home page' to return to the home page of the website.
在相关技术中,需要技术人员手动编排各页面的面包屑导航的配置数据,基于配置数据生成各页面的面包屑导航。但是手动编排的工作量较大,效率较低,且易出错,不便于后期维护。In the related art, a technician is required to manually arrange the configuration data of the breadcrumb navigation of each page, and generate the breadcrumb navigation of each page based on the configuration data. However, manual scheduling requires a large workload, low efficiency, and is prone to errors, which is inconvenient for post-maintenance.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种面包屑导航的生成方法、装置及计算机可读存储介质,可以自动生成面包屑导航,减少工作量,提高效率,不易出错,便于后期维护,所生成的面包屑导航还能够更加准确地体现页面层级关系。所述技术方案如下:The present application provides a method, device and computer-readable storage medium for generating breadcrumbs, which can automatically generate breadcrumbs, reduce workload, improve efficiency, are less prone to errors, and facilitate later maintenance, and the generated breadcrumbs can also More accurately reflect the page hierarchy. The technical solution is as follows:
一方面,提供了一种面包屑导航的生成方法,所述方法包括:In one aspect, a method for generating breadcrumb navigation is provided, the method comprising:
确定目标路由信息,所述目标路由信息为当前页面的路由信息;Determine target routing information, where the target routing information is the routing information of the current page;
如果所述目标路由信息不具有指示标签,则获取历史导航信息,所述指示标签用于指示相应页面的页面层级与路由层级一致,所述历史导航信息用于指示在所述当前页面之前所访问的上一个页面的面包屑导航;If the target routing information does not have an indication label, obtain historical navigation information, where the indication label is used to indicate that the page level of the corresponding page is consistent with the route level, and the historical navigation information is used to indicate that the page visited before the current page The breadcrumb navigation of the previous page;
基于所述历史导航信息和所述目标路由信息,生成所述当前页面的面包屑导航。Based on the historical navigation information and the target routing information, a breadcrumb navigation of the current page is generated.
可选地,所述历史导航信息包括一个或多个页面的路由信息,且所述一个或多个页面的路由信息按照页面层级从高到低的顺序排列;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 descending order of page level;
所述基于所述历史导航信息和所述目标路由信息,生成所述当前页面的面包屑导航,包括:The generating the breadcrumb navigation of the current page based on the historical navigation information and the target routing information includes:
如果所述历史导航信息中包括所述目标路由信息,则基于所述历史导航信息中首个页面至所述当前页面的路由信息,生成所述当前页面的面包屑导航。If the historical navigation information includes the target routing information, the breadcrumb navigation of the current page is generated based on the routing information from the first page to the current page in the historical navigation information.
可选地,所述方法还包括:Optionally, the method further includes:
将所述历史导航信息更新为所述历史导航信息中所述首个页面至所述当前页面的路由信息。The historical navigation information is updated to route 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 descending order of page level;
所述基于所述历史导航信息和所述目标路由信息,生成所述当前页面的面包屑导航,包括:The generating the breadcrumb navigation of the current page based on the historical navigation information and the target routing information includes:
如果所述历史导航信息中不包括所述目标路由信息,则将所述目标路由信息拼接至所述历史导航信息中最后一个页面的路由信息之后,以得到所述当前页面的导航信息;If the target routing information is not included in the historical navigation information, then the target routing information is spliced after the routing information of the last page in the historical navigation information to obtain the navigation information of the current page;
基于所述当前页面的导航信息,生成所述当前页面的面包屑导航。Based on the navigation information of the current page, the breadcrumb navigation of the current page is generated.
可选地,所述方法还包括:Optionally, the method further includes:
将所述历史导航信息更新为所述当前页面的导航信息。The historical navigation information is updated to the navigation information of the current page.
可选地,所述确定目标路由信息之后,还包括:Optionally, after the target routing information is determined, the method further includes:
如果所述目标路由信息具有所述指示标签,则获取路由树中根节点至目标节点的所有节点的路由信息,所述路由树用于描述所述当前页面所属网站中各个页面的路由层级关系,所述目标节点为所述当前页面对应的节点,所述根节点为所述网站的根页面对应的节点;If the target routing information has the indication label, the routing information of all nodes from the root node to the target node in the routing tree is obtained, and the routing tree is used to describe the routing hierarchy relationship of each page in the website to which the current page belongs. The target node is the node corresponding to the current page, and the root node is the node corresponding to the root page of the website;
基于获取的所有节点的路由信息,生成所述当前页面的面包屑导航。Based on the obtained routing information of all nodes, the breadcrumb navigation of the current page is generated.
可选地,所述获取路由树中根节点至目标节点的所有节点的路由信息,包括:Optionally, the obtaining routing information of all nodes from the root node to the target node in the routing tree includes:
从所述路由树的根节点开始,按照递归的方式逐级向下查找各个节点的路由信息,直至查找到所述目标路由信息为止,得到从所述根节点至所述目标节点的所有节点的路由信息。Starting from the root node of the routing tree, the routing information of each node is searched down step by step in a recursive manner until the target routing information is found, and the routing information of all nodes from the root node to the target node is obtained. routing information.
可选地,所述获取路由树中根节点至目标节点的所有节点的路由信息之后,还包括:Optionally, after obtaining the routing information of all nodes from the root node to the target node in the routing tree, the method further includes:
将所述根节点至所述目标节点的所有节点的路由信息作为历史导航信息进行存储。The routing information of all nodes from the root node to the target node is stored as historical navigation information.
另一方面,提供了一种面包屑导航的生成装置,所述装置包括:In another aspect, an apparatus for generating breadcrumb navigation is provided, the apparatus comprising:
确定模块,用于确定目标路由信息,所述目标路由信息为当前页面的路由信息;a determining module, for determining target routing information, the target routing information being the routing information of the current page;
第一获取模块,用于如果所述目标路由信息不具有指示标签,则获取历史导航信息,所述指示标签用于指示相应页面的页面层级与路由层级一致,所述历史导航信息用于指示在所述当前页面之前所访问的上一个页面的面包屑导航;The first obtaining module is configured to obtain historical navigation information if the target routing information does not have an indication label, the indication label is used to indicate that the page level of the corresponding page is consistent with the routing level, and the historical navigation information is used to indicate that the Breadcrumb navigation of the previous page visited before the current page;
生成模块,用于基于所述历史导航信息和所述目标路由信息,生成所述当前页面的面包屑导航。A generating module, configured to generate 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 descending order of page level;
所述生成模块包括:The generation module includes:
第一生成子模块,用于如果所述历史导航信息中包括所述目标路由信息,则基于所述历史导航信息中首个页面至所述当前页面的路由信息,生成所述当前页面的面包屑导航。A first generating submodule, configured to generate breadcrumbs of the current page based on the routing information from the first page to the current page in the historical navigation information if the target routing information is included in the historical navigation information navigation.
可选地,所述装置还包括:Optionally, the device further includes:
第一更新模块,用于将所述历史导航信息更新为所述历史导航信息中所述首个页面至所述当前页面的路由信息。A first update module, configured to update the historical navigation information to 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 descending order of page level;
所述生成模块包括:The generation module includes:
拼接子模块,用于如果所述历史导航信息中不包括所述目标路由信息,则将所述目标路由信息拼接至所述历史导航信息中最后一个页面的路由信息之后,以得到所述当前页面的导航信息;A splicing submodule, used for splicing the target routing information after the routing information of the last page in the historical navigation information if the target routing information is not included in the historical navigation information, to obtain the current page navigation information;
第二生成子模块,用于基于所述当前页面的导航信息,生成所述当前页面的面包屑导航。The second generating submodule is configured to generate the breadcrumb navigation of the current page based on the navigation information of the current page.
可选地,所述装置还包括:Optionally, the device further includes:
第二更新模块,用于将所述历史导航信息更新为所述当前页面的导航信息。The second updating module is configured to update the historical navigation information to the navigation information of the current page.
可选地,所述装置还包括:Optionally, the device further includes:
第二获取模块,用于如果所述目标路由信息具有所述指示标签,则获取路由树中根节点至目标节点的所有节点的路由信息,所述路由树用于描述所述当前页面所属网站中各个页面的路由层级关系,所述目标节点为所述当前页面对应的节点,所述根节点为所述网站的根页面对应的节点;The second obtaining module is configured to obtain the routing information of all nodes from the root node to the target node in the routing tree, if the target routing information has the indication label, where the routing tree is used to describe each node in the website to which the current page belongs. The routing hierarchy relationship of the page, the target node is the node corresponding to the current page, and the root node is the node corresponding to the root page of the website;
第二生成模块,用于基于获取的所有节点的路由信息,生成所述当前页面的面包屑导航。The second generating module is configured to generate the breadcrumb navigation of the current page based on the obtained routing information of all nodes.
可选地,所述第二获取模块包括:Optionally, the second obtaining module includes:
获取子模块,用于从所述路由树的根节点开始,按照递归的方式逐级向下查找各个节点的路由信息,直至查找到所述目标路由信息为止,得到从所述根节点至所述目标节点的所有节点的路由信息。The acquisition sub-module is used for starting from the root node of the routing tree, and searching down the routing information of each node step by step in a recursive manner until the target routing information is found, and obtaining from the root node to the Routing information for all nodes of the target node.
可选地,所述装置还包括:Optionally, the device further includes:
存储模块,用于将所述根节点至所述目标节点的所有节点的路由信息作为历史导航信息进行存储。The storage module is configured to store the routing information of all nodes from the root node to the target node as historical navigation information.
另一方面,提供了一种电子设备,所述电子设备包括处理器、通信接口、存储器和通信总线,所述处理器、所述通信接口和所述存储器通过所述通信总线完成相互间的通信,所述存储器用于存放计算机程序,所述处理器用于执行所述存储器上所存放的程序,以实现上述所述面包屑导航的生成方法的步骤。所述电子设备还包括显示屏,用于显示所生成的面包屑导航。In another aspect, an electronic device is provided, the electronic device includes a processor, a communication interface, a memory and a communication bus, and the processor, the communication interface and the memory communicate with each other through the communication bus , the memory is used for storing a computer program, and the processor is used for executing the program stored in the memory, so as to realize the steps of the above-mentioned method for generating breadcrumb navigation. The electronic device further includes a display screen for displaying the generated breadcrumb navigation.
另一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述所述面包屑导航的生成方法的步骤。In another aspect, a computer-readable storage medium is provided, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned method for generating a breadcrumb navigation are implemented.
另一方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述所述的面包屑导航的生成方法的步骤。In another aspect, there is provided a computer program product comprising instructions that, when executed on a computer, cause the computer to perform the steps of the above-described method for generating breadcrumbs.
本申请实施例提供的技术方案至少可以带来以下有益效果:The technical solutions provided in the embodiments of the present application can at least bring the following beneficial effects:
本方案能够自动生成面包屑导航,减少手动编排的弊端,即减少工作量,提高效率,且不易出错,便于后期维护。另外,在本方案中,通过指示标签来指示相应页面的页面层级与路由层级一致,如果当前页面不具有指示标签,说明当前页面的页面层级与路由层级可能不一致,那么基于历史导航信息来生成当前页面的面包屑导航。即,由于页面间的路由层级关系是严格的,而页面层级关系并非是严格的,路由层级关系与页面层级关系可能并非完全一致,因此,本方案并不限制于严格按照页面的路由层级关系来生成面包屑导航,所生成的面包屑导航能够更加准确地体现页面层级关系。This solution can automatically generate breadcrumb navigation, reducing the drawbacks of manual scheduling, that is, reducing workload, improving efficiency, and being less prone to errors, which is convenient for later maintenance. In addition, in this solution, the page level of the corresponding page is indicated by the indication label to be consistent with the routing level. If the current page does not have an indication label, it means that the page level of the current page may be inconsistent with the routing level, then the current page is generated based on historical navigation information. Breadcrumb navigation for the page. That is, since the routing hierarchy between pages is strict, but the page hierarchy is not strict, the routing hierarchy may not be completely consistent with the page hierarchy. Therefore, this solution is not limited to strictly follow the routing hierarchy of pages. Generate breadcrumb navigation, the generated breadcrumb navigation can more accurately reflect the page hierarchy.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.
图1是本申请实施例提供的一种面包屑导航的生成方法的流程图;1 is a flowchart of a method for generating breadcrumb navigation provided by an embodiment of the present application;
图2是本申请实施例提供的一种面包屑导航的生成装置的结构示意图;2 is a schematic structural diagram of a device for generating breadcrumb navigation provided by an embodiment of the present application;
图3是本申请实施例提供的一种电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, 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 below with reference to the accompanying drawings.
在生成面包屑导航的一种相关技术中,需要技术人员手动编排各页面的面包屑导航的配置数据,基于配置数据生成各页面的面包屑导航。在生成面包屑导航的另一相关技术中,严格按照网站中各个页面的路由层级关系自动生成面包屑导航。In a related technology for generating breadcrumbs, a technician is required to manually arrange configuration data of the breadcrumbs of each page, and to generate the breadcrumbs of each page based on the configuration data. In another related technology for generating breadcrumbs, the breadcrumbs are automatically generated in strict accordance with the routing hierarchy relationship of each page in the website.
然而,网站中各个页面的路由层级关系是通过技术人员所编写的网站的源代码体现的,各个页面的路由层级关系是严格的,即,路由树中任一子节点只能具有一个父节点。其中,路由树用于描述网站中各个页面的路由层级关系。示例性地,某路由树包括‘文件管理>文件列表>预览’和‘文件管理>文件列表>编辑’这两条路径。那么,如果严格按照路由层级关系来生成面包屑导航的话,‘预览’和‘编辑’只可能作为面包屑导航中的第三级导航。However, the hierarchical relationship of routing of each page in the website is embodied by the source code of the website written by technical personnel, and the hierarchical relationship of routing of each page is strict, that is, any child node in the routing tree can only have one parent node. Among them, the routing tree is used to describe the routing hierarchical relationship of each page in the website. Exemplarily, a certain routing tree includes two paths of 'file management>file list>preview' and 'file management>file list>edit'. Then, if the breadcrumb navigation is generated strictly according to the routing hierarchy, 'preview' and 'edit' can only be used as the third-level navigation in the breadcrumb navigation.
但是技术人员还可能期望生成如‘文件管理>文件列表>编辑>预览’、‘文件管理>文件列表>预览>编辑’这样的面包屑导航,而相关技术中按照路由层级关系是无法实现的。由此可见,相关技术中所构建的页面目录树与路由树是完全一致的,即各个页面的页面层级关系与路由层级关系是完全一致的。而技术人员所期望构建的页面目录树并非与路由树完全一致。其中,页面目录树用于描述网站中各个页面的页面层级关系。However, technicians may also expect to generate breadcrumb navigation such as 'file management>file list>edit>preview', 'file management>file list>preview>edit', which cannot be implemented according to the routing hierarchy in the related art. 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 relationship of each page is completely consistent with the routing hierarchy relationship. However, the page directory tree that the technician expects to construct is not completely consistent with the routing tree. Among them, the page directory tree is used to describe the page hierarchy relationship of each page in the website.
换句话说,在实际需求中各个页面的页面层级关系并非是严格的,页面目录树中任一子节点可以具有一个或多个父节点。例如,页面目录树包括‘文件管理>文件列表>预览’、‘文件管理>文件列表>编辑>预览’、‘文件管理>文件列表>预览>编辑’这几条路径。可以看出,‘预览’和‘编辑’均具有两个父节点,‘预览’和‘编辑’既可以作为面包屑导航中的第三级导航,也可以作为第四级导航。按照本申请实施例提供的面包屑导航的生成方法所生成的面包屑导航能够更加准确地描述页面层级关系,满足实际需求。In other words, the page hierarchy relationship of each page is not strict in actual requirements, and any child node in the page directory tree can have one or more parent nodes. For example, the page directory tree includes the paths of 'File Management>File List>Preview', 'File Management>File List>Edit>Preview', and 'File Management>File List>Preview>Edit'. It can be seen that both 'preview' and 'edit' have two parent nodes, and 'preview' and 'edit' can be used as the third-level navigation in the breadcrumb navigation or as the fourth-level navigation. The breadcrumb navigation generated according to the method for generating the breadcrumb navigation provided by the embodiment of the present application can describe the hierarchical relationship of the pages more accurately and meet the actual requirements.
需要说明的是,本申请实施例描述的系统架构以及业务场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。It should be noted that the system architecture and business scenarios described in the embodiments of the present application are for the purpose of illustrating the technical solutions of the embodiments of the present application more clearly, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. It can be seen that, with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
接下来对本申请实施例提供的面包屑导航的生成方法进行详细的解释说明。图1是本申请实施例提供的一种面包屑导航的生成方法的流程图。以该方法应用于电子设备为例进行介绍。请参考图1,该方法包括如下步骤。Next, the method for generating the breadcrumb navigation provided by the embodiment of the present application will be explained in detail. FIG. 1 is a flowchart of a method for generating breadcrumb navigation provided by an embodiment of the present application. The application of the method to electronic equipment is taken as an example for introduction. Please refer to FIG. 1 , the method includes the following steps.
步骤101:确定目标路由信息,目标路由信息为当前页面的路由信息。Step 101: Determine target routing information, where the target routing information is the routing information of the current page.
在本申请实施例中,电子设备接收到页面加载指令后,基于该页面加载指令,确定目标路由信息,即当前页面的路由信息,当前页面即该页面加载指令所请求加载的页面。其中,页面加载指令可以通过用户点击面包屑导航中的页面名称、用户输入网址、关键词搜索等生成。In this embodiment of the present application, after receiving the page loading instruction, the electronic device determines target routing information based on the page loading instruction, that is, the routing information of the current page, which is the page requested by the page loading instruction. Wherein, the page loading instruction may be generated by the user clicking on the page name in the breadcrumb navigation, the user inputting the website address, keyword searching, and the like.
可选地,电子设备从当前页面的源代码中获取目标路由信息。示例性地,电子设备从当前页面的源代码中查找带有参考字符的代码段,以得到目标路由信息,即该代码段中包括技术人员所定义的目标路由信息,该参考字符为事先定义的,比如‘path’字符。电子设备也可以通过其他方式确定目标路由信息,本申请实施例对此不作限定。Optionally, the electronic device obtains the target routing information from the source code of the current page. Exemplarily, the electronic device searches the source code of the current page for a code segment with a reference character to obtain target routing information, that is, the code segment includes target routing information defined by a technician, and the reference character is defined in advance. , such as the 'path' character. 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 reflects the path mapping relationship of the page, and the electronic device can obtain the resources required for generating the page based on the routing information of the page, thereby generating the page. In the 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 click the page name of any page in the breadcrumb navigation , to jump to the corresponding page according to the page jump address.
在本申请实施例中,目标路由信息中包括当前页面的页面名称和统一资源定位符(uniform resource locator,URL)。其中,当前页面的页面名称用于在面包屑导航栏中显示,当前页面的URL用于生成当前页面的链接,当前页面的链接用于在浏览器的链接栏中显示,并且作为面包屑导航中当前页面的页面名称的附属属性,以便于电子设备检测到对面包屑导航中该页面名称的点击操作时进行页面跳转,即刷新当前页面。In this embodiment of the present application, the target routing information includes a page name and a uniform resource locator (uniform resource locator, URL) of the current page. Among them, the page name of the current page is used to display in the breadcrumb navigation bar, the URL of the current page is used to generate the link of the current page, and the link of the current page is used to display in the link bar of the browser, and is used as the breadcrumb navigation bar. The subordinate attribute of the page name of the current page, so that the electronic device can perform a page jump when detecting a click operation on the page name in the breadcrumb navigation, that is, refresh the current page.
可选地,目标路由信息还包括当前页面的路由名称、路由参数、路径参数和重定向地址中的一个或多个。其中,在目标路由信息不包括重定向地址的情况下,当前页面的路由参数和路径参数用于拼接到当前页面的URL的后面,以得到当前页面的链接。在目标路由信息包括重定向地址的情况下,重定向地址即作为当前页面的链接。电子设备用于按照当前页面的链接来生成相应页面。Optionally, the target routing information further includes one or more of the routing name, routing parameters, path parameters and redirection addresses of the current page. Wherein, in the case where the target routing information does not include the redirection address, the routing parameters and path parameters of the current page are used for splicing to the back of the URL of the current page to obtain the link of the current page. In the case where the target routing information includes a redirection address, the redirection address is used as a link to the current page. The electronic device is used to generate a corresponding page according to the link of the current page.
换种方式来讲,若一个页面的路由信息既包括该页面的URL,还包括该页面的重定向地址,那么,该页面的链接实际上为重定向地址,电子设备每次接收到关于该页面的页面加载指令后,均显示的是重定向地址对应的页面,当前页面实质上是重定向地址对应的页面。例如,电子设备在首次接收到关于该页面的页面加载指令的情况下,所生成的页面即为重定向地址所对应的页面。电子设备在检测到对面包屑导航中该页面的页面名称的点击操作的情况下,也跳转到重定向地址所对应的页面。In other words, 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 the electronic device receives information about the page every time. After the page loading instruction of the redirection address is displayed, the page corresponding to the redirection address is displayed, and the current page is essentially 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 the page corresponding to the redirection address. When the electronic device detects a click operation on the page name of the page in the breadcrumb navigation, it also jumps to the page corresponding to the redirection address.
简单地说,如果一个页面的路由信息包括URL,而不包括重定向地址,则电子设备均以URL为准来生成页面,页面跳转地址也以URL为准。如果一个页面的路由信息包括既包括该页面的URL,还包括该页面的重定向地址,则电子设备均以重定向地址为准来显示页面,页面跳转地址也以重定向地址为准。To put it simply, if the routing information of a page includes a URL but not a redirection address, the electronic device generates the page based on the URL, and the page jumping address is also 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 device displays the page based on the redirection address, and the page jump address is also based on the redirection address.
可选地,目标路由信息还包括返回参数,返回参数包括返回按钮的显示指示信息。该显示指示信息用于指示在当前页面的面包屑导航中是否显示返回按钮。其中,返回按钮可以显示在面包屑导航栏的右侧,面包屑导航中的各个页面的页面名称可以显示在面包屑导航栏的左侧。Optionally, the target routing information further includes a return parameter, and the return parameter includes display indication information of the return button. The display indication information is used to indicate whether to display the back button in the breadcrumb navigation of the current page. The back button may be displayed on the right side of the breadcrumb navigation bar, and the page names of each page in the breadcrumb navigation may be displayed on the left side of the breadcrumb navigation bar.
可选地,在该显示指示信息指示在当前页面的面包屑导航中显示返回按钮的情况下,该返回参数还包括返回地址,该返回地址用于在检测到对当前页面的面包屑导航中返回按钮的点击操作的情况下,跳转到返回地址对应的页面。需要说明的是,在该显示指示信息指示在当前页面的面包屑导航中显示返回按钮,且该返回参数不包括返回地址的情况下,若检测到对当前页面的面包屑导航中返回按钮的点击操作,则返回到当前页面之前所访问的上一个页面。Optionally, in the case that the display instruction information indicates that a return button is displayed in the breadcrumb navigation of the current page, the return parameter further includes a return address, and the return address is used to return in the breadcrumb navigation of the current page is detected. In the case of button click operation, jump to the page corresponding to the return address. It should be noted that when the display instruction information indicates that the return button is displayed in the breadcrumb navigation of the current page, and the return parameter does not include the return address, if a click on the return button in the breadcrumb navigation of the current page is detected operation, return to the previous page visited before the current page.
示例性地,当前页面的路由信息包括label、URL、params、queryParams、redirect和data,data包括breadcrumb、showBack和backPath。其中,label、URL、params、queryParams、redirect和data分别代表当前页面的路由名称、统一资源定位符、路径参数、路由参数、重定向地址和自定义参数。breadcrumb、showBack和backPath分别代表当前页面的页面名称、返回按钮的显示指示信息和返回地址。其中,params、queryParams、redirect、showBack和backPath的值可以为空。Exemplarily, the routing information of the current page includes label, URL, params, queryParams, redirect, and data, and data includes breadcrumb, showBack, and backPath. Among them, label, URL, params, queryParams, redirect, and data represent the route name, uniform resource locator, path parameter, route parameter, redirect address, and custom parameter of the current page, respectively. breadcrumb, showBack and backPath respectively represent the page name of the current page, the display instruction information of the back button and the return address. Among them, the values of params, queryParams, redirect, showBack and backPath can be empty.
在本申请实施例中,一个页面的路由信息除了具有以上所介绍的内容之外,还可能具有指示标签,指示标签用于指示相应页面的页面层级与路由层级一致。需要说明的是,本方案中页面的页面层级与路由层级之间的关系分为两种情况,一种情况下,一个页面的页面层级与路由层级完全一致,另一种情况下,一个页面的页面层级与路由层级可能不一致,因此,在本方案中用指示标签来区分这两种情况,以使得所生成的面包屑导航能够更加准确地体现页面层级关系。In this embodiment of the present application, in addition to the content described above, the routing information of a page may also have an indication label, where the indication label 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 this solution is divided into two cases. In one case, the page level of a page is exactly the same as the routing level. The page level and the routing level may be inconsistent. Therefore, in this solution, an indicator label is used to distinguish these two situations, so that the generated breadcrumb navigation can more accurately reflect the page level relationship.
可选地,一个页面的路由信息具有指示标签是指,该页面的路由信息包括指示标签。例如,某页面的路由信息包括自定义参数,自定义参数包括指示标签。或者,一个页面的路由信息具有指示标签是指,该页面的路由信息对应有指示标签。例如,某页面的源代码中包括该页面的路由信息和指示标签。其中,指示标签可以为‘node:true’、‘root:true’或‘node:1’等。Optionally, that the routing information of a page has an indication tag means that the routing information of the page includes an indication tag. For example, the routing information of a page includes custom parameters, and the custom parameters include indication tags. Alternatively, the fact that the routing information of a page has an indication label means that the routing information of the page corresponds to an indication label. For example, the source code of a page includes routing information and indication tags for the page. Among them, the indicating label can be 'node: true', 'root: true' or 'node: 1', etc.
步骤102:如果目标路由信息不具有指示标签,则获取历史导航信息,该指示标签用于指示相应页面的页面层级与路由层级一致,历史导航信息用于指示在当前页面之前所访问的上一个页面的面包屑导航。Step 102: If the target routing information does not have an indication label, obtain historical navigation information, the indication label is used to indicate that the page level of the corresponding page is consistent with the routing level, and the historical navigation information is used to indicate the previous page visited before the current page. breadcrumb navigation.
在本申请实施例中,如果目标路由信息不具有指示标签,说明当前页面的页面层级与路由层级可能存在不一致的情况,那么电子设备获取历史导航信息,以便于基于历史导航信息来生成当前页面的面包屑导航。其中,历史导航信息用于指示在当前页面之前所访问的上一个页面的面包屑导航。In the embodiment of the present application, if the target routing information does not have an indication label, indicating that the page level of the current page may be inconsistent with the routing level, then the electronic device obtains historical navigation information, so as to generate the current page based on the historical navigation information. Breadcrumbs. The historical navigation information is used to indicate the breadcrumb navigation of the previous page visited before the current page.
可选地,历史导航信息存储在电子设备中,电子设备从本地存储空间中获取历史导航信息。或者,历史导航信息存储在当前页面所属网站的服务器中,电子设备从服务器中获取历史导航信息。Optionally, the historical navigation information is stored in the electronic device, and the electronic device acquires the historical navigation information from a local storage space. Alternatively, the historical navigation information is stored in the server of the website to which the current page belongs, and the electronic device obtains the historical navigation information from the server.
在本申请实施例中,历史导航信息包括一个或多个页面的路由信息,且该一个或多个页面的路由信息按照页面层级从高到低的顺序排列。示例性地,在当前页面之前所访问的上一个页面的面包屑导航为‘首页>活动管理>活动列表’,那么,历史导航信息包括三个页面的路由信息,这三个页面的路由信息按照与‘首页、活动管理、活动列表’一致的顺序依次排列。In this embodiment of the present application, 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 descending order of page levels. Exemplarily, the breadcrumb navigation of the previous page visited before the current page is 'Home > Activity Management > Activity List', then, the historical navigation information includes the routing information of three pages, and the routing information of these three pages is as follows: Arrange in the same order as 'Home, Event Management, Event List'.
在另一些实施例中,历史导航信息中的一个或多个页面的路由信息按照页面层级从低到高的顺序排列。示例性地,上述三个页面的路由信息按照与‘活动列表、活动管理、首页’一致的顺序依次排列。In other embodiments, the routing information of one or more pages in the historical navigation information is arranged in descending order of page hierarchy. Exemplarily, the routing information of the above-mentioned three pages is sequentially arranged in an order consistent with 'activity list, activity management, and home page'.
在又一些实施例中,历史导航信息中各个页面的路由信息均对应有序号,各个页面的路由信息所对应的序号与相应页面的页面层级一致,该一个或多个页面的路由信息可以不按照页面层级从高到低的顺序排列,也可以不按照页面层级从低到高的顺序排列,而是可以随意排列。示例性地,‘首页’、‘活动管理’和‘活动列表’分别对应序号‘1’、‘2’和‘3’,那么,这三个页面的路由信息可以按照与‘首页、活动列表、活动管理’一致的顺序依次排列,也可以按照与‘活动列表、首页、活动管理’一致的顺序依次排列,也可以按照其他的顺序依次排列。In still other embodiments, the routing information of each page in the historical navigation information corresponds to a serial number, the serial number corresponding to the routing information of each page is consistent with the page level of the corresponding page, and the routing information of the one or more pages may not follow The page levels are arranged in order from high to low, or they can be arranged not in the order of page levels from low to high, but can be arranged at will. Exemplarily, 'home page', 'activity management' and 'activity list' correspond to sequence numbers '1', '2' and '3' respectively, then, the routing information of these three pages can be Activity management' can be arranged in sequence in the same order as 'activity list, home page, activity management', or in other order.
可选地,电子设备通过第一数组来存储历史导航信息,历史导航信息中各个页面的路由信息为第一数组中的元素。假设该一个或多个页面的路由信息按照页面层级从高到低的顺序依次排列,那么,以在当前页面之前所访问的上一个页面的面包屑导航为‘首页>活动管理>活动列表’为例,第一数组中第一个元素为页面名称为‘首页’的页面的路由信息,第二个元素为页面名称为‘活动管理’的页面的路由信息,第三个元素为页面名称为‘活动列表’的页面的路由信息。Optionally, the electronic device stores historical navigation information through a first array, and 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 descending order of the page level, then the breadcrumb navigation of the previous page visited before the current page is 'Home>Activity Management>Activity List' as For example, the first element in the first array is the routing information of the page whose page name is 'Home', the second element is the routing information of the page whose page name is 'Activity Management', and the third element is the page whose name is ' Routing information for pages in the active list'.
步骤103:基于历史导航信息和目标路由信息,生成当前页面的面包屑导航。Step 103: Based on the historical navigation information and the target routing information, a breadcrumb navigation of the current page is generated.
在本申请实施例中,在当前页面的路由信息不具有指示标签的情况下,电子设备基于历史导航信息和目标路由信息,生成当前页面的面包屑导航。In this embodiment of the present application, when the routing information of the current page does not have an indication label, 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 include target routing information, or may not include target routing information. Based on this, the electronic device can first determine whether the historical navigation information includes target routing information, so as to facilitate processing according to the situation.
接下来首先介绍在历史导航信息中包括目标路由信息的情况下,电子设备生成面包屑导航的实现过程。Next, the implementation process of generating breadcrumb navigation by the electronic device in the case that the historical navigation information includes target routing information is introduced first.
如果历史导航信息中包括目标路由信息,则电子设备从历史导航信息中确定出当前页面的导航信息,基于当前页面的导航信息,生成当前页面的面包屑导航。换句话说,历史导航信息中包括当前页面的导航信息,电子设备按照历史导航信息中当前页面的导航信息,生成当前页面的面包屑导航即可。If the historical navigation information includes target routing information, the electronic device determines the navigation information of the current page from the historical navigation information, and generates 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 may generate 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, there are various ways of arranging each routing information in the historical navigation information. Based on this, in the case where the historical navigation information includes target routing information, there are also various implementation methods for the electronic device to generate the breadcrumb navigation of the current page. Three of these implementations will be introduced next.
在第一种实现方式中,历史导航信息包括一个或多个页面的路由信息,且该一个或多个页面的路由信息按照页面层级从高到低的顺序排列。如果历史导航信息中包括目标路由信息,则电子设备基于历史导航信息中首个页面至当前页面的路由信息,生成当前页面的面包屑导航。其中,历史导航信息中首个页面至当前页面的路由信息即为电子设备从历史导航信息中确定出的当前页面的导航信息。In a first implementation manner, 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 descending order of page hierarchy. If the historical navigation information includes target routing information, the electronic device generates a breadcrumb navigation of the current page based on the routing information from the first page to the current page in the historical navigation information. 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 device from the historical navigation information.
在这种实现方式中,电子设备按照与历史导航信息中首个页面至当前页面的路由信息相同的顺序生成面包屑导航中的各个页面名称,以使得所生成的面包屑导航中各个页面名称是按照页面层级从高到低的顺序排列的。In this implementation manner, the electronic device generates each page name 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, so that each page name in the generated breadcrumb navigation is Arranged in descending order of page hierarchy.
其中,电子设备基于历史导航信息中首个页面至当前页面的路由信息,生成当前页面的面包屑导航的方式有多种。接下来介绍其中三种方式。There are various ways for the electronic device to generate 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. Three of these methods are described next.
方式1.1:电子设备截取出历史导航信息中首个页面至当前页面的路由信息,基于截取出的路由信息,生成当前页面的面包屑导航。Mode 1.1: The electronic device intercepts the routing information from the first page to the current page in the historical navigation information, and generates the breadcrumb 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 of the current page based on the routing information of each page in the second array. The routing information stored in the second array is the navigation information of the current page.
方式1.2:电子设备删除历史导航信息中排列在当前页面的路由信息之后的路由信息,以更新历史导航信息。电子设备基于更新后的历史导航信息,生成当前页面的面包屑导航。其中,更新后的历史导航信息即为当前页面的导航信息。Manner 1.2: The electronic device deletes the routing information arranged after the routing information of the current page in the historical navigation information, so as to update the historical navigation information. The electronic device generates breadcrumb navigation of the current page based on the updated historical navigation information. The updated historical navigation information is the navigation information of the current page.
方式1.3:电子设备直接按照历史导航信息中首个页面至当前页面的路由信息,生成当前页面的面包屑导航。应当理解的是,在方式1.3中,电子设备并非通过截取或删除路由信息的方式来生成当前页面的面包屑导航。Mode 1.3: The electronic device directly generates the breadcrumb navigation of the current page according to the routing information from the first page to the current page in the historical navigation information. It should be understood that, in mode 1.3, the electronic device does not generate the breadcrumb navigation of the current page by intercepting or deleting routing information.
可选地,为了便于后续还能够利用历史导航信息来快速、准确生成面包屑导航,电子设备每生成一次面包屑导航,就更新一次历史导航信息。基于此,电子设备在确定历史导航信息中包括目标路由信息的情况下,将历史导航信息更新为历史导航信息中首个页面至当前页面的路由信息。Optionally, in order to facilitate the subsequent generation of breadcrumb navigation by using historical navigation information quickly and accurately, the electronic device updates the historical navigation information every time the electronic device generates breadcrumb navigation. Based on this, the electronic device updates the historical navigation information to route information from the first page to the current page in the historical navigation information when it is determined that the target routing information is included in the historical navigation information.
示例性地,在按照上述方式1.1生成当前页面的面包屑导航的情况下,电子设备将历史导航信息更新为截取出的路由信息。例如,电子设备将第二数组的值赋给第一数组。在按照上述方式1.2生成当前页面的面包屑导航的情况下,电子设备在生成当前页面的面包屑的过程中已更新历史导航信息。在按照上述方式1.3生成当前页面的面包屑导航的情况下,电子设备将历史导航信息中排列在当前页面的路由信息之后的路由信息进行删除,以更新历史导航信息。或者,电子设备也可以截取出历史导航信息中首个页面至当前页面的路由信息,将历史导航信息更新为截取出的路由信息。Exemplarily, in the case of generating the breadcrumb navigation of the current page according to the above-mentioned method 1.1, the electronic device updates the historical navigation information to the extracted routing information. For example, the electronic device assigns the value of the second array to the first array. In the case of generating the breadcrumb navigation of the current page according to the above method 1.2, the electronic device has updated the historical navigation information in the process of generating the breadcrumbs of the current page. In the case of generating the breadcrumb navigation of the current page according to the above method 1.3, the electronic device deletes the routing information arranged after the routing information of the current page in the historical navigation information to update the historical navigation information. Alternatively, the electronic device may also intercept the routing information from the first page to the current page in the historical navigation information, and update the historical navigation information to the intercepted routing information.
接下来介绍在历史导航信息包括目标路由信息的情况下,电子设备基于历史导航信息和目标路由信息,生成当前页面的面包屑导航的第二种实现方式。Next, a second implementation manner in which the electronic device generates the breadcrumb navigation of the current page based on the historical navigation information and the target routing information when the historical navigation information includes the target routing information is introduced.
在第二种实现方式中,历史导航信息包括一个或多个页面的路由信息,且该一个或多个页面的路由信息按照页面层级从低到高的顺序排列。如果历史导航信息中包括目标路由信息,则电子设备基于历史导航信息中当前页面至最后一个页面的路由信息,生成当前页面的面包屑导航。其中,历史导航信息中当前页面至最后一个页面的路由信息即为电子设备从历史导航信息中确定出的当前页面的导航信息。In a second implementation manner, 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 descending order of page hierarchy. If the historical navigation information includes target routing information, the electronic device generates a breadcrumb navigation of the current page based on the routing information from the current page to the last page in the historical navigation information. 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 device from the historical navigation information.
在这种实现方式中,电子设备按照与历史导航信息中当前页面至最后一个页面的路由信息相反的顺序生成面包屑导航中的各个页面名称,以使得所生成的面包屑导航中各个页面名称是按照页面层级从高到低的顺序排列的。In this implementation manner, the electronic device generates each page name in the breadcrumb navigation according to the reverse order of the routing information from the current page to the last page in the historical navigation information, so that each page name in the generated breadcrumb navigation is Arranged in descending order of page hierarchy.
其中,电子设备基于历史导航信息中当前页面至最后一个页面的路由信息,生成当前页面的面包屑导航的方式有多种。接下来介绍其中三种方式。There are various ways for the electronic device to generate 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. Three of these methods are described next.
方式2.1:电子设备截取出历史导航信息中当前页面至最后一个页面的路由信息,基于截取出的路由信息,生成当前页面的面包屑导航。Mode 2.1: The electronic device intercepts the routing information from the current page to the last page in the historical navigation information, and generates the breadcrumb navigation of the current page based on the intercepted routing information.
示例性地,假设历史导航信息存放在第一数组中,电子设备截取出第一数组中第i至最后一个页面的路由信息,以得到第二数组。电子设备基于第二数组中各个页面的路由信息,生成当前页面的面包屑导航。其中,第i个页面即当前页面,第二数组存放的路由信息即为当前页面的导航信息。Exemplarily, assuming that the historical navigation information is stored in the first array, the electronic device intercepts the routing information of the ith to the last page in the first array to obtain the second array. The electronic device generates a breadcrumb navigation of the current page based on the routing information of each page in the second array. The i-th page is the current page, and the routing information stored in the second array is the navigation information of the current page.
方式2.2:电子设备删除历史导航信息中排列在当前页面的路由信息之前的路由信息,以更新历史导航信息。电子设备基于更新后的历史导航信息,生成当前页面的面包屑导航。其中,更新后的历史导航信息即为当前页面的导航信息。Mode 2.2: The electronic device deletes the routing information arranged before the routing information of the current page in the historical navigation information, so as to update the historical navigation information. The electronic device generates breadcrumb navigation of the current page based on the updated historical navigation information. The updated historical navigation information is the navigation information of the current page.
方式2.3:电子设备直接按照历史导航信息中当前页面至最后一个页面的路由信息,生成当前页面的面包屑导航。应当理解的是,在方式2.3中,电子设备并非通过截取或删除路由信息的方式来生成当前页面的面包屑导航。Mode 2.3: The electronic device 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 understood that, in mode 2.3, the electronic device does not generate the breadcrumb navigation of the current page by intercepting or deleting routing information.
可选地,与前述第一种实现方式类似地,在第二种实现方式中,电子设备每生成一次面包屑导航,就更新一次历史导航信息。基于此,电子设备在确定历史导航信息中包括目标路由信息的情况下,将历史导航信息更新为历史导航信息中当前页面至最后一个页面的路由信息。Optionally, similar to the foregoing first implementation manner, in the second implementation manner, the electronic device updates historical navigation information every time a breadcrumb navigation is generated. Based on this, 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 it is determined that the target routing information is included in the historical navigation information.
示例性地,在按照上述方式2.1生成当前页面的面包屑导航的情况下,电子设备将历史导航信息更新为截取出的路由信息。例如,电子设备将第二数组的值赋给第一数组。在按照上述方式2.2生成当前页面的面包屑导航的情况下,电子设备在生成当前页面的面包屑的过程中已更新历史导航信息。在按照上述方式2.3生成当前页面的面包屑导航的情况下,电子设备将历史导航信息中排列在当前页面的路由信息之前的路由信息进行删除,以更新历史导航信息。或者,电子设备也可以截取出历史导航信息中首个页面至当前页面至最后一个页面的路由信息,将历史导航信息更新为截取出的路由信息。Exemplarily, in the case of generating the breadcrumb navigation of the current page according to the above-mentioned method 2.1, the electronic device updates the historical navigation information to the extracted routing information. For example, the electronic device assigns the value of the second array to the first array. In the case of generating the breadcrumbs of the current page according to the above method 2.2, the electronic device has updated the historical navigation information during the process of generating the breadcrumbs of the current page. In the case of generating the breadcrumb navigation of the current page according to the above-mentioned method 2.3, the electronic device deletes the routing information arranged before the routing information of the current page in the historical navigation information to update the historical navigation information. Alternatively, the electronic device may also intercept 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 manner in which the electronic device generates the breadcrumb navigation of the current page based on the historical navigation information and the target routing information when the historical navigation information includes the target routing information is introduced.
在第三种实现方式中,历史导航信息包括一个或多个页面的路由信息,历史导航信息中各个页面的路由信息均对应有序号,各个页面的路由信息所对应的序号与相应页面的页面层级一致,该一个或多个页面的路由信息可以随意排列。如果历史导航信息中包括目标路由信息,则电子设备确定目标序号,目标序号为当前页面的路由信息所对应的序号,电子设备获取历史导航信息中对应的序号小于以及等于目标序号的页面的路由信息,基于获取的路由信息,生成当前页面的面包屑导航。其中,所获取的路由信息即为电子设备从历史导航信息中确定出的当前页面的导航信息。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 serial number, and the serial number corresponding to the routing information of each page corresponds to the page level of the corresponding page. Consistently, the routing information of the one or more pages can be arranged arbitrarily. If the historical navigation information includes target routing information, the electronic device determines the target serial number, the target serial number is the serial number corresponding to the routing information of the current page, and the electronic device obtains the routing information of the page whose serial number is less than or equal to the target serial number in the historical navigation information , based on the obtained routing information, generate the breadcrumb navigation of the current page. The acquired routing information is the navigation information of the current page determined by the electronic device from the historical navigation information.
在这种实现方式中,电子设备按照对应的序号从小到大的顺序生成面包屑导航中的各个页面名称,以使得所生成的面包屑导航中各个页面名称是按照页面层级从高到低的顺序排列的。In this implementation manner, the electronic device generates the names of the pages in the breadcrumb navigation according to the corresponding serial numbers in ascending order, so that the names of the pages in the generated breadcrumbs are in the order of the page hierarchy from high to low arranged.
可选地,与前述第一种实现方式类似地,在第三种实现方式中,电子设备每生成一次面包屑导航,就更新一次历史导航信息。基于此,电子设备在确定历史导航信息中包括目标路由信息的情况下,将历史导航信息更新为历史导航信息中对应的序号小于以及等于目标序号的页面的路由信息。示例性地,电子设备在获取历史导航信息中对应的序号小于以及等于目标序号的页面的路由信息之后,将历史导航信息更新为所获取的路由信息。Optionally, similar to the foregoing first implementation manner, in a third implementation manner, the electronic device updates historical navigation information every time a breadcrumb navigation is generated. Based on this, when determining that the historical navigation information includes target routing information, the electronic device updates the historical navigation information to routing information of pages whose corresponding serial numbers in the historical navigation information are less than or equal to the target serial number. Exemplarily, after acquiring the routing information of a page whose sequence number is less than or equal to the target sequence number in the historical navigation information, the electronic device updates the historical navigation information to the acquired routing information.
以上介绍了在历史导航信息包括目标路由信息的情况下,电子设备基于历史导航信息和目标路由信息,生成当前页面的面包屑导航的三种实现方式。接下来介绍在历史导航信息不包括目标路由信息的情况下,电子设备基于历史导航信息和目标路由信息,生成当前页面的面包屑导航的三种实现方式。The above describes three implementation manners for the electronic device to generate the breadcrumb navigation of the current page based on the historical navigation information and the target routing information when the historical navigation information includes the target routing information. Next, three implementation manners for the electronic device to generate the breadcrumb navigation of the current page based on the historical navigation information and the target routing information when the historical navigation information does not include the target routing information are introduced.
在第一种实现方式中,历史导航信息中的一个或多个页面的路由信息按照页面层级从高到低的顺序排列。如果历史导航信息中不包括目标路由信息,则电子设备将目标路由信息拼接至历史导航信息中最后一个页面的路由信息之后,以得到当前页面的导航信息。电子设备基于当前页面的导航信息,生成当前页面的面包屑导航。In a first implementation manner, the routing information of one or more pages in the historical navigation information is arranged in descending order of page hierarchy. If the historical navigation information does not include target routing information, the electronic device splices 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. The electronic device generates breadcrumb navigation of the current page based on the navigation information of the current page.
在这种实现方式中,电子设备按照与当前页面的导航信息中首个页面至当前页面的路由信息相同的顺序生成面包屑导航中的各个页面名称,以使得所生成的面包屑导航中各个页面名称是按照页面层级从高到低的顺序排列的。In this implementation manner, the electronic device generates the names of each page in the breadcrumb navigation in the same order as the routing information from the first page in the navigation information of the current page to the current page, so that each page in the generated breadcrumb navigation is named The names are arranged in descending order of page hierarchy.
在第二种实现方式中,历史导航信息中的一个或多个页面的路由信息按照页面层级从低到高的顺序排列。如果历史导航信息中不包括目标路由信息,则电子设备将目标路由信息拼接至历史导航信息中首个页面的路由信息之前,以得到当前页面的导航信息。电子设备基于当前页面的导航信息,生成当前页面的面包屑导航。In the second implementation manner, the routing information of one or more pages in the historical navigation information is arranged in descending order of page hierarchy. If the historical navigation information does not include the target routing information, the electronic device splices the target routing information before 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 breadcrumb navigation of the current page based on the navigation information of the current page.
在这种实现方式中,电子设备按照与当前页面的导航信息中当前页面至最后一个页面的路由信息相反的顺序生成面包屑导航中的各个页面名称,以使得所生成的面包屑导航中各个页面名称是按照页面层级从高到低的顺序排列的。In this implementation manner, the electronic device generates the names of each page in the breadcrumb navigation according to the reverse order of the routing information from the current page to the last page in the navigation information of the current page, so that each page in the generated breadcrumb navigation is generated. The names are arranged in descending order of page hierarchy.
在第三种实现方式中,历史导航信息中各个页面的路由信息均对应有序号,各个页面的路由信息所对应的序号与相应页面的页面层级一致,该一个或多个页面的路由信息可以随意排列。如果历史导航信息中不包括目标路由信息,则电子设备确定参考序号,参考序号为历史导航信息中路由信息对应的最大序号,将目标路由信息添加到历史导航信息中,以更新历史导航信息,并将参考序号加1之后作为历史导航信息中目标路由信息对应的序号。电子设备基于更新后的历史导航信息,生成当前页面的面包屑导航。其中,更新后的历史导航信息即为当前页面的导航信息。In the third implementation manner, the routing information of each page in the historical navigation information corresponds to a serial number, the serial 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 can be arbitrarily arrangement. If the historical navigation information does not include the target routing information, the electronic device determines the reference serial number, which is the maximum serial number corresponding to the routing information in the historical navigation information, and adds the target routing information to the historical navigation information to update the historical navigation information, and Add 1 to the reference sequence number as the sequence number corresponding to the target routing information in the historical navigation information. The electronic device generates breadcrumb navigation of the current page based on the updated historical navigation information. The updated historical navigation information is the navigation information of the current page.
在这种实现方式中,电子设备按照对应的序号从小到大的顺序生成面包屑导航中的各个页面名称,以使得所生成的面包屑导航中各个页面名称是按照页面层级从高到低的顺序排列的。In this implementation manner, the electronic device generates the names of the pages in the breadcrumb navigation according to the corresponding serial numbers in ascending order, so that the names of the pages in the generated breadcrumbs are in the order of the page hierarchy from high to low arranged.
可选地,电子设备每生成一次面包屑导航,就更新一次历史导航信息。基于此,电子设备在确定历史导航信息中不包括目标路由信息的情况下,将历史导航信息更新为当前页面的导航信息。Optionally, the electronic device updates historical navigation information every 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 it is determined that the target routing information is not included in the historical navigation information.
以上实施例通过步骤102和步骤103对目标路由信息不具有指示标签的情况下,电子设备生成当前页面的面包屑导航的实现过程进行了介绍。接下来将对目标路由信息具有指示标签的情况下,电子设备生成当前页面的面包屑导航的实现过程进行介绍。In the above embodiment, the implementation process of generating the breadcrumb navigation of the current page by the electronic device in the case where the target routing information does not have an indication label is introduced through
在本申请实施例中,在确定目标路由信息之后,如果目标路由信息具有指示标签,则电子设备获取路由树中根节点至目标节点的所有节点的路由信息,基于获取的所有节点的路由信息,生成当前页面的面包屑导航。其中,路由树用于描述当前页面所属网站中各个页面的路由层级关系,目标节点为当前页面对应的节点,根节点为网站的根页面对应的节点。简单来说,如果目标路由信息具有指示标签,则电子设备按照路由层级关系来生成面包屑导航。In this embodiment of the present application, after determining the target routing information, if the target routing information has an indication label, the electronic device obtains the routing information of all nodes from the root node to the target node in the routing tree, and generates the routing information based on the obtained routing information of all nodes. Breadcrumb navigation for the current page. The routing tree is used to describe the routing hierarchical relationship of each page in the website to which the current page belongs, the target node is the node corresponding to the current page, and the root node is the node corresponding to the root page of the website. In short, if the target routing information has an indication label, the electronic device generates a breadcrumb navigation according to the routing hierarchy.
其中,电子设备获取路由树中根节点至目标节点的所有节点的路由信息,的一种实现方式为:从路由树的根节点开始,按照递归的方式逐级向下查找各个节点的路由信息,直至查找到目标路由信息为止,得到从根节点至目标节点的所有节点的路由信息。Wherein, the electronic device obtains the routing information of all nodes from the root node to the target node in the routing tree. One implementation method is: starting from the root node of the routing tree, and searching for the routing information of each node in a recursive manner, until Until the target routing information is found, the routing information of all nodes from the root node to the target node is obtained.
可选地,电子设备获取目标链接,目标链接为当前页面的链接。电子设备从目标链接中确定从根节点到目标节点的所有节点的路径标签,按照从根节点到目标节点的所有节点的路径标签,依次从网站的源代码中获取从根节点到目标节点的所有节点的路由信息。Optionally, the electronic device acquires a target link, where the target link is a link of the current page. The electronic device determines the path labels of all nodes from the root node to the target node from the target link, and sequentially obtains all the path labels 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. Routing information for the node.
示例性地,假设目标链接为‘http://a/b/c.com’,电子设备从该目标链接中确定从根节点到目标节点的路径标签依次为‘/a’、‘/b’和‘/c’,电子设备首先从根页面的源代码中查找路径(path)标签为‘/a’的代码段,以获取根节点的路由信息。电子设备再从根页面的源代码中查找根节点的各个子节点的路径标签,从各个子节点中查找出路径标签为‘/b’的子节点,从根节点的源代码中获取路径标签为‘/b’的子节点对应页面的源代码的位置。电子设备基于该位置,获取路径标签为‘/b’的子节点对应页面的源代码,从该页面的源代码中查找路径标签为‘/b’的代码段,以获取路径标签为‘/b’的节点的路由信息。以此类推,直至电子设备获取到路径标签为‘/c’的节点的路由信息为止。Exemplarily, assuming that the target link is 'http://a/b/c.com', the electronic device determines from the target link that the path labels from the root node to the target node are '/a', '/b' in sequence and '/c', the electronic device first searches the code segment with the path label '/a' from the source code of the root page to obtain the routing information of the root node. The electronic device then searches the source code of the root page for the path label of each child node of the root node, finds the child node with the path label '/b' from each child node, and obtains the path label from the source code of the root node as The child nodes of '/b' correspond to the location of the source code of the page. Based on the location, the electronic device obtains the source code of the page corresponding to the child node whose path label is '/b', and searches the code segment whose path label is '/b' from the source code of the page to obtain the code segment whose path label is '/b' ' routing information for the node. And so on, until the electronic device obtains the routing information of the node whose path label is '/c'.
需要说明的是,电子设备除了通过上述方法获取路有树中各个节点的路由信息之外,也可以按照其他方法获取各个节点的路由信息,本申请实施例对此不作限定。It should be noted that, in addition to obtaining the routing information of each node in the route tree by the above method, the electronic device may also obtain the routing information of each node by other methods, which is not limited in this embodiment of the present application.
可选地,电子设备在从路由树的根节点开始,按照递归的方式逐级向下查找各个节点的路由信息的过程中,每获取一个节点的路由信息,将所获取的路由信息存放在第三数组中。其中,电子设备每获取一个节点的路由信息,将所获取的路由信息插入到第三数组中的最后一个元素之后,即,按照与路由信息的获取顺序相同的顺序来依次存放各个节点的路由信息。或者,电子设备每获取一个节点的路由信息,将所获取的路由信息插入到第三数组中的第一个元素之前,即,按照与路由信息的获取顺序相反的顺序来依次存放各个节点的路由信息。或者,电子设备每获取一个节点的路由信息,将所获取的路由信息随机插入到第三数组中。Optionally, the electronic device starts from the root node of the routing tree, and in the process of searching down the routing information of each node in a recursive manner, every time the routing information of a node is acquired, the acquired routing information is stored in the in three groups. Wherein, each time the electronic device obtains the routing information of a node, the obtained routing information is inserted after the last element in the third array, that is, the routing information of each node is sequentially stored in the same order as the order in which the routing information was obtained. . Alternatively, each time the electronic device acquires the routing information of a 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 order in which the routing information was acquired. information. Alternatively, each time the electronic device acquires routing information of a node, the acquired routing information is randomly inserted into the third array.
在本申请实施例中,电子设备在获取路由树中根节点至目标节点的所有节点的路由信息之后,将根节点至目标节点的所有节点的路由信息作为历史导航信息进行存储,以便于后续能够基于历史导航信息来生成面包屑导航。示例性地,在以第一数组来存放历史导航信息,以第三数组来存放所待获取各个节点的路由信息的情况下,电子设备在将目标路由信息存放到第三数组之后,将第三数组的值赋给第一数组。In this embodiment of the present application, after acquiring the routing information of all nodes from the root node to the target node in the routing tree, the electronic device stores the routing information of all nodes from the root node to the target node as historical navigation information, so that the electronic device can store the routing information of all nodes from the root node to the target node as historical navigation information, so that it can be easily Historical navigation information to generate breadcrumb navigation. Exemplarily, when the historical navigation information is stored in the first array and the routing information of each node to be acquired is stored in the third array, after the electronic device stores the target routing information in the third array, the third array is stored. The value of the array is assigned to the first array.
需要说明的是,在本申请实施例中,可以通过面包屑组件来实现本方案。例如,在访问者浏览网站中页面的过程中,电子设备通过调用面包屑组件来渲染页面的面包屑导航。接下来将对面包屑组件的实现逻辑进行介绍。It should be noted that, in the embodiments of the present application, the solution can be implemented by using a breadcrumb component. For example, when a visitor browses a page in a website, the electronic device renders the breadcrumb navigation of the page by invoking the breadcrumb component. Next, the implementation logic of the breadcrumb component will be introduced.
首先,为了基于指示标签来实现面包屑组件的功能,在网站的源代码中定义各个页面的路由信息,在路由信息中定义相应页面的页面名称,即相应页面在面包屑导航中的名称,在路由信息中还定义相应页面的路由信息是否具有指示标签。比如,若在某页面的路由信息中定义‘root:true’,则表示该页面的路由信息具有指示标签。若在某页面的路由信息中未定义‘root:true’,则表示该页面的路由信息不具有指示标签。First, in order to realize the function of the breadcrumb component based on the indicator tag, the routing information of each page is defined in the source code of the website, and the page name of the corresponding page is defined in the routing information, that is, the name of the corresponding page in the breadcrumb navigation. The routing information also defines whether the routing information of the corresponding page has an indication label. For example, if 'root: true' is defined in the routing information of a page, it means that the routing information of the page has an indication label. If 'root: true' is not defined in the routing information of a page, it means 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 a page is as follows, indicating that the routing information of the page has an indication tag.
其次,在网站的源代码中定义并封装用于生成面包屑导航的面包屑组件。并且,为了电子设备能够在需要生成面包屑导航的情况下调用上述面包屑组件,在需要生成面包屑导航的页面的源代码中引用上述面包屑组件。例如,假设以页面的源代码中的‘<breadcrumb></breadcrumb>’来表示对面包屑组件的引用,则电子设备在检测到某页面的源代码中‘<breadcrumb></breadcrumb>’这个代码段的情况下,调用上述面包屑组件,以生成该页面的面包屑导航。Second, define and encapsulate the breadcrumb component used to generate the breadcrumb navigation in the source code of the website. In addition, in order for the electronic device to call the above-mentioned breadcrumb component when the breadcrumb navigation needs to be generated, the above-mentioned breadcrumb component is referenced in the source code of the page that needs to generate the breadcrumb navigation. For example, if the reference to the breadcrumb component is represented by '<breadcrumb></breadcrumb>' in the source code of the page, the electronic device detects the '<breadcrumb></breadcrumb>' in the source code of a certain page. In the case of a code snippet, the above breadcrumb component is called to generate a breadcrumb navigation for that page.
其中,在该面包屑组件中定义有用于生成面包屑导航所需的变量,如数组breadcrumbs,用于存放当前页面的导航信息,以渲染出面包屑导航。在该面包屑组件中还定义有一个构造函数(如constructor函数),用于按照本方案生成当前页面的面包屑导航,即在当前页面中渲染出面包屑导航。接下来对通过该构造函数来生成面包屑导航的实现过程进行介绍。Among them, variables required for generating breadcrumb navigation are defined in the breadcrumb component, such as an array breadcrumbs, which is used to store the navigation information of the current page to render the breadcrumb navigation. A constructor (such as a constructor function) is also defined in the breadcrumb component, which is used to generate the breadcrumb navigation of the current page according to this scheme, that is, render the breadcrumb navigation in the current page. Next, the implementation process of generating breadcrumb navigation through this constructor will be introduced.
在该构造函数中监听路由导航事件,路由导航事件可以是由页面加载指令所触发的事件,在当监听到路由导航事件完成时,将当前页面的链接传入一个面包屑获取函数(如getBreadcrumbs函数)中,以通过该面包屑获取函数按照递归的方式逐级向下获取路由树中根节点到目标节点的所有节点的路由信息,将获取的各个节点的路由信息按照获取顺序依次放入到第三数组中。In this constructor, listen for routing navigation events. The routing navigation events can be events triggered by page loading instructions. When the routing navigation events are monitored, the link of the current page is passed into a breadcrumbs function (such as the getBreadcrumbs function). ), in order to obtain the routing information of all nodes from the root node to the target node in the routing tree in a recursive manner through the breadcrumb obtaining function, and put the obtained routing information of each node into the third in the array.
在构造函数获取到第三数组之后,取出第三数组中的最后一个元素,该元素即当前页面的路由信息,并判断当前页面的路由信息是否包括‘root:true’。如果当前页面的路由信息包括‘root:true’,则删除本地存储的第一数组,第一数组用于存放历史导航信息,将第三数组的值赋给面包屑组件中的数组breadcrumbs。如果当前页面的路由信息不包括‘root:true’,则判断本地存储的第一数组中是否包括当前页面的路由信息。如果第一数组中包括当前页面的路由信息,则直接截取出第一数组中第1至第i个页面的路由信息,以得到第二数组,并将第二数组的值赋给面包屑组件中的数组breadcrumbs,第i个页面即当前页面。如果第一数组中不包括当前页面的路由信息,则将当前页面的路由信息拼接到第一数组中的最后一个元素之后,将拼接后的第一数组的值赋给面包屑组件中的数组breadcrumbs。After the constructor obtains the third array, it takes out the last element in the third array, which is the routing information of the current page, and determines whether the routing information of the current page includes 'root: true'. If the routing information of the current page includes 'root: true', delete the first array stored locally, the first array is used to store historical navigation information, and assign the value of the third array to the array breadcrumbs in the breadcrumb component. If the routing information of the current page does not include 'root: true', it is determined whether the routing information of the current page is included in the first array stored locally. If the first array includes the routing information of the current page, directly extract the routing information of the 1st to i-th pages in the first array to obtain the second array, and assign the value of the second array to the breadcrumb component The array breadcrumbs, the i-th page is the current page. If the routing information of the current page is not included in the first array, the routing information of the current page is spliced to the last element in the first array, and the value of the spliced first array is assigned to the array breadcrumbs in the breadcrumb component .
在对面包屑组件中的数组breadcrumbs赋值之后,面包屑组件即可基于数组breadcrumbs中的路由信息,生成当前页面的面包屑导航。另外,面包屑组件还将数组breadcrumbs作为最新的历史导航信息在本地存储,以用于下一次渲染面包屑导航。After assigning a value to the array breadcrumbs in the breadcrumb component, the breadcrumb component can generate the breadcrumb navigation of the current page based on the routing information in the array breadcrumbs. In addition, the breadcrumb component also stores the array breadcrumbs locally as the latest historical navigation information for the next rendering of breadcrumbs.
接下来对采用本方案所生成的面包屑导航进行示例性说明。在该示例中,以网站包括页面名称分别为‘文件管理’、‘文件列表’、‘预览’和‘编辑’的四个页面为例,‘文件管理’和‘文件列表’所对应的页面的路由信息具有指示标签,‘预览’和‘编辑’所对应的路由信息不具有指示标签。假设访问者正在浏览的页面中所显示的面包屑导航为‘文件管理>文件列表’,若在第一时刻从‘文件列表’对应的页面跳转到‘预览’对应的页面,那么所生成的面包屑导航即为‘文件管理>文件列表>预览’。若在第一时刻从‘文件列表’对应的页面跳转到‘编辑’对应的页面,那么所生成的面包屑导航即为‘文件管理>文件列表>编辑’。若在第二时刻从‘编辑’对应的页面跳转到‘预览’对应的页面,那么所生成的面包屑导航即为‘文件管理>文件列表>编辑>预览’。Next, an exemplary description of the breadcrumb navigation generated by this solution is given. In this example, taking the website including four pages with page names of 'file management', 'file list', 'preview' and 'edit' as an example, the pages corresponding to 'file management' and 'file list' The routing information has an indication label, and the routing information corresponding to 'preview' and 'edit' does not have an indication label. Assuming that the breadcrumb navigation displayed in the page the visitor is browsing is 'File Management > File List', if the page corresponding to 'File List' jumps to the page corresponding to 'Preview' at the first moment, then the generated The breadcrumb navigation is 'File Management > File List > Preview'. If jumping from the page corresponding to 'file list' to the page corresponding to 'edit' at the first moment, the generated breadcrumb navigation is 'file management>file list>edit'. If jumping from the page corresponding to 'edit' to the page corresponding to 'preview' at the second moment, the generated breadcrumb navigation is 'file management>file list>edit>preview'.
综上所述,本方案能够自动生成面包屑导航,减少手动编排的弊端,即减少工作量,提高效率,且不易出错,便于后期维护。另外,在本方案中,通过指示标签来指示相应页面的页面层级与路由层级一致,如果当前页面不具有指示标签,说明当前页面的页面层级与路由层级可能不一致,那么基于历史导航信息来生成当前页面的面包屑导航。即,由于页面间的路由层级关系是严格的,而页面层级关系并非是严格的,路由层级关系与页面层级关系可能并非完全一致,因此,本方案并不限制于严格按照页面的路由层级关系来生成面包屑导航,所生成的面包屑导航能够更加准确地体现页面层级关系。To sum up, this solution can automatically generate breadcrumb navigation, which reduces the drawbacks of manual scheduling, that is, reduces workload, improves efficiency, and is less prone to errors and facilitates later maintenance. In addition, in this solution, the page level of the corresponding page is indicated by the indication label to be consistent with the routing level. If the current page does not have an indication label, it means that the page level of the current page may be inconsistent with the routing level, then the current page is generated based on historical navigation information. Breadcrumb navigation for the page. That is, since the routing hierarchy between pages is strict, but the page hierarchy is not strict, the routing hierarchy may not be completely consistent with the page hierarchy. Therefore, this solution is not limited to strictly follow the routing hierarchy of pages. Generate breadcrumb navigation, the generated breadcrumb navigation can more accurately reflect the page hierarchy.
上述所有可选技术方案,均可按照任意结合形成本申请的可选实施例,本申请实施例对此不再一一赘述。All the above-mentioned optional technical solutions can be combined to form optional embodiments of the present application, which are not repeated in this embodiment of the present application.
图2是本申请实施例提供的一种面包屑导航的生成装置200的结构示意图,该面包屑导航的生成装置可以由软件、硬件或者两者的结合实现成为电子设备的部分或者全部。该电子设备为上述实施例中的任一电子设备。请参考图2,该装置200包括:确定模块201、第一获取模块202和生成模块203。2 is a schematic structural diagram of an apparatus 200 for generating breadcrumbs provided by an embodiment of the present application. The apparatus for generating breadcrumbs may be implemented as part or all of an electronic device by software, hardware, or a combination of the two. The electronic device is any of the electronic devices in the above-mentioned embodiments. Referring to FIG. 2 , the apparatus 200 includes: a determining
确定模块201,用于确定目标路由信息,目标路由信息为当前页面的路由信息;The determining
第一获取模块202,用于如果目标路由信息不具有指示标签,则获取历史导航信息,该指示标签用于指示相应页面的页面层级与路由层级一致,历史导航信息用于指示在当前页面之前所访问的上一个页面的面包屑导航;The first obtaining
生成模块203,用于基于历史导航信息和目标路由信息,生成当前页面的面包屑导航。The
可选地,历史导航信息包括一个或多个页面的路由信息,且该一个或多个页面的路由信息按照页面层级从高到低的顺序排列;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 descending order of page level;
生成模块203包括:The
第一生成子模块,用于如果历史导航信息中包括目标路由信息,则基于历史导航信息中首个页面至当前页面的路由信息,生成当前页面的面包屑导航。The first generating sub-module is configured to generate a 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 target routing information is included in the historical navigation information.
可选地,该装置200还包括:Optionally, the apparatus 200 further includes:
第一更新模块,用于将历史导航信息更新为上述历史导航信息中首个页面至当前页面的路由信息。The first update module is configured to update the historical navigation information to the routing information from the first page to the current page in the above 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 descending order of page level;
生成模块203包括:The
拼接子模块,用于如果历史导航信息中不包括目标路由信息,则将目标路由信息拼接至历史导航信息中最后一个页面的路由信息之后,以得到当前页面的导航信息;A splicing submodule, for if the target routing information is not included in the historical navigation information, then the target routing information is spliced after the routing information of the last page in the historical navigation information to obtain the navigation information of the current page;
第二生成子模块,用于基于当前页面的导航信息,生成当前页面的面包屑导航。The second generating submodule is used for generating the breadcrumb navigation of the current page based on the navigation information of the current page.
可选地,该装置200还包括:Optionally, the apparatus 200 further includes:
第二更新模块,用于将历史导航信息更新为当前页面的导航信息。The second update module is used to update the historical navigation information to the navigation information of the current page.
可选地,该装置200还包括:Optionally, the apparatus 200 further includes:
第二获取模块,用于如果目标路由信息具有指示标签,则获取路由树中根节点至目标节点的所有节点的路由信息,该路由树用于描述当前页面所属网站中各个页面的路由层级关系,该目标节点为当前页面对应的节点,该根节点为网站的根页面对应的节点;The second obtaining module is configured to obtain the routing information of all nodes from the root node to the target node in the routing tree if the target routing information has an indication label, the routing tree is used to describe the routing hierarchy relationship of each page in the website to which the current page belongs, the The target node is the node corresponding to the current page, and the root node is the node corresponding to the root page of the website;
第二生成模块,用于基于获取的所有节点的路由信息,生成当前页面的面包屑导航。The second generating module is configured to generate the breadcrumb navigation of the current page based on the obtained routing information of all nodes.
可选地,第二获取模块包括:Optionally, the second obtaining module includes:
获取子模块,用于从该路由树的根节点开始,按照递归的方式逐级向下查找各个节点的路由信息,直至查找到目标路由信息为止,得到从根节点至目标节点的所有节点的路由信息。Obtain the sub-module, which is used to start from the root node of the routing tree, and search for the routing information of each node in a recursive manner, until the target routing information is found, and obtain the routes from the root node to all nodes of the target node. information.
可选地,该装置200还包括:Optionally, the apparatus 200 further includes:
存储模块,用于将路由树中根节点至目标节点的所有节点的路由信息作为历史导航信息进行存储。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.
综上所述,本方案能够自动生成面包屑导航,减少手动编排的弊端,即减少工作量,提高效率,且不易出错,便于后期维护。另外,在本方案中,通过指示标签来指示相应页面的页面层级与路由层级一致,如果当前页面不具有指示标签,说明当前页面的页面层级与路由层级可能不一致,那么基于历史导航信息来生成当前页面的面包屑导航。即,由于页面间的路由层级关系是严格的,而页面层级关系并非是严格的,路由层级关系与页面层级关系可能并非完全一致,因此,本方案并不限制于严格按照页面的路由层级关系来生成面包屑导航,所生成的面包屑导航能够更加准确地体现页面层级关系。To sum up, this solution can automatically generate breadcrumb navigation, which reduces the drawbacks of manual scheduling, that is, reduces workload, improves efficiency, and is less prone to errors and facilitates later maintenance. In addition, in this solution, the page level of the corresponding page is indicated by the indication label to be consistent with the routing level. If the current page does not have an indication label, it means that the page level of the current page may be inconsistent with the routing level, then the current page is generated based on historical navigation information. Breadcrumb navigation for the page. That is, since the routing hierarchy between pages is strict, but the page hierarchy is not strict, the routing hierarchy may not be completely consistent with the page hierarchy. Therefore, this solution is not limited to strictly follow the routing hierarchy of pages. Generate breadcrumb navigation, the generated breadcrumb navigation can more accurately reflect the page hierarchy.
需要说明的是:上述实施例提供的面包屑导航的生成装置在生成面包屑导航时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的面包屑导航的生成装置与面包屑导航的生成方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。It should be noted that: when the device for generating breadcrumbs provided by the above embodiments, when generating breadcrumbs, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions may be allocated by different The function module is completed, that is, the internal structure of the device is divided into different function modules, so as to complete all or part of the functions described above. In addition, the apparatus for generating breadcrumbs provided in the above embodiments and the embodiments of the methods for generating breadcrumbs belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
图3示出了本申请一个示例性实施例提供的电子设备300的结构框图。该电子设备300可以是:智能手机、平板电脑、笔记本电脑或台式电脑等。电子设备300还可能被称为计算机设备、终端设备、用户设备、便携式电子设备、膝上型电子设备、台式电子设备等其他名称。FIG. 3 shows a structural block diagram of an
通常,电子设备300包括有:处理器301和存储器302。Generally, the
处理器301可以包括一个或多个处理核心,比如4核心处理器、8核心处理器等。处理器301可以采用DSP(Digital Signal Processing,数字信号处理)、FPGA(Field-Programmable Gate Array,现场可编程门阵列)、PLA(Programmable Logic Array,可编程逻辑阵列)中的至少一种硬件形式来实现。处理器301也可以包括主处理器和协处理器,主处理器是用于对在唤醒状态下的数据进行处理的处理器,也称CPU(Central ProcessingUnit,中央处理器);协处理器是用于对在待机状态下的数据进行处理的低功耗处理器。在一些实施例中,处理器301可以集成有GPU(Graphics Processing Unit,图像处理器),GPU用于负责显示屏所需要显示的内容的渲染和绘制。一些实施例中,处理器301还可以包括AI(Artificial Intelligence,人工智能)处理器,该AI处理器用于处理有关机器学习的计算操作。The
存储器302可以包括一个或多个计算机可读存储介质,该计算机可读存储介质可以是非暂态的。存储器302还可包括高速随机存取存储器,以及非易失性存储器,比如一个或多个磁盘存储设备、闪存存储设备。在一些实施例中,存储器302中的非暂态的计算机可读存储介质用于存储至少一个指令,该至少一个指令用于被处理器301所执行以实现本申请中方法实施例提供的面包屑导航的生成方法。
在一些实施例中,电子设备300还可选包括有:外围设备接口303和至少一个外围设备。处理器301、存储器302和外围设备接口303之间可以通过总线或信号线相连。各个外围设备可以通过总线、信号线或电路板与外围设备接口303相连。具体地,外围设备包括:射频电路304、显示屏305、摄像头组件306、音频电路307、定位组件308和电源309中的至少一种。In some embodiments, the
外围设备接口303可被用于将I/O(Input/Output,输入/输出)相关的至少一个外围设备连接到处理器301和存储器302。在一些实施例中,处理器301、存储器302和外围设备接口303被集成在同一芯片或电路板上;在一些其他实施例中,处理器301、存储器302和外围设备接口303中的任意一个或两个可以在单独的芯片或电路板上实现,本实施例对此不加以限定。The
射频电路304用于接收和发射RF(Radio Frequency,射频)信号,也称电磁信号。射频电路304通过电磁信号与通信网络以及其他通信设备进行通信。射频电路304将电信号转换为电磁信号进行发送,或者,将接收到的电磁信号转换为电信号。可选地,射频电路304包括:天线系统、RF收发器、一个或多个放大器、调谐器、振荡器、数字信号处理器、编解码芯片组、用户身份模块卡等等。射频电路304可以通过至少一种无线通信协议来与其它电子设备进行通信。该无线通信协议包括但不限于:城域网、各代移动通信网络(2G、3G、4G及5G)、无线局域网和/或WiFi(Wireless Fidelity,无线保真)网络。在一些实施例中,射频电路304还可以包括NFC(Near Field Communication,近距离无线通信)有关的电路,本申请对此不加以限定。The
显示屏305用于显示UI(User Interface,用户界面)。该UI可以包括图形、文本、图标、视频及其它们的任意组合。当显示屏305是触摸显示屏时,显示屏305还具有采集在显示屏305的表面或表面上方的触摸信号的能力。该触摸信号可以作为控制信号输入至处理器301进行处理。此时,显示屏305还可以用于提供虚拟按钮和/或虚拟键盘,也称软按钮和/或软键盘。在一些实施例中,显示屏305可以为一个,设置在电子设备300的前面板;在另一些实施例中,显示屏305可以为至少两个,分别设置在电子设备300的不同表面或呈折叠设计;在另一些实施例中,显示屏305可以是柔性显示屏,设置在电子设备300的弯曲表面上或折叠面上。甚至,显示屏305还可以设置成非矩形的不规则图形,也即异形屏。显示屏305可以采用LCD(Liquid Crystal Display,液晶显示屏)、OLED(Organic Light-Emitting Diode,有机发光二极管)等材质制备。The
摄像头组件306用于采集图像或视频。可选地,摄像头组件306包括前置摄像头和后置摄像头。通常,前置摄像头设置在电子设备的前面板,后置摄像头设置在电子设备的背面。在一些实施例中,后置摄像头为至少两个,分别为主摄像头、景深摄像头、广角摄像头、长焦摄像头中的任意一种,以实现主摄像头和景深摄像头融合实现背景虚化功能、主摄像头和广角摄像头融合实现全景拍摄以及VR(Virtual Reality,虚拟现实)拍摄功能或者其它融合拍摄功能。在一些实施例中,摄像头组件306还可以包括闪光灯。闪光灯可以是单色温闪光灯,也可以是双色温闪光灯。双色温闪光灯是指暖光闪光灯和冷光闪光灯的组合,可以用于不同色温下的光线补偿。The
音频电路307可以包括麦克风和扬声器。麦克风用于采集用户及环境的声波,并将声波转换为电信号输入至处理器301进行处理,或者输入至射频电路304以实现语音通信。出于立体声采集或降噪的目的,麦克风可以为多个,分别设置在电子设备300的不同部位。麦克风还可以是阵列麦克风或全向采集型麦克风。扬声器则用于将来自处理器301或射频电路304的电信号转换为声波。扬声器可以是传统的薄膜扬声器,也可以是压电陶瓷扬声器。当扬声器是压电陶瓷扬声器时,不仅可以将电信号转换为人类可听见的声波,也可以将电信号转换为人类听不见的声波以进行测距等用途。在一些实施例中,音频电路307还可以包括耳机插孔。
定位组件308用于定位电子设备300的当前地理位置,以实现导航或LBS(LocationBased Service,基于位置的服务)。定位组件308可以是基于美国的GPS(GlobalPositioning System,全球定位系统)、中国的北斗系统、俄罗斯的格雷纳斯系统或欧盟的伽利略系统的定位组件。The
电源309用于为电子设备300中的各个组件进行供电。电源309可以是交流电、直流电、一次性电池或可充电电池。当电源309包括可充电电池时,该可充电电池可以支持有线充电或无线充电。该可充电电池还可以用于支持快充技术。
在一些实施例中,电子设备300还包括有一个或多个传感器310。该一个或多个传感器310包括但不限于:加速度传感器311、陀螺仪传感器312、压力传感器313、指纹传感器314、光学传感器315以及接近传感器316。In some embodiments, the
加速度传感器311可以检测以电子设备300建立的坐标系的三个坐标轴上的加速度大小。比如,加速度传感器311可以用于检测重力加速度在三个坐标轴上的分量。处理器301可以根据加速度传感器311采集的重力加速度信号,控制显示屏305以横向视图或纵向视图进行用户界面的显示。加速度传感器311还可以用于游戏或者用户的运动数据的采集。The acceleration sensor 311 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the
陀螺仪传感器312可以检测电子设备300的机体方向及转动角度,陀螺仪传感器312可以与加速度传感器311协同采集用户对电子设备300的3D动作。处理器301根据陀螺仪传感器312采集的数据,可以实现如下功能:动作感应(比如根据用户的倾斜操作来改变UI)、拍摄时的图像稳定、游戏控制以及惯性导航。The gyroscope sensor 312 can detect the body direction and rotation angle of the
压力传感器313可以设置在电子设备300的侧边框和/或显示屏305的下层。当压力传感器313设置在电子设备300的侧边框时,可以检测用户对电子设备300的握持信号,由处理器301根据压力传感器313采集的握持信号进行左右手识别或快捷操作。当压力传感器313设置在显示屏305的下层时,由处理器301根据用户对显示屏305的压力操作,实现对UI界面上的可操作性控件进行控制。可操作性控件包括按钮控件、滚动条控件、图标控件、菜单控件中的至少一种。The pressure sensor 313 may be disposed on the side frame of the
指纹传感器314用于采集用户的指纹,由处理器301根据指纹传感器314采集到的指纹识别用户的身份,或者,由指纹传感器314根据采集到的指纹识别用户的身份。在识别出用户的身份为可信身份时,由处理器301授权该用户执行相关的敏感操作,该敏感操作包括解锁屏幕、查看加密信息、下载软件、支付及更改设置等。指纹传感器314可以被设置在电子设备300的正面、背面或侧面。当电子设备300上设置有物理按键或厂商Logo时,指纹传感器314可以与物理按键或厂商Logo集成在一起。The fingerprint sensor 314 is used to collect the user's fingerprint, and the
光学传感器315用于采集环境光强度。在一个实施例中,处理器301可以根据光学传感器315采集的环境光强度,控制显示屏305的显示亮度。具体地,当环境光强度较高时,调高显示屏305的显示亮度;当环境光强度较低时,调低显示屏305的显示亮度。在另一个实施例中,处理器301还可以根据光学传感器315采集的环境光强度,动态调整摄像头组件306的拍摄参数。Optical sensor 315 is used to collect ambient light intensity. In one embodiment, the
接近传感器316,也称距离传感器,通常设置在电子设备300的前面板。接近传感器316用于采集用户与电子设备300的正面之间的距离。在一个实施例中,当接近传感器316检测到用户与电子设备300的正面之间的距离逐渐变小时,由处理器301控制显示屏305从亮屏状态切换为息屏状态;当接近传感器316检测到用户与电子设备300的正面之间的距离逐渐变大时,由处理器301控制显示屏305从息屏状态切换为亮屏状态。
本领域技术人员可以理解,图3中示出的结构并不构成对电子设备300的限定,可以包括比图示更多或更少的组件,或者组合某些组件,或者采用不同的组件布置。Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the
在一些实施例中,还提供了一种计算机可读存储介质,该存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现上述实施例中面包屑导航的生成方法的步骤。例如,所述计算机可读存储介质可以是ROM、RAM、CD-ROM、磁带、软盘和光数据存储设备等。In some embodiments, a computer-readable storage medium is also provided, where a computer program is stored in the storage medium, and when the computer program is executed by a processor, implements the steps of the method for generating breadcrumbs in the foregoing embodiments. For example, the computer-readable storage medium may be ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
值得注意的是,本申请实施例提到的计算机可读存储介质可以为非易失性存储介质,换句话说,可以是非瞬时性存储介质。It should be noted that the computer-readable storage medium mentioned in the embodiments of the present application may be a non-volatile storage medium, in other words, may be a non-transitory storage medium.
应当理解的是,实现上述实施例的全部或部分步骤可以通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。所述计算机指令可以存储在上述计算机可读存储介质中。It should be understood that, all or part of the steps of implementing the above embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented in software, it can 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 comprising instructions, which, when executed on a computer, cause the computer to perform the steps of the above-described method for generating breadcrumbs.
应当理解的是,本文提及的“至少一个”是指一个或多个,“多个”是指两个或两个以上。在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。It should be understood that references herein to "at least one" refers to one or more, and "plurality" refers to two or more. In the description of the embodiments of the present application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in this document is only an association that describes an associated object Relation, it means that there can be three kinds of relations, for example, A and/or B can mean that A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like are not necessarily different.
需要说明的是,本申请实施例所涉及的信息(包括但不限于用户设备信息、用户个人信息等)、数据(包括但不限于用于分析的数据、存储的数据、展示的数据等)以及信号,均为经用户授权或者经过各方充分授权的,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。例如,本申请实施例中涉及到的页面的路由信息、源代码等都是在充分授权的情况下获取的。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.) involved in the embodiments of this application, and Signals are authorized by users or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions. For example, the routing information, source code, etc. of the pages involved in the embodiments of the present application are all obtained with sufficient authorization.
以上所述为本申请提供的实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above-mentioned examples provided for this application are not intended to limit this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection scope of this application. Inside.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210405491.2A CN114969579B (en) | 2022-04-18 | 2022-04-18 | Breadcrumb navigation generation method, device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210405491.2A CN114969579B (en) | 2022-04-18 | 2022-04-18 | Breadcrumb navigation generation method, device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114969579A true CN114969579A (en) | 2022-08-30 |
CN114969579B CN114969579B (en) | 2024-11-22 |
Family
ID=82978301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210405491.2A Active CN114969579B (en) | 2022-04-18 | 2022-04-18 | Breadcrumb navigation generation method, device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114969579B (en) |
Citations (10)
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 |
CN101796517A (en) * | 2007-09-04 | 2010-08-04 | 微软公司 | Breadcrumb list supplementing for hierarchical data sets |
CN101887444A (en) * | 2009-05-15 | 2010-11-17 | 国际商业机器公司 | Navigation method and system for web pages |
CA2895479A1 (en) * | 2012-12-21 | 2014-06-26 | Ebay Inc. | Contextual breadcrumbs during navigation |
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/CN114969579B/en active Active
Patent Citations (10)
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 |
CN101796517A (en) * | 2007-09-04 | 2010-08-04 | 微软公司 | Breadcrumb list supplementing for hierarchical data sets |
CN101887444A (en) * | 2009-05-15 | 2010-11-17 | 国际商业机器公司 | Navigation method and system for web pages |
CA2895479A1 (en) * | 2012-12-21 | 2014-06-26 | Ebay Inc. | Contextual breadcrumbs during navigation |
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 (2)
Title |
---|
START2019: ""element实现动态路由+面包"", pages 1 - 8, Retrieved from the Internet <URL:《https://blog.csdn.net/Start2019/article/details/100032203》> * |
闫娜: ""基于CSS样式的"面包屑"导航设计与探讨"", 《黑龙江科技信息》, no. 02, 15 January 2017 (2017-01-15), pages 65 * |
Also Published As
Publication number | Publication date |
---|---|
CN114969579B (en) | 2024-11-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107885533B (en) | Method and device for managing component codes | |
CN109828802B (en) | List view display method, device and readable medium | |
CN112256425B (en) | Load balancing method and system, computer cluster, information editing method and terminal | |
JP7246502B2 (en) | Mini-program creation method, device, terminal and program | |
CN112000331A (en) | Page rendering method and device, electronic equipment and storage medium | |
CN108717432B (en) | Resource query method and device | |
CN108959361B (en) | Form management method and device | |
CN112905328B (en) | Task processing method, device and computer readable storage medium | |
CN110046018A (en) | Show method, apparatus, electronic equipment and the medium of message | |
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 | |
CN109358931A (en) | Interface display method and terminal | |
CN110149408B (en) | Service data display method and device, terminal and server | |
CN114329292B (en) | Resource information configuration method, device, electronic device and storage medium | |
CN111275607A (en) | Interface display method and device, computer equipment and storage medium | |
CN113051485B (en) | Group searching method, device, terminal and storage medium | |
CN114706846A (en) | Method, device, device and storage medium for querying data | |
CN110569064B (en) | Interface identifier generation method, device, equipment and storage medium | |
CN115134316B (en) | Topic display method, device, terminal and storage medium | |
CN114168120B (en) | Data acquisition method, device, computer equipment and storage medium | |
CN114969579B (en) | Breadcrumb navigation generation method, device and computer readable storage medium | |
CN110390065B (en) | Webpage acquisition method, device and system | |
CN109918566B (en) | Query method, device, electronic equipment and 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |