Webpage keyword interpretation information display method and device, equipment, medium and product

By obtaining and locating keyword explanation configuration information when a webpage loads, and dynamically displaying explanation icons, the flexibility and cost issues of webpage keyword suggestions are resolved, enabling flexible application of keyword explanations.

CN121638233APending Publication Date: 2026-03-10JINGDONG TECH HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In existing technologies, the keyword suggestion function for web pages cannot be adjusted in real time, and different keyword explanations cannot be applied to different pages as needed, resulting in high usage costs, high maintenance difficulty, and a lack of flexible configuration.

Method used

By obtaining keyword explanation configuration information, responding to webpage loading, locating keywords in the document object model, and displaying explanation icons according to icon configuration information, it supports dynamic configuration in the background and webpage matching conditions, enabling flexible application of keyword explanations.

Benefits of technology

It reduces the cost and maintenance difficulty of keyword explanations, improves the flexibility of keyword suggestions, and supports dynamic configuration in the background and enabling keyword explanation functions on demand.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121638233A_ABST
    Figure CN121638233A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a webpage keyword interpretation information display method and device, equipment, a medium and a product. A specific embodiment of the method comprises the following steps: in response to webpage loading, obtaining keyword interpretation configuration information; in response to the fact that the webpage matching condition is met, keywords in the keyword set are positioned in the document object model, and a positioning result is obtained; for each positioning keyword in the positioning result, performing interpretation icon configuration on the positioning keyword according to the icon configuration information and interpretation information corresponding to the positioning keyword; and in response to an explanation icon selection operation corresponding to any positioning keyword detected in the webpage, displaying explanation information corresponding to any positioning keyword. The embodiment is related to webpage keyword explanation, supports background dynamic configuration of keyword explanation configuration information, can apply different keyword explanations for different pages, reduces the use cost and maintenance difficulty of keyword explanation, and improves the flexibility of keyword prompt.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method and apparatus for displaying explanation information of a keyword in a webpage. BACKGROUND

[0002] In the current webpage interaction design, the keyword prompt and explanation function is commonly used in the scene of help document, product introduction or teaching page, etc. The current implementation method includes using tooltip plug-in or manually embedding HTML element, etc.

[0003] However, when the above method is used, the following technical problems often exist: the tooltip plug-in usually needs to be hard-coded by the developer with the keyword and prompt content, and cannot be adjusted in real time; different keyword explanations cannot be applied to different pages as needed, lacking webpage matching logic, resulting in high use cost, high maintenance difficulty and lack of flexible configuration of keyword explanation.

[0004] The above information disclosed in this BACKGROUND section is only for the purpose of enhancing the understanding of the background of the present inventive concepts, and therefore, it can contain information that does not form the prior art that is already known in this country to those ordinary skilled in the art. SUMMARY

[0005] The summary of the present disclosure is used to introduce the concepts in a simple form, which will be described in detail in the specific embodiments section. The summary of the present disclosure is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to be used to limit the scope of the claimed technical solutions.

[0006] Some embodiments of the present disclosure propose a method and apparatus for displaying explanation information of a keyword in a webpage, an electronic device, a computer readable medium and a computer program product, to solve one or more of the technical problems mentioned in the BACKGROUND section.

[0007] In a first aspect, some embodiments of this disclosure provide a method for displaying explanatory information of web page keywords. The method includes: in response to a web page loading, obtaining keyword explanation configuration information, wherein the keyword explanation configuration information includes a keyword set, a set of explanation information corresponding to the keyword set, web page matching information, and icon configuration information; in response to determining that the web page satisfies the web page matching conditions corresponding to the web page matching information, locating keywords in the keyword set in the document object model of the web page to obtain a location result, wherein the location result includes the located keywords; for each located keyword in the location result, configuring an explanation icon for the located keyword according to the icon configuration information and the explanation information corresponding to the located keyword; and in response to detecting an explanation icon selection operation corresponding to any located keyword in the web page, displaying the explanation information corresponding to the arbitrary located keyword.

[0008] Optionally, obtaining keyword explanation configuration information as described above includes: calling the keyword explanation configuration information acquisition interface through a pre-loaded software development kit to obtain the keyword explanation configuration information.

[0009] Optionally, the above-mentioned method of locating keywords in the keyword set in the document object model of the webpage to obtain the location result includes: parsing preset elements in the preset content area in the document object model to obtain the parsing result; and locating keywords in the keyword set in the parsing result to obtain the location result.

