A human-computer interaction method, system, electronic device, and storage medium
By generating unique identifiers for electronic device controls, the problem of voice input response caused by missing control attribute information is solved, achieving accurate control matching and improved interactive experience, while avoiding the hassle of third-party adaptation.
Patent Information
- Application Number
- CN202311769187.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-12-20
AI Technical Summary
In existing technologies, electronic devices cannot correctly respond to user voice input when control attribute information is missing, and supplementing control attribute information requires a lot of manpower and effort.
By generating unique identifiers for each control, based on the control's attribute information or view layout information, and using generalized information to match the target control, third-party adaptation is avoided.
It enables accurate matching of target controls even when control attribute information is missing or duplicated, improving the interactive experience and saving the third-party adaptation process.
Smart Images

Figure CN117746859B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of human-computer interaction technology, and in particular to a human-computer interaction method, system, electronic device, and storage medium. Background Technology
[0002] Controlling electronic devices via voice commands has gradually become a common way for users to convey their intentions and control electronic devices. Visible-to-Speak (VUI) is a user interface technology that allows users to interact with electronic devices through voice, providing a more convenient, intelligent, and natural way to interact.
[0003] Currently, in the implementation of "what you see is what you can say," the controllable controls are typically determined from the user interface using the accessibility mode provided by the operating system of the electronic device, and then controlled based on the user's voice input. Since the accessibility mode determines the controllable controls based on their attribute information, it cannot identify a unique control if some control's attribute information is missing. This prevents it from correctly responding to the user's voice input and hinders effective control of the electronic device.
[0004] In addition, although it is possible to supplement the property information of a control by adding relevant descriptions through the corresponding application when the control's property information is missing, this requires third-party adaptation of the application and consumes a lot of manpower and effort. Summary of the Invention
[0005] This invention provides a human-computer interaction method, system, electronic device, and storage medium, aiming to effectively solve the above-mentioned technical problems.
[0006] According to a first aspect of the present invention, the present invention provides a human-computer interaction method, the method being applied to an electronic device, the method comprising:
[0007] During the operation of the human-computer interaction application in the electronic device, at least one first control on the current interface is obtained, and identification information corresponding to the at least one first control and generalization information corresponding to the identification information are obtained. The identification information is generated based on a first identifier or a second identifier. The first identifier is determined according to the attribute information of the first control, and the second identifier is determined according to the view layout information of the first control.
[0008] Obtain the user's voice commands;
[0009] The target generalization information is obtained by matching the generalization information from the voice command, and the target control is determined based on the identification information corresponding to the target generalization information;
[0010] In response to the voice command, control is performed on the target control.
[0011] Furthermore, the second identifier is determined based on the resource ID of the first control and the root element information, child element information, and position index information of the first control in the view layout information.
[0012] Furthermore, the first identifier includes one or more attribute information from the control's title information, description information, or resource ID.
[0013] Furthermore, the identification information is generated in the following manner:
[0014] Obtain the running interface of the application in different states and multiple first controls on the running interface;
[0015] In the event that the first identifiers of the plurality of first controls are duplicated or missing, the second identifier shall be used as the identifier information;
[0016] In the case where the first identifiers of the plurality of first controls are not duplicated or missing, the first identifier shall be used as the identifier information;
[0017] The identification information is stored in correspondence with the first control.
[0018] Furthermore, the first identifier being duplicated means that all the attribute information is repeated;
[0019] The step of using the first identifier as identifier information when the first identifiers of the plurality of first controls are not duplicated and are missing includes:
[0020] Based on the priority of the attribute information, determine whether the attribute information is repeated, and if the current attribute information is not repeated, use the current attribute information as the identification information.
[0021] Furthermore, after obtaining the application's running interface in different states and multiple first controls on the running interface, the method further includes:
[0022] Configure generalization information for the first control, and store the configured generalization information in correspondence with the identification information of the first control.
[0023] Further, the step of configuring generalization information for the first control includes:
[0024] Configure generalization information for the first control according to its type, wherein the type of the first control includes button type, text type, switch type, tab type, progress bar type, and scroll type.
[0025] Furthermore, after the step of configuring generalization information for the first control according to its type, the method further includes:
[0026] Configure feedback information and corresponding interaction information for the first control according to its type;
[0027] After the step of controlling the target control in response to the voice command, the method further includes:
[0028] Obtain feedback information and corresponding interaction information from the target control, and respond to the voice command with the corresponding interaction information.
[0029] Further, when the target control is of type scrolling, the step of performing control over the target control includes:
[0030] The first sliding distance of the target control is determined by multiplying the display height of the target control by a preset sliding percentage, and the sliding of the target control is controlled according to the first sliding distance.
[0031] Furthermore, when the target control is of type progress bar, the step of controlling the target control includes:
[0032] The second sliding distance is calculated based on the maximum progress, minimum progress, and preset sliding percentage of the target control, and the sliding of the target control is controlled based on the second sliding distance.
[0033] Further, the step of obtaining at least one first control on the current interface includes:
[0034] Scan the current interface through the focus window to obtain all control information of the current interface;
[0035] After the target control performs an operation, the incremental control information corresponding to the target control is obtained by scanning the current interface through the focus window.
[0036] Further, the step of responding to the voice command and executing control over the target control includes:
[0037] When the target control is listening for a click event, in response to the voice command, the target control is clicked via a click event.
[0038] When the target control is not listening for click events, the target control is touched via a touch event.
[0039] Furthermore, the method also includes:
[0040] During the operation of the human-computer interaction application in the first electronic device or the second electronic device, the human-computer interaction application obtains at least one first control, corresponding identification information and generalization information on the current interface of the first electronic device, and obtains at least one first control, corresponding identification information and generalization information on the current interface of the second electronic device, and the first electronic device and the second electronic device are in a communicative connection.
[0041] The step of matching target generalized information from the generalized information according to the voice command, and determining the target control based on the identification information corresponding to the target generalized information, includes:
[0042] The human-computer interaction application determines the target generalization information from the generalization information of the first electronic device and the generalization information of the second electronic device according to the voice command, and determines the target electronic device and the target control based on the identification information corresponding to the target generalization information.
[0043] The step of responding to the voice command and executing control over the target control includes:
[0044] In response to the voice command, control of the target control is performed on the target electronic device.
[0045] Furthermore, the method also includes:
[0046] The software development kit is used to obtain at least one second control on the current interface, the identity information of the second control, and generalization information.
[0047] The step of matching target generalized information from the generalized information according to the voice command, and determining the target control based on the identification information corresponding to the target generalized information, includes:
[0048] The target generalization information is obtained by matching the generalization information corresponding to the first control and the generalization information corresponding to the second control according to the voice command, and the target control is determined based on the target generalization information, identity information and identification information.
[0049] Furthermore, the step of scanning the current interface through the focus window includes:
[0050] Determine the focus window from multiple applications on the electronic device and obtain the control information of the first control on the focus window.
[0051] Secondly, the present invention also provides a human-computer interaction system, wherein the electronic device includes the human-computer interaction system, the system comprising:
[0052] The control information acquisition module is used to acquire at least one first control on the current interface during the operation of the human-computer interaction application in the electronic device, and to acquire the identification information corresponding to the at least one first control and the generalization information corresponding to the identification information. The identification information is generated based on a first identifier or a second identifier. The first identifier is determined according to the attribute information of the first control, and the second identifier is determined according to the view layout information of the first control.
[0053] The voice command acquisition module is used to acquire the user's voice commands;
[0054] The control matching module is used to match target generalized information from the generalized information according to the voice command, and determine the target control based on the identification information corresponding to the target generalized information;
[0055] The control execution module is used to control the target control in response to the voice command.
[0056] Thirdly, the present invention also provides an electronic device, comprising:
[0057] One or more processors;
[0058] One or more memory units;
[0059] A module with multiple applications installed;
[0060] The memory stores one or more applications, which, when executed by the processor, cause the electronic device to perform the steps of the human-computer interaction method described above.
[0061] Fourthly, the present invention also provides a storage medium storing a plurality of instructions adapted for loading by a processor to perform the steps of the human-computer interaction method described above.
[0062] Through one or more embodiments of the above embodiments of the present invention, at least the following technical effects can be achieved: Target generalized information is obtained by matching the generalized information according to the voice command; a target control is determined based on the identification information corresponding to the target generalized information. Each first control has unique identification information. Even if the attribute information of the first control is missing or duplicated, the target control can still be matched using the identification information, improving the accuracy of control matching and the interactive experience. Furthermore, since the identification information is generated based on the original attribute information or view layout information of the first control, no third-party adaptation is required. This ensures that all native controls can be correctly matched while saving the third-party adaptation process. Attached Figure Description
[0063] The technical solution and other beneficial effects of the present invention will become apparent from the following detailed description of specific embodiments of the invention, in conjunction with the accompanying drawings.
[0064] Figure 1 This is one of the flowcharts of the human-computer interaction method provided in the embodiments of the present invention;
[0065] Figure 2 This is a schematic diagram illustrating the process of generating identification information provided in an embodiment of the present invention;
[0066] Figure 3 A schematic diagram of the interface for configuring generalized information provided in an embodiment of the present invention;
[0067] Figure 4 This is a schematic diagram of generalized information provided in an embodiment of the present invention;
[0068] Figure 5 This is a second flowchart of the human-computer interaction method provided in the embodiments of the present invention;
[0069] Figure 6 This is a schematic diagram of the current interface provided in an embodiment of the present invention;
[0070] Figure 7 This is a schematic diagram of cross-device interaction provided in an embodiment of the present invention;
[0071] Figure 8 This is a schematic diagram illustrating the acquisition of control information provided in an embodiment of the present invention;
[0072] Figure 9 This is a schematic diagram illustrating the implementation of the "what is visible is what is spoken" service provided in an embodiment of the present invention;
[0073] Figure 10 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0074] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0075] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, the character " / " in this document, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0076] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0077] In existing technologies, the accessibility mode provided by the operating system matches native controls by first matching the generalized information of the control based on the voice command, and then determining the target control based on the attribute information (such as title, description, etc.) corresponding to the matched generalized information (generalized information - attribute information - corresponding native control storage). However, in most cases, when the attribute information of the native control is missing (such as icon-type native controls), it is impossible to determine the native control corresponding to the generalized information, and thus, a response cannot be achieved.
[0078] While it's possible to supplement the native control's attribute information by adding descriptions on the application side, this requires third-party adaptation of the application. An application often involves a large number of controls, and if a third party were to adapt each native control with missing or duplicate attribute information, it would require a lot of time and effort.
[0079] In the human-computer interaction method provided by the present invention, each native control (i.e., the first control) carries identification information, and the identification information is generated based on the original attribute information or view layout information of the native control. It does not require third-party adaptation, thereby ensuring that all native controls can be correctly matched while saving the third-party adaptation process.
[0080] The following description, in conjunction with the accompanying drawings, introduces a human-computer interaction method, system, electronic device, and storage medium provided by the present invention.
[0081] Figure 1 One of the flowcharts for the human-computer interaction method provided in the embodiments of the present invention is as follows: Figure 1 As shown, a human-computer interaction method includes the following steps:
[0082] S101, during the operation of the human-computer interaction application in the electronic device, at least one first control on the current interface is obtained, and the identification information corresponding to the at least one first control and the generalization information corresponding to the identification information are obtained.
[0083] The first control is a native control under the operating system of the electronic device (such as a button, a text box, a text view, an image view, etc.). In this embodiment, the operating system is the Android operating system (the following examples also use the Android operating system). In other embodiments, it can also be the HarmonyOS system or the iOS system. This invention does not limit it.
[0084] The identification information is generated based on a first identifier or a second identifier. The first identifier is determined according to the attribute information of the first control, and the second identifier is determined according to the view layout information of the first control. Each first control has unique identification information.
[0085] Generalized information refers to the operation text related to the first control corresponding to the user's voice command. For example, for a first control such as a button, generalized information can be point, click, selection, etc.
[0086] More specifically, the first identifier can be any of the following attributes used to describe and identify the first control: title, description, resource ID, text, visibility, enabled status, background, etc. A first control can correspond to multiple first identifiers.
[0087] The second identifier is determined based on the resource ID of the first control and the root element information, child element information and position index information of the first control in the view layout information.
[0088] The view layout information describes the hierarchical relationship and position of each view. It typically includes the root element, child elements, attributes, layout manager, resource references (applying the value of a resource to certain attributes in the layout via a resource ID), and position index.
[0089] Common root elements include LinearLayout, RelativeLayout, ConstraintLayout, and FrameLayout.
[0090] The root element can contain multiple child elements, such as TextView, ImageView, and Button, which represent different control types. These child elements can be nested within each other, forming a hierarchical layout structure.
[0091] The position index is the position index of the control in the layout hierarchy.
[0092] like Figure 2 As shown, the resource ID of the first control, along with its root element information, child element information, and position index information from the view layout information, are concatenated into a string. The concatenated string is then converted to MD5 format to obtain the final second identifier. Figure 2 Taking the view layout information in the middle as an example, in Figure 2 In the example where the root element information is FrameLayout, Figure 2 The root element FrameLayout@id:root is the outermost view of FrameLayout. Its child elements include FrameLayout@id:group and ImageView@id:image. ImageView@id:image is the identifier of the first control, the image view. The identifier (i.e., the second identifier StaticID) of the first control, the image view, is obtained by concatenating the root element information FrameLayout@id:root with the child element ImageView@id:image.
[0093] `FrameLayout@id:group` refers to a direct child view within a `FrameLayout`, which includes two child elements. These two child elements are the first control—a button. When there are two or more first controls of the same type within the same level of child elements, a position index needs to be introduced on top of the root element and child elements to ensure the uniqueness of the first control's identifier. Specifically, the second identifier for the button is `FrameLayout:root$FrameLayout:group$Button:1`, where the number 1 is the button's position index.
[0094] S102, Obtain the user's voice commands.
[0095] In this step, the user's voice input is recorded and received, and then converted into text to form voice commands. It should be noted that these voice commands correspond to the content displayed on the current interface, implementing a "what you see is what you can say" approach.
[0096] S103, according to the voice command, the target generalization information is obtained by matching from the generalization information, and the target control is determined based on the identification information corresponding to the target generalization information.
[0097] In this step, the text-based voice commands are classified to identify the user's intent or purpose, which can be achieved based on machine learning algorithms. After obtaining the intent, it is matched with the generalization information of all first controls in the current interface to determine the target generalization information. Then, based on the previously stored first control—identification information—generalization information, the identification information is used to determine which control in the current interface needs to be controlled. The generalization information includes the control's related operational behaviors, common actions described when the control is mentioned in the voice command, etc.
[0098] To illustrate, if the voice command is to open music, the corresponding intent is to click on the music application. The generalized information of clicking on music is obtained by matching, and the identification information is determined based on the generalized information, thereby determining the control of the music application.
[0099] S104, in response to the voice command, execute control of the target control.
[0100] In this step, the target control is operated according to the intent of the voice command. For example, if the voice command is to play a song, a play button is matched in the current interface, and control is achieved by clicking the play button.
[0101] It should be noted that the human-computer interaction method provided by this invention can be applied in scenarios including a single electronic device, or in scenarios including at least two electronic devices. The electronic devices can be mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality / virtual reality devices, and other electronic devices.
[0102] The human-computer interaction method provided in this invention matches target generalized information from the generalized information according to the voice command, and determines the target control based on the identification information corresponding to the target generalized information. Each first control has unique identification information. Even if the attribute information of the first control is missing or duplicated, the target control can still be matched using the identification information, improving the accuracy of control matching and the interactive experience. Furthermore, since the identification information is generated based on the original attribute information or view layout information of the first control, no third-party adaptation is required. This ensures that all native controls can be correctly matched while saving the third-party adaptation process.
[0103] Before the human-computer interaction application runs on the electronic device, the first control-identification information-generalization information is pre-configured and stored. In some embodiments of the present invention, the human-computer interaction method further includes a specific configuration process:
[0104] S201, Obtain the running interface of the application on the electronic device in different states and multiple first controls on each running interface.
[0105] Different applications have multiple running interfaces, and each running interface has multiple corresponding first controls. An application refers to an application that can be controlled through human-computer interaction (i.e., a voice assistant), such as a music player, navigation system, or video player. This section retrieves all the first controls for each application. The first controls are stored independently for each application; that is, one application corresponds to one first control information storage file.
[0106] S202, generate a second identifier based on the resource ID of the first control, the root element information, child element information, and position index information of the first control in the view layout information, and obtain all the first identifiers of the first control. Each first control will have one second identifier, and there will be no duplicate or missing second identifiers.
[0107] In this embodiment, the first identifier of the first control includes a title, a description, and a resource ID.
[0108] S203, if the first identifier is duplicated or missing, the second identifier is used as the identifier information; if the first identifier is not duplicated and not missing, the first identifier is used as the identifier information, and the identifier information determined above is stored in correspondence with the first control.
[0109] The duplication of the first identifier here refers to a situation where the title, description, and resource ID of a certain first control in the current application are all the same as the titles, descriptions, or resource IDs of all other first controls. In this case, the uniqueness of the first identifier cannot be guaranteed, making it impossible for the first control to be accurately matched.
[0110] The first identifier is missing when a first control lacks a title, description, and resource ID. In this case, the first control is in a state where it cannot be matched.
[0111] Therefore, in both of the above cases, using the second identifier as the identifier information ensures the uniqueness of the identifier information of the first control.
[0112] When the first identifier is not repeated and not missing, it is necessary to determine whether the attribute information is repeated according to the priority of the attribute information. If the current attribute information is not repeated, the current attribute information is used as the identifier information. If the current attribute information is repeated, the next attribute information is judged to be repeated according to the priority.
[0113] Schematic illustration: First, the titles of the first control are compared. If no titles are duplicated, the title is used as the identifier of the first control. If titles are duplicated, the resource ID is further checked for duplication. If resource IDs are unique, they are used as identifiers. If resource IDs are duplicated, the description is checked for duplication. If descriptions are unique, they are used as identifiers. If descriptions are duplicated, the second identifier is used as identifiers. In embodiments of the present invention, the identifier of the first control can also be determined by prioritizing other attribute information to determine duplication.
[0114] It should be noted that the process of repeatedly determining the first identifier of the first control mentioned above involves repeated judgment among all first controls in the current application, not a mixed judgment among the first controls of all applications in the operating system. Repeated judgment of the first identifier on an application-by-application basis improves the efficiency of identifier information generation while still ensuring the uniqueness of the identifier information.
[0115] S204 After obtaining the unique identifier information of the first control, the generalization information of the first control is configured. The generalization information is stored in correspondence with the identifier information, thereby forming the storage information corresponding to the first control, identifier information and generalization information, which is used to complete the matching of the target control in the human-computer interaction process.
[0116] Specifically, such as Figure 3 As shown, the generalized information configuration process includes a runtime interface area and a configuration information area.
[0117] The configuration information area includes page information, control information, and generalization information. Page information includes the application corresponding to the running interface, the application version, and the name of the running interface, among other things. Control information refers to the information of the selected control to be configured in the running interface, including the control's identifier, ID, and bounding box information (which describes the control's position and size), etc. Generalization information is the content matched after determining the control to be configured based on the page and control information, specifically including the generalization name, generalization action, and interaction information (i.e., the text replied to the user), etc.
[0118] For example, if the control to be configured is an account (the identification information of the control is the title), the corresponding generic name can be "My Account", the generic action can be "Switch", "Open", "Login", etc., and the interaction information can be "OK", "Login", etc.
[0119] In addition, to help administrators clearly identify which controls need configuration on the runtime interface, controls requiring configuration are highlighted based on their bounding box information (e.g., by displaying the control's bounding box in a highlighted manner). Selecting a control to be configured also changes its style (e.g., changing its bounding box from color A to color B) to clearly indicate which control in the runtime interface is being configured. These methods improve the efficiency of generalized information configuration.
[0120] By obtaining the storage information corresponding to the first control-identification information-generalization information of each application through the above S201-S204, in the formal human-computer interaction process, the current first control is first scanned in the focus window and the corresponding identification information and generalization information are filtered from the storage information. For example, if application C has n pieces of storage information corresponding to the first control-identification information-generalization information, the identification information and generalization information corresponding to m (m < n) first controls on the current interface are filtered from the n pieces.
[0121] Subsequently, the target control is obtained by matching the filtered identifier information and generalized information according to the voice command.
[0122] In addition, during the above-mentioned generalization information configuration process, generalization information is also configured for the first control according to its type (which is displayed in the control information). The types of the first control include button, text, switch, tab, progress bar, and scroll types, encompassing all native control types. Each control type corresponds to commonly used basic operations, generalized names, etc., thereby improving the efficiency of generalization information configuration.
[0123] Furthermore, feedback information and corresponding interaction information are configured for the first control according to its type.
[0124] Different control types correspond to different feedback information and corresponding interaction information. After controlling the target control in response to the voice command, the operating system obtains the feedback information of the target control and determines the relevant interaction information based on the feedback information. This interaction information is then broadcast verbally to complete the response. (Illustratively, as shown...) Figure 4 As shown, if the target control is a switch, after the operation is performed, the Checked state of the control is used to determine whether the switch is complete. If the switch is complete, interactive information such as "switched" or "switched successfully" is returned; if the switch is not complete, interactive information such as "switched failed" is returned. This allows the user to clearly understand the result after the voice command and improves the interactive experience.
[0125] If the configuration is not based on the control type, it will usually reply with uniform interactive information such as "success" or "completed", which will not allow the user to determine whether the desired control control has been completed.
[0126] In some embodiments of the present invention, when the target control is of type scrolling, the step of performing control over the target control includes:
[0127] The first sliding distance of the target control is determined by multiplying the display height of the target control by a preset sliding percentage, and the sliding of the target control is controlled according to the first sliding distance.
[0128] In other words, the display height of the control is first calculated based on its bounding box information, and then multiplied by a set sliding percentage to obtain the first sliding distance. Then, the control is slid along this first sliding distance using `smoothScrollBy`. The sliding percentage can be 20%, 50%, 80%...100%, or even more precise values like 1%, 2%...100%. Based on voice commands, the sliding percentage relevant to the user's intent is determined from various options, and the sliding distance is calculated based on this determined percentage.
[0129] When the target control is of type progress bar, the step of controlling the target control includes:
[0130] The second sliding distance is calculated based on the maximum progress, minimum progress, and preset sliding percentage of the target control, and the sliding of the target control is controlled based on the second sliding distance.
[0131] To illustrate, if the target control of the progress bar type is a Seekbar, the required progress (i.e., the second sliding distance) is calculated by using the maximum progress, minimum progress, and a specified sliding percentage, and then setProgressInternal is used to adjust the progress of the Seekbar.
[0132] Compared to the existing 100% swipe percentage, the above swipe method is more flexible, providing users with more interaction options and improving the interactive experience.
[0133] The present invention also provides an embodiment, such as Figure 5 As shown, a human-computer interaction method specifically includes the following steps:
[0134] S301 refers to the power-on startup of electronic devices, which is also the power-on startup of the operating system.
[0135] S302, the voice assistant (i.e., human-computer interaction application) and other applications in the operating system are all started and bound to the "see and speak" service.
[0136] S303: The voice assistant obtains the user's voice command for the first time and opens the "Speak When You See" service.
[0137] S304 notifies each application that "Visible and Talkable" is enabled through the "Visible and Talkable" service, and each application registers a window with the "Visible and Talkable" service and sends information about whether it is the focus window to the "Visible and Talkable" service.
[0138] S305, the "See and Speak" service identifies the target application corresponding to the focused window and collects the interface information of that target application. This interface information includes all control information on the current interface of the electronic device, i.e., full control information. Simultaneously, the "See and Speak" service also sends this full control information to the voice assistant.
[0139] S306: The voice assistant matches the first control based on the full set of control information and the voice command to obtain the target control, generates an execution command for the target control and sends it to the Visible and Speakable service, which then forwards it to the corresponding target application.
[0140] S307: After the target control on the target application completes execution according to the execution instruction, the target application scans the view of the current interface through the focus window to obtain the control information after the target control's execution as incremental control information. The target application sends the incremental control information to the "Visible and Speakable" service, which then sends the incremental control information to the voice assistant. The voice assistant processes the received incremental control information, obtains voice feedback information, and provides the voice feedback information to the user.
[0141] S308: After the voice assistant receives a new voice command, repeat S304-S307.
[0142] S309: After the voice assistant receives the voice command indicating the end of the dialogue, the voice assistant closes the "Visible and Speakable" service. The "Visible and Speakable" service notifies each application that the "Visible and Speakable" service is closed. Each application sends a callback to the "Visible and Speakable" service's logout window to initialize its status information.
[0143] The human-computer interaction method provided in this embodiment starts the Visible and Speakable service when the electronic device is powered on. Subsequently, when the voice assistant and other applications start, they establish a binding with the Visible and Speakable service. When the user wakes up the voice assistant, the Visible and Speakable function is turned on. The Visible and Speakable service actively notifies the focus window to scan the view to obtain control information and sends it to the voice assistant in full. Subsequently, when the state of the target control in the focus window changes (switching, page scrolling, button clicks, etc.), the focus window automatically collects the target control information and sends it to the Visible and Speakable service in incremental form. The Visible and Speakable service processes the data and then sends it to the voice assistant in incremental form. The Visible and Speakable function is turned off when the dialogue between the voice assistant and the user ends. Incremental processing improves response speed and reduces communication overhead, while a dynamic switch ensures that the Visible and Speakable function only runs during user interaction, enabling the service to be activated on demand.
[0144] In some embodiments of the present invention, the control of the target control according to the voice command will differ depending on whether the target control is listening for click events. Specifically, when the target control is listening for click events, the target control is clicked in response to the voice command via a click event; when the target control is not listening for click events, the target control is touched via a touch event.
[0145] Indicatively, with Figure 6 Taking the current interface as an example, there are six primary controls: Button 1, Button 2, Image 1, Image 2, Image 3, and Text 1. Image 1, Image 2, and Image 3 have click listeners set. When Image 1, Image 2, or Image 3 is the target control, a simulated click can be achieved directly using the `performClick()` method in the Android View class. Button 1, Button 2, and Text 1 do not have click listeners set, so a touch is simulated using `MotionEvent`. For example, for Text 1, `MotionEvent` can simulate a touch on the view area where Text 1 is located (within...). Figure 6 The middle section (i.e., the media card) is used to simulate a click on the view area. Within this view area, a click event listener is set for image 1, and text 1 is a text description of image 1. The view area also includes other first controls that listen for click events, and these first controls have a corresponding relationship with the target control. For example, the target control might be a text description or image indicator for one of the other first controls listening for click events.
[0146] The simulated clicks described above can improve the hit rate of the target control and increase the execution accuracy of the target control.
[0147] In other embodiments of the present invention, the human-computer interaction method also supports cross-device interaction, as illustrated in the following diagram: Figure 7 As shown, the specific cross-device human-computer interaction method includes: firstly establishing a direct communication connection between the first electronic device and the second electronic device.
[0148] Furthermore, during the operation of the human-computer interaction application (i.e., voice assistant) in the first or second electronic device, the human-computer interaction application obtains at least one first control, corresponding identification information, and generalization information on the current interface of the first electronic device, and obtains at least one first control, corresponding identification information, and generalization information on the current interface of the second electronic device.
[0149] In other words, the human-computer interaction application obtains all first controls, their corresponding identification information and generalization information in the current interface of the first electronic device through the "what you see is what you can say" service in the first electronic device, and obtains all first controls, their corresponding identification information and generalization information in the current interface of the second electronic device through the "what you see is what you can say" service in the second electronic device.
[0150] Accordingly, the step of matching target generalized information from the generalized information according to the voice command, and determining the target control based on the identification information corresponding to the target generalized information, includes:
[0151] The human-computer interaction application determines the target generalization information from the generalization information of the first electronic device and the generalization information of the second electronic device based on the voice command, and determines the target electronic device and the target control based on the identification information corresponding to the target generalization information.
[0152] The step of responding to the voice command and executing control over the target control includes:
[0153] In response to the voice command, control of the target control is performed on the target electronic device.
[0154] It should be noted that the first electronic device and the second electronic device can be the same type of electronic device or different types of electronic devices. For example, the first electronic device may be an electronic device in an autonomous vehicle (specifically, it may be an electronic device that interacts with the vehicle's infotainment system), and the second electronic device may be a smartphone; or the first electronic device may be a wearable device, and the second electronic device may be a smartphone, and so on, in different combinations.
[0155] In other embodiments of the present invention, the human-computer interaction method is based on, for example... Figure 9 The structural diagram shown is implemented by, as... Figure 9The structure shown allows for the determination of the focus window from multiple applications on an electronic device and the acquisition of control information for the first control on the focus window.
[0156] Specifically, human-computer interaction applications (i.e., voice assistants) obtain the user's voice input commands and notify the user that the "visible and speakable" service function is enabled.
[0157] Once the Visible and Speak service is started, it retrieves the window or view that receives user input events scanned by the focused window of the LayerService in the Android system. The Visible and Speak service determines the focused window from various windows in multiple applications. After obtaining the focused window, the corresponding VuiWindowCallback (i.e., window callback, each window in each application has a corresponding VuiWindowCallback) communicates with the Visible and Speak service.
[0158] Then, obtain the control information (including each View element) of each first control on the focus window. Specifically, this can be done by collecting the View elements in the current window through VuiWindowController. Here, VuiWindowController is a newly injected module in ViewRootImpl (responsible for managing view drawing, event handling, and communication with the window system), and each window has a VuiWindowController.
[0159] After obtaining control information from the visible-speakable service, the human-computer interaction application filters the identification information and generalized information of the current interface from the storage table of first control-identification information-generalization information, and then matches the target control from it according to the voice command.
[0160] After the target control is determined, the human-computer interaction application sends operation instructions for the target space to the visible-and-speak service. The visible-and-speak service performs control operations on the target control through VuiWindowController, and after the execution is completed, sends feedback information and text information to the human-computer interaction application to complete the response to the user.
[0161] In addition, after each application starts, it establishes communication with the Visible and Speakable service through VuiConectionManager. It also uses VuiConectionManager to listen for the startup and shutdown of the Visible and Speakable service. When starting, it registers each VuiWindowCallback to the Visible and Speakable service, and when shutting down, it unregisters each VuiWindowCallback.
[0162] It should be noted that the above Figure 9The human-computer interaction is based on various classes in the Android system. In other embodiments, the human-computer interaction can also be based on other operating systems, and this invention does not limit it.
[0163] In addition, the aforementioned "see and speak" service can also communicate and connect with other electronic devices to enable cross-device human-computer interaction.
[0164] The human-computer interaction method provided in this embodiment, under the Android system, ensures that the Visible and Speakable service can dynamically obtain view control information during runtime by injecting the VuiWindowController module into ViewRootImpl, and at the same time parse the field information of the accessibility service itself. This is compatible with Android's accessibility mode (accessibility service), and the information of each control is encapsulated into ViewProperty (a class used to represent view properties), filtering out some ViewProperty that cannot be operated, and then uniformly sending it to the Visible and Speakable service.
[0165] In other embodiments of the present invention, the current interface also includes a second control (i.e., a cross-platform control or a non-native control not in the current operating system), such as... Figure 8 As shown, the target control is matched to the second control in the following way:
[0166] The system obtains at least one secondary control on the current interface, the identity information of the secondary control, and generalization information through a pre-defined software development kit (SDK).
[0167] In other words, the SDK provided by "Visible and Speakable" is used to obtain the current interface information, including the second control on the current interface, its corresponding identity information, and generalization information. The SDK then sends the second control, its corresponding identity information, and generalization information to the "Visible and Speakable" service and the human-computer interaction application for processing to match and obtain the target control. The second control, its identity information, and generalization information are stored accordingly.
[0168] It should be noted that the identity information of the second control differs from that of the first control. The first control's identity information is determined directly based on its attribute and view layout information, and it can be generated without relying on a third party. However, the second control's identity information requires the application to fill in and upload it, adding an adaptation process. It cannot be generated directly and is not based on the second control's attribute and view layout information.
[0169] The step of matching target generalized information from the generalized information according to the voice command, and determining the target control based on the identification information corresponding to the target generalized information, includes:
[0170] The target generalization information is obtained by matching the generalization information corresponding to the first control and the generalization information corresponding to the second control according to the voice command, and the target control is determined based on the target generalization information, identity information and identification information.
[0171] In other words, after obtaining the identification information, generalization information, and identity information and generalization information of the first control, the visible-speakable service determines the target generalization information based on the voice command, and then determines the target control based on the correspondence between generalization information-identification information-first control or generalization information-identity information-second control.
[0172] Based on any of the above embodiments, another embodiment of the present invention provides a human-computer interaction system, which is included in an electronic device, the human-computer interaction system comprising:
[0173] The control information acquisition module is used to acquire at least one first control on the current interface during the operation of the human-computer interaction application in the electronic device, and to acquire the identification information corresponding to the at least one first control and the generalization information corresponding to the identification information.
[0174] The identification information is generated based on a first identifier or a second identifier. The first identifier is determined according to the attribute information of the first control, and the second identifier is determined according to the view layout information of the first control.
[0175] The voice command acquisition module is used to acquire the user's voice commands.
[0176] The control matching module is used to match target generalized information from the generalized information according to the voice command, and to determine the target control based on the identification information corresponding to the target generalized information.
[0177] The control execution module is used to control the target control in response to the voice command.
[0178] The human-computer interaction system corresponds to the human-computer interaction method mentioned above, and will not be elaborated further here.
[0179] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include: a processor 1010, a communication interface 1020, a memory 1030, and a communication bus 1040. The processor 1010, communication interface 1020, and memory 1030 communicate with each other via the communication bus 1040. The processor 1010 can call logical instructions in the memory 1030 to execute the human-computer interaction method.
[0180] Furthermore, the logical instructions in the aforementioned memory 1030 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0181] On the other hand, this application also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer is able to execute the human-computer interaction methods provided by the above methods.
[0182] In another aspect, this application also provides a storage medium on which a computer program is stored, which, when executed by a processor, is implemented to perform the aforementioned human-computer interaction methods.
[0183] The present application provides an electronic device, a computer program product, and a storage medium, wherein the computer program stored thereon enables the processor to implement all the method steps implemented in the above method embodiments and achieve the same technical effect. Here, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail.
[0184] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0185] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0186] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A human-computer interaction method, characterized in that, The method is applied to an electronic device, and the method includes: During the operation of the human-computer interaction application in the electronic device, at least one first control on the current interface is obtained, and the identification information corresponding to the at least one first control and the generalization information corresponding to the identification information are obtained. The identification information is generated based on a first identifier or a second identifier. The first identifier is determined according to the attribute information of the first control, and the second identifier is determined according to the view layout information of the first control. The generalization information refers to text information related to the operation of the control, which is used to match the user's voice commands. The identification information is generated in the following manner: obtaining the running interface of the application in different states and multiple first controls on the running interface; if the first identifiers of the multiple first controls are duplicated or missing, the second identifier is used as the identification information; if the first identifiers of the multiple first controls are not duplicated and are not missing, the first identifier is used as the identification information; and the identification information is stored in correspondence with the first control. Obtain the user's voice commands; The target generalization information is obtained by matching the generalization information from the voice command, and the target control is determined based on the identification information corresponding to the target generalization information; In response to the voice command, control of the target control is performed.
2. The human-computer interaction method as described in claim 1, characterized in that, The second identifier is determined based on the resource ID of the first control and the root element information, child element information and position index information of the first control in the view layout information.
3. The human-computer interaction method as described in claim 1, characterized in that, The first identifier includes one or more attribute information from the control's title information, description information, or resource ID.
4. The human-computer interaction method as described in claim 1, characterized in that, The first identifier being duplicated means that all the attribute information is repeated; The step of using the first identifier as identifier information when the first identifiers of the plurality of first controls are neither duplicated nor missing includes: Based on the priority of the attribute information, determine whether the attribute information is repeated, and if the current attribute information is not repeated, use the current attribute information as the identification information.
5. The human-computer interaction method as described in claim 1, characterized in that, After obtaining the application's running interface in different states and multiple first controls on the running interface, the method further includes: Configure generalization information for the first control, and store the configured generalization information in correspondence with the identification information of the first control.
6. The human-computer interaction method as described in claim 5, characterized in that, The step of configuring generalization information for the first control includes: Configure generalization information for the first control according to its type, wherein the type of the first control includes button type, text type, switch type, tab type, progress bar type, and scroll type.
7. The human-computer interaction method as described in claim 6, characterized in that, After the step of configuring generalization information for the first control according to its type, the method further includes: Configure feedback information and corresponding interaction information for the first control according to its type; After the step of controlling the target control in response to the voice command, the method further includes: Obtain feedback information and corresponding interaction information from the target control, and respond to the voice command with the corresponding interaction information.
8. The human-computer interaction method as described in claim 6, characterized in that, When the target control is of type scrolling, the step of controlling the target control includes: The first sliding distance of the target control is determined by multiplying the display height of the target control by a preset sliding percentage, and the sliding of the target control is controlled according to the first sliding distance.
9. The human-computer interaction method as described in claim 6, characterized in that, When the target control is of type progress bar, the step of controlling the target control includes: The second sliding distance is calculated based on the maximum progress, minimum progress, and preset sliding percentage of the target control, and the sliding of the target control is controlled based on the second sliding distance.
10. The human-computer interaction method as described in claim 1, characterized in that, The step of obtaining at least one first control on the current interface includes: Scan the current interface through the focus window to obtain all control information of the current interface; After the target control performs an operation, the incremental control information corresponding to the target control is obtained by scanning the current interface through the focus window.
11. The human-computer interaction method as described in claim 1, characterized in that, The step of responding to the voice command and executing control over the target control includes: When the target control is listening for a click event, in response to the voice command, the target control is clicked via a click event. When the target control is not listening for click events, the target control is touched via a touch event.
12. The human-computer interaction method as described in claim 1, characterized in that, The method further includes: During the operation of the human-computer interaction application in the first electronic device or the second electronic device, the human-computer interaction application obtains at least one first control, corresponding identification information and generalization information on the current interface of the first electronic device, and obtains at least one first control, corresponding identification information and generalization information on the current interface of the second electronic device, and the first electronic device and the second electronic device are in a communicative connection. The step of matching target generalized information from the generalized information according to the voice command, and determining the target control based on the identification information corresponding to the target generalized information, includes: The human-computer interaction application determines the target generalization information from the generalization information of the first electronic device and the generalization information of the second electronic device according to the voice command, and determines the target electronic device and the target control based on the identification information corresponding to the target generalization information. The step of responding to the voice command and executing control over the target control includes: In response to the voice command, control of the target control is performed on the target electronic device.
13. The human-computer interaction method as described in claim 1, characterized in that, The method also includes: The software development kit is used to obtain at least one second control on the current interface, the identity information of the second control, and generalization information. The step of matching target generalized information from the generalized information according to the voice command, and determining the target control based on the identification information corresponding to the target generalized information, includes: The target generalization information is obtained by matching the generalization information corresponding to the first control and the generalization information corresponding to the second control according to the voice command, and the target control is determined based on the target generalization information, identity information and identification information.
14. The human-computer interaction method as described in claim 10, characterized in that, The step of scanning the current interface through the focus window includes: Determine the focus window from multiple applications on the electronic device and obtain the control information of the first control on the focus window.
15. A human-computer interaction system, characterized in that, The electronic device includes the human-computer interaction system, the system comprising: A control information acquisition module is used to acquire at least one first control on the current interface during the operation of a human-computer interaction application in the electronic device, and to acquire identification information corresponding to the at least one first control and generalized information corresponding to the identification information. The identification information is generated based on a first identifier or a second identifier. The first identifier is determined according to the attribute information of the first control, and the second identifier is determined according to the view layout information of the first control. The generalized information refers to text information related to control operation, used for matching with the user's voice commands. The identification information is generated in the following manner: acquiring the running interface of the application in different states and multiple first controls on the running interface; if the first identifiers of the multiple first controls are duplicated or missing, using the second identifier as the identification information; if the first identifiers of the multiple first controls are not duplicated and are not missing, using the first identifier as the identification information; and storing the identification information corresponding to the first control. The voice command acquisition module is used to acquire the user's voice commands; The control matching module is used to match target generalized information from the generalized information according to the voice command, and to determine the target control based on the identification information corresponding to the target generalized information; The control execution module is used to control the target control in response to the voice command.
16. An electronic device, characterized in that, include: One or more processors; One or more memory units; A module with multiple applications installed; The memory stores one or more applications, which, when executed by the processor, cause the electronic device to perform the steps of the human-computer interaction method as described in any one of claims 1 to 14.
17. A storage medium, characterized in that, The storage medium stores a plurality of instructions adapted for loading by a processor to perform the steps of the human-computer interaction method as described in any one of claims 1 to 14.
Citation Information
Patent Citations
Method and device for controlling intelligent terminal in analog mode and intelligent terminal
CN110795175A
Method and device for controlling application through voice, electronic equipment and storage medium
CN112286485A
Display equipment, server and voice-based display control method
CN112885354A
