CN108416009A - Text retrieval method, device, storage medium and mobile terminal for mobile terminal - Google Patents
Text retrieval method, device, storage medium and mobile terminal for mobile terminal Download PDFInfo
- Publication number
- CN108416009A CN108416009A CN201810172191.8A CN201810172191A CN108416009A CN 108416009 A CN108416009 A CN 108416009A CN 201810172191 A CN201810172191 A CN 201810172191A CN 108416009 A CN108416009 A CN 108416009A
- Authority
- CN
- China
- Prior art keywords
- retrieval
- text
- target
- mobile terminal
- string
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Audiology, Speech & Language Pathology (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
Description
技术领域technical field
本申请实施例涉及信息检索技术,尤其涉及一种移动终端的文本检索方法、装置、存储介质及移动终端。The embodiments of the present application relate to information retrieval technology, and in particular to a text retrieval method, device, storage medium and mobile terminal for a mobile terminal.
背景技术Background technique
随着移动终端的技术的发展,其功能不再限于打电话或发短信,还可以用于阅读,例如,用户可以在移动终端上浏览文档或网页等。With the development of mobile terminal technology, its functions are no longer limited to making calls or sending short messages, but can also be used for reading, for example, users can browse documents or webpages on the mobile terminal.
然而,相关技术中的移动终端无法实现针对用户正在浏览的文本进行检索。当用户需要寻找目标内容时,不得不人为的浏览已知的文档或网页,从而,通过肉眼由文档或网页中找出目标内容,很容易发生目标内容遗漏的问题,且查找效率不高。However, the mobile terminal in the related art cannot implement retrieval for the text that the user is browsing. When the user needs to find the target content, he has to manually browse known documents or webpages. Therefore, to find the target content from the document or webpage by naked eyes, it is easy to miss the target content, and the search efficiency is not high.
发明内容Contents of the invention
本申请实施例提供一种移动终端的文本检索方法、装置、存储介质及移动终端,可以在用户浏览某个页面时快速定位到目标文本段。Embodiments of the present application provide a text retrieval method, device, storage medium and mobile terminal for a mobile terminal, which can quickly locate a target text segment when a user browses a certain page.
第一方面,本申请实施例提供了一种移动终端的文本检索方法,包括:In the first aspect, the embodiment of the present application provides a text retrieval method for a mobile terminal, including:
在文本检索事件被触发时,启动预先配置于移动终端内的检索服务,通过所述检索服务获取目标字符串及文本信息,其中,所述文本信息包括当前显示内容及所述当前显示内容对应的控件信息;When the text retrieval event is triggered, the retrieval service preconfigured in the mobile terminal is started, and the target character string and text information are obtained through the retrieval service, wherein the text information includes the currently displayed content and the text corresponding to the currently displayed content control information;
通过所述检索服务查询所述当前显示内容,确定与所述目标字符串匹配的检索结果,其中,所述检索结果包括目标字符串的出现位置及出现次数;Querying the currently displayed content through the retrieval service, and determining a retrieval result matching the target character string, wherein the retrieval result includes the occurrence position and the occurrence frequency of the target character string;
显示所述检索结果,并在当前显示内容中标注所述目标字符串。Displaying the retrieval result, and marking the target character string in the currently displayed content.
第二方面,本申请实施例还提供了一种移动终端的文本检索装置,该装置包括:In the second aspect, the embodiment of the present application also provides a text retrieval device for a mobile terminal, the device comprising:
信息获取模块,用于在文本检索事件被触发时,启动预先配置于移动终端内的检索服务,通过所述检索服务获取目标字符串及文本信息,其中,所述文本信息包括当前显示内容及所述当前显示内容对应的控件信息;The information acquisition module is used to start the retrieval service pre-configured in the mobile terminal when the text retrieval event is triggered, and obtain the target character string and text information through the retrieval service, wherein the text information includes the currently displayed content and the Describe the control information corresponding to the current display content;
字符检索模块,用于通过所述检索服务查询所述当前显示内容,确定与所述目标字符串匹配的检索结果,其中,所述检索结果包括目标字符串的出现位置及出现次数;A character retrieval module, configured to query the currently displayed content through the retrieval service, and determine a retrieval result matching the target character string, wherein the retrieval result includes the occurrence position and the number of occurrences of the target character string;
结果显示模块,用于显示所述检索结果,并在当前显示内容中标注所述目标字符串。The result display module is used to display the search result and mark the target character string in the currently displayed content.
第三方面,本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述第一方面所述的移动终端的文本检索方法。In the third aspect, the embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the text retrieval method of the mobile terminal as described in the first aspect above is implemented.
第四方面,本申请实施例还提供了一种移动终端,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的移动终端的文本检索方法。In the fourth aspect, the embodiment of the present application also provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and runnable by the processor. When the processor executes the computer program, the above-mentioned first A text retrieval method for a mobile terminal described in one aspect.
本申请实施例提供一种移动终端的文本检索方案,通过在文本检索事件被触发时,启动预先配置于移动终端内的检索服务,通过该检索服务获取目标字符串及文本信息;通过该检索服务查询当前显示内容,确定与目标字符串匹配的检索结果;显示检索结果,并在当前现实内容中标注目标字符串,实现文本自动检索,快速定位目标字符串所在的目标文本段。采用上述技术方案可以避免用户在浏览某个页面时需要肉眼检索文本的情况,通过自动检索文本,提高了检索准确率及检索效率。An embodiment of the present application provides a text retrieval solution for a mobile terminal. When a text retrieval event is triggered, a retrieval service pre-configured in the mobile terminal is activated, and the target character string and text information are obtained through the retrieval service; through the retrieval service Query the currently displayed content, determine the search results that match the target string; display the search results, and mark the target string in the current real content, realize automatic text retrieval, and quickly locate the target text segment where the target string is located. Adoption of the above technical solution can avoid the situation that the user needs to retrieve the text with the naked eye when browsing a certain page, and the retrieval accuracy and retrieval efficiency are improved by automatically retrieving the text.
附图说明Description of drawings
图1是本申请实施例提供的一种移动终端的文本检索方法的流程图;FIG. 1 is a flow chart of a text retrieval method for a mobile terminal provided in an embodiment of the present application;
图2是本申请实施例提供的一种移动终端的文本检索示意图;FIG. 2 is a schematic diagram of text retrieval of a mobile terminal provided by an embodiment of the present application;
图3是本申请实施例提供的另一种移动终端的文本检索方法的流程图;FIG. 3 is a flow chart of another text retrieval method for a mobile terminal provided by an embodiment of the present application;
图4是本申请实施例提供的一种移动终端的文本检索装置的工作过程示意图;FIG. 4 is a schematic diagram of a working process of a text retrieval device for a mobile terminal provided in an embodiment of the present application;
图5是本申请实施例提供的一种移动终端的文本检索装置的原理框图;FIG. 5 is a functional block diagram of a text retrieval device for a mobile terminal provided in an embodiment of the present application;
图6是本申请实施例提供的一种移动终端的结构示意图;FIG. 6 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present application;
图7是本申请实施例提供的一种智能手机的结构框图。Fig. 7 is a structural block diagram of a smart phone provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部结构。The application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only some structures related to the present application are shown in the drawings but not all structures.
在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各步骤描述成顺序的处理,但是其中的许多步骤可以被并行地、并发地或者同时实施。此外,各步骤的顺序可以被重新安排。当其操作完成时所述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。所述处理可以对应于方法、函数、规程、子例程、子程序等等。Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processing, many of the steps may be performed in parallel, concurrently, or simultaneously. Additionally, the order of steps may be rearranged. The process may be terminated when its operations are complete, but may also have additional steps not included in the figure. The processing may correspond to a method, function, procedure, subroutine, subroutine, or the like.
图1为本申请实施例提供的一种移动终端的文本检索方法的流程图,本实施例可适用于在用户浏览文档或网页等文本时,根据用户提供的目标字符串自动检索文本的情况。该方法可以由移动终端的文本检索装置来执行,其中,该装置可由软件和/或硬件实现,一般可集成在移动终端中。如图1所示,该方法包括:FIG. 1 is a flow chart of a text retrieval method for a mobile terminal provided by an embodiment of the present application. This embodiment is applicable to the situation where the text is automatically retrieved according to a target character string provided by the user when the user browses text such as a document or a web page. The method can be executed by the text retrieval device of the mobile terminal, wherein the device can be realized by software and/or hardware, and can generally be integrated in the mobile terminal. As shown in Figure 1, the method includes:
步骤110、在文本检索事件被触发时,启动预先配置于移动终端内的检索服务,通过该检索服务获取目标字符串及文本信息。Step 110, when the text retrieval event is triggered, start the retrieval service pre-configured in the mobile terminal, and obtain the target character string and text information through the retrieval service.
其中,文本检索事件可以是预先配置在移动终端内的事件,该文本检索事件用于指示移动终端启动预先配置的检索服务。Wherein, the text retrieval event may be an event preconfigured in the mobile terminal, and the text retrieval event is used to instruct the mobile terminal to start a preconfigured retrieval service.
需要说明的是,文本检索事件可以因自动检索功能被启用而被触发。其中,自动检索功能的启用与否可以通过功能启用开关的开关状态确定。例如,移动终端的配置界面增加一功能启用开关。该功能启用开关若处于打开状态,则确定自动检索功能被启用;该功能启用开关若处于关闭状态,则确定自动检索功能被禁用。又如,移动终端的下拉状态栏中增加一功能启用开关。若该功能启用开关的图标处于点亮状态,则确定自动检索功能被启用;若该功能启用开关的图标处于熄灭状态,则确定自动检索功能被禁用。可以理解的是,自动检索功能的启用方式并不限于上述示例,还可以是输入预设手势或按照预设动作晃动移动终端等等。It should be noted that the text retrieval event may be triggered because the automatic retrieval function is enabled. Wherein, whether the automatic retrieval function is enabled or not can be determined by the switch state of the function enabling switch. For example, a function activation switch is added to the configuration interface of the mobile terminal. If the function enabling switch is on, it is determined that the automatic retrieval function is enabled; if the function enabling switch is off, it is determined that the automatic retrieval function is disabled. As another example, a function enabling switch is added in the pull-down status bar of the mobile terminal. If the icon of the function enabling switch is on, it is determined that the automatic retrieval function is enabled; if the icon of the function enabling switch is off, it is determined that the automatic retrieval function is disabled. It can be understood that the way of enabling the automatic retrieval function is not limited to the above examples, and it may also be inputting a preset gesture or shaking the mobile terminal according to a preset action, and the like.
需要说明的是,检索服务可以是预先注册的系统服务,用于在后台匹配当前显示文本和目标字符串,并将匹配到的结果输出到显示界面,该显示界面可以被认为是移动终端的当前页面。该当前页面可以具有多个图层以分别显示悬浮窗口及文档窗口。其中,显示界面可以包括当前页面中显示的文本内容中与目标字符段匹配的记录条数和位置信息,以及以预设背景色或下划线等形式标注目标字符串的文本内容。可选的,采用悬浮窗口显示与目标字符段匹配的记录条数和位置信息,并以文档窗口显示以预设背景色或下划线等形式标注目标字符串的文本内容。It should be noted that the retrieval service can be a pre-registered system service, which is used to match the currently displayed text and the target character string in the background, and output the matched result to the display interface, which can be regarded as the current display interface of the mobile terminal. page. The current page may have multiple layers to display the floating window and the document window respectively. Wherein, the display interface may include the record number and location information matching the target character field in the text content displayed on the current page, and the text content marked with the target character string in the form of preset background color or underline. Optionally, a floating window is used to display the number of records and location information matching the target character field, and a document window is used to display the text content of the target character string marked with a preset background color or underline.
示例性的,在用户浏览文本或使用应用时,文字内容可以通过诸如TextView的系统控件进行显示。若用户输入启用自动检索功能的指示,移动终端根据该指示打开功能启用开关。其中,启用自动检索功能的指示可以是用户输入的打开功能启用开关的触摸操作,或者是用户输入的用于打开功能启用开关的手势等。如果功能启用开关被打开,则确定文本检索事件被触发。在文本检索事件被触发时,启动预先配置于移动终端内的检索服务。还可以在文本检索事件被触发时,显示搜索窗口。其中,搜索窗口用于向检索服务导入目标字符串,并显示该目标字符串对应的检索结果。若检测到用户向当前显示的搜索窗口输入待查询的目标字符串,则将该目标字符串传入检索服务,以将其作为检索操作的检索词。另外,在用户浏览文档或使用应用程序(简称App)时,App的文字将显示在TextView上,并调用了setText方法。其中,setText是TextView和editText使用的基本方法,用于设置文本信息。在执行setText方法时,可以通过Intent发送当前显示文本至检索服务。其中,Intent是执行某操作的一个抽象描述,例如,Intent可以用来绑定Activity和Service以建立它们之间的通信(bindServiceConnaction(Intent,ServiceConnection,int))等。综上所述,检索服务获取到目标字符串和当前显示文本。其中,当前显示文本,也就是文本信息,包括当前显示内容,以及用于显示该当前显示内容的控件信息(包括进程标识和控件标识)。Exemplarily, when the user browses the text or uses the application, the text content can be displayed through a system control such as TextView. If the user inputs an instruction to enable the automatic retrieval function, the mobile terminal turns on the function enabling switch according to the instruction. Wherein, the instruction for enabling the automatic retrieval function may be a touch operation input by the user to turn on the function enabling switch, or a gesture input by the user for turning on the function enabling switch. If the function enabling switch is turned on, it is determined that the text retrieval event is triggered. When the text retrieval event is triggered, the retrieval service pre-configured in the mobile terminal is started. It is also possible to display a search window when a text search event is triggered. Wherein, the search window is used to import a target character string into the search service, and display the search result corresponding to the target character string. If it is detected that the user enters a target character string to be queried into the currently displayed search window, the target character string is passed to the retrieval service to be used as a search word for the retrieval operation. In addition, when a user browses a document or uses an application program (App for short), the text of the App will be displayed on the TextView, and the setText method is called. Among them, setText is the basic method used by TextView and editText to set text information. When the setText method is executed, the currently displayed text can be sent to the retrieval service through an Intent. Among them, Intent is an abstract description of performing an operation. For example, Intent can be used to bind Activity and Service to establish communication between them (bindServiceConnaction(Intent, ServiceConnection, int)), etc. To sum up, the retrieval service obtains the target string and the currently displayed text. Wherein, the currently displayed text, that is, text information, includes the currently displayed content, and control information (including a process ID and a control ID) used to display the currently displayed content.
需要说明的是,搜索窗口可以是悬浮窗口(可以是OverlayView形式,它是View上面的一个浮层,这个浮层与当前View视图大小一致,上层的内容并不影响整个布局)。图2是本申请实施例提供的一种移动终端的文本检索示意图,如图2所示,在功能启用开关被打开之前,移动终端的触摸屏210中显示预设文本。在功能启用开关被打开后,弹出悬浮窗口220,以供用户输入待匹配的目标字符串。也就是说在触摸屏210上还显示悬浮窗口220。可以理解的是,搜索窗口的形式可以有很多种,并不限于上述列举。例如,搜索窗口可以仅用于显示检索结果,也就是说,获取用户输入的特定手势对应的目标字符串,根据该目标字符串查询当前页面显示的文本内容,确定检索结果,并弹出搜索窗口显示该检索结果。例如,特定手势可以是用户分别单击目标字符串的起始字符及结尾字符。又如,特定手势可以是以目标字符串的起始字符为起点,输入滑动操作直至该目标字符串的结尾字符等等选中目标字符串的操作。It should be noted that the search window can be a floating window (it can be in the form of an OverlayView, which is a floating layer above the View, which is the same size as the current View, and the content of the upper layer does not affect the entire layout). FIG. 2 is a schematic diagram of text retrieval of a mobile terminal provided by an embodiment of the present application. As shown in FIG. 2 , before the function activation switch is turned on, preset text is displayed on the touch screen 210 of the mobile terminal. After the function enabling switch is turned on, a floating window 220 pops up for the user to input the target character string to be matched. That is to say, the floating window 220 is also displayed on the touch screen 210 . It can be understood that there may be many forms of the search window, which are not limited to the above-mentioned examples. For example, the search window can only be used to display the search results, that is, to obtain the target string corresponding to the specific gesture input by the user, query the text content displayed on the current page according to the target string, determine the search result, and pop up the search window to display The search results. For example, the specific gesture may be that the user clicks the start character and the end character of the target character string respectively. For another example, the specific gesture may be an operation of selecting the target character string starting from the start character of the target character string, inputting a sliding operation until the end character of the target character string, and so on.
步骤120、通过该检索服务查询当前显示内容,确定与该目标字符串匹配的检索结果。Step 120, query the currently displayed content through the retrieval service, and determine the retrieval result matching the target character string.
其中,当前显示内容可以是当前正在显示的显示文本。可选的,为了缩小需要查询的数据量,当前显示内容还可以是当前页面中显示的文本内容。Wherein, the currently displayed content may be the currently displayed display text. Optionally, in order to reduce the amount of data to be queried, the currently displayed content may also be the text content displayed on the current page.
其中,检索结果包括目标字符串的出现位置及出现次数。也就是说,检索结果可以是以整个显示文本作为对象,查询该显示文本的显示内容中目标字符串的出现位置及出现次数。Wherein, the retrieval result includes the occurrence position and the occurrence frequency of the target character string. That is to say, the retrieval result may take the entire display text as an object, and query the occurrence position and occurrence frequency of the target character string in the display content of the display text.
可选的,出现次数也可以是当前页面对应的检索记录条数,出现位置也可以是当前页面中目标字符串的位置信息,这样仅将当前页面作为对象,缩小需要查询的数据范围,提升查询效率。Optionally, the number of occurrences can also be the number of retrieval records corresponding to the current page, and the occurrence position can also be the position information of the target string in the current page, so that only the current page is used as the object, narrowing the range of data to be queried, and improving the query efficiency.
需要说明的是,当前页面可以理解为当前屏幕显示的页面;如果存在进度条,则当前页面也可以被理解为该进度条由起始位置滑动至末尾位置对应的整个页面。It should be noted that the current page can be understood as the page displayed on the current screen; if there is a progress bar, the current page can also be understood as the entire page corresponding to the progress bar sliding from the start position to the end position.
示例性的,在检索服务获取到目标字符串和当前显示内容之后,通过该检索服务以目标字符串为检索词查询当前显示内容,确定与该检索词匹配的目标字符串的出现次数以及该目标字符串在当前显示内容中的出现位置。Exemplarily, after the retrieval service acquires the target string and the current display content, the retrieval service uses the target string as a search term to inquire about the current display content, and determines the number of occurrences of the target string matching the search term and the target The position of the string within the current display.
步骤130、显示该检索结果,并在当前显示内容中标注该目标字符串。Step 130, display the retrieval result, and mark the target character string in the currently displayed content.
示例性的,可以通过弹出悬浮窗口的形式显示检索结果,可以参见图2。将检索结果输出至预设的悬浮窗口,该检索结果包括目标字符串的记录条数及位置信息。由于悬浮窗口对应的应用程序中维持有字符串和检索结果的键值对,在悬浮窗口获取到检索服务输出的检索结果后,提取检索结果中的记录条数(也就是出现次数)更新该键值对,显示更新后的检索结果。需要说明的是,该悬浮窗口对应的应用程序中具有采用预设数据存储目标字符串与检索结果的键值对集合,存储形式可以是Map<String,Result>。Exemplarily, the retrieval result may be displayed in the form of a pop-up floating window, as shown in FIG. 2 . The retrieval result is output to a preset floating window, and the retrieval result includes the record number and location information of the target character string. Since the application program corresponding to the floating window maintains key-value pairs of character strings and retrieval results, after the floating window obtains the retrieval results output by the retrieval service, extract the number of records (that is, the number of occurrences) in the retrieval results and update the key A value pair that displays the updated search results. It should be noted that the application program corresponding to the floating window has a key-value pair set using preset data storage target strings and retrieval results, and the storage format may be Map<String, Result>.
由于通过Intent发送当前显示文本至检索服务时,一并发送该当前显示文本对应的系统控件的控件信息,用于全局获取该系统控件的相关信息。其中,该控件信息包括但不限于进程标识(即Pid)和控件标识(viewId)。例如,将当前显示文本的文本标识与控件信息进行关联存储等。When the currently displayed text is sent to the search service through the Intent, the control information of the system control corresponding to the currently displayed text is also sent to obtain relevant information of the system control globally. Wherein, the control information includes but not limited to a process identifier (ie Pid) and a control identifier (viewId). For example, the text identifier of the currently displayed text and the control information are associated and stored.
若已确定当前显示内容中与目标字符串匹配的记录条数及位置信息,则查询与当前显示内容对应的控件信息,并通过预设函数基于控件信息匹配系统控件。例如,在得到当前显示内容中与目标字符串匹配的记录条数及位置信息之后,通过findViewById()方式获取与控件信息匹配的控件记录,该控件记录包括用于显示当前显示文本的系统控件TextView。示例性的,根据进程标识和/或控件标识,采用findViewById()方法确定匹配的系统控件。由于检索服务内具有通过Intent传入的当前显示文本,在该当前显示文本的显示内容中以预设背景色标注目标字符串,例如,高亮显示该目标字符串。然后,将标注后的文本输出至系统控件TextView进行显示。需要说明的是,标注方式并不限于为目标字符串添加预设背景色,还可以是以下划线的形式标注,或者以加重字体的形式标注,或者以矩形框的形式标注,或者以调整字体颜色的形式标注等等。If the number of records and location information matching the target character string in the current display content have been determined, query the control information corresponding to the current display content, and match the system control based on the control information through a preset function. For example, after obtaining the number and location information of the records matching the target string in the current display content, obtain the control records matching the control information through findViewById(). The control records include the system control TextView used to display the currently displayed text . Exemplarily, according to the process ID and/or the control ID, the findViewById() method is used to determine the matching system control. Since the retrieval service has the current display text passed in through the Intent, the target character string is marked with a preset background color in the display content of the current display text, for example, the target character string is highlighted. Then, output the marked text to the system control TextView for display. It should be noted that the labeling method is not limited to adding a preset background color to the target character string, and can also be marked in the form of underline, or in the form of an accentuated font, or in the form of a rectangular box, or in the form of adjusting the font color form annotations, etc.
本实施例的技术方案,通过在文本检索事件被触发时,启动预先配置于移动终端内的检索服务,通过该检索服务获取目标字符串及文本信息;通过该检索服务查询当前显示内容,确定与目标字符串匹配的检索结果;显示检索结果,并在当前现实内容中标注目标字符串,实现文本自动检索,快速定位目标字符串所在的目标文本段。采用上述技术方案可以避免用户在浏览某个页面时需要肉眼检索文本的情况,通过自动检索文本,提高了检索准确率及检索效率。In the technical solution of this embodiment, when a text retrieval event is triggered, the retrieval service pre-configured in the mobile terminal is started, and the target character string and text information are obtained through the retrieval service; the current display content is queried through the retrieval service, and determined and The search result matching the target string; display the search result, and mark the target string in the current reality content, realize automatic text retrieval, and quickly locate the target text segment where the target string is located. Adoption of the above technical solution can avoid the situation that the user needs to retrieve the text with the naked eye when browsing a certain page, and the retrieval accuracy and retrieval efficiency are improved by automatically retrieving the text.
图3是本申请实施例提供的另一种移动终端的文本检索方法的流程图。如图3所示,该方法包括:Fig. 3 is a flow chart of another text retrieval method for a mobile terminal provided by an embodiment of the present application. As shown in Figure 3, the method includes:
步骤301、在文本检索事件被触发时,启动预先配置于移动终端内的检索服务。Step 301. When a text retrieval event is triggered, start a retrieval service pre-configured in the mobile terminal.
检测用户输入的启用自动检索功能的操作。若检测到自动检索功能启用,则启动预先配置于移动终端内的检索服务。示例性的,用户在浏览文档、网页或者使用应用程序时,文字内容通过文档窗口进行显示,其中,文档窗口包括但不限于浏览器窗口、word文档窗口以及应用程序内的显示界面窗口。若在显示文档、网页或应用程序的过程中,检测到自动检索功能被启用,则启动检索服务,用于在获取用户输入的目标字符串后,在移动终端的后台匹配文档窗口对应的显示内容和目标字符串,并显示匹配到的结果。Detects user input to enable auto-retrieval. If it is detected that the automatic retrieval function is activated, the retrieval service pre-configured in the mobile terminal is started. Exemplarily, when a user browses a document, a web page, or uses an application program, text content is displayed through a document window, wherein the document window includes but is not limited to a browser window, a word document window, and a display interface window in an application program. If it is detected that the automatic retrieval function is enabled during the process of displaying documents, web pages or applications, the retrieval service is started to match the display content corresponding to the document window in the background of the mobile terminal after obtaining the target character string input by the user and the target string, and display the matching results.
步骤302、显示悬浮窗口。Step 302, displaying a floating window.
示例性的,可以采用弹出框的形式在移动终端屏幕的预设区域显示悬浮窗口,作为搜索窗口。例如,在文档窗口的预设区域的上层形成新图层,并通过该新图层显示悬浮窗口。可选的,为了避免悬浮窗口遮挡文档窗口内的文字,可以调整显示内容中文字的排版格式,以在显示文字时空出该预设区域。可选的,还可以设置悬浮窗口的透明度,以透过该悬浮窗口看见被遮挡的文字。需要说明的是,上述对悬浮窗口的设置方式的描述为示例并非限制。Exemplarily, a floating window may be displayed in a preset area of the screen of the mobile terminal in the form of a pop-up box as the search window. For example, a new layer is formed on the upper layer of the preset area of the document window, and the floating window is displayed through the new layer. Optionally, in order to prevent the floating window from covering the text in the document window, the typesetting format of the text in the displayed content can be adjusted to leave the preset area when the text is displayed. Optionally, the transparency of the floating window can also be set, so that the occluded text can be seen through the floating window. It should be noted that, the above description of the manner of setting the floating window is an example and not a limitation.
步骤303、监测悬浮窗口,获取用户输入的目标字符串,并将目标字符串导入检索服务。Step 303, monitor the floating window, acquire the target character string input by the user, and import the target character string into the retrieval service.
示例性的,按照预设的周期检测悬浮窗口,判断是否检测到用户输入的目标字符串。可选的,还可以是在用户对悬浮窗口操作时,触发检测事件,通过检测事件判断该操作是否为输入目标字符串的操作。若是,则由悬浮窗口的预设第一区域提取目标字符串。例如,若该操作为针对悬浮窗口内预设第一区域,且该操作包括对预设控件的操作,则确定该操作为输入目标字符串的操作。Exemplarily, the floating window is detected according to a preset period, and it is judged whether the target character string input by the user is detected. Optionally, a detection event may be triggered when the user operates the floating window, and it is determined whether the operation is an operation of inputting a target character string through the detection event. If yes, the target character string is extracted from the preset first area of the floating window. For example, if the operation is to preset the first area in the floating window, and the operation includes an operation on a preset control, it is determined that the operation is an operation of inputting a target character string.
需要说明的是,在悬浮窗口对应的应用程序中包括预先定义的键值对结构,例如,Map<String,Result>键值对,在获取到用户输入的目标字符串时,以键值对的形式存储目标字符串及检索结果(未通过目标字符串检索显示内容前,检索结果可以采用默认值代替,且不显示检索结果)。将该键值对结构导入检索服务,并在检索服务中维持Map<String,Result>键值对,用于检索多个目标字符串。也就是说,检索服务由该悬浮窗口获取目标字符串,并采用Map<String,Result>结构存储目标字符串与检索结果的键值对集合。It should be noted that the application program corresponding to the floating window includes a predefined key-value pair structure, for example, Map<String,Result> key-value pair, when the target string input by the user is obtained, the key-value pair Store the target character string and the search result in the format (before the content is displayed through the target character string search, the search result can be replaced by the default value, and the search result will not be displayed). Import the key-value pair structure into the retrieval service, and maintain a Map<String,Result> key-value pair in the retrieval service to retrieve multiple target strings. That is to say, the retrieval service obtains the target string from the floating window, and uses the Map<String, Result> structure to store the key-value pair set of the target string and the retrieval result.
需要说明的是,目标字符串可以为1个,例如,AAB。目标字符串还可以至少是2个,且各个字符串之间通过逻辑符号连接,例如AAB+BBC,表示在同一文本段中包括AAB和BBC字符串,或者AAB+BBC+BBD,表示在同一文本段中包括AAB、BBC和BBD字符串。需要说明的是,上述目标字符串仅为示例并非限定。可以理解的是,目标字符串还可以是AAB/BBC/BBD,表示在文本段中出现AAB、BBC或BBD字符串。It should be noted that there may be one target character string, for example, AAB. There can also be at least 2 target strings, and the strings are connected by logical symbols, such as AAB+BBC, which means that AAB and BBC strings are included in the same text segment, or AAB+BBC+BBD, which means that they are in the same text segment The segment includes AAB, BBC and BBD strings. It should be noted that the above target character string is only an example and not a limitation. It can be understood that the target character string may also be AAB/BBC/BBD, which means that AAB, BBC or BBD character strings appear in the text segment.
步骤304、获取当前显示内容对应的目标控件,通过预设方法发送当前显示内容及该目标控件的控件信息至该检索服务。Step 304: Obtain the target control corresponding to the current display content, and send the current display content and the control information of the target control to the search service through a preset method.
其中,预设方法包括setText方法。Wherein, the preset method includes a setText method.
通常情况下,用户浏览文档或使用应用程序时,文字内容会显示在系统控件TextView(记为目标控件)上,并调用setText方法。移动终端执行setText方法时,通过Intent发送显示文本及控件信息至检索服务。其中,控件信息包括但不限于进程标识和控件标识。Usually, when a user browses a document or uses an application program, the text content will be displayed on the system control TextView (marked as the target control), and the setText method will be called. When the mobile terminal executes the setText method, it sends the display text and control information to the search service through the Intent. Wherein, the control information includes, but is not limited to, a process ID and a control ID.
步骤305、检索服务遍历键值对集合获取目标字符串。Step 305, the retrieval service traverses the key-value pair collection to obtain the target character string.
需要说明的是,目标字符串可以采用Map<String,Result>方式存在,检索服务遍历该数据结构得到目标字符串。目标字符串可以是1个,也可以是通过预设逻辑符号连接的多个字符串。It should be noted that the target string can exist in the form of Map<String, Result>, and the search service traverses the data structure to obtain the target string. The target character string can be one or multiple character strings connected by preset logic symbols.
步骤306、以该目标字符串为检索词查询当前显示内容,确定与该检索词匹配的检索结果。Step 306: Use the target character string as a search term to inquire about the currently displayed content, and determine a search result matching the search term.
示例性的,在目标字符串为1个时,查询当前显示内容确定与该目标字符串匹配的字符串所在的文本段。在目标字符串为2个或2个以上时,确定各个字符串之间的逻辑关系。若是与的关系,如AAB+BBC,则查询当前显示内容确定同时包含AAB和BBC的文本段。若是或的关系,若AAB/BBC,则查询当前显示内容确定至少包括AAB或BBC中一个的文本段。Exemplarily, when there is one target character string, the currently displayed content is queried to determine the text segment where the character string matching the target character string is located. When there are 2 or more target character strings, determine the logical relationship between each character string. If the relationship is with, such as AAB+BBC, query the current display content to confirm that the text segment contains both AAB and BBC. If it is an or relationship, if it is AAB/BBC, query the currently displayed content to determine at least one text segment including AAB or BBC.
若确定包含目标字符串的文本段,统计目标字符串在显示文本中的出现次数并记录,同时记录各个目标字符串的位置信息,生成检索结果。需要说明的是,检索结果还可以包括显示内容中目标字符串的标注方式,例如是高亮显示目标字符串还是加粗显示等。If the text segment containing the target character string is determined, count and record the number of occurrences of the target character string in the displayed text, and record the position information of each target character string at the same time to generate a retrieval result. It should be noted that the search result may also include a labeling method of the target character string in the displayed content, for example, whether the target character string is highlighted or bolded.
需要说明的是,在显示文本具有多页时,可以仅查询移动终端的当前页面,从而减少查询数据量。It should be noted that when the displayed text has multiple pages, only the current page of the mobile terminal may be queried, thereby reducing the amount of queried data.
步骤307、将该检索结果输出至悬浮窗口,根据该检索结果更新该悬浮窗口对应的键值对,显示更新后的检索结果。Step 307: Output the retrieval result to the floating window, update the key-value pair corresponding to the floating window according to the retrieval result, and display the updated retrieval result.
步骤308、根据该控件信息匹配目标控件,在当前显示内容中以预设背景色标注该目标字符串,并将标注结果输出至该目标控件。Step 308: Match the target control according to the control information, mark the target character string with a preset background color in the current display content, and output the marking result to the target control.
步骤309、定位首个与该目标字符串匹配的文本段,跳转至该文本段进行显示。Step 309, locate the first text segment matching the target character string, and jump to the text segment for display.
示例性的,根据检索结果中目标字符串的位置信息,定位文档窗口中显示的首个包含该目标字符串的文本段。根据该文本段的位置对当前显示进度进行调整,调整方式可以是跳过首个包含该目标字符串的文本段之前的文字内容,直接显示该文本段。Exemplarily, according to the position information of the target character string in the retrieval result, the first text segment containing the target character string displayed in the document window is located. The current display progress is adjusted according to the position of the text segment, and the adjustment method may be to skip the text content before the first text segment containing the target character string and directly display the text segment.
步骤310、检测用户输入的跳转指示。Step 310, detecting the jump instruction input by the user.
示例性的,在悬浮窗口中显示跳转按钮,包括跳转至上一个目标字符串以及跳转至下一个目标字符串。若跳转按钮被触发,则确定用户输入了跳转指示,执行相应的跳转操作。Exemplarily, a jump button is displayed in the floating window, including jumping to a previous target character string and jumping to a next target character string. If the jump button is triggered, it is determined that the user has input a jump instruction, and a corresponding jump operation is performed.
步骤311、在检测到所述跳转指示时,执行所述跳转指示对应的跳转操作。Step 311 , when the jump indication is detected, perform a jump operation corresponding to the jump indication.
示例性的,在检测到的跳转指示是跳转至下一个目标字符串时,响应该跳转指示,跳过该目标字符串之前的文字内容,将该目标字符串所在的行作为显示首行。Exemplarily, when the detected jump instruction is to jump to the next target string, in response to the jump instruction, the text content before the target string is skipped, and the line where the target string is located is used as the display first Row.
可选的,还可以对目标字符串进行归类,为属于同一文本段的目标字符串赋予相同的标识,将该标识与段号关联存储。从而,可以将悬浮窗口中的跳转按钮定义为跳转至上一个与目标字符串匹配的文本段或跳转至下一个与目标字符串匹配的文本段。在检测到跳转指示时,执行跳转指示对应的跳转操作可以是跳转至显示下一个包含目标字符串的文本段,或者跳转至显示上一个包含目标字符串的文本段。Optionally, the target character strings can also be categorized, the target character strings belonging to the same text segment are given the same identifier, and the identifier is stored in association with the segment number. Therefore, the jump button in the floating window can be defined as jumping to the previous text segment matching the target character string or jumping to the next text segment matching the target character string. When a jump indication is detected, performing a jump operation corresponding to the jump indication may be to jump to display the next text segment containing the target character string, or jump to display the previous text segment containing the target character string.
本实施例的技术方案,通过在用户浏览文本过程中,若检测到文本检索事件被触发,则弹出悬浮窗口,启动检索服务;获取用户向悬浮窗口输入的目标字符串并导入检索服务;获取文档窗口中的显示文本及控件信息并导入检索服务;以所述目标字符串为检索词查询所述当前显示内容,确定与所述检索词匹配的检索结果,通过悬浮窗口显示该检索结果,并在文档窗口中显示以预设背景色标注目标字符串,定位首个与目标字符串匹配的文本段,跳转至该文本段进行显示,可以在系统中查询目标字符串,并快速的定位至目标文本段,避免用户用肉眼去检索可能出现的问题,提高了检索效率及准确率。In the technical solution of this embodiment, if it is detected that the text retrieval event is triggered during the user's browsing of the text, a floating window will pop up to start the retrieval service; obtain the target character string input by the user to the floating window and import it into the retrieval service; obtain the document The display text and control information in the window are imported into the search service; the current display content is inquired with the target character string as the search term, and the search result matching the search term is determined, and the search result is displayed through the floating window, and in The document window displays the target string with a preset background color, locates the first text segment that matches the target string, and jumps to the text segment for display. You can query the target string in the system and quickly locate the target The text segment avoids the possible problems that may arise when users search with the naked eye, and improves the retrieval efficiency and accuracy.
图4是本申请实施例提供的一种移动终端的文本检索装置的工作过程示意图。如图4所示,该文本检索装置包括悬浮窗口410、检索服务420及文档窗口430。其中,悬浮窗口410,也就是搜索窗口,用于导入目标字符串和显示检索结果,其中,检索结果可以是当前页面检索记录条数和位置信息。文档窗口430,即为移动终端显示文档的当前窗口,例如,浏览窗口、word窗口及应用内的显示界面窗口等等。检索服务420,即为系统Service,在后台匹配文档窗口430和目标字符串,将匹配到的检索结果分别输出至悬浮窗口410和文档窗口430进行显示。示例性的,在自动检索功能启用时显示悬浮窗口410,获取用户在悬浮窗口410输入的目标字符串。将该目标字符串导入检索服务420。此外,将文档窗口430中显示的显示文本及用于显示该显示文本的控件信息导入检索服务420。通过检索服务420在后台匹配目标字符串及显示文本的文本内容,得到检索结果,其中,检索结果包括当前页文本内容中出现目标字符串的次数及位置。将检索结果输出至悬浮窗口410,以更新悬浮窗口的检索信息。并且,根据检索结果,以预设背景色标注当前页文本内容,将标注后的文本内容导出至文档窗口430,并按照预设规则跳转至目标文本段,默认可以是跳转至首个包含目标字符串的文本段,从而,帮助用户在浏览某个页面时,快速定位的到目标文本段。Fig. 4 is a schematic diagram of a working process of a text retrieval device for a mobile terminal provided by an embodiment of the present application. As shown in FIG. 4 , the text retrieval device includes a floating window 410 , a retrieval service 420 and a document window 430 . Wherein, the floating window 410, that is, the search window, is used to import the target character string and display the search result, where the search result may be the number of search records and location information on the current page. The document window 430 is the current window for displaying documents in the mobile terminal, for example, a browsing window, a word window, and a display interface window in an application, and the like. The retrieval service 420 is a system service that matches the document window 430 and the target character string in the background, and outputs the matched retrieval results to the floating window 410 and the document window 430 for display. Exemplarily, when the automatic retrieval function is enabled, a floating window 410 is displayed, and the target character string input by the user in the floating window 410 is acquired. This target string is imported into the retrieval service 420 . In addition, the display text displayed in the document window 430 and the control information for displaying the display text are imported into the retrieval service 420 . The search service 420 matches the target character string and the text content of the displayed text in the background to obtain a search result, wherein the search result includes the number and position of the target character string appearing in the text content of the current page. The search result is output to the floating window 410, so as to update the search information of the floating window. And, according to the search result, mark the text content of the current page with the preset background color, export the marked text content to the document window 430, and jump to the target text segment according to the preset rules, and the default can be to jump to the first containing The text segment of the target string, thereby helping the user to quickly locate the target text segment when browsing a certain page.
图5是本申请实施例提供的一种移动终端的文本检索装置的原理框图。该装置可以通过软件和/或硬件实现,可被集成于移动终端内,用于执行本申请实施例提供的移动终端的文本检索方法。如图5所示,该装置包括:Fig. 5 is a functional block diagram of a text retrieval device for a mobile terminal provided by an embodiment of the present application. The device can be realized by software and/or hardware, and can be integrated in the mobile terminal to execute the text retrieval method for the mobile terminal provided in the embodiment of the present application. As shown in Figure 5, the device includes:
信息获取模块510,用于在文本检索事件被触发时,启动预先配置于移动终端内的检索服务,通过所述检索服务获取目标字符串及文本信息,其中,所述文本信息包括当前显示内容及所述当前显示内容对应的控件信息;The information acquisition module 510 is configured to start a search service pre-configured in the mobile terminal when a text search event is triggered, and obtain target character strings and text information through the search service, wherein the text information includes the currently displayed content and Control information corresponding to the currently displayed content;
字符检索模块520,用于通过所述检索服务查询所述当前显示内容,确定与所述目标字符串匹配的检索结果,其中,所述检索结果包括目标字符串的出现位置及出现次数;A character retrieval module 520, configured to query the currently displayed content through the retrieval service, and determine a retrieval result that matches the target character string, wherein the retrieval result includes the occurrence position and the number of occurrences of the target character string;
结果显示模块530,用于显示所述检索结果,并在当前显示内容中标注所述目标字符串。The result display module 530 is configured to display the search result and mark the target character string in the currently displayed content.
本申请实施例的技术方案提供一种移动终端的文本检索装置,可以实现文本自动检索,快速定位目标字符串所在的目标文本段。采用上述技术方案可以避免用户在浏览某个页面时需要肉眼检索文本的情况,通过自动检索文本,提高了检索准确率及检索效率。The technical solutions of the embodiments of the present application provide a text retrieval device for a mobile terminal, which can realize automatic text retrieval and quickly locate the target text segment where the target character string is located. Adoption of the above technical solution can avoid the situation that the user needs to retrieve the text with the naked eye when browsing a certain page, and the retrieval accuracy and retrieval efficiency are improved by automatically retrieving the text.
可选的,还包括:Optionally, also include:
窗口显示模块,用于在文本检索事件被触发时,显示搜索窗口,其中,所述搜索窗口用于向检索服务导入目标字符串,并显示所述目标字符串对应的检索结果。The window display module is configured to display a search window when a text retrieval event is triggered, wherein the search window is used to import a target character string into the search service and display a search result corresponding to the target character string.
可选的,信息获取模块510具体用于:Optionally, the information acquisition module 510 is specifically used for:
所述检索服务由所述搜索窗口获取所述目标字符串,并采用预设数据结构存储目标字符串与检索结果的键值对集合;The search service obtains the target character string from the search window, and uses a preset data structure to store the key-value pair set of the target character string and the search result;
获取当前显示内容对应的目标控件,通过预设方法发送所述当前显示内容及所述目标控件的控件信息至所述检索服务,其中,控件信息包括进程标识和控件标识。Obtain the target control corresponding to the current display content, and send the current display content and the control information of the target control to the retrieval service through a preset method, wherein the control information includes a process ID and a control ID.
可选的,字符检索模块520具体用于:Optionally, the character retrieval module 520 is specifically used for:
所述检索服务遍历所述键值对集合获取目标字符串,其中,所述目标字符串包括由预设逻辑符号连接的字符串;The retrieval service traverses the set of key-value pairs to obtain a target string, wherein the target string includes a string connected by preset logical symbols;
以所述目标字符串为检索词查询所述当前显示内容,确定与所述检索词匹配的检索结果。The currently displayed content is queried by using the target character string as a search term, and a search result matching the search term is determined.
可选的,结果显示模块530具体用于:Optionally, the result display module 530 is specifically used for:
将所述检索结果输出至预设悬浮窗口,根据所述检索结果更新所述预设悬浮窗口对应的键值对,显示更新后的检索结果,其中,所述预设悬浮窗口采用预设数据结构存储目标字符串与检索结果的键值对集合。Outputting the retrieval result to a preset floating window, updating the key-value pair corresponding to the preset floating window according to the retrieval result, and displaying the updated retrieval result, wherein the preset floating window adopts a preset data structure A collection of key-value pairs that store target strings and search results.
可选的,结果显示模块530具体用于:Optionally, the result display module 530 is specifically used for:
根据所述控件信息匹配目标控件,在所述当前显示内容中以预设背景色标注所述目标字符串,并将标注结果输出至所述目标控件。matching the target control according to the control information, marking the target character string with a preset background color in the current display content, and outputting the marking result to the target control.
可选的,还包括:Optionally, also include:
跳转模块,用于在当前显示内容中标注所述目标字符串之后,定位首个与所述目标字符串匹配的文本段,跳转至所述文本段进行显示;检测用户输入的跳转指示,其中,所述跳转指示用于指示跳转至下一个与目标字符串匹配的文本段进行显示;在检测到所述跳转指示时,执行所述跳转指示对应的跳转操作。A jump module, configured to locate the first text segment that matches the target character string after marking the target character string in the current display content, and jump to the text segment for display; detect a jump instruction input by the user , wherein the jump instruction is used to instruct to jump to the next text segment matching the target character string for display; when the jump instruction is detected, the jump operation corresponding to the jump instruction is executed.
本申请实施例还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行移动终端的文本检索方法,该方法包括:An embodiment of the present application also provides a storage medium containing computer-executable instructions, the computer-executable instructions are used to execute a text retrieval method of a mobile terminal when executed by a computer processor, the method comprising:
在文本检索事件被触发时,启动预先配置于移动终端内的检索服务,通过所述检索服务获取目标字符串及文本信息,其中,所述文本信息包括当前显示内容及所述当前显示内容对应的控件信息;When the text retrieval event is triggered, the retrieval service preconfigured in the mobile terminal is started, and the target character string and text information are obtained through the retrieval service, wherein the text information includes the currently displayed content and the text corresponding to the currently displayed content control information;
通过所述检索服务查询所述当前显示内容,确定与所述目标字符串匹配的检索结果,其中,所述检索结果包括目标字符串的出现位置及出现次数;Querying the currently displayed content through the retrieval service, and determining a retrieval result matching the target character string, wherein the retrieval result includes the occurrence position and the occurrence frequency of the target character string;
显示所述检索结果,并在当前显示内容中标注所述目标字符串。Displaying the retrieval result, and marking the target character string in the currently displayed content.
存储介质——任何的各种类型的存储器设备或存储设备。术语“存储介质”旨在包括:安装介质,例如CD-ROM、软盘或磁带装置;计算机系统存储器或随机存取存储器,诸如DRAM、DDR RAM、SRAM、EDO RAM,兰巴斯(Rambus)RAM等;非易失性存储器,诸如闪存、磁介质(例如硬盘或光存储);寄存器或其它相似类型的存储器元件等。存储介质可以还包括其它类型的存储器或其组合。另外,存储介质可以位于程序在其中被执行的第一计算机系统中,或者可以位于不同的第二计算机系统中,第二计算机系统通过网络(诸如因特网)连接到第一计算机系统。第二计算机系统可以提供程序指令给第一计算机用于执行。术语“存储介质”可以包括可以驻留在不同位置中(例如在通过网络连接的不同计算机系统中)的两个或更多存储介质。存储介质可以存储可由一个或多个处理器执行的程序指令(例如具体实现为计算机程序)。storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media such as CD-ROMs, floppy disks or tape drives; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc. ; non-volatile memory, such as flash memory, magnetic media (eg hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. Also, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network such as the Internet. The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems connected by a network. The storage medium may store program instructions (eg embodied as computer programs) executable by one or more processors.
当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上所述的移动终端的文本检索操作,还可以执行本申请任意实施例所提供的移动终端的文本检索方法中的相关操作。Certainly, a storage medium containing computer-executable instructions provided by the embodiments of the present application, the computer-executable instructions are not limited to the text retrieval operation of the mobile terminal as described above, and can also execute the mobile terminal provided by any embodiment of the present application. Related operations in the text retrieval method of the terminal.
本申请实施例提供了一种移动终端,该移动终端内具有操作系统,该移动终端中可集成本申请实施例提供的移动终端的文本检索装置。其中,移动终端可以为智能手机、PAD(平板电脑)、掌上阅读器及智能穿戴设备等。图6是本申请实施例提供的一种移动终端的结构示意图。如图6所示,该移动终端包括存储器610及处理器620。所述存储器610,用于存储计算机程序、目标字符串、文本信息及检索结果等;所述处理器620读取并执行所述存储器610中存储的计算机程序。所述处理器620在执行所述计算机程序时实现以下步骤:在文本检索事件被触发时,启动预先配置于移动终端内的检索服务,通过所述检索服务获取目标字符串及文本信息,其中,所述文本信息包括当前显示内容及所述当前显示内容对应的控件信息;通过所述检索服务查询所述当前显示内容,确定与所述目标字符串匹配的检索结果,其中,所述检索结果包括目标字符串的出现位置及出现次数;显示所述检索结果,并在当前显示内容中标注所述目标字符串。An embodiment of the present application provides a mobile terminal with an operating system inside, and the mobile terminal text retrieval device provided by the embodiment of the present application can be integrated in the mobile terminal. Wherein, the mobile terminal may be a smart phone, a PAD (tablet computer), a handheld reader, a smart wearable device, and the like. FIG. 6 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present application. As shown in FIG. 6 , the mobile terminal includes a memory 610 and a processor 620 . The memory 610 is used to store computer programs, target character strings, text information, search results, etc.; the processor 620 reads and executes the computer programs stored in the memory 610 . The processor 620 implements the following steps when executing the computer program: when a text retrieval event is triggered, start a retrieval service pre-configured in the mobile terminal, and obtain the target character string and text information through the retrieval service, wherein, The text information includes the currently displayed content and the control information corresponding to the currently displayed content; the currently displayed content is queried through the search service, and a search result matching the target character string is determined, wherein the search result includes The occurrence position and occurrence times of the target character string; displaying the retrieval result, and marking the target character string in the currently displayed content.
上述示例中列举的存储器及处理器均为移动终端的部分元器件,所述移动终端还可以包括其它元器件。以智能手机为例,说明上述移动终端可能的结构。图7是本申请实施例提供的一种智能手机的结构框图。如图7所示,该智能手机可以包括:存储器701、中央处理器(Central Processing Unit,CPU)702(又称处理器,以下简称CPU)、外设接口703、RF(Radio Frequency,射频)电路705、音频电路706、扬声器711、触摸屏712、电源管理芯片708、输入/输出(I/O)子系统709、其他输入/控制设备710以及外部端口704,这些部件通过一个或多个通信总线或信号线707来通信。The memories and processors listed in the above examples are all components of the mobile terminal, and the mobile terminal may also include other components. Taking a smart phone as an example, a possible structure of the above mobile terminal is described. Fig. 7 is a structural block diagram of a smart phone provided by an embodiment of the present application. As shown in FIG. 7 , the smart phone may include: a memory 701, a central processing unit (Central Processing Unit, CPU) 702 (also known as a processor, hereinafter referred to as CPU), a peripheral interface 703, and an RF (Radio Frequency, radio frequency) circuit 705, audio circuitry 706, speaker 711, touch screen 712, power management chip 708, input/output (I/O) subsystem 709, other input/control devices 710, and external ports 704, which are communicated via one or more communication buses or Signal line 707 for communication.
应该理解的是,图示智能手机700仅仅是移动终端的一个范例,并且智能手机700可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that the illustrated smartphone 700 is merely an example of a mobile terminal, and that the smartphone 700 may have more or fewer components than shown in the figure, and two or more components may be combined, Or can have a different component configuration. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
下面就本实施例提供的集成有移动终端的文本检索装置的智能手机进行详细的描述。The smart phone integrated with the text retrieval device of the mobile terminal provided in this embodiment will be described in detail below.
存储器701,所述存储器701可以被CPU702、外设接口703等访问,所述存储器701可以包括高速随机存取存储器,还可以包括非易失性存储器,例如一个或多个磁盘存储器件、闪存器件、或其他易失性固态存储器件。在存储器701中存储计算机程序,还可以存储目标字符串、文本信息及检索结果等。Memory 701, the memory 701 can be accessed by the CPU 702, the peripheral interface 703, etc., the memory 701 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more disk storage devices, flash memory devices , or other volatile solid-state storage devices. Computer programs are stored in the memory 701, and target character strings, text information, search results, and the like can also be stored.
外设接口703,所述外设接口703可以将设备的输入和输出外设连接到CPU702和存储器701。Peripheral interface 703 , which can connect the input and output peripherals of the device to CPU 702 and memory 701 .
I/O子系统709,所述I/O子系统709可以将设备上的输入输出外设,例如触摸屏712和其他输入/控制设备710,连接到外设接口703。I/O子系统709可以包括显示控制器7091和用于控制其他输入/控制设备710的一个或多个输入控制器7092。其中,一个或多个输入控制器7092从其他输入/控制设备710接收电信号或者向其他输入/控制设备710发送电信号,其他输入/控制设备710可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮。值得说明的是,输入控制器7092可以与以下任一个连接:键盘、红外端口、USB接口以及诸如鼠标的指示设备。The I/O subsystem 709 , the I/O subsystem 709 can connect input and output peripherals on the device, such as a touch screen 712 and other input/control devices 710 , to the peripheral interface 703 . I/O subsystem 709 may include a display controller 7091 and one or more input controllers 7092 for controlling other input/control devices 710 . Among them, one or more input controllers 7092 receive electrical signals from or send electrical signals to other input/control devices 710, which may include physical buttons (push buttons, rocker buttons, etc.) ), dials, slide switches, joysticks, click wheels. It is worth noting that the input controller 7092 can be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
触摸屏712,所述触摸屏712是用户终端与用户之间的输入接口和输出接口,将可视输出显示给用户,可视输出可以包括图形、文本、图标、视频等。例如,可以显示悬浮窗口及文档窗口。A touch screen 712. The touch screen 712 is an input interface and an output interface between the user terminal and the user, and displays visual output to the user. The visual output may include graphics, text, icons, videos, and the like. For example, floating windows and document windows can be displayed.
I/O子系统709中的显示控制器7091从触摸屏712接收电信号或者向触摸屏712发送电信号。触摸屏712检测触摸屏上的接触,显示控制器7091将检测到的接触转换为与显示在触摸屏712上的用户界面对象的交互,即实现人机交互,显示在触摸屏712上的用户界面对象可以是运行游戏的图标、联网到相应网络的图标等。值得说明的是,设备还可以包括光鼠,光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸。The display controller 7091 in the I/O subsystem 709 receives electrical signals from the touch screen 712 or sends electrical signals to the touch screen 712 . The touch screen 712 detects the contact on the touch screen, and the display controller 7091 converts the detected contact into an interaction with the user interface object displayed on the touch screen 712, that is, realizes human-computer interaction, and the user interface object displayed on the touch screen 712 can be a running Icons for games, icons for networking to appropriate networks, etc. It is worth noting that the device may also include an optical mouse, which is a touch-sensitive surface that does not display visual output, or that is an extension of a touch-sensitive surface formed by a touch screen.
RF电路705,主要用于建立手机与无线网络(即网络侧)的通信,实现手机与无线网络的数据接收和发送。例如收发短信息、电子邮件等。具体地,RF电路705接收并发送RF信号,RF信号也称为电磁信号,RF电路705将电信号转换为电磁信号或将电磁信号转换为电信号,并且通过该电磁信号与通信网络以及其他设备进行通信。RF电路705可以包括用于执行这些功能的已知电路,其包括但不限于天线系统、RF收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、CODEC(COder-DECoder,编译码器)芯片组、用户标识模块(Subscriber Identity Module,SIM)等等。The RF circuit 705 is mainly used to establish communication between the mobile phone and the wireless network (that is, the network side), and realize data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. Specifically, the RF circuit 705 receives and sends RF signals, which are also called electromagnetic signals, and the RF circuit 705 converts electrical signals into electromagnetic signals or converts electromagnetic signals into electrical signals, and communicates with communication networks and other devices through the electromagnetic signals to communicate. RF circuitry 705 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC ( COder-DECoder, Codec) Chipset, Subscriber Identity Module (Subscriber Identity Module, SIM) and so on.
音频电路706,主要用于从外设接口703接收音频数据,将该音频数据转换为电信号,并且将该电信号发送给扬声器711。The audio circuit 706 is mainly used to receive audio data from the peripheral interface 703 , convert the audio data into electrical signals, and send the electrical signals to the speaker 711 .
扬声器711,用于将手机通过RF电路705从无线网络接收的语音信号,还原为声音并向用户播放该声音。The speaker 711 is used to restore the voice signal received by the mobile phone from the wireless network through the RF circuit 705 into sound and play the sound to the user.
电源管理芯片708,用于为CPU702、I/O子系统及外设接口所连接的硬件进行供电及电源管理。The power management chip 708 is used for power supply and power management for the hardware connected to the CPU 702 , the I/O subsystem and the peripheral interface.
本申请实施例提供的移动终端,可以解决相关技术中用户在浏览某个显示界面时需要肉眼检索文本导致准确率及效率不高的问题,实现文本自动检索,快速定位目标字符串所在的目标文本段,提高了检索准确率及检索效率。The mobile terminal provided by the embodiment of the present application can solve the problem in the related art that the user needs to retrieve the text with the naked eye when browsing a certain display interface, which leads to low accuracy and efficiency, realizes automatic text retrieval, and quickly locates the target text where the target character string is located segment, which improves the retrieval accuracy and retrieval efficiency.
上述实施例中提供的移动终端的文本检索装置、存储介质及移动终端可执行本申请任意实施例所提供的移动终端的文本检索方法,具备执行该方法相应的功能模块和有益效果。未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的移动终端的文本检索方法。The mobile terminal text retrieval device, storage medium, and mobile terminal provided in the above embodiments can execute the mobile terminal text retrieval method provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details not exhaustively described in the foregoing embodiments, reference may be made to the text retrieval method for a mobile terminal provided in any embodiment of the present application.
注意,上述仅为本申请的较佳实施例及所运用技术原理。本领域技术人员会理解,本申请不限于这里所述的特定实施例,对本领域技术人员来说能够进行各种明显的变化、重新调整和替代而不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。Note that the above are only preferred embodiments and technical principles used in this application. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present application, and the present application The scope is determined by the scope of the appended claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810172191.8A CN108416009A (en) | 2018-03-01 | 2018-03-01 | Text retrieval method, device, storage medium and mobile terminal for mobile terminal |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810172191.8A CN108416009A (en) | 2018-03-01 | 2018-03-01 | Text retrieval method, device, storage medium and mobile terminal for mobile terminal |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN108416009A true CN108416009A (en) | 2018-08-17 |
Family
ID=63129821
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810172191.8A Pending CN108416009A (en) | 2018-03-01 | 2018-03-01 | Text retrieval method, device, storage medium and mobile terminal for mobile terminal |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108416009A (en) |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110597401A (en) * | 2019-09-20 | 2019-12-20 | 中国银行股份有限公司 | Mechanism information input method and system |
| CN110674491A (en) * | 2019-09-29 | 2020-01-10 | 上海淇玥信息技术有限公司 | Method and device for real-time evidence obtaining of android application and electronic equipment |
| CN111147354A (en) * | 2019-12-25 | 2020-05-12 | 广州华多网络科技有限公司 | Message processing method, device, equipment and storage medium |
| CN111400457A (en) * | 2020-04-15 | 2020-07-10 | Oppo广东移动通信有限公司 | A text query method, device and terminal device |
| CN111782895A (en) * | 2020-07-02 | 2020-10-16 | 北京字节跳动网络技术有限公司 | Retrieval processing method and device, readable medium and electronic equipment |
| CN112307265A (en) * | 2019-07-26 | 2021-02-02 | 珠海金山办公软件有限公司 | A method, system, storage medium and terminal for finding diagrams in a document |
| CN112527386A (en) * | 2019-09-18 | 2021-03-19 | 华为技术有限公司 | Application program issuing method and device |
| CN114117182A (en) * | 2020-08-31 | 2022-03-01 | 腾讯科技(深圳)有限公司 | Network document processing method and device applied to mobile terminal and mobile terminal |
| CN115238214A (en) * | 2019-03-18 | 2022-10-25 | 智慧芽信息科技(苏州)有限公司 | Display method, apparatus, computer equipment, storage medium and program product |
| CN116089572A (en) * | 2021-11-05 | 2023-05-09 | 北京小米移动软件有限公司 | Content display method, device, mobile terminal and computer readable storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102915318A (en) * | 2012-03-08 | 2013-02-06 | 北京金山安全软件有限公司 | Method and device for positioning and searching information in browser |
| US20140380144A1 (en) * | 2011-05-15 | 2014-12-25 | Guanzhou Ucweb Computer Technology Co., Ltd | Method and apparatus for webpage reading based on mobile terminal |
| CN105468591A (en) * | 2014-08-01 | 2016-04-06 | 中兴通讯股份有限公司 | Content searching method, device and terminal |
| CN105843826A (en) * | 2015-05-25 | 2016-08-10 | 维沃移动通信有限公司 | Search method and device |
-
2018
- 2018-03-01 CN CN201810172191.8A patent/CN108416009A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140380144A1 (en) * | 2011-05-15 | 2014-12-25 | Guanzhou Ucweb Computer Technology Co., Ltd | Method and apparatus for webpage reading based on mobile terminal |
| CN102915318A (en) * | 2012-03-08 | 2013-02-06 | 北京金山安全软件有限公司 | Method and device for positioning and searching information in browser |
| CN105468591A (en) * | 2014-08-01 | 2016-04-06 | 中兴通讯股份有限公司 | Content searching method, device and terminal |
| CN105843826A (en) * | 2015-05-25 | 2016-08-10 | 维沃移动通信有限公司 | Search method and device |
Non-Patent Citations (1)
| Title |
|---|
| 黑马程序员: "《Android项目实战 博学谷》", 31 July 2017 * |
Cited By (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115238214A (en) * | 2019-03-18 | 2022-10-25 | 智慧芽信息科技(苏州)有限公司 | Display method, apparatus, computer equipment, storage medium and program product |
| CN112307265A (en) * | 2019-07-26 | 2021-02-02 | 珠海金山办公软件有限公司 | A method, system, storage medium and terminal for finding diagrams in a document |
| CN112527386B (en) * | 2019-09-18 | 2022-10-04 | 华为技术有限公司 | Application program issuing method and device |
| CN112527386A (en) * | 2019-09-18 | 2021-03-19 | 华为技术有限公司 | Application program issuing method and device |
| CN110597401A (en) * | 2019-09-20 | 2019-12-20 | 中国银行股份有限公司 | Mechanism information input method and system |
| CN110674491B (en) * | 2019-09-29 | 2022-02-01 | 上海淇玥信息技术有限公司 | Method and device for real-time evidence obtaining of android application and electronic equipment |
| CN110674491A (en) * | 2019-09-29 | 2020-01-10 | 上海淇玥信息技术有限公司 | Method and device for real-time evidence obtaining of android application and electronic equipment |
| CN111147354A (en) * | 2019-12-25 | 2020-05-12 | 广州华多网络科技有限公司 | Message processing method, device, equipment and storage medium |
| CN111400457A (en) * | 2020-04-15 | 2020-07-10 | Oppo广东移动通信有限公司 | A text query method, device and terminal device |
| CN111782895A (en) * | 2020-07-02 | 2020-10-16 | 北京字节跳动网络技术有限公司 | Retrieval processing method and device, readable medium and electronic equipment |
| CN111782895B (en) * | 2020-07-02 | 2024-03-19 | 北京字节跳动网络技术有限公司 | Retrieval processing method and device, readable medium and electronic equipment |
| CN114117182A (en) * | 2020-08-31 | 2022-03-01 | 腾讯科技(深圳)有限公司 | Network document processing method and device applied to mobile terminal and mobile terminal |
| CN116089572A (en) * | 2021-11-05 | 2023-05-09 | 北京小米移动软件有限公司 | Content display method, device, mobile terminal and computer readable storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108416009A (en) | Text retrieval method, device, storage medium and mobile terminal for mobile terminal | |
| CN108647052B (en) | Application preloading method, device, storage medium and terminal | |
| US10831314B2 (en) | Method and electronic device for preventing touch button from being false triggered | |
| RU2616536C2 (en) | Method, device and terminal device to display messages | |
| US9645730B2 (en) | Method and apparatus for providing user interface in portable terminal | |
| JP6051338B2 (en) | Page rollback control method, page rollback control device, terminal, program, and recording medium | |
| CN107491560B (en) | Page picture display method, device, storage medium, server and mobile terminal | |
| CN106708496B (en) | Processing method and device for label page in graphical interface | |
| US10884611B2 (en) | Method and apparatus for controlling touch screen of terminal, and terminal | |
| WO2019072201A1 (en) | Webpage content extraction method and terminal device | |
| US20150278164A1 (en) | Method and apparatus for constructing documents | |
| CN107678780B (en) | Memory management method and device, storage medium and terminal equipment | |
| CN107404576B (en) | Lock screen magazine browsing method, mobile terminal and computer-readable storage medium | |
| WO2017032089A1 (en) | Search method and terminal | |
| CN106293705A (en) | A kind of collecting method and mobile terminal | |
| CN107678823A (en) | Mobile terminal application control method, device and storage medium, and mobile terminal | |
| WO2014026510A1 (en) | Webpage content browsing method, device and browser | |
| WO2021179904A1 (en) | Labeled data processing method, device, and storage medium | |
| US20180024976A1 (en) | Annotation providing method and device | |
| CN106503179A (en) | A kind of loading method of Webpage and mobile terminal | |
| KR20160056827A (en) | Content Share Method and Content Share System | |
| CN106776821A (en) | A kind of album creating method and terminal | |
| WO2022242542A1 (en) | Application icon management method and electronic device | |
| US10140265B2 (en) | Apparatuses and methods for phone number processing | |
| CN107220377B (en) | Search method, electronic device, and computer storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
| CB02 | Change of applicant information | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180817 |
|
| RJ01 | Rejection of invention patent application after publication |