[0010] Optionally, the above-mentioned method of locating keywords in the keyword set from the above-mentioned parsing results to obtain the location result includes: performing word segmentation on the above-mentioned parsing results to obtain a word segmentation set; matching the above-mentioned word segmentation set with the above-mentioned keyword set to obtain at least one matched keyword as the location result, wherein the keywords included in the above-mentioned location result are location keywords.

[0011] Optionally, configuring the explanation icon for the positioning keyword based on the icon configuration information and the explanation information corresponding to the positioning keyword includes: configuring the explanation icon for the positioning keyword in the document object model based on preset element wrapping tags and preset icon tags; associating the icon configuration information with the explanation icon configured for the positioning keyword; and associating the explanation information corresponding to the positioning keyword with the selection operation corresponding to the explanation icon.

[0012] Optionally, the method further includes: in response to detecting changes in the webpage, determining whether there are updated page elements in the webpage; in response to determining that there are updated page elements, locating the keywords in the keyword set in the document object model of the updated webpage, and obtaining the location result.

[0013] Optionally, the above-mentioned response to the detection of an explanation icon selection operation corresponding to any positioning keyword in the above-mentioned web page and the display of explanation information corresponding to the above-mentioned positioning keyword includes: in response to the detection of a hover operation of an explanation icon corresponding to any positioning keyword in the above-mentioned web page, displaying an explanation box corresponding to the above-mentioned positioning keyword at the target position, wherein the explanation box displays explanation information.

[0014] Optionally, the above explanatory information is rendered in the above explanation box using a markup language rendering engine.

[0015] Secondly, some embodiments of this disclosure provide a device for displaying explanatory information of web page keywords. The device includes: an acquisition unit configured to acquire keyword explanation configuration information in response to web page loading, wherein the keyword explanation configuration information includes a keyword set, an explanation information set corresponding to the keyword set, web page matching information, and icon configuration information; a positioning unit configured to locate keywords in the keyword set in the document object model of the web page in response to determining that the web page satisfies the web page matching conditions corresponding to the web page matching information, and obtain a positioning result, wherein the positioning result includes the positioned keywords; a configuration unit configured to configure an explanation icon for each positioned keyword in the positioning result according to the icon configuration information and the explanation information corresponding to the positioned keyword; and a display unit configured to display the explanation information corresponding to the arbitrary positioned keyword in response to detecting an explanation icon selection operation corresponding to any positioned keyword in the web page.

[0016] Optionally, the acquisition unit is further configured to: call the keyword explanation configuration information acquisition interface through a pre-loaded software development kit to obtain the keyword explanation configuration information.

[0017] Optionally, the positioning unit is further configured to: parse preset elements in the preset content area in the above document object model to obtain the parsing result; and locate keywords in the above keyword set in the parsing result to obtain the positioning result.

[0018] Optionally, the positioning unit is further configured to: perform word segmentation on the above parsing results to obtain a word segmentation set; match the above word segmentation set with the above keyword set to obtain at least one matched keyword as the positioning result, wherein the keywords included in the above positioning result are positioning keywords.

[0019] Optionally, the configuration unit is further configured to: perform explanatory icon configuration processing on the above-mentioned positioning keywords in the above-mentioned document object model according to the preset element wrapping label and the preset icon label; associate the above-mentioned icon configuration information with the explanatory icons configured for the above-mentioned positioning keywords; and associate the explanatory information corresponding to the above-mentioned positioning keywords with the selection operation corresponding to the above-mentioned explanatory icons.

[0020] Optionally, the webpage keyword explanation information display device further includes a determining unit and a keyword locating unit. The determining unit is configured to determine whether there are updated page elements in the webpage in response to detecting changes in the webpage. The keyword locating unit is configured to locate keywords in the keyword set in the document object model of the updated webpage in response to determining the existence of updated page elements, thereby obtaining the locating result.

[0021] Optionally, the display unit is further configured to: in response to a hover operation of an explanation icon corresponding to any positioning keyword detected on the webpage, display an explanation box corresponding to the aforementioned positioning keyword at the target location, wherein the explanation box displays explanation information.

[0022] Optionally, the above explanatory information is rendered in the above explanation box using a markup language rendering engine.

[0023] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.

[0024] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.

[0025] Fifthly, some embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the implementations of the first aspect above.

[0026] The above embodiments of this disclosure have the following beneficial effects: The webpage keyword explanation information display method of some embodiments of this disclosure supports dynamic configuration of keyword explanation configuration information in the background, and can apply different keyword explanations to different pages, reducing the usage cost and maintenance difficulty of keyword explanations, and improving the flexibility of keyword prompts. Specifically, the reasons for the high usage cost, high maintenance difficulty, and lack of flexible configuration of keyword explanations are: tooltip plugins usually require developers to hardcode keywords and prompt content, which cannot be adjusted in real time; different keyword explanations cannot be applied to different pages as needed, and there is a lack of webpage matching logic, resulting in high usage cost, high maintenance difficulty, and a lack of flexible configuration of keyword explanations. Based on this, the webpage keyword explanation information display method of some embodiments of this disclosure firstly obtains keyword explanation configuration information in response to webpage page loading, wherein the keyword explanation configuration information includes a keyword set, a set of explanation information corresponding to the keyword set, webpage matching information, and icon configuration information. Thus, the keyword explanation configuration information uniformly configured in the background can be obtained in real time. Then, in response to determining that the webpage page meets the webpage matching conditions corresponding to the webpage matching information, the keywords in the keyword set are located in the document object model of the webpage page to obtain the location result, wherein the location result includes the located keywords. Therefore, when the current webpage meets the webpage matching criteria, the keyword explanation function can be enabled. Next, for each keyword in the above location results, an explanation icon is configured based on the icon configuration information and the corresponding explanation information. This allows an explanation icon to be inserted into the document object model of the webpage when a keyword is located. Finally, in response to the detection of an explanation icon selection operation for any keyword on the webpage, the explanation information for that keyword is displayed. This enables the explanation of keywords located on the webpage. Because keyword explanation configuration information can be dynamically loaded without intervention from page developers, and because webpage matching criteria can be configured, the keyword explanation function can be enabled on demand for multiple pages. This supports dynamic configuration of keyword explanation information in the backend and allows different keyword explanations to be applied to different pages, reducing the cost and maintenance difficulty of keyword explanation usage and improving the flexibility of keyword suggestions. Attached Figure Description

[0027] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.

[0028] Figure 1This is an architecture diagram of an exemplary system to which some embodiments of this disclosure can be applied; Figure 2 This is a flowchart of some embodiments of the method for displaying explanatory information of web page keywords according to this disclosure; Figure 3 These are flowcharts of some other embodiments of the method for displaying explanatory information of web page keywords according to this disclosure; Figure 4 These are schematic diagrams illustrating the structure of some embodiments of the webpage keyword explanation information display device according to this disclosure; Figure 5 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation

[0029] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0030] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.

[0031] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0032] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0033] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0034] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0035] Figure 1 An exemplary system architecture 100 is shown, which can be used to display explanatory information of web page keywords according to some embodiments of the present disclosure.

[0036] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0037] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, search applications, instant messaging tools, email clients, and social media platform software.

[0038] Terminal devices 101, 102, and 103 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with a display screen and supporting web browsing, including but not limited to smartphones, tablets, e-book readers, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices. They can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are imposed here.

[0039] Server 105 can be a server that provides various services, such as a backend web server that supports the web pages displayed on terminal devices 101, 102, and 103. The backend web server can analyze and process the received web page requests and other data, and feed back the processing results (such as web page data) to the terminal devices.

[0040] It should be noted that the method for displaying the explanation information of web page keywords provided in the embodiments of this disclosure can be executed by terminal devices 101, 102, and 103. Accordingly, the device for displaying the explanation information of web page keywords can be disposed in terminal devices 101, 102, and 103.

[0041] It should be noted that a server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are made here.

[0042] It should be understood that Figure 1The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0043] Continue to refer to Figure 2 The flowchart 200 illustrates some embodiments of a method for displaying explanatory information of web page keywords according to the present disclosure. This method for displaying explanatory information of web page keywords includes the following steps: Step 201: In response to the webpage loading, obtain the keyword explanation configuration information.

[0044] In some embodiments, the execution entity of the webpage keyword explanation information display method (e.g. Figure 1 The terminal device shown can retrieve keyword explanation configuration information from the server in response to webpage loading. Specifically, when a user accesses a webpage, the aforementioned execution entity can load the webpage. The keyword explanation configuration information can be information pre-configured for the site or the aforementioned webpage to provide explanations for keywords on the webpage. This keyword explanation configuration information can include, but is not limited to: a keyword set, a set of explanation information corresponding to the keyword set, webpage matching information, and icon configuration information. The keyword set can be each keyword for which explanations are required. The explanation information in the explanation information set corresponds to the keywords in the keyword set. The explanation information can be the content explaining the corresponding keyword. For example, the keyword could be "artificial intelligence," and the corresponding explanation information could be "a new technological science that studies and develops theories, methods, technologies, and application systems for simulating, extending, and expanding human intelligence." The webpage matching information can be rule-related information for matching URLs. For example, the webpage matching information can be represented by regular expressions. The icon configuration information can be information related to the style configuration of the explanation icon for the keyword. The explanation icon can be an icon used to represent that the corresponding keyword has an explanation function. In practice, the aforementioned execution entity can retrieve keyword explanation configuration information from the server through a browser plugin.

[0045] In some optional implementations of certain embodiments, the aforementioned execution entity can obtain keyword explanation configuration information by calling a keyword explanation configuration information retrieval interface through a pre-loaded software development kit (SDK). The SSDK can be a JavaScript Software Development Kit (JSSDK). The keyword explanation configuration information retrieval interface can be an API provided by the SSDK for requesting keyword explanation configuration information from a server. This simplifies deployment and is more suitable for general web page scenarios.

[0046] Step 202: In response to determining that the webpage meets the webpage matching conditions corresponding to the webpage matching information, locate the keywords in the keyword set in the document object model of the webpage to obtain the location result.

[0047] In some embodiments, the execution entity may, in response to determining that the webpage satisfies the webpage matching conditions corresponding to the webpage matching information, locate keywords in the keyword set within the document object model (DOM) of the webpage to obtain a location result. The webpage matching conditions may be a match between the URL of the webpage and the webpage matching information. Here, the match may be a match between the URL of the webpage and a regular expression included in the webpage matching information. The document object model may be the DOM. In practice, the execution entity may search for words in the document object model that are identical to keywords in the keyword set, and use these identical words as location keywords to obtain a location result. The location result includes location keywords.

[0048] Optionally, the aforementioned execution entity can, in response to detecting changes to the webpage, determine whether there are updated page elements on the webpage. Then, in response to determining the existence of updated page elements, it can locate the keywords in the keyword set within the document object model of the updated webpage, obtaining the location result. Thus, keyword location can be performed on the updated webpage when page changes are detected.

[0049] Step 203: For each location keyword in the location results, configure the explanation icon for the location keyword according to the icon configuration information and the explanation information corresponding to the location keyword.

[0050] In some embodiments, for each location keyword in the above location results, the execution entity can configure an explanation icon for the location keyword based on the icon configuration information and the corresponding explanation information. In practice, a page element with the explanation icon corresponding to the location keyword can be inserted into the document object model, and the icon configuration information can be injected into the explanation icon using Cascading Style Sheets (CSS). An `after` pseudo-class style listener can be added to the page element of the location keyword to listen for the selection event corresponding to the explanation icon, and the explanation information can be displayed after the selection event is triggered, thereby configuring the explanation icon for the location keyword. The selection operation that triggers the selection event can include, but is not limited to, clicking and hovering.

[0051] In some optional implementations of certain embodiments, the execution entity can configure explanatory icons for the positioning keywords in the document object model based on preset element wrapping tags and preset icon tags. The preset element wrapping tag can be a tag used to wrap the positioning keywords, and may include a line content container and a CSS class name. The preset icon tag can be used to add explanatory icon elements for the positioning keywords, and may include an icon element tag and a corresponding CSS class name. In practice, the positioning keywords and the preset icon tags can be wrapped in the preset element wrapping tag to configure explanatory icons for the positioning keywords in the document object model. For example, when the positioning keyword is "artificial intelligence," after configuring explanatory icons, the positioning keyword in the document object model can be wrapped as follows: KEYWORDS .in, represents a row content container. class="explain-keyword" represents the type of keyword to be explained. 表示上标元素。class="icon"表示图标类型。图标类型可以为默认提示的icon,也可以为自定义的icon。然后,可以将上述图标配置信息与针对上述定位关键词配置的解释图标进行关联。实践中,可以将上述图表配置信息注入CSS表,以将上述图标配置信息与针对上述定位关键词配置的解释图标进行关联。最后,可以将上述定位关键词对应的解释信息与对应上述解释图标的选择操作进行关联。实践中,可以在上述定位关键词的页面元素中增加after伪类样式监听对应上述解释图标的选择事件,并配置触发选择事件后显示上述解释信息,以实现对上述定位关键词进行解释图标配置。触发选择事件的选择操作可以包括但不限于:点击、悬停。

[0052] 步骤204,响应于在网页页面中检测到对应任意定位关键词的解释图标选择操作,显示对应任意定位关键词的解释信息。

[0053] 在一些实施例中,上述执行主体可以响应于在上述网页页面中检测到对应任意定位关键词的解释图标选择操作,显示对应上述任意定位关键词的解释信息。解释图标选择操作可以为作用于解释图标的选择操作。选择操作可以包括但不限于:点击、悬停。实践中,上述执行主体可以在上述任意定位关键词的预设位置显示上述解释信息。例如,预设位置可以为右上方。

[0054] 在一些实施例的一些可选的实现方式中,上述执行主体可以响应于在上述网页页面中检测到对应任意定位关键词的解释图标悬停操作,在目标位置显示对应上述任意定位关键词的解释框。其中,上述目标位置可以为预设位置,也可以为动态位置。实践中,可以在定位关键词的预设页面范围内进行页面边界的碰撞检测,以确定未与页面边界产生碰撞的各个页面位置。预设页面范围可以为以定位关键词为中心,向外延伸预设长、预设宽的矩形区域。接着,可以对上述各个页面位置按照预设方位顺序排列,以及将排列在第一个的页面位置确定为动态位置。预设方位顺序可以为先右后左、先上后下。例如,定位关键词的预设页面范围与顶部的页面边界碰撞时,未与顶部的页面边界产生碰撞的各个页面位置可以包括左下位置和右下位置,按照预设方位顺序排序后,第一个页面位置为右下位置,可以将右下位置确定为动态位置。通过动态位置的确定,可以避免解释信息被遮挡。上述解释框可以为文本框。上述解释框中显示有解释信息。

[0055] 可选地,上述解释信息在上述解释框中通过标记语言渲染引擎渲染。标记语言渲染引擎可以为支持标题、列表、图片、链接等格式的渲染引擎。例如,标记语言渲染引擎可以为Markdown渲染引擎。优选地,标记语言渲染引擎可以为轻量级的Markdown渲染引擎,例如,如marked.js。由此,可以增强信息表达能力和可阅读性。

[0056] 可选地,可以在上述网页页面中检测到对应任意定位关键词的解释图标的取消选择操作,延迟预设时长隐藏上述解释框。取消选择操作可以为鼠标从解释框或解释图标移开的操作。例如,预设时长可以为2秒钟。由此,可以呈现延迟关闭解释信息的效果。

[0057] 本公开的上述各个实施例具有如下有益效果:通过本公开的一些实施例的网页关键词的解释信息显示方法,支持后台动态配置关键词解释配置信息,且可以针对不同页面应用不同关键词解释,降低了关键词解释的使用成本、维护难度,提升了关键词提示的灵活性。具体来说,造成关键词解释的使用成本高、维护难度大、缺乏灵活配置的原因在于:tooltip插件通常需开发者硬编码关键词与提示内容,无法实时调整;无法按需对不同页面应用不同关键词解释,缺少网页匹配逻辑,导致关键词解释的使用成本高、维护难度大、缺乏灵活配置。基于此,本公开的一些实施例的网页关键词的解释信息显示方法,首先,响应于网页页面加载,获取关键词解释配置信息,其中,上述关键词解释配置信息包括关键词集合、对应上述关键词集合的解释信息集合、网页匹配信息和图标配置信息。由此,可以实时获取后台统一配置的关键词解释配置信息。然后,响应于确定上述网页页面满足上述网页匹配信息对应的网页匹配条件,在上述网页页面的文档对象模型中定位上述关键词集合中的关键词,得到定位结果,其中,上述定位结果包括定位关键词。由此,可以在当前网页页面符合网页匹配条件时,确定启用关键词解释功能。接着,对于上述定位结果中的每个定位关键词,根据上述图标配置信息和上述定位关键词对应的解释信息,对上述定位关键词进行解释图标配置。由此,可以在定位到关键词时,在网页页面的文档对象模型中插入解释图标。最后,响应于在上述网页页面中检测到对应任意定位关键词的解释图标选择操作,显示对应上述任意定位关键词的解释信息。由此,可以实现对网页页面中定位的关键词的解释。也因为可以动态加载关键词解释配置信息,可以无需页面开发者干预,还因为可以配置网页匹配条件,可以针对多个页面系统按需启用关键词解释功能。由此,可以支持后台动态配置关键词解释配置信息,且可以针对不同页面应用不同关键词解释,降低了关键词解释的使用成本、维护难度,提升了关键词提示的灵活性。

[0058] 进一步参考图3,其示出了网页关键词的解释信息显示方法的另一些实施例的流程300。该网页关键词的解释信息显示方法的流程300,包括以下步骤:步骤301,响应于网页页面加载,获取关键词解释配置信息。

[0059] 在一些实施例中,步骤301的具体实现及所带来的技术效果可以参考图2对应的那些实施例中的步骤201,在此不再赘述。

[0060] 步骤302,响应于确定网页页面满足网页匹配信息对应的网页匹配条件,在文档对象模型中对预设内容区域中的预设元素进行解析,得到解析结果。

[0061] 在一些实施例中,网页关键词的解释信息显示方法的执行主体(例如图1所示的终端设备)可以响应于确定上述网页页面满足上述网页匹配信息对应的网页匹配条件,在上述文档对象模型中对预设内容区域中的预设元素进行解析,得到解析结果。其中,上述预设内容区域可以为文档对象模型中的内容区域。例如,预设内容区域可以为当前网页页面的主体内容区域(document.body,即HTML文档中的元素,包含页面可见区域内的所有内容(如文本、图片、表单等))。上述预设元素可以为预设的自定义元素,从而可通过参数指定只解析特定的自定义元素。例如,预设元素可以包括但不限于:.article-content,.doc。实践中,上述执行主体可以在上述文档对象模型中的预设内容区域内仅针对预设元素进行解析,得到解析结果。

[0062] 步骤303,在解析结果中定位关键词集合中的关键词,得到定位结果。

[0063] 在一些实施例中,上述执行主体可以在上述解析结果中定位上述关键词集合中的关键词,得到定位结果。实践中,可以首先对上述解析结果进行分词处理,得到分词集合。实践中,可以采用分词算法对上述解析结果进行分词处理,得到分词集合。例如,分词算法可以为jieba分词算法。然后,可以对上述分词集合和上述关键词集合进行匹配,得到所匹配的至少一个关键词作为定位结果。具体地,可以响应于分词和关键词相同,确定分词和关键词匹配。其中,上述定位结果包括的关键词为定位关键词。

[0064] 步骤304,对于定位结果中的每个定位关键词,根据图标配置信息和定位关键词对应的解释信息,对定位关键词进行解释图标配置。

[0065] 步骤305,响应于在网页页面中检测到对应任意定位关键词的解释图标选择操作,显示对应任意定位关键词的解释信息。

[0066] 在一些实施例中,步骤304-305的具体实现及所带来的技术效果可以参考图2对应的那些实施例中的步骤203-204,在此不再赘述。

[0067] 从图3中可以看出,与图2对应的一些实施例的描述相比,图3对应的一些实施例中的网页关键词的解释信息显示方法的流程300体现了对定位关键词的方式进行扩展的步骤。由此,这些实施例描述的方案可配置解析区域,适配复杂页面结构。

[0068] 进一步参考图4,作为对上述各图所示方法的实现,本公开提供了一种网页关键词的解释信息显示装置的一些实施例,这些装置实施例与图2所示的那些方法实施例相对应,该装置具体可以应用于各种电子设备中。

[0069] 如图4所示,一些实施例的网页关键词的解释信息显示装置400包括:获取单元401、定位单元402、配置单元403和显示单元404。其中,获取单元401被配置成响应于网页页面加载,获取关键词解释配置信息,其中,上述关键词解释配置信息包括关键词集合、对应上述关键词集合的解释信息集合、网页匹配信息和图标配置信息;定位单元402被配置成响应于确定上述网页页面满足上述网页匹配信息对应的网页匹配条件,在上述网页页面的文档对象模型中定位上述关键词集合中的关键词,得到定位结果,其中,上述定位结果包括定位关键词;配置单元403被配置成对于上述定位结果中的每个定位关键词,根据上述图标配置信息和上述定位关键词对应的解释信息,对上述定位关键词进行解释图标配置;显示单元404被配置成响应于在上述网页页面中检测到对应任意定位关键词的解释图标选择操作,显示对应上述任意定位关键词的解释信息。

[0070] 可选地,获取单元401可以进一步被配置成:通过预先加载的软件开发工具包,调用关键词解释配置信息获取接口,得到关键词解释配置信息。

[0071] 可选地,定位单元402可以进一步被配置成:在上述文档对象模型中对预设内容区域中的预设元素进行解析,得到解析结果;在上述解析结果中定位上述关键词集合中的关键词,得到定位结果。

[0072] 可选地,定位单元402可以进一步被配置成:对上述解析结果进行分词处理,得到分词集合;对上述分词集合和上述关键词集合进行匹配,得到所匹配的至少一个关键词作为定位结果,其中,上述定位结果包括的关键词为定位关键词。

[0073] 可选地,配置单元403可以进一步被配置成:根据预设元素包裹标签和预设图标标签,在上述文档对象模型中对上述定位关键词进行解释图标配置处理;将上述图标配置信息与针对上述定位关键词配置的解释图标进行关联;将上述定位关键词对应的解释信息与对应上述解释图标的选择操作进行关联。

[0074] 可选地,网页关键词的解释信息显示装置400还可以包括:确定单元和关键词定位单元(图中未示出)。其中,确定单元被配置成响应于监听到上述网页页面变化,确定上述网页页面中是否存在更新的页面元素。关键词定位单元被配置成响应于确定存在更新的页面元素,在更新的网页页面的文档对象模型中定位上述关键词集合中的关键词,得到定位结果。

[0075] 可选地,显示单元404可以进一步被配置成:响应于在上述网页页面中检测到对应任意定位关键词的解释图标悬停操作,在目标位置显示对应上述任意定位关键词的解释框,其中,上述解释框中显示有解释信息。

[0076] 可选地,上述解释信息在上述解释框中通过标记语言渲染引擎渲染。

[0077] 可以理解的是,该装置400中记载的诸单元与参考图2描述的方法中的各个步骤相对应。由此,上文针对方法描述的操作、特征以及产生的有益效果同样适用于装置400及其中包含的单元,在此不再赘述。

[0078] 下面参考图5,其示出了适于用来实现本公开的一些实施例的电子设备500(例如图1中的终端设备)的结构示意图。本公开的一些实施例中的电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。

[0079] 如图5所示,电子设备500可以包括处理装置501(例如中央处理器、图形处理器等),其可以根据存储在只读存储器(ROM)502中的程序或者从存储装置508加载到随机访问存储器(RAM)503中的程序而执行各种适当的动作和处理。在RAM 503中,还存储有电子设备500操作所需的各种程序和数据。处理装置501、ROM 502以及RAM 503通过总线504彼此相连。输入 / 输出(I / O)接口505也连接至总线504。

[0080] 通常,以下装置可以连接至I / O接口505:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置506;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置507;包括例如磁带、硬盘等的存储装置508;以及通信装置509。通信装置509可以允许电子设备500与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备500,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。图5中示出的每个方框可以代表一个装置,也可以根据需要代表多个装置。

[0081] 特别地,根据本公开的一些实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的一些实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的一些实施例中,该计算机程序可以通过通信装置509从网络上被下载和安装,或者从存储装置508被安装,或者从ROM 502被安装。在该计算机程序被处理装置501执行时,执行本公开的一些实施例的方法中限定的上述功能。

[0082] 需要说明的是,本公开的一些实施例中记载的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开的一些实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开的一些实施例中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。

[0083] 在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText TransferProtocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网("LAN”),广域网("WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。

[0084] 上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:响应于网页页面加载,获取关键词解释配置信息,其中,上述关键词解释配置信息包括关键词集合、对应上述关键词集合的解释信息集合、网页匹配信息和图标配置信息;响应于确定上述网页页面满足上述网页匹配信息对应的网页匹配条件,在上述网页页面的文档对象模型中定位上述关键词集合中的关键词,得到定位结果,其中,上述定位结果包括定位关键词;对于上述定位结果中的每个定位关键词,根据上述图标配置信息和上述定位关键词对应的解释信息,对上述定位关键词进行解释图标配置;响应于在上述网页页面中检测到对应任意定位关键词的解释图标选择操作,显示对应上述任意定位关键词的解释信息。

[0085] 可以以一种或多种程序设计语言或其组合来编写用于执行本公开的一些实施例的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如"C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。

[0086] 附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和 / 或流程图中的每个方框、以及框图和 / 或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。

[0087] 描述于本公开的一些实施例中的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括获取单元、定位单元、配置单元和显示单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,获取单元还可以被描述为"响应于网页页面加载,获取关键词解释配置信息的单元”。

[0088] 本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。

[0089] 本公开的一些实施例还提供一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现上述的任一种网页关键词的解释信息显示方法。

[0090] 以上描述仅为本公开的一些较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开的实施例中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开的实施例中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

Claims

1. A method for displaying explanation information of keywords in a webpage, comprising: obtaining keyword explanation configuration information in response to loading of a webpage page, wherein the keyword explanation configuration information comprises a keyword set, an explanation information set corresponding to the keyword set, webpage matching information, and icon configuration information; locating a keyword in the keyword set in a document object model of the webpage page to obtain a locating result in response to determining that the webpage page satisfies a webpage matching condition corresponding to the webpage matching information, wherein the locating result comprises a locating keyword; configuring an explanation icon for the locating keyword according to the icon configuration information and explanation information corresponding to the locating keyword; displaying explanation information corresponding to any locating keyword in response to detecting an explanation icon selection operation corresponding to the any locating keyword in the webpage page.

2. The method of claim 1, wherein, The obtaining of the keyword explanation configuration information comprises: calling a keyword explanation configuration information obtaining interface through a preloaded software development kit to obtain the keyword explanation configuration information.

3. The method of claim 1, wherein, The locating of the keyword in the keyword set in the document object model of the webpage page to obtain the locating result comprises: analyzing a preset element in a preset content area in the document object model to obtain an analysis result; locating the keyword in the keyword set in the analysis result to obtain the locating result.

4. The method of claim 3, wherein, The locating of the keyword in the keyword set in the analysis result to obtain the locating result comprises: performing word segmentation processing on the analysis result to obtain a word segmentation set; matching the word segmentation set and the keyword set to obtain at least one matched keyword as the locating result, wherein the locating result comprises a locating keyword.

5. The method of claim 1, wherein, The configuring of the explanation icon for the locating keyword according to the icon configuration information and the explanation information corresponding to the locating keyword comprises: configuring the explanation icon for the locating keyword in the document object model according to a preset element wrapping tag and a preset icon tag; associating the icon configuration information with the explanation icon configured for the locating keyword; associating the explanation information corresponding to the locating keyword with a selection operation corresponding to the explanation icon.

6. The method of claim 1, wherein, The method further comprises: determining whether there is an updated page element in the webpage page in response to listening to a change in the webpage page; locating a keyword in the keyword set in a document object model of an updated webpage page to obtain a locating result in response to determining that there is the updated page element.

7. The method of claim 1, wherein, The displaying of the explanation information corresponding to the any locating keyword in response to detecting the explanation icon selection operation corresponding to the any locating keyword in the webpage page comprises: displaying an explanation box corresponding to the any locating keyword at a target position in response to detecting an explanation icon hovering operation corresponding to the any locating keyword in the webpage page, wherein the explanation box displays explanation information.

8. The method of claim 7, wherein, The explanation information is rendered in the explanation box by a markup language rendering engine.

9. An apparatus for displaying explanation information of a keyword in a webpage, comprising: an obtaining unit configured to obtain keyword explanation configuration information in response to webpage page loading, wherein the keyword explanation configuration information comprises a keyword set, a keyword explanation information set corresponding to the keyword set, webpage matching information, and icon configuration information; a positioning unit configured to position a keyword in the keyword set in a document object model of the webpage page to obtain a positioning result in response to determining that the webpage page satisfies a webpage matching condition corresponding to the webpage matching information, wherein the positioning result comprises a positioned keyword; a configuration unit configured to, for each positioned keyword in the positioning result, configure an explanation icon for the positioned keyword according to the icon configuration information and explanation information corresponding to the positioned keyword; a display unit configured to display explanation information corresponding to any positioned keyword in response to detecting an explanation icon selection operation corresponding to the any positioned keyword in the webpage page.

10. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-8.

11. A computer readable medium having stored thereon a computer program, wherein, The computer program is executed by the processor to implement the method of any one of claims 1-8.

12. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-8.