Terminal equipment control method and device, equipment and storage medium
By responding to the focus switching operation in the terminal device, determining the focus direction and obtaining the focus strategy, the focus switching problems in the prior art are solved and the "wall collision" problems are realized, and effective focus switching for any control is achieved.
Patent Information
- Application Number
- CN202311404910.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, when a user uses a remote control to control the terminal device, it is difficult for the user to effectively switch the focus to nested controls or invisible controls, and there is a "wall-bumping" situation, so the focus cannot be continued to move.
By responding to the focus switching operation, determine the focus direction and obtain the focus strategy of the current display interface. Based on the initial control, focus direction, and policy, determine the target control and move the focus to the target control.
It realizes that the focus can be switched to any control without adapting the application of the terminal device in any display interface, solving the problem of inconvenient focus switching and "bumping against the wall".
Smart Images

Figure CN119902661A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of terminal equipment, and in particular to a control method, device, equipment and storage medium of a terminal equipment. Background Art
[0002] In the related art, when users use the remote control to move the focus, the system default focus search solution will be used. However, this method can only simply find the next control in a fixed direction and cannot cope with the nested control scenario. There is a "wall collision" situation: when the focus moves to a position where the next control cannot be found around, it cannot move further. If the control is not visible or obvious, the user may mistakenly think that the system has crashed; and the focus cannot be switched to certain special controls, and all controls cannot be controlled. Summary of the invention
[0003] The purpose of the present invention is to provide a control method, device, equipment and storage medium of a terminal device to solve the technical problems in the prior art.
[0004] In a first aspect, an embodiment of the present application provides a method for controlling a terminal device, the method comprising:
[0005] In response to the focus switching operation, a focus direction is determined, and a focus strategy corresponding to the current display interface is obtained; the focus strategy is used to characterize the focus switching relationship between various controls in the current display interface, and the focus strategies corresponding to different interfaces are not completely the same;
[0006] Determine a target control based on an initial control of the current display interface, the focus direction, and the focus strategy; wherein the initial control is a focus control in the current display interface;
[0007] The focus of the current display interface is moved from the initial control to the target control.
[0008] In an embodiment of the present application, the acquired focus strategy is constructed based on all controls in the current display interface. Therefore, the focus can be switched to any control in the current display interface through the focus strategy without adapting the application in the terminal device, which is convenient for users to operate any control in the current display interface in the terminal device through an external device.
[0009] In some possible embodiments, obtaining the focus strategy corresponding to the current display interface includes:
[0010] Obtaining parameter information of each first control in the current display interface;
[0011] A focus strategy corresponding to the current display interface is generated based on parameter information of each first control in the current display interface.
[0012] In some possible embodiments, generating a focus strategy corresponding to the current display interface based on parameter information of each first control in the current display interface includes:
[0013] Determine the associated control of each first control in each specified direction based on the parameter information of each first control; wherein the specified direction includes at least one or a combination of the following: a first direction, a second direction, a third direction, and a fourth direction; the first direction, the second direction, the third direction, and the fourth direction are all different;
[0014] A focus strategy is generated based on the associated controls of each first control in each specified direction.
[0015] In some possible embodiments, the parameter information of the first control includes position information of the first control in the current display interface; and determining the associated control of each first control in each specified direction based on the parameter information of each first control includes:
[0016] For each first control, determining a parent control and a child control of the first control based on position information of the first control in the current display interface;
[0017] Determining a control of the same level of the first control based on the parent control of the first control; wherein the parent control of the control of the same level is the same as the parent control of the first control;
[0018] Based on the parent control, child controls and controls at the same level of the first control, an associated control of the first control in each specified direction is determined.
[0019] In some possible embodiments, determining the associated controls of the first control in each specified direction based on the parent control, child controls, and controls at the same level of the first control includes:
[0020] If the specified direction includes a first direction, based on the positional relationship between the first control and the control at the same level in the current display interface, determine the control at the same level of the first control in the first direction, and use the control at the same level of the first control in the first direction as the associated control of the first control in the first direction; and / or,
[0021] If the specified direction includes a second direction and the first control has a sub-control, the sub-control of the first control is used as an associated control of the first control in the second direction; and / or,
[0022] If the specified direction includes a third direction and the first control has a parent control, the parent control of the first control is used as an associated control of the first control in the third direction; and / or,
[0023] If the specified direction includes a fourth direction, based on the positional relationship between the first control and the control at the same level in the current display interface, the control at the same level of the first control in the fourth direction is determined, and the control at the same level of the first control in the fourth direction is used as the associated control of the first control in the fourth direction.
[0024] In some possible embodiments, the method further includes:
[0025] If the specified direction includes a second direction and the first control has no child control, the parent control of the first control, the control at the same level of the first control, or the child control of the control at the same level of the first control is used as the associated control of the first control in the second direction.
[0026] In some possible embodiments, if the specified direction includes a second direction and the first control has no child control, using a control at the same level of the first control as an associated control of the first control in the second direction includes:
[0027] If the specified direction includes a second direction and the first control has no child control, when the first control has a control at the same level and the control at the same level is located in the second direction of the first control, the control at the same level in the second direction is used as an associated control of the first control in the second direction; or
[0028] If the specified direction includes a second direction and the first control has no child controls, when the first control has controls at the same level and the controls at the same level are not located in the second direction of the first control, the controls at the same level that are not located in the second direction will be used as associated controls of the first control in the second direction.
[0029] In some possible embodiments, if the specified direction includes a second direction and the first control has no child control, taking the parent control of the first control as an associated control of the first control in the second direction includes:
[0030] If the designated direction includes a second direction and the first control has no child control, when the first control has no controls at the same level, the parent control of the first control is used as an associated control of the first control in the second direction.
[0031] In some possible embodiments, if the specified direction includes a second direction and the first control has no child control, taking a child control of a control at the same level of the first control as an associated control of the first control in the second direction includes:
[0032] If the specified direction includes a second direction and the first control has no sub-control, when the first control has a control at the same level in the second direction and the control at the same level has a sub-control, the sub-control of the control at the same level is used as an associated control of the first control in the second direction; or
[0033] If the specified direction includes a second direction and the first control has no child controls, when the first control has a control at the same level, the control at the same level has child controls and the control at the same level is not located in the second direction of the first control, the child controls of the control at the same level that are not located in the second direction will be used as associated controls of the first control in the second direction.
[0034] In some possible embodiments, the method further includes:
[0035] If the specified direction includes a third direction and the pair of controls has no parent control, the child control of the first control, the control at the same level of the first control, or the parent control of the control at the same level of the first control is used as the associated control of the first control in the third direction.
[0036] In some possible embodiments, if the specified direction includes a third direction and the pair of controls does not have a parent control, using the child control of the first control as an associated control of the first control in the third direction includes:
[0037] If the designated direction includes a third direction and the first control has no parent control, when the first control has no controls at the same level, a child control of the first control is used as an associated control of the first control in the third direction.
[0038] In some possible embodiments, if the specified direction includes a third direction and the pair of controls does not have a parent control, using a control at the same level of the first control as an associated control of the first control in the third direction includes:
[0039] If the specified direction includes a third direction and the first control has no parent control, when there is a control at the same level as the first control and the control at the same level is located in the third direction of the first control, the control at the same level in the third direction is used as an associated control of the first control in the third direction; or
[0040] If the specified direction includes a third direction and the first control has no parent control, when the first control has a control at the same level and the control at the same level is not located in the third direction of the first control, the control at the same level that is not located in the third direction will be used as the associated control of the first control in the third direction.
[0041] In some possible embodiments, the position information of the first control in the current display interface includes: coordinate information of a preset point of the first control in the current display interface;
[0042] Determining a control at the same level as the first control in a specified direction includes:
[0043] Obtaining the location information of the control at the same level;
[0044] Based on the preset point coordinate information of the first control and the preset coordinate information of the control at the same level, a control at the same level of the first control in the specified direction is obtained.
[0045] In some possible embodiments, if there are multiple controls at the same level as the first control in the specified direction, taking the controls at the same level as the first control in the specified direction as associated controls of the first control in the specified direction includes:
[0046] Determine a first distance between the coordinate information of the preset point of the first control and the coordinate information of the preset point of each first same-level control; the first same-level control is a same-level control of the first control in the specified direction;
[0047] Based on the first same-level control with the smallest first distance, the associated control of the first control in the specified direction is obtained.
[0048] In some possible embodiments, obtaining an associated control of the first control in a specified direction based on the first same-level control with the smallest first distance includes:
[0049] Using the first same-level control with the smallest first distance as the second same-level control;
[0050] If there is a second control at the same level, the second control at the same level is used as an associated control of the first control in the specified direction;
[0051] If there are multiple second controls at the same level, determine the second distance between the preset point and the preset origin of each of the second controls at the same level; and determine the second control at the same level with the smallest second distance as the associated control of the first control in the specified direction.
[0052] In some possible embodiments, the position information of the first control in the current display interface includes: coordinate information of a preset point of the first control in the current display interface;
[0053] The determining of the sub-control of the first control includes:
[0054] Determine a first pixel point of the current display interface based on the preset point coordinate information of the first control, where the first pixel point is a pixel point included in the first control;
[0055] Determine a second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is a first control other than the first control in the current display interface;
[0056] For each of the other controls, if the first pixel includes all the second pixel points corresponding to the other control, the other control is determined as a second control;
[0057] For each of the second controls, determine whether all the pixels corresponding to the second control are contained in other second controls; if so, use the second control as a third control;
[0058] Update the second control based on the third control to obtain an updated second control;
[0059] The updated second control is used as a child control of the first control.
[0060] In some possible embodiments, the position information of the first control in the current display interface includes: coordinate information of a preset point of the first control in the current display interface; and determining the parent control of the first control includes:
[0061] Determine a first pixel point included in the first control based on the preset point coordinates of the first control;
[0062] Determine a second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is a first control other than the first control in the current display interface;
[0063] For each of the other controls: if the second pixel points corresponding to the other controls include all the first pixel points corresponding to the first control, the other controls are determined as the fourth control;
[0064] For each of the fourth controls: determining whether all the pixels in the fourth control are contained in the pixels corresponding to other fourth controls; if so, recording the fourth control as a fifth control;
[0065] Update the fourth control based on the fifth control to obtain an updated fourth control;
[0066] The updated fourth control is used as a parent control of the first control.
[0067] In some possible embodiments, the parameter information further includes: preset attribute information, and the determining the parent control of the first control includes:
[0068] Obtaining a preset inclusion relationship corresponding to the current display interface; the preset inclusion relationship corresponding to the current display interface is used to record the predicted controls included in the current display interface and the inclusion relationship between each control;
[0069] Determining whether the first control is a separate first control based on the preset inclusion relationship; the separate first control is a control that exists in the current display interface and is not recorded in the preset inclusion relationship;
[0070] If yes, then obtaining preset attribute information and position information of the first control and the non-individual control; the non-individual control is the control recorded in the preset inclusion relationship;
[0071] For each non-individual control, based on the position information of the first control, the position information of the non-individual control, the preset attribute information of the first control, and the preset attribute information of the non-individual control, obtain a first score of the non-individual control;
[0072] The first highest-scoring non-individual control was identified;
[0073] Based on the non-individual control with the first highest score, a parent control of the first control is determined.
[0074] In some possible embodiments, determining the parent control of the first control based on the non-individual control with the highest first score includes:
[0075] Based on the position information of each non-individual control with the highest first score, determining the distance between each non-individual control with the highest first score and a preset origin;
[0076] The first non-single control with the highest score whose distance to the preset origin is the smallest is used as the first target non-single control;
[0077] The parent control of the first target non-independent control is used as the parent control of the first control.
[0078] In some possible embodiments, the preset attribute information includes at least one of the following: attributes of the control, and the type of the control.
[0079] In some possible embodiments, determining the target control based on the focus switching operation, the initial control, and the focus search strategy includes:
[0080] Determining a focus direction corresponding to the focus switching operation;
[0081] The control in the focus direction of the initial control in the focus strategy is used as the target control.
[0082] In some possible embodiments, obtaining the focus strategy corresponding to the current display interface includes:
[0083] Obtaining the identity of the current display interface;
[0084] A focus strategy corresponding to the current display interface is obtained from the generated focus strategies based on the identity identifier of the current display interface.
[0085] In a second aspect, an embodiment of the present application further provides a control device for a terminal device, the device comprising:
[0086] A response module, used to respond to the focus switching operation, determine the focus direction, and obtain the focus strategy corresponding to the current display interface; the focus strategy is used to characterize the focus switching relationship between various controls in the current display interface, and the focus strategies corresponding to different interfaces are not completely the same;
[0087] A target control determination module, used to determine a target control based on an initial control of a current display interface, the focus direction, and the focus strategy; wherein the initial control is a focus control in the current display interface;
[0088] A focus switching module is used to move the focus of the current display interface from the initial control to the target control.
[0089] In some possible embodiments, the response module is specifically used to:
[0090] Obtaining parameter information of each first control in the current display interface;
[0091] A focus strategy corresponding to the current display interface is generated based on parameter information of each first control in the current display interface.
[0092] In some possible embodiments, the response module is specifically used to:
[0093] Determine the associated control of each first control in each specified direction based on the parameter information of each first control; wherein the specified direction includes at least one or a combination of the following: a first direction, a second direction, a third direction, and a fourth direction; the first direction, the second direction, the third direction, and the fourth direction are all different;
[0094] A focus strategy is generated based on the associated controls of each first control in each specified direction.
[0095] In some possible embodiments, the response module is specifically used to:
[0096] For each first control, determining a parent control and a child control of the first control based on position information of the first control in the current display interface;
[0097] Determining a control of the same level of the first control based on the parent control of the first control; wherein the parent control of the control of the same level is the same as the parent control of the first control;
[0098] Based on the parent control, child controls and controls at the same level of the first control, an associated control of the first control in each specified direction is determined.
[0099] In some possible embodiments, the response module is specifically used to:
[0100] If the specified direction includes a first direction, based on the positional relationship between the first control and the control at the same level in the current display interface, determine the control at the same level of the first control in the first direction, and use the control at the same level of the first control in the first direction as the associated control of the first control in the first direction; and / or,
[0101] If the specified direction includes a second direction and the first control has a sub-control, the sub-control of the first control is used as an associated control of the first control in the second direction; and / or,
[0102] If the specified direction includes a third direction and the first control has a parent control, the parent control of the first control is used as an associated control of the first control in the third direction; and / or,
[0103] If the specified direction includes a fourth direction, based on the positional relationship between the first control and the control at the same level in the current display interface, the control at the same level of the first control in the fourth direction is determined, and the control at the same level of the first control in the fourth direction is used as the associated control of the first control in the fourth direction.
[0104] In some possible embodiments, the response module is further used for:
[0105] If the specified direction includes a second direction and the first control has no child control, the parent control of the first control, the control at the same level of the first control, or the child control of the control at the same level of the first control is used as the associated control of the first control in the second direction.
[0106] In some possible embodiments, the response module is specifically used to:
[0107] If the specified direction includes a second direction and the first control has no child control, when the first control has a control at the same level and the control at the same level is located in the second direction of the first control, the control at the same level in the second direction is used as an associated control of the first control in the second direction; or
[0108] If the specified direction includes a second direction and the first control has no child controls, when the first control has controls at the same level and the controls at the same level are not located in the second direction of the first control, the controls at the same level that are not located in the second direction will be used as associated controls of the first control in the second direction.
[0109] In some possible embodiments, the response module is specifically used to:
[0110] If the designated direction includes a second direction and the first control has no child control, when the first control has no controls at the same level, the parent control of the first control is used as an associated control of the first control in the second direction.
[0111] In some possible embodiments, the response module is specifically used to:
[0112] If the specified direction includes a second direction and the first control has no sub-control, when the first control has a control at the same level in the second direction and the control at the same level has a sub-control, the sub-control of the control at the same level is used as an associated control of the first control in the second direction; or
[0113] If the specified direction includes a second direction and the first control has no child controls, when the first control has a control at the same level, the control at the same level has child controls and the control at the same level is not located in the second direction of the first control, the child controls of the control at the same level that are not located in the second direction will be used as associated controls of the first control in the second direction.
[0114] In some possible embodiments, the response module is further used to:
[0115] If the specified direction includes a third direction and the pair of controls has no parent control, the child control of the first control, the control at the same level of the first control, or the parent control of the control at the same level of the first control is used as the associated control of the first control in the third direction.
[0116] In some possible embodiments, the response module is specifically used to:
[0117] If the designated direction includes a third direction and the first control has no parent control, when the first control has no controls at the same level, a child control of the first control is used as an associated control of the first control in the third direction.
[0118] In some possible embodiments, the response module is specifically used to:
[0119] If the specified direction includes a third direction and the first control has no parent control, when there is a control at the same level as the first control and the control at the same level is located in the third direction of the first control, the control at the same level in the third direction is used as an associated control of the first control in the third direction; or
[0120] If the specified direction includes a third direction and the first control has no parent control, when the first control has a control at the same level and the control at the same level is not located in the third direction of the first control, the control at the same level that is not located in the third direction will be used as the associated control of the first control in the third direction.
[0121] In some possible embodiments, the response module is specifically used to:
[0122] Obtaining the location information of the control at the same level;
[0123] Based on the preset point coordinate information of the first control and the preset coordinate information of the control at the same level, a control at the same level of the first control in the specified direction is obtained.
[0124] In some possible embodiments, the response module is specifically used to:
[0125] Determine a first distance between the coordinate information of the preset point of the first control and the coordinate information of the preset point of each first same-level control; the first same-level control is a same-level control of the first control in the specified direction;
[0126] Based on the first same-level control with the smallest first distance, the associated control of the first control in the specified direction is obtained.
[0127] In some possible embodiments, the response module is specifically used to:
[0128] Using the first same-level control with the smallest first distance as the second same-level control;
[0129] If there is a second control at the same level, the second control at the same level is used as an associated control of the first control in the specified direction;
[0130] If there are multiple second controls at the same level, determine the second distance between the preset point and the preset origin of each of the second controls at the same level; and determine the second control at the same level with the smallest second distance as the associated control of the first control in the specified direction.
[0131] In some possible embodiments, the response module is specifically used to:
[0132] Determine a first pixel point of the current display interface based on the preset point coordinate information of the first control, where the first pixel point is a pixel point included in the first control;
[0133] Determine a second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is a first control other than the first control in the current display interface;
[0134] For each of the other controls, if the first pixel includes all the second pixel points corresponding to the other control, the other control is determined as a second control;
[0135] For each of the second controls, determine whether all the pixels corresponding to the second control are contained in other second controls; if so, use the second control as a third control;
[0136] Update the second control based on the third control to obtain an updated second control;
[0137] The updated second control is used as a child control of the first control.
[0138] In some possible embodiments, the response module is specifically used to:
[0139] Determine a first pixel point included in the first control based on the preset point coordinates of the first control;
[0140] Determine a second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is a first control other than the first control in the current display interface;
[0141] For each of the other controls: if the second pixel points corresponding to the other controls include all the first pixel points corresponding to the first control, the other controls are determined as the fourth control;
[0142] For each of the fourth controls: determining whether all the pixels in the fourth control are contained in the pixels corresponding to other fourth controls; if so, recording the fourth control as a fifth control;
[0143] Update the fourth control based on the fifth control to obtain an updated fourth control;
[0144] The updated fourth control is used as a parent control of the first control.
[0145] In some possible embodiments, the response module is specifically used to:
[0146] Obtaining a preset inclusion relationship corresponding to the current display interface; the preset inclusion relationship corresponding to the current display interface is used to record the predicted controls included in the current display interface and the inclusion relationship between each control;
[0147] Determining whether the first control is a separate first control based on the preset inclusion relationship; the separate first control is a control that exists in the current display interface and is not recorded in the preset inclusion relationship;
[0148] If yes, then obtaining preset attribute information and position information of the first control and the non-individual control; the non-individual control is the control recorded in the preset inclusion relationship;
[0149] For each non-individual control, based on the position information of the first control, the position information of the non-individual control, the preset attribute information of the first control, and the preset attribute information of the non-individual control, obtain a first score of the non-individual control;
[0150] The first highest-scoring non-individual control was identified;
[0151] Based on the non-individual control with the first highest score, a parent control of the first control is determined.
[0152] In some possible embodiments, the response module is specifically used to:
[0153] Based on the position information of each non-individual control with the highest first score, determining the distance between each non-individual control with the highest first score and a preset origin;
[0154] The first non-single control with the highest score whose distance to the preset origin is the smallest is used as the first target non-single control;
[0155] The parent control of the first target non-independent control is used as the parent control of the first control.
[0156] In some possible embodiments, the preset attribute information includes at least one of the following: attributes of the control, and the type of the control.
[0157] In some possible embodiments, the target control determination module is specifically used to:
[0158] Determining a focus direction corresponding to the focus switching operation;
[0159] The control in the focus direction of the initial control in the focus strategy is used as the target control.
[0160] In some possible embodiments, the response module is specifically used to:
[0161] Obtaining the identity of the current display interface;
[0162] A focus strategy corresponding to the current display interface is obtained from the generated focus strategies based on the identity identifier of the current display interface.
[0163] In the third aspect, another embodiment of the present application also provides an electronic device, comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method provided in the embodiment of the first aspect of the present application.
[0164] In a fourth aspect, another embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute any method provided in the embodiment of the first aspect of the present application.
[0165] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0166] Figure 1 A schematic diagram of a method for controlling a terminal device provided in an embodiment of the present application for projecting a third-party application of a smart terminal onto a vehicle display screen;
[0167] Figure 2 A schematic diagram of a method for controlling a terminal device provided in an embodiment of the present application, which uses a smart terminal to simulate a mouse to remotely control a projected device;
[0168] Figure 3 A schematic diagram of focus switching in a related art of a control method of a terminal device provided in an embodiment of the present application;
[0169] Figure 4 Another schematic diagram of focus switching in the related art of a control method of a terminal device provided in an embodiment of the present application;
[0170] Figure 5 A schematic diagram of control properties in a related technology of a method for controlling a terminal device provided in an embodiment of the present application;
[0171] Figure 6A schematic diagram of switching the focus to a designated control in a related art of a method for controlling a terminal device provided in an embodiment of the present application;
[0172] Figure 7 A schematic diagram of the overall process of a method for controlling a terminal device provided in an embodiment of the present application;
[0173] Figure 8 A schematic diagram of a flow chart of a control method of a terminal device provided in an embodiment of the present application for generating a focus strategy corresponding to a current display interface based on parameter information;
[0174] Fig. 9 A schematic diagram of a flow chart of determining an associated control of a first control in each specified direction in a control method of a terminal device provided in an embodiment of the present application;
[0175] Fig.10 A schematic diagram of a flow chart of determining a sub-control of a first control in a control method of a terminal device provided in an embodiment of the present application;
[0176] Fig.11 A schematic diagram of preset points of a control method for a terminal device provided in an embodiment of the present application;
[0177] Fig.12 A schematic diagram of a current display interface of a control method for a terminal device provided in an embodiment of the present application;
[0178] Fig.13 A schematic diagram of a flow chart of determining a parent control corresponding to a first control in a control method of a terminal device provided in an embodiment of the present application;
[0179] Fig.14 A schematic diagram of a flow chart of determining a parent control of a first control according to position information and attribute information in a control method of a terminal device provided in an embodiment of the present application;
[0180] Fig.15 A schematic diagram of the relationship between the parent control and the child control of each first control in the current display interface of a control method of a terminal device provided in an embodiment of the present application;
[0181] Fig.16 Another schematic diagram of a current display interface of a control method for a terminal device provided in an embodiment of the present application;
[0182] Fig.17 A schematic diagram of a flow chart of determining a parent control of a first control when there are multiple non-independent controls with the highest first scores in a control method of a terminal device provided by an embodiment of the present application;
[0183] Fig.18Another schematic diagram of the relationship between the parent control and the child control of each first control in a method for controlling a terminal device provided by an embodiment of the present application;
[0184] Fig.19 A schematic diagram of a flow chart of determining an associated control of a first control in each specified direction in a control method of a terminal device provided in an embodiment of the present application;
[0185] Fig. 20 A schematic diagram of a flow chart of determining a control of the same level of a first control in any specified direction in a control method of a terminal device provided in an embodiment of the present application;
[0186] Fig.21 Another schematic diagram of a current display interface of a control method for a terminal device provided in an embodiment of the present application;
[0187] Fig. 22 A schematic diagram of the relationship between the parent control and the child control of each first control in a method for controlling a terminal device provided in an embodiment of the present application;
[0188] Fig.23 A schematic diagram of a method for controlling a terminal device provided in an embodiment of the present application, wherein a coordinate system is established with the upper left corner vertex of a current display interface as a preset origin;
[0189] Fig.24 A schematic diagram of a flow chart of determining a unique associated control of a first control in a specified direction in a control method of a terminal device provided in an embodiment of the present application;
[0190] Fig.25 A schematic flow chart of a method for controlling a terminal device provided in an embodiment of the present application, for obtaining an associated control of a first control in a specified direction based on a first same-level control with a minimum first distance;
[0191] Fig.26 Another schematic diagram of a current display interface of a control method for a terminal device provided in an embodiment of the present application;
[0192] Fig. 27 A method for controlling a terminal device provided in an embodiment of the present application Fig.26 A schematic diagram of the relationship between the parent control and the child controls of each corresponding first control;
[0193] Fig.28A Another schematic diagram of a current display interface of a control method for a terminal device provided in an embodiment of the present application;
[0194] Fig.28B A method for controlling a terminal device provided in an embodiment of the present application Fig.28AA schematic diagram of the relationship between the parent control and the child controls of each corresponding first control;
[0195] Fig.28C A schematic flow chart of obtaining associated controls of a first control in a second direction based on the positional relationship of sub-controls of a first control in a control method of a terminal device provided in an embodiment of the present application;
[0196] Fig.28D Another schematic diagram of a current display interface of a control method for a terminal device provided in an embodiment of the present application;
[0197] Fig.29 Another schematic diagram of a current display interface of a control method for a terminal device provided in an embodiment of the present application;
[0198] Fig.30 A method for controlling a terminal device provided in an embodiment of the present application Fig.29 A schematic diagram of the relationship between the parent control and the child controls of each corresponding first control;
[0199] Fig.31 A schematic diagram of a process of obtaining associated controls of a first control in a fourth direction based on the positional relationship of controls at the same level and the positional relationship of a first control, according to a control method of a terminal device provided in an embodiment of the present application;
[0200] Fig.32 Another schematic diagram of a current display interface of a control method for a terminal device provided in an embodiment of the present application;
[0201] Fig.33 A method for controlling a terminal device provided in an embodiment of the present application Fig.32 A schematic diagram of the relationship between the parent control and the child controls of each corresponding first control;
[0202] Fig.34 A schematic diagram of a flow chart of determining the associated controls of each first control in each specified direction according to the position relationship of a control method of a terminal device provided in an embodiment of the present application;
[0203] Fig.35 A schematic flow chart of a control method for a terminal device provided in an embodiment of the present application for determining, when the specified direction is a first direction, an associated control of a first control in a specified direction based on position information;
[0204] Fig.36 A schematic flow chart of a control method for a terminal device provided in an embodiment of the present application for determining an associated control of a first control in a specified direction based on position information when the specified direction is a second direction;
[0205] Fig.37A schematic flow chart of a control method for a terminal device provided in an embodiment of the present application for determining, when the specified direction is a third direction, an associated control of a first control in a specified direction based on position information;
[0206] Fig.38 A schematic flow chart of a control method for a terminal device provided in an embodiment of the present application for determining, when the specified direction is a fourth direction, an associated control of a first control in a specified direction based on position information;
[0207] Fig.39A A schematic diagram of a focus-seeking strategy of a control method for a terminal device provided in an embodiment of the present application;
[0208] Fig.39B An information schematic diagram of a first control of a method for controlling a terminal device provided in an embodiment of the present application;
[0209] Fig.40 A schematic diagram of a virtual remote control on a mobile phone for a method for controlling a terminal device provided in an embodiment of the present application;
[0210] Fig.41 A schematic diagram of a current display interface of a control method for a terminal device provided in an embodiment of the present application;
[0211] Fig.42 A method for controlling a terminal device provided in an embodiment of the present application Fig.41 A schematic diagram of the relationship between the parent control and the child controls of each corresponding first control;
[0212] Fig.43A A schematic diagram of a selection process of a control method for a terminal device provided in an embodiment of the present application;
[0213] Fig.43B Another schematic diagram of a selection process of a control method for a terminal device provided in an embodiment of the present application;
[0214] Fig.44 A schematic diagram of changes in the layout of controls in a terminal device according to a method for controlling a terminal device provided in an embodiment of the present application;
[0215] Fig.45 A schematic diagram of a control system of a terminal device provided in an embodiment of the present application;
[0216] Fig.46 A schematic diagram of the interaction process between a focus management module and ViewRoot of a control method for a terminal device provided in an embodiment of the present application;
[0217] Fig.47 A schematic diagram of a device for controlling a terminal device provided in an embodiment of the present application;
[0218] Fig.48 A schematic diagram of an electronic device for a method for controlling a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0219] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, but should not be construed as limiting the present invention.
[0220] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0221] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0222] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0223] It should be understood that the term "and / or" used in this article is only a kind of associative control to describe the associative objects, indicating that there can be three kinds of relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associative objects before and after are in an "or" relationship.
[0224] like Figure 1 As shown, the vehicle has an on-board display screen, such as Figure 2 As shown, the user can use the smart terminal to simulate a mouse to remotely control the content displayed on the vehicle display screen. For example, the content displayed on the vehicle display screen can be the content displayed by the vehicle system itself, or it can be the content projected to the vehicle display screen by the smart terminal.
[0225] When the user uses the smart terminal to simulate a mouse to remotely control the in-vehicle display screen, the screen of the smart terminal will become a touchpad and a mouse pointer will be displayed on the screen. The user moves the mouse by sliding on the screen of the smart terminal, double-clicks to click the mouse, and double-clicks and presses to slide, which is more cumbersome and complicated.
[0226] However, when the rear passengers are far away from the car screen, it is difficult to control the car screen by touch. In addition, many car screens, projectors and other devices do not have touch functions and need to be controlled by intelligent terminals simulating mice / touch remote controls / air mice / gestures, etc. But obviously, these control methods are not as easy to use as traditional directional remote controls.
[0227] Traditional directional remote controls can be replaced by external devices, such as mobile phones, tablets, external universal serial buses, Bluetooth keyboards, etc. Users can use the directional keys (↑, ↓, ←, →) in the application on the external device to move the focus. However, only apps developed specifically for TVs will adapt to these directional keys, and most other external device apps are not specially adapted; in this case, the system default focus search solution will be used: it is difficult to switch correctly. For example: Figure 3 As shown in the figure, the user's focus is on the left control. After pressing the → key, the focus is transferred to the parent control of the right control, rather than the right child control. That is, in this solution, Figure 4 As shown in the figure, when the user presses the "→" key, the system will look for the nearest control to the right of A, find B, and switch the focus to B. This will prevent the user from switching the focus to sub-controls C and D. Because no matter which key the user presses again, the system cannot find its sub-control in the corresponding direction. At this time, the user cannot switch the focus to control C or control D. Unless the user manually clicks control C to switch the focus to control C, if the "→" key is pressed again at this time, the system can find control D and switch the focus to control D; but if the user continues to press the "←" key, the focus will eventually move to control A again, and the user still cannot switch the focus to control C or control D. In addition, not all devices have touch screens, and users may not be able to manually click control C.
[0228] In addition, there are some controls that are set by technicians to be out of focus (such as the zoom bar of a camera). However, these controls may be responsible for operation. According to this focus switching method, these controls cannot be operated.
[0229] In the related art, the TV app will configure the focus switching logic and specify the focus switching logic after pressing different direction keys. Figure 5 As shown in the figure, when developing an app, developers need to manually specify the position relationship of each control. When the user presses the arrow key, the system will first search for the next control from the preset position relationship. When it is found, the focus will be switched to the specified control. For example: Figure 6As shown in the figure, the current focus is on control A. When the app configures the position relationship (the right side of A is C, the right side of C is B, and the right side of B is D), after the user presses the "→" key, the focus will be transferred to C according to the preset position relationship; when the right key is pressed again, it will be transferred to B. However, this method requires the app developer to adapt. When the layout changes, the position relationship needs to be re-specified, which is a lot of work.
[0230] In response to the above problems, the embodiments of the present application provide a control method, device, equipment and storage medium for a terminal device, which are used to solve the above problems. The inventive concept of the present application can be summarized as follows: in response to a focus switching operation, a focus direction is determined, and a focus strategy corresponding to the current display interface is obtained; the focus strategy is used to characterize the focus switching relationship between the various controls in the current display interface, and the focus strategies corresponding to different interfaces are not exactly the same; based on the initial control, focus direction and focus strategy of the current display interface, the target control is determined; wherein the initial control is the focus control in the current display interface; the focus of the current display interface is moved from the initial control to the target control. In the embodiments of the present application, the acquired focus strategy is constructed based on the controls in the current display interface, so the focus can be switched to any control in the current display interface through the focus strategy, without the need to adapt the APP in the terminal device, so that the user can operate any control in the current display interface in the terminal device through an external device.
[0231] The present application provides a method for controlling a terminal device that is applicable to various terminal devices, such as but not limited to computers, laptops, smart phones, tablet computers, smart watches, smart bracelets, vehicle-mounted terminals, and other devices that have focus switching requirements.
[0232] like Figure 7 FIG. 1 is a flow chart of a control method of a terminal device provided in an embodiment of the present application, wherein the method includes:
[0233] Step 701: In response to a focus switching operation, determine a focus direction and obtain a focus strategy corresponding to the current display interface; the focus strategy is used to characterize the focus switching relationship between various controls in the current display interface.
[0234] It is important to know that after determining that the user has triggered a focus switching operation, the steps of determining the focusing direction and obtaining the focusing strategy corresponding to the current display interface can be performed simultaneously, or the focusing direction can be determined first and then the focusing strategy corresponding to the current display interface can be obtained, or the focusing strategy corresponding to the current display interface can be obtained first and then the focusing direction can be determined; that is, the present application does not limit the execution order of determining the focusing direction and obtaining the focusing strategy corresponding to the current display interface.
[0235] In this application, in order to ensure that focus switching can be achieved accurately, a focus search strategy is set. The focus search strategy is constructed according to the controls in the current display interface, so that when the focus is switched based on the focus search strategy, each control in the current display interface can be switched, and the focus search strategies corresponding to different display interfaces in this application can be the same or different.
[0236] In order to reduce the time spent on switching the focus in the terminal device based on the user's focus switching operation, when obtaining the focus strategy corresponding to the current display interface in the present application, it can be implemented as follows: obtaining the identity of the current display interface; obtaining the focus strategy corresponding to the current display interface based on the identity of the current display interface. That is, pre-store the focus strategy corresponding to each display interface in the terminal device, and associate each focus strategy with the identity of the display interface. This method saves the time of generating training strategies during the focus switching process and reduces the time spent on focus switching.
[0237] In some possible embodiments, there may be some newly generated interfaces, resulting in the failure to store the training strategies corresponding to the interfaces in a timely manner. Therefore, the focus strategy corresponding to the current display interface may not be obtained based on the identity of the current display interface. In this case, the focus strategy corresponding to the current display interface can be generated based on the parameter information of the controls in the current display interface. This method ensures that each display interface can obtain the corresponding focus strategy, further ensuring the accuracy of focus switching.
[0238] In other possible embodiments, in order to ensure the accuracy of the focus strategy corresponding to each acquired display interface, the focus strategy corresponding to the current display interface is obtained, which can be implemented as follows: obtaining parameter information of each first control in the current display interface; wherein the controls included in the current display interface are first controls; and generating the focus strategy corresponding to the current display interface based on the parameter information of each first control in the current display interface.
[0239] That is, in this application, after determining that the user triggers the focus switching operation, the focus strategy corresponding to the current display interface is generated in a timely manner through the parameter information of each first control in the current display interface. This method can ensure the timeliness of the determined focus strategy, and thus ensure the accuracy of the focus switching.
[0240] It should be noted that the method of generating the focus strategy corresponding to each display interface in advance and storing the focus strategy is the same as the method of generating the focus strategy corresponding to the current display interface based on the parameter information of each first control in the current display interface. Therefore, the following only describes in detail the method of generating the focus strategy corresponding to the current display interface based on the parameter information of each first control in the current display interface.
[0241] In some possible embodiments, a focus search strategy corresponding to the current display interface is generated based on the parameter information of the first control in the current display interface, which can be specifically implemented as follows: Figure 8 The steps shown, where:
[0242] Step 801: For each first control in the current display interface, determine an associated control of the first control in each specified direction based on parameter information of the first control.
[0243] The specified direction includes at least one or a combination of the following: a first direction, a second direction, a third direction, and a fourth direction.
[0244] In the present application, by constructing associated controls for each first control in each specified direction, it can be ensured that the target control can be accurately determined based on the user's focus switching operation.
[0245] The first direction may be any one of the following: upward, downward, left, and right; the second direction may be any one of the following: upward, downward, left, and right; the third direction may be any one of the following: upward, downward, left, and right; the fourth direction may be any one of the following: upward, downward, left, and right. It should be noted that when the specified direction includes multiple directions, each specified direction is different.
[0246] For example, if the specified direction includes a first direction and a second direction and the first direction is upward, the second direction may be any one of downward, left, and right.
[0247] Step 802: Generate a focus strategy based on the associated controls of each first control in each specified direction.
[0248] That is, in the present application, after determining the associated controls of each first control in each specified direction, a focus strategy can be obtained based on the corresponding relationship between the first controls and their corresponding associated controls.
[0249] In the embodiment of the present application, the parameter information of the first control includes the position information of the first control in the current display interface. Therefore, the specific implementation of determining the associated control of the first control in each specified direction based on the parameter information of the first control is as follows: Fig. 9 The steps shown, where:
[0250] Step 901: For each first control, determine the parent control and child control of the first control based on the position information of the first control in the current display interface.
[0251] In the present application, the position information of the first control is the coordinates of the first control in the current display interface. If the first control is a regular rectangle, the position information can be any one or a combination of the following: the coordinates of the vertices in the current display interface, the control height, and the control width; if the first control is a circle, the position information can be any one or a combination of the following: the coordinates of the center of the circle, the radius, and the diameter; if the first control is an irregular shape, the position information can be any one or a combination of the following: the coordinates of each vertex, the area occupied by the control, the control height, and the control width.
[0252] In some possible embodiments, the position information includes the coordinates of the preset point, and the sub-control of the first control is determined, which can be implemented as follows: Fig.10 The steps shown, where:
[0253] Step 1001: Determine a first pixel point included in the first control based on the preset point coordinates of the first control.
[0254] In the present application, the preset point can be any one of the vertices of the first control, such as Fig.11 As shown, the first control has a total of 4 vertices, namely vertex A, vertex B, vertex C, and vertex D. Any one of vertex A, vertex B, vertex C, and vertex D can be used as a preset point. For the sake of convenience, the following takes the preset point as the upper left corner vertex (vertex A) of the first control as an example.
[0255] Step 1002: Determine the second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is the first control other than the first control in the current display interface.
[0256] Step 1003: For each other control, if the first pixel point includes all the second pixel points corresponding to the other control, the other control is determined as a second control.
[0257] That is, in the present application, the second pixel points contained in each other control can be determined based on the preset points of each other control. For each other control, if all the second pixel points corresponding to the other control are included in the first pixel points corresponding to the first control, it means that the other control is inside the first control.
[0258] Step 1004: for each second control, determine whether all the pixels corresponding to the second control are contained in other second controls; if so, use the second control as the third control.
[0259] In the present application, if the pixel points corresponding to the second control are all included in other second controls, it means that the second control is inside the other second controls, which means that the first control contains the other second controls, and the other second controls contain the second control, which means that the second control is not directly included in the first control, and therefore the second control is determined to be the third control.
[0260] In step 1005: the second control is updated based on the third control to obtain an updated second control.
[0261] In the present application, when updating the second control based on the third control, it can be specifically implemented as: removing the third control from the second control, or marking the third control as unavailable in the second control. The present application does not limit the specific steps of the update.
[0262] In step 1006: the updated second control is used as a child control of the first control.
[0263] For example: Fig.12 As shown, the current display interface includes: control 1, control 2, control 3, control 4, control 5, control 6, control 7, control 8, control 9; if the first control is control 1, then the other controls are: control 2, control 3, control 4, control 5, control 6, control 7, control 8, control 9; based on the acquired preset point coordinates of control 1, the first pixel point corresponding to control 1 is determined, and the second pixel points corresponding to controls 2 to 9 are determined according to the preset point coordinates corresponding to controls 2 to 9 respectively; based on the second pixel points corresponding to controls 2 to 9 respectively, the second controls are determined to be: control 2, control 3, control 4, control 5, control 6, control 7, control 8, control 9; for control 2, it is determined that the second pixel point corresponding to control 2 is not included in other second controls; for control 3, it is determined that the second pixel point corresponding to control 3 is not included in other second controls; for control 4, Determine that the second pixel point corresponding to control 4 is not included in other second controls; for control 5, determine that the pixel point corresponding to control 5 is included in control 2, then determine that control 5 is the third control; for control 6, determine that the pixel point corresponding to control 6 is included in control 3, then determine that control 6 is the third control; for control 7, determine that the pixel point corresponding to control 7 is included in control 3, then determine that control 7 is the third control; for control 8, determine that the pixel point corresponding to control 8 is included in control 4, then determine that control 8 is the third control; for control 9, determine that the pixel point corresponding to control 9 is included in control 4, then determine that control 9 is the third control; at this time, determine that the third control includes: control 5, control 6, control 7, control 8, control 9; remove the third control from the second control, and the processed second control includes: control 2, control 3, control 4; in summary, it can be determined that the sub-controls of control 1 include: control 2, control 3, control 4.
[0264] In some other possible embodiments, determining the parent control corresponding to the first control may be implemented as follows: Fig.13 The steps shown, where:
[0265] Step 1301: Determine a first pixel point included in the first control based on the preset point coordinates of the first control.
[0266] The specific implementation of this step is the same as step 1001 and will not be repeated here.
[0267] Step 1302: Determine the second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is the first control other than the first control in the current display interface.
[0268] The specific implementation of this step is the same as step 1002 and will not be repeated here.
[0269] Step 1303: For each other control: if the second pixel points corresponding to the other control include all the first pixel points corresponding to the first control, the other control is determined as the fourth control.
[0270] That is, in the present application, the second pixel points contained in each other control can be determined based on the preset points of each other control. For each other control, if all the second pixel points corresponding to the other controls include the first pixel points corresponding to the first control, it means that the first control is inside the other control.
[0271] Step 1304: For each fourth control: determine whether all the pixels in the fourth control are contained in the pixels corresponding to other fourth controls; if so, record the fourth control as the fifth control.
[0272] In the present application, if the pixel points corresponding to the fourth control are all included in other fourth controls, it means that the fourth control is inside the other fourth controls, which means that the first control is included in the fourth control, and the other fourth controls are included in the other fourth controls, which means that the other fourth controls do not directly include the first control, and therefore the fourth control is determined to be the fifth control.
[0273] Step 1305: Update the fourth control based on the fifth control to obtain an updated fourth control.
[0274] The specific implementation of this step is the same as step 1005 and will not be repeated here.
[0275] Step 1306: Use the updated fourth control as the parent control of the first control.
[0276] For example: Fig.12As shown, the current display interface includes: control 1, control 2, control 3, control 4, control 5, control 6, control 7, control 8, control 9; if the first control is control 5, then the other controls are: control 1, control 2, control 3, control 4, control 6, control 7, control 8, control 9; based on the acquired preset point coordinates of control 5, the first pixel point corresponding to control 5 is determined, and the second pixel points corresponding to control 2 to control 4 and control 6 to control 9 are determined according to the preset point coordinates corresponding to control 2 to control 4 and control 6 to control 9 respectively; based on the second pixel points corresponding to control 2 to control 4 and control 6 to control 9 respectively, the second control is determined to be: control 1 and control 2; for control 1, it is determined that control 1 contains the second pixel point corresponding to control 2, and control 1 is determined to be the fifth control; for control 2, it is determined that control 2 does not contain other fourth controls; at this time, it is determined that the fifth control includes: control 1; the fifth control is removed from the fourth control, and the processed fourth control includes: control 2; in summary, it can be determined that the parent control of control 5 is control 2.
[0277] Continue with Fig.12 Taking an example to illustrate, it is determined that the parent control corresponding to Control 1 is empty, and the corresponding child controls are Control 2, Control 3, and Control 4; it is determined that the parent control corresponding to Control 2 is 1, and the corresponding child control is 5; it is determined that the parent control corresponding to Control 3 is Control 1, and the corresponding child controls are Control 6 and Control 7; it is determined that the parent control corresponding to Control 4 is Control 1, and the corresponding child controls are Control 8 and Control 9; it is determined that the parent control corresponding to Control 5 is Control 2, and the corresponding child control is empty; it is determined that the parent control corresponding to Control 6 is Control 3, and the corresponding child control is empty; it is determined that the parent control corresponding to Control 7 is Control 3, and the corresponding child control is empty; it is determined that the parent control corresponding to Control 8 is Control 4, and the corresponding child control is empty; it is determined that the parent control corresponding to Control 8 is Control 9, and the corresponding child control is empty.
[0278] In this application, parameter information processing includes not only position information but also attribute information. Therefore, when determining the parent control, in addition to using Fig.13 In addition to determining the parent control of the first control based only on the position information, the method shown in the figure can also determine the parent control of the first control based on the position information and the attribute information at the same time, which is specifically implemented as follows Fig.14 The steps shown, where:
[0279] Step 1401: Obtain the preset inclusion relationship corresponding to the current display interface.
[0280] In the present application, a preset inclusion relationship is pre-stored in the terminal device, but the preset inclusion relationship may not be reasonable or does not correspond to the current display interface. Therefore, the parent control of the first control can be determined based on the preset inclusion relationship, which not only reduces the resources consumed in determining the parent control of the first control, but also makes the obtained parent control more accurate.
[0281] Step 1402: Determine a separate first control based on a preset inclusion relationship, where the separate first control is a control that exists in the current display interface and is not recorded in the preset inclusion relationship.
[0282] In this application, a single first control is a control that is in the current display interface but is not in the preset inclusion relationship. For example: the preset inclusion relationship is Fig.15 As shown, it includes: control 1, control 2, control 3, control 4, control 5, control 6, control 7, control 8, control 9; the current display interface is as follows Fig.18 As shown, including: control 1, control 2, control 3, control 4, control 5, control 6, control 7, control 8, control 9, control 10, control 11, control 12, control 12, then the individual controls can be determined as: control 10, control 11, control 12, control 12.
[0283] Step 1403: Determine whether the first control belongs to a separate first control.
[0284] Step 1404: If yes, then obtain preset attribute information of the first control and the non-individual control, and obtain location information of the non-individual control; the non-individual control is a control recorded in the preset inclusion relationship.
[0285] In the present application, the preset attribute information includes: the attributes of the control and / or the type of the control. Among them, the attributes of the control include: focusable, non-focusable; the type of the control includes but is not limited to: text, image.
[0286] Continue with Fig.15 , Fig.16 Taking this as an example, the non-independent controls may be determined to be: control 1, control 2, control 3, control 4, control 5, control 6, control 7, control 8, and control 9.
[0287] Step 1405: For each non-individual control, based on the position information of the first control, the position information of the non-individual control, the preset attribute information of the first control, and the preset attribute information of the non-individual control, obtain a first score of the non-individual control.
[0288] In the present application, the first score is obtained based on position information and attribute information, and the calculation process of the first score is: based on the position information of the first control and the position information of the non-individual control, determine the distance between the first control and the non-individual control; based on the preset attribute information of the first control and the preset attribute information of the non-individual control, obtain the similarity of attribute information between the first control and the non-individual control; determine a first product value of the distance and the position information weight, and a second product value of the attribute information similarity and the attribute information weight; and use the sum of the first product value and the second product value as the first score.
[0289] Continue with Fig.15 , Fig.16 Take this as an example to illustrate, for example: for control 1 and control 10, the attribute similarity between control 1 and control 10 is determined to be 50%, the distance between control 1 and control 10 is determined to be A, the position information weight is determined to be 0.6, and the attribute information weight is determined to be 0.4, then the first score between control 1 and control 10 is determined to be 0.6A+0.2.
[0290] Since the attribute information in the present application includes: the attributes of the control and / or the type of the control, when the attribute information is an attribute, the attribute information similarity is the attribute similarity, and the attribute information weight is the attribute weight; when the attribute information is a type, the attribute information similarity is the type similarity, and the attribute information weight is the type weight; when the attribute information is an attribute and a type, the attribute information similarity is the attribute similarity and the type similarity, and the attribute information weight is the attribute weight and the type weight.
[0291] Step 1406: Determine the non-individual control with the first highest score.
[0292] Step 1407: Determine the parent control of the first control based on the first non-individual control with the highest score.
[0293] In the present application, when there is only one non-individual control with the highest first score, the parent control of the non-individual control is used as the parent control of the first control. When there are multiple non-individual controls with the highest first scores, the following can be implemented: Fig.17 The steps shown, where:
[0294] Step 1701: Based on the position information of each non-individual control with the highest first score, determine the distance between each non-individual control with the highest first score and a preset origin.
[0295] Step 1702: The non-individual control with the highest first score and the smallest distance between the non-individual control and the preset origin is used as the first target non-individual control.
[0296] Step 1703: Use the parent control of the first target non-independent control as the parent control of the first control.
[0297] That is, in this application, when there are multiple non-individual controls with the highest first scores, the parent control of the non-individual control with the highest first score and the smallest distance from the origin is used as the parent control of the first control. This method can ensure that each first control has only one parent control.
[0298] Continue with Fig.15 , Fig.16 For control 10, it is determined that control 6 and control 8 are both the first non-individual controls with the highest scores. The preset origin is the upper left corner vertex of the current display interface. It is determined that the distance between control 6 and the preset origin is the shortest. Then the first target non-individual control is control 6, and the parent control of control 6 is used as the parent control of control 10, that is, control 3 is used as the parent control of control 10.
[0299] Continue with Fig.15 , Fig.16 , assuming that the parent control of control 10 is determined to be control 3, the parent control of control 11 is determined to be control 3, the parent control of control 12 is determined to be control 4, and the parent control of control 12 is determined to be control 4, then the relationship between the parent control and the child control of each first control is as follows: Fig.18 shown.
[0300] Step 902: Determine a control of the same level of the first control based on the parent control of the first control; wherein the parent control of the control of the same level is the same as the parent control of the first control.
[0301] That is, in this application, after determining the parent control of the first control, the controls at the same level of the first control can be determined based on the parent control of the first control, that is, the controls that are the same as the parent control of the first control are taken as controls at the same level of the first control.
[0302] For example: determine the relationship between the parent control and the child control of each first control as follows Fig.18 As shown, it can be determined that control 2, control 3, and control 4 are controls of the same level; control 6, control 7, control 10, and control 11 are controls of the same level; and control 8, control 9, control 12, and control 13 are controls of the same level.
[0303] Step 903: Determine the associated controls of the first control in each specified direction based on the parent control, child controls, and controls at the same level of the first control.
[0304] In the present application, after determining the parent control, child control and controls at the same level of the first control, the associated controls of the first control in each specified direction can be determined based on the parent control, child control and controls at the same level of the first control, which can be specifically implemented as follows: Fig.19 The steps shown, where:
[0305] Step 1901: If the specified direction includes the first direction, based on the positional relationship between the first control and the controls at the same level in the current display interface, determine the controls at the same level of the first control in the first direction, and use the controls at the same level of the first control in the first direction as the associated controls of the first control in the first direction.
[0306] In this application, the first direction can be any of the following: up, down, left, right. It should be noted that the steps for determining the same-level controls of the first control in any specified direction are the same, which can be specifically implemented as follows: Fig. 20 The steps shown, where:
[0307] Step 2001: Obtain the location information of controls at the same level.
[0308] The specific implementation is the same as step 901 and will not be described again here.
[0309] Step 2002: Based on the preset point coordinate information of the first control and the preset coordinate information of the controls at the same level, obtain the controls at the same level of the first control in the specified direction.
[0310] Take the first direction as downward as an example for explanation. The current display interface is as follows Fig.21 As shown, Fig. 22 for Fig.21 Schematic diagram of the relationship between the parent control and the child control of the control in the figure. Take control 2 as the first control and determine that the controls of the same level corresponding to control 2 are: control 1, control 3, control 4, control 5, control 6, control 7, control 8, control 9; it is necessary to determine the controls of the same level below control 2, such as Fig.23 As shown, a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls of the same level whose vertical coordinates are greater than or equal to control 2 are determined to be: control 3, control 4, control 5, control 6, control 7; that is, the controls of the same level of the first control in the first direction are control 3, control 4, control 5, control 6, control 7.
[0311] It should be noted that the method for determining the only associated control of the first control in any specified direction is the same. Therefore, in some possible embodiments, if there are multiple controls at the same level as the first control in the specified direction, in order to determine the only associated control of the first control in the specified direction, the following method can be implemented. Fig.24 Steps shown:
[0312] Step 2401: Determine a first distance between coordinate information of a preset point of a first control and coordinate information of a preset point of each first same-level control; the first same-level control is a same-level control of the first control in a specified direction.
[0313] Continue with Figure 21 to Figure 23Taking an example to illustrate, the upper left corner vertex of each control is used as the preset point, that is, the first distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 3, control 4, control 5, control 6, and control 7 is determined respectively.
[0314] Step 2402: Obtain the associated controls of the first control in the specified direction based on the first same-level control with the smallest first distance.
[0315] Continue with Figure 21 to Figure 23 For example, if it is determined that the first same-level control with the shortest first distance is control 3.
[0316] In the embodiment of the present application, it should be noted that the steps of obtaining the associated controls of the first control in any specified direction based on the first same-level control with the smallest first distance are the same, which can be specifically implemented as follows: Fig.25 The steps shown, where:
[0317] In step 2501: the first same-level control with the smallest first distance is used as the second same-level control.
[0318] Continue with Figure 21 to Figure 23 Taking an example for explanation, if it is determined that the first same-level control with the shortest first distance is control 3, control 3 is used as the second same-level control.
[0319] In step 2502: if there is a second control at the same level, the second control at the same level is used as an associated control of the first control in the specified direction.
[0320] Continue with Figure 21 to Figure 23 For example, if it is determined that there is only one second-level control, namely, control 3, then control 3 is used as the associated control of control 2 below.
[0321] In step 2503: if there are multiple second controls at the same level, determine the second distance between the preset point and the preset origin of each second control at the same level; and determine the second control at the same level with the smallest second distance as the associated control of the first control in the specified direction.
[0322] Take the specified direction as the first direction, and the first direction is downward as an example for explanation, for example: the current display interface is as follows Fig.26 As shown, Fig. 27 for Fig.26The corresponding relationship between the parent controls and child controls of the controls in the table is as follows: control 2 is taken as the first control, and the corresponding controls of the same level of control 2 are determined as: control 1, control 3, control 4, control 5, control 6, control 7, and control 8; the coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls of the same level whose vertical coordinates are greater than or equal to control 2 are determined as: control 3, control 4, control 5, and control 6. That is, the controls of the same level in the first direction are control 3, control 4, control 5, and control 6. The upper left corner vertex of each control is taken as the preset point, that is, the first distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 3, control 4, control 5, and control 6 is determined. It is determined that the first controls of the same level with the smallest first distance are control 3 and control 4, and control 3 and control 4 are taken as the second controls of the same level. It is determined that the second distance between the upper left corner vertex of control 3 and the preset origin is the smallest, and control 3 is taken as the associated control of control 2 below.
[0323] In some possible embodiments, some controls do not have controls at the same level. In order to avoid being unable to find the associated control corresponding to the first control in the first direction in this situation, it can be implemented: determine that the first control does not have controls at the same level, and based on the positional relationship of the sub-controls of the first control, obtain the associated controls of the first control in the first direction.
[0324] Take the first direction as the bottom as an example for explanation, for example: the current display interface is as follows Fig.28A As shown, Fig.28B for Fig.28A The corresponding relationship between the parent controls and child controls of the controls in the figure is as follows: control 2.1.1 is taken as the first control; it is determined that control 2.1.1 does not have a corresponding control at the same level; the child controls of control 2.1.1 are determined to be: control 2.1.1.1 and control 2.1.1.2; then the associated controls of the first control in the first direction are determined based on control 2.1.1.1 and control 2.1.1.2.
[0325] In some possible embodiments, based on the positional relationship of the sub-controls of the first control, the associated controls of the first control in the first direction are obtained, which can be specifically implemented as follows: determining the distance between the position coordinates of the specified vertex of the first control and the position coordinates of the specified vertex of each sub-control of the first control, taking the sub-control with the smallest distance as the alternative sub-control, determining the distance between the specified vertex of each alternative sub-control and a preset origin; and determining the alternative sub-control with the smallest distance as the associated control of the first control in the first direction.
[0326] Take the first direction as the bottom as an example for explanation, for example: the current display interface is as follows Fig.28A As shown, Fig.28B for Fig.28AThe corresponding relationship between the parent controls and child controls of the controls in the figure is determined. Control 2.1.1 is taken as the first control. It is determined that there is no corresponding control at the same level for control 2.1.1. The child controls of control 2.1.1 are determined to be: control 2.1.1.1 and control 2.1.1.2. The upper left corner vertex of each control is taken as the designated vertex, that is, the distance between the coordinates of the upper left corner vertex of control 2.1.1 and the coordinates of the upper left corner vertices of control 2.1.1.1 and control 2.1.1.2 is determined. It is determined that the child control with the smallest first distance is control 2.1.1.1, and control 2.1.1.1 is used as the associated control of control 2.1.1 below.
[0327] In some other possible embodiments, Fig.21 As shown in the control 2.1.1 in the figure, there is no control at the same level and no child control. In this case, the parent control of the control can be used as the associated control in the first direction, that is, control 2.1 can be used as the associated control of control 2.1.1 below.
[0328] Step 1902: If the specified direction includes the second direction and the first control has a sub-control, the sub-control of the first control is used as an associated control of the first control in the second direction.
[0329] In the present application, the second direction can be any of the following: top, bottom, left, and right. When there are multiple sub-controls in the second direction, in order to accurately determine the associated controls of the first control in the second direction, the associated controls of the first control in the second direction can be determined based on the position information of the sub-controls of the first control. Specifically, it can be implemented as follows: Fig.28C The steps shown, where:
[0330] Step 2801: Determine a third distance between the position coordinates of a preset point of a first control and the position coordinates of a preset point of each sub-control of the first control.
[0331] Take the second direction as the right as an example, the current display interface is as follows Fig.21 As shown, Fig.24 for Fig.21 The corresponding relationship between the parent control and the child control of each control in the control, control 2 is taken as the first control, and the child controls corresponding to control 2 are determined as: control 2.1, control 2.2, and control 2.3. Fig.23 As shown, a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the upper left corner vertex of each control is used as the preset point, that is, the third distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 2.1, control 2.2, and control 2.3 is determined.
[0332] Step 2802: Set the sub-control with the smallest third distance as the first sub-control.
[0333] Continue with Figure 21 to Figure 23 For example, if it is determined that the sub-control with the smallest third distance is control 2.1, control 2.1 is used as the first sub-control.
[0334] Step 2803: Obtain the associated control of the first control in the second direction based on the first sub-control.
[0335] In the present application, when there is only one first sub-control, the first sub-control is used as the associated control of the first control in the second direction. If there are multiple first sub-controls, the following can be implemented: determining the fourth distance between the preset point and the preset origin of each first sub-control; and determining the first sub-control with the smallest fourth distance as the associated control of the first control in the second direction.
[0336] Take the second direction as the right as an example for explanation, for example: the current display interface is as follows Fig.29 Show, Fig.30 for Fig.29 The corresponding relationship between the parent controls and child controls of the controls in the table is determined. Control 3 is taken as the first control, and the child controls corresponding to control 3 are determined as: control 3.1, control 3.2, and control 3.3. A coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the upper left corner vertex of each control is taken as the preset point, that is, the third distance between the coordinates of the upper left corner vertex of control 3 and the coordinates of the upper left corner vertices of control 3.1, control 3.2, and control 3.3 is determined. The first child controls with the smallest third distance are determined to be control 3.1 and control 3.2, and the fourth distance between the upper left corner vertex of control 3.1 and the preset origin is determined to be the smallest, and control 3.1 is used as the associated control on the right of control 3.
[0337] In some possible embodiments, in order to accurately determine the associated control of the first control in the second direction when the specified direction includes the second direction and the first control has no child controls, the parent control of the first control, the control at the same level of the first control, or the child control of the control at the same level of the first control can be used as the associated control of the first control in the second direction.
[0338] The following are explanations of the above three situations:
[0339] In some possible embodiments, if the specified direction includes the second direction and the first control has no sub-controls, the same-level controls of the first control are used as the associated controls of the first control in the second direction. Specifically, it can be implemented as follows: if the specified direction includes the second direction and the first control has no sub-controls, when there are controls of the same level in the first control and the controls of the same level are located in the second direction of the first control, the controls of the same level in the second direction are used as the associated controls of the first control in the second direction; or, if the specified direction includes the second direction and the first control has no sub-controls, when there are controls of the same level in the first control and the controls of the same level are not located in the second direction of the first control, the controls of the same level that are not located in the second direction are used as the associated controls of the first control in the second direction.
[0340] That is, in the present application, when it is determined that there are no child controls in the second direction of the first control, in order to ensure that the associated controls of the first control in the second direction can be determined, the controls of the same level in the second direction of the first control can be used as the associated controls of the first control in the second direction; when there are no controls of the same level in the second direction of the first control, the controls of the same level of the first control that are not in the second direction can be used as the associated controls of the first control in the second direction.
[0341] Among them, determining the same-level controls of the first control and obtaining the associated controls of the first control in the second direction based on the position information of the same-level controls and the position information of the first control. The specific implementation method is the same as the method for obtaining the associated controls of the first control in the first direction based on the position information of the same-level controls and the position information of the first control, and will not be repeated here.
[0342] In some possible embodiments, if the specified direction includes the second direction and the first control has no child controls, the parent control of the first control is used as the associated control of the first control in the second direction. Specifically, it can be implemented as follows: If the specified direction includes the second direction and the first control has no child controls, when there are no controls at the same level as the first control, the parent control of the first control is used as the associated control of the first control in the second direction.
[0343] For example: Fig.21 As shown in the control 2.1.1 in the figure, there is no child control and no control at the same level. In this case, the parent control of the control can be used as the associated control in the second direction, that is, control 2.1 is used as the associated control of control 2.1.1 on the right.
[0344] In some other possible embodiments, if the specified direction includes the second direction and the first control has no sub-controls, the sub-controls of the same-level controls of the first control are used as the associated controls of the first control in the second direction. Specifically, it can be implemented as follows: if the specified direction includes the second direction and the first control has no sub-controls, when there is a control of the same level in the second direction of the first control and the control of the same level has sub-controls, the sub-controls of the control of the same level are used as the associated controls of the first control in the second direction; or if the specified direction includes the second direction and the first control has no sub-controls, when there is a control of the same level in the first control, the control of the same level has sub-controls and the control of the same level is not located in the second direction of the first control, the sub-controls of the control of the same level that are not located in the second direction are used as the associated controls of the first control in the second direction.
[0345] That is, in the present application, when it is determined that there are no sub-controls in the second direction of the first control, in order to ensure that the associated controls of the first control in the second direction can be determined, the sub-controls of the same-level controls in the second direction of the first control can be used as the associated controls of the first control in the second direction; when there are no controls of the same level in the second direction of the first control, the sub-controls of the same-level controls of the first control that are not in the second direction can be used as the associated controls of the first control in the second direction.
[0346] For example: Fig.28D As shown in the control 2.2 in the figure, there is no child control, and the same-level controls of control 2.2 are determined to be 2.1 and 2.3. If control 2.3 has a child control and control 2.3 is to the right of control 2.2, then the child control 2.3.1 or the child control 2.3.2 of control 2.3 is used as the associated control of control 2.2 in the second direction. Fig.28C The method shown is the same and will not be described again here.
[0347] Step 1903: If the specified direction includes a third direction and the first control has a parent control, the parent control of the first control is used as the associated control of the first control in the third direction.
[0348] In this application, the third direction can be any of the following: up, down, left, right. Take the third direction as left as an example, the current display interface is as follows Fig.21 As shown, Fig.24 for Fig.21 Corresponding to the inclusion relationship, control 2.1 is taken as the first control, and the parent control corresponding to control 2.1 is determined to be: control 2; then control 2 is taken as the associated control on the left of control 2.1.
[0349] In some possible embodiments, in order to accurately determine the associated control of the first control in the third direction when the specified direction includes the third direction and the first control has no parent control, the child control of the first control or the control of the same level of the first control or the parent control of the control of the same level of the first control can be used as the associated control of the first control in the third direction.
[0350] The following are explanations of the above three situations:
[0351] In some possible embodiments, if the specified direction includes a third direction and there is no parent control for the control, the child control of the first control is used as the associated control of the first control in the third direction. Specifically, it can be implemented as follows: If the specified direction includes a third direction and there is no parent control for the first control, when there is no control at the same level as the first control, the child control of the first control is used as the associated control of the first control in the third direction.
[0352] For example: Fig.21 As shown in the control 0 in FIG. 1 , there is no parent control. In this case, the associated control of the third direction can be determined based on the child control of the control. The specific implementation method is the same as Fig.28C The same is not repeated here.
[0353] In some possible embodiments, if the specified direction includes a third direction and there is no parent control for the control, the same-level control of the first control is used as the associated control of the first control in the third direction. Specifically, it can be implemented as follows: if the specified direction includes a third direction and there is no parent control for the first control, when there is a same-level control for the first control and the same-level control is located in the third direction of the first control, the same-level control in the third direction is used as the associated control of the first control in the third direction; or, if the specified direction includes a third direction and there is no parent control for the first control, when there is a same-level control for the first control and the same-level control is not located in the third direction of the first control, the same-level control that is not located in the third direction is used as the associated control of the first control in the third direction.
[0354] That is, in the present application, when it is determined that the first control has no parent control and no child control, in order to ensure that the associated control of the first control in the third direction can be determined, the control of the same level in the third direction of the first control can be used as the associated control of the first control in the third direction; when there is no control of the same level in the third direction of the first control, the control of the same level of the first control that is not in the third direction can be used as the associated control of the first control in the third direction.
[0355] Among them, the method for determining the same-level control of the first control is the same as Fig. 22 The same, no further description is given here; the method for determining the associated control of the first control based on the same level control of the first control is the same as Fig.26 , Fig. 27The same is not repeated here.
[0356] Step 1904: If the specified direction includes a fourth direction, based on the positional relationship between the first control and the controls at the same level in the current display interface, determine the controls at the same level of the first control in the fourth direction, and use the controls at the same level of the first control in the fourth direction as the associated controls of the first control in the fourth direction.
[0357] In the present application, the fourth direction can be any one of the following: up, down, left, and right. In some possible embodiments, based on the positional relationship of controls at the same level and the positional relationship of the first control, the associated controls of the first control in the fourth direction are obtained, which can be specifically implemented as follows: Fig.31 The steps shown, where:
[0358] Step 3101: The control at the same level whose vertical coordinate is smaller than the vertical coordinate of the first control is taken as the third control at the same level.
[0359] If a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the fourth direction is upward, the third same-level control is a same-level control above the first control in the current display interface.
[0360] Take the fourth direction as upward as an example, the current display interface is as follows Fig.21 As shown, Fig.24 for Fig.21 The corresponding relationship between the parent controls and child controls of the controls in the figure, taking control 2 as the first control, and determining the controls of the same level corresponding to control 2 are: control 1, control 3, control 4, control 5, control 6, control 7, control 8, control 9; Fig.23 As shown, a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls of the same level whose vertical coordinates are smaller than control 2 are determined to be: control 1, control 8, control 9; that is, the third controls of the same level are control 1, control 8, and control 9.
[0361] Step 3102: Determine the fifth distance between the position coordinates of the specified vertex of the first control and the position coordinates of the specified vertex of each third control at the same level.
[0362] Continue with Figure 21 to Figure 23 For example, the upper left corner vertex of each control is used as the designated vertex, that is, the fifth distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 1, control 8, and control 9 is determined.
[0363] Step 3103: Use the third same-level control with the smallest fifth distance as the fourth same-level control.
[0364] Continue with Figure 21 to Figure 23For example, if it is determined that the third control at the same level with the smallest fifth distance is control 1, control 1 is used as the fourth control at the same level.
[0365] Step 3104: Obtain the associated control of the first control in the fourth direction based on the fourth same-level control.
[0366] In the present application, when there is only one fourth-level control, the fourth-level control is used as the associated control of the first control in the fourth direction. If there are multiple fourth-level controls, the following can be implemented: determining the sixth distance between the specified vertex of each fourth-level control and the preset origin; and determining the fourth-level control with the largest sixth distance as the associated control of the first control in the fourth direction.
[0367] Take the fourth direction as upward as an example for explanation, for example: the current display interface is as follows Fig.32 As shown, Fig.33 for Fig.32 The corresponding relationship between the parent controls and child controls of the controls in the table is determined. Control 3 is taken as the first control, and the controls of the same level corresponding to control 3 are determined as: control 1, control 2, control 4, control 5, control 6, control 7, and control 8; the coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls of the same level with a ordinate smaller than that of control 3 are determined as: control 1, control 2, and control 8. That is, the third controls of the same level are control 1, control 2, and control 8. The upper left corner vertex of each control is taken as the designated vertex, that is, the fifth distance between the coordinates of the upper left corner vertex of control 3 and the coordinates of the upper left corner vertices of control 1, control 2, and control 8 is determined. It is determined that the third controls of the same level with the smallest fifth distance are control 1 and control 2, and control 1 and control 2 are taken as the fourth controls of the same level. It is determined that the second distance between the upper left corner vertex of control 2 and the preset origin is the largest, and control 2 is taken as the associated control of control 3 above.
[0368] In some possible embodiments, when determining a non-existent same-level control of the first control, in order to determine the associated control of the first control in the fourth direction, it can be implemented as follows: taking the parent control of the first control as the associated control of the first control in the fourth direction.
[0369] In some other possible embodiments, if it is determined that the first control has neither a control at the same level nor a parent control, the associated control of the first control in the fourth direction can be determined based on the child control of the first control. The specific implementation method is the same as Fig.28C The same is not repeated here.
[0370] In summary, for each first control, it is sufficient to determine the only associated control of the first control in each specified direction. This method can accurately find the target control corresponding to each initial control in each focusing direction, thereby ensuring the accuracy of focus switching.
[0371] What you need to know is, Fig.21 The relationship between each step shown is an and / or relationship, that is, execution Fig.21 You can choose any one or more steps to perform, and this application is for Fig.21 There is no restriction on the execution timing of each step.
[0372] In the embodiment of the present application, in addition to using the above method to determine the associated controls of each first control in each specified direction based on the position information of the control and the parent control and / or child control of each control, the associated controls of each first control in each specified direction can also be determined only based on the position relationship between each control, which can be specifically implemented as follows: Fig.34 The steps shown, where:
[0373] Step 3401: Obtain the position information of the first control in the current display interface.
[0374] The specific implementation method of this step is the same as step 1101 and will not be repeated here.
[0375] Step 3402: For each specified direction, determine the associated control of the first control in the specified direction based on the position information.
[0376] After the position relationship is determined, the associated controls of the first control in each specified direction can be determined based on the position information of each control, which are described below:
[0377] In some possible embodiments, when the specified direction is the first direction, the associated control of the first control in the specified direction is determined based on the position information, which can be specifically implemented as follows: Fig.35 The steps shown, where:
[0378] In step 3501: a control whose designated vertex ordinate is greater than or equal to the designated vertex ordinate of the first control is taken as the first designated control.
[0379] If a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the first direction is downward, the first designated control is a control below the first control in the current display interface.
[0380] Take the first direction as downward as an example for explanation. The current display interface is as follows Fig.21 As shown, control 2 is used as the first control. If the specified vertex is the upper left corner vertex, such as Fig.23As shown, a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls whose ordinates are greater than or equal to the ordinate of the upper left corner vertex of control 2 are: control 3, control 4, control 5, control 6, control 7, control 2.1, control 2.2, control 2.3, control 2.1.1, control 2.2.1, control 2.2.2, control 2.3.1, control 2.3.2. That is, control 3, control 4, control 5, control 6, control 7, control 2.1, control 2.2, control 2.3, control 2.1.1, control 2.2.1, control 2.2.2, control 2.3.1, control 2.3.2 are taken as the first designated controls.
[0381] In step 3502: determine the seventh distance between the position coordinates of the designated vertex of the first control and the position coordinates of the designated vertex of each first designated control.
[0382] Continue with Fig.21 , Fig.23 Taking the upper left corner vertex of each control as an example, the seventh distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 3, control 4, control 5, control 6, control 7, control 2.1, control 2.2, control 2.3, control 2.1.1, control 2.2.1, control 2.2.2, control 2.3.1, and control 2.3.2 is determined respectively.
[0383] In step 3503: the first designated control with the smallest seventh distance is used as the second designated control.
[0384] Continue with Fig.21 , Fig.23 For example, if it is determined that the first designated control with the smallest seventh distance is control 2.1, control 2.1 is used as the second designated control.
[0385] In step 3504: based on the second designated control, the associated control of the first control in the first direction is obtained.
[0386] In the present application, when there is only one second designated control, the second designated control is used as the associated control of the first control in the first direction. If there are multiple second designated controls, the following can be implemented: determining the eighth distance between the designated vertex of each second designated control and the preset origin; and determining the second designated control with the smallest eighth distance as the associated control of the first control in the first direction.
[0387] Take the first direction as the bottom as an example for explanation, for example: the current display interface is as follows Fig.26As shown, control 2 is taken as the first control, and a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls whose vertical coordinates are greater than or equal to control 2 are determined to be: control 3, control 4, control 5, and control 6. That is, the first designated controls are control 3, control 4, control 5, and control 6. The upper left corner vertex of each control is taken as the designated vertex, that is, the seventh distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 3, control 4, control 5, and control 6 is determined. It is determined that the first designated controls with the smallest seventh distance are control 3 and control 4, and control 3 and control 4 are used as the second designated controls. It is determined that the eighth distance between the upper left corner vertex of control 3 and the preset origin is the smallest, and control 3 is used as the associated control of control 2 below.
[0388] In some other possible embodiments, if it is determined that the first specified control does not exist, the associated control of the first control can be determined based on the control whose specified vertex ordinate is smaller than the specified vertex ordinate of the first control. The method for determining the associated control of the first control based on the control whose specified vertex ordinate is smaller than the specified vertex ordinate of the first control is the same as Fig.38 The same is not repeated here; or, the associated control of the first control can be determined based on the control whose specified vertex horizontal coordinate is greater than or equal to the specified vertex horizontal coordinate of the first control, and the method for determining the associated control of the first control based on the control whose specified vertex horizontal coordinate is greater than or equal to the specified vertex horizontal coordinate of the first control is the same as Fig.36 The same is not repeated here; or, the associated control of the first control can be determined based on the control whose horizontal coordinate is smaller than the horizontal coordinate of the first control, and the method for determining the associated control of the first control based on the control whose horizontal coordinate is smaller than the horizontal coordinate of the first control is the same as Fig.37 The same is not repeated here.
[0389] In some possible embodiments, when the specified direction is the second direction, the associated control of the first control in the specified direction is determined based on the position information, which can be specifically implemented as follows: Fig.36 The steps shown, where:
[0390] Step 3601: The control whose designated vertex horizontal coordinate is greater than or equal to the designated vertex horizontal coordinate of the first control is taken as the third designated control.
[0391] If the coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the second direction is the right, the first designated control is the control to the right of the first control in the current display interface.
[0392] Take the second direction as the right as an example, the current display interface is as follows Fig.21 As shown, control 2 is used as the first control. If the specified vertex is the upper left corner vertex, such as Fig.23As shown, a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls whose horizontal coordinates are greater than or equal to the horizontal coordinate of the upper left corner vertex of control 2 are: control 4, control 5, control 6, control 7, control 2.1, control 2.2, control 2.3, control 2.1.1, control 2.2.1, control 2.2.2, control 2.3.1, control 2.3.2. That is, control 4, control 5, control 6, control 7, control 2.1, control 2.2, control 2.3, control 2.1.1, control 2.2.1, control 2.2.2, control 2.3.1, control 2.3.2 are used as the third designated control.
[0393] Step 3602: Determine a ninth distance between the position coordinates of the designated vertex of the first control and the position coordinates of the designated vertex of each third designated control.
[0394] Continue with Fig.21 , Fig.23 Taking the upper left corner vertex of each control as an example, the ninth distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 4, control 5, control 6, control 7, control 2.1, control 2.2, control 2.3, control 2.1.1, control 2.2.1, control 2.2.2, control 2.3.1, and control 2.3.2 is determined respectively.
[0395] Step 3603: Use the third designated control with the smallest ninth distance as the fourth designated control.
[0396] Continue with Fig.21 , Fig.23 For example, if it is determined that the third designated control with the smallest ninth distance is control 2.2, then control 2.2 is used as the fourth designated control.
[0397] Step 3604: Obtain the associated control of the first control in the second direction based on the fourth specified control.
[0398] In the present application, when there is only one fourth designated control, the fourth designated control is used as the associated control of the first control in the second direction. If there are multiple fourth designated controls, the following can be implemented: determining the tenth distance between the designated vertex of each fourth designated control and the preset origin; and determining the fourth designated control with the smallest tenth distance as the associated control of the first control in the second direction.
[0399] Take the second direction as downward as an example for explanation, for example: the current display interface is as follows Fig.26As shown, control 2 is used as the first control, and a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls whose horizontal coordinates are greater than or equal to control 2 are determined to be: control 4, control 5, control 6, and control 8. That is, the third designated controls are control 4, control 5, control 6, and control 8. The upper left corner vertex of each control is used as the designated vertex, that is, the ninth distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 4, control 5, control 6, and control 8 is determined. It is determined that the third designated control with the smallest ninth distance is control 4, and control 4 is used as the associated control on the right of control 2.
[0400] In some other possible embodiments, if it is determined that there is no third specified control, the associated control of the first control can be determined based on the control whose specified vertex ordinate is smaller than the specified vertex ordinate of the first control. The method for determining the associated control of the first control based on the control whose specified vertex ordinate is smaller than the specified vertex ordinate of the first control is the same as Fig.38 The same is not repeated here; or, the associated control of the first control can be determined based on the control whose specified vertex ordinate is greater than or equal to the specified vertex horizontal coordinate of the first control, and the method for determining the associated control of the first control based on the control whose specified vertex ordinate is greater than or equal to the specified vertex horizontal coordinate of the first control is the same as Fig.35 The same is not repeated here; or, the associated control of the first control can be determined based on the control whose horizontal coordinate is smaller than the horizontal coordinate of the first control, and the method for determining the associated control of the first control based on the control whose horizontal coordinate is smaller than the horizontal coordinate of the first control is the same as Fig.37 The same is not repeated here.
[0401] In some possible embodiments, when the specified direction is the third direction, the associated control of the first control in the specified direction is determined based on the position information, which can be specifically implemented as follows: Fig.37 The steps shown, where:
[0402] Step 3701: The control whose horizontal coordinate is smaller than the horizontal coordinate of the first control is taken as the fifth designated control.
[0403] If the coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the third direction is the left, the first designated control is the control to the left of the first control in the current display interface.
[0404] Take the third direction as the left as an example. The current display interface is as follows: Fig.26 As shown, control 4 is used as the first control. If the designated vertex is the upper left vertex, a coordinate system is established with the upper left vertex of the current display interface as the preset origin. Then, the controls whose horizontal coordinates are smaller than the vertical coordinates of the upper left vertex of control 2 are: control 1, control 2, control 3, and control 9. That is, control 1, control 2, control 3, and control 9 are used as the fifth designated controls.
[0405] Step 3702: Determine an eleventh distance between the position coordinates of the designated vertex of the first control and the position coordinates of the designated vertex of each fifth designated control.
[0406] Continue with Fig.26 For example, the upper left corner vertex of each control is used as the designated vertex, that is, the eleventh distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 1, control 2, control 3, and control 9 is determined.
[0407] Step 3703: Use the fifth designated control with the smallest eleventh distance as the sixth designated control.
[0408] Continue with Fig.26 For example, if it is determined that the fifth control designated control with the smallest eleventh distance is control 3, control 3 is used as the sixth designated control.
[0409] Step 3704: Obtain the associated control of the first control in the third direction based on the sixth designated control.
[0410] In the present application, when there is only one sixth designated control, the sixth designated control is used as the associated control of the first control in the third direction. If there are multiple sixth designated controls, the following can be implemented: determining the twelfth distance between the designated vertex of each sixth designated control and the preset origin; and determining the sixth designated control with the smallest twelfth distance as the associated control of the first control in the third direction.
[0411] Take the third direction as the left as an example for explanation, for example: the current display interface is as follows Fig.29 As shown, control 3.3 is used as the first control, and a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin. The controls whose horizontal coordinates are smaller than control 2 are determined as: control 1, control 2, control 3.1, control 3.2, control 4, and control 5. That is, the fifth designated controls are control 1, control 2, control 3.1, control 3.2, control 4, and control 5. The upper left corner vertex of each control is used as the designated vertex, that is, the eleventh distance between the coordinates of the upper left corner vertex of control 3.3 and the coordinates of the upper left corner vertices of control 1, control 2, control 3.1, control 3.2, control 4, and control 5 is determined. It is determined that the fifth designated controls with the smallest eleventh distance are control 3.1 and control 3.2, and control 3.1 and control 3.2 are used as the sixth designated controls; the twelfth distance between the upper left corner vertices of control 3.1 and control 3.2 and the preset origin is determined respectively, and the sixth designated control with the smallest twelfth distance is determined to be control 3.2, and control 3.2 is used as the associated control of control 3.3 in the third direction.
[0412] In some other possible embodiments, if it is determined that there is no fifth specified control, the associated control of the first control can be determined based on the control whose specified vertex ordinate is smaller than the specified vertex ordinate of the first control. The method for determining the associated control of the first control based on the control whose specified vertex ordinate is smaller than the specified vertex ordinate of the first control is the same as Fig.38 The same is not repeated here; or, the associated control of the first control can be determined based on the control whose specified vertex ordinate is greater than or equal to the specified vertex horizontal coordinate of the first control, and the method for determining the associated control of the first control based on the control whose specified vertex ordinate is greater than or equal to the specified vertex horizontal coordinate of the first control is the same as Fig.35 The same is not repeated here; or, the associated control of the first control can be determined based on the control whose horizontal coordinate is greater than or equal to the horizontal coordinate of the first control, and the method for determining the associated control of the first control based on the control whose horizontal coordinate is greater than or equal to the horizontal coordinate of the first control is the same as Fig.36 The same is not repeated here.
[0413] In some possible embodiments, when the specified direction is the fourth direction, the associated control of the first control in the specified direction is determined based on the position information, which can be specifically implemented as follows: Fig.38 The steps shown, where:
[0414] Step 3801: The control whose designated vertex ordinate is smaller than the designated vertex ordinate of the first control is taken as the seventh designated control.
[0415] If a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the fourth direction is upward, the first designated control is a control below the first control in the current display interface.
[0416] Take the fourth direction as upward as an example, the current display interface is as follows Fig.21 As shown, control 2 is used as the first control. If the specified vertex is the upper left corner vertex, such as Fig.23 As shown, a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls whose ordinates are smaller than the ordinate of the upper left corner vertex of control 2 are: control 8 and control 9. That is, control 8 and control 9 are taken as the seventh designated controls.
[0417] Step 3802: Determine the thirteenth distance between the position coordinates of the designated vertex of the first control and the position coordinates of the designated vertex of each seventh designated control.
[0418] Continue with Fig.21 , Fig.23 For example, the upper left corner vertex of each control is used as the designated vertex, that is, the thirteenth distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 8 and control 9 is determined.
[0419] Step 3803: The seventh designated control with the smallest thirteenth distance is used as the eighth designated control.
[0420] Continue with Fig.21 , Fig.23 For example, if it is determined that the seventh designated control with the smallest thirteenth distance is control 8, then control 8 is used as the eighth designated control.
[0421] Step 3804: Obtain the associated control of the first control in the fourth direction based on the eighth designated control.
[0422] In the present application, when there is only one eighth designated control, the eighth designated control is used as the associated control of the first control in the fourth direction. If there are multiple eighth designated controls, the following can be implemented: determining the fourteenth distance between the designated vertex of each eighth designated control and the preset origin; and determining the eighth designated control with the smallest fourteenth distance as the associated control of the first control in the fourth direction.
[0423] Take the fourth direction as upward as an example for explanation, for example: the current display interface is as follows Fig.29 As shown, control 3 is used as the first control, and a coordinate system is established with the upper left corner vertex of the current display interface as the preset origin, and the controls whose vertical coordinates are smaller than control 3 are determined to be: control 1 and control 2. That is, the seventh designated controls are control 1 and control 2. The upper left corner vertex of each control is used as the designated vertex, that is, the thirteenth distance between the coordinates of the upper left corner vertex of control 2 and the coordinates of the upper left corner vertices of control 1 and control 2 is determined. It is determined that the seventh designated controls with the smallest thirteenth distance are control 1 and control 2, and control 1 and control 2 are used as the eighth designated controls. It is determined that the fourteenth distance between the upper left corner vertex of control 1 and the preset origin is the smallest, and control 1 is used as the associated control of control 3 above.
[0424] In some other possible embodiments, if it is determined that the seventh designated control does not exist, the associated control of the first control can be determined based on the control whose designated vertex ordinate is greater than or equal to the designated vertex ordinate of the first control. The method for determining the associated control of the first control based on the control whose designated vertex ordinate is greater than or equal to the designated vertex ordinate of the first control is the same as Fig.35 The same is not repeated here; or, the associated control of the first control can be determined based on the control whose specified vertex ordinate is smaller than the specified vertex horizontal coordinate of the first control, and the method for determining the associated control of the first control based on the control whose specified vertex ordinate is smaller than the specified vertex horizontal coordinate of the first control is the same as Fig.36 The same is not repeated here; or, the associated control of the first control can be determined based on the control whose horizontal coordinate is smaller than the horizontal coordinate of the first control, and the method for determining the associated control of the first control based on the control whose horizontal coordinate is smaller than the horizontal coordinate of the first control is the same as Fig.37 The same is not repeated here.
[0425] In summary, the associated controls of each first control in each specified direction can be determined according to the position relationship, and the first direction is downward, the second direction is rightward, the third direction is leftward, and the fourth direction is upward. Fig.29 The current display interface is shown. The above method can be used to obtain Fig.39A The focus-finding strategy shown. Fig.39A You can get the information of each first control, such as Fig.39B shown.
[0426] In some other possible embodiments, the remote controller may have other buttons in addition to the conventional direction buttons, such as switching groups. The user may also use these buttons to trigger the focus switching operation, for example, the user uses the virtual remote controller on the mobile phone to operate, such as Fig.40 As shown, the virtual remote control on the mobile phone has two buttons, ENTER and EXIT, in addition to the common direction keys. Therefore, when building a focus search strategy, it is also necessary to determine the associated controls corresponding to each first control when the user presses ENTER, and the associated controls corresponding to each first control when the user presses EXIT.
[0427] In some possible embodiments, determining the associated control corresponding to the ENTER of each first control can be implemented as follows: determining the parent control corresponding to the first control, and using the parent control of the first control as the associated control corresponding to the ENTER of the first control. Fig.35 The method shown is to determine the parent control of the first control as the associated control corresponding to the ENTER of the first control.
[0428] For example: Fig.41 As shown, there are controls A, B, C, and D in the current display interface; confirm Fig.41 The corresponding inclusion relationship is as follows Fig.42 As shown, it is determined that the first control is control C, and based on the inclusion relationship, it can be determined that the associated control corresponding to the ENTER of control C is control B.
[0429] In some possible embodiments, determining the associated control corresponding to EXIT of each first control can be implemented as follows: determining the sub-control corresponding to the first control, and obtaining the associated control corresponding to EXIT based on the position information of the sub-control and the position information of the first control. The specific implementation method of obtaining the associated control corresponding to EXIT based on the position information of the sub-control and the position information of the first control is the same as FIG28 and will not be repeated here.
[0430] For example: Fig.41 As shown, there are controls A, B, C, and D in the current display interface; confirm Fig.41The corresponding inclusion relationship is as follows Fig.42 As shown, it is determined that the first control is control B, and based on the inclusion relationship and the position relationship, it can be determined that the associated control corresponding to the EXIT of control B is control C.
[0431] Step 702: Determine a target control based on an initial control, a focus direction, and a focus strategy of the current display interface; wherein the initial control is a focus control in the current display interface.
[0432] In this application, after the user triggers the focus switching operation, in order to ensure the accuracy of the focus switching, it is necessary to determine the initial control in the current interface. The initial control is the focus control in the current display interface. The focus control is the control selected by the user after the last focus switching operation, or the default control set by the terminal device system. The terminal device determines the interface where the user triggers the focus switching operation as the current display interface.
[0433] In some possible embodiments, there may be non-focusable controls set by technicians in the current display interface. Therefore, when determining the initial control, it is first necessary to determine whether there is a selected control. If there is a selected control, the selected control is used as the initial control; if there is no selected control, the control with focus is used as the initial control. The selected control is the control selected based on the user's focus switching operation. When the selected control is a non-focusable control, the focus is on the control selected before the selected control is selected. For example: the order in which the user selects controls is to select control A and control B, where control B is a non-focusable control. The step implemented based on the user's focus switching operation is to select control B. At this time, there is no need to move the focus, and the control with focus is still control A. If the user triggers the focus switching operation again at this time, it is determined that the initial control at this time is control B.
[0434] In the present application, the initial control can be accurately determined by this method, thereby ensuring the accuracy of focus switching.
[0435] In the present application, after determining the initial control and the focusing strategy, the target control corresponding to the initial control is determined in the focusing strategy based on the focus switching operation. Specifically, it can be implemented as follows: determining the focusing direction corresponding to the focus switching operation; and taking the control in the focusing strategy in the focusing direction of the initial control as the target control.
[0436] For example: if the focus direction corresponding to the focus switching operation is determined to be upward, the control above the initial control in the focus strategy is used as the target control, as shown in Figure 39. If the initial control is control 3 and the focus direction is upward, the target control is control 1.
[0437] Step 703: Move the focus of the current display interface from the initial control to the target control.
[0438] In this application, in order to facilitate the user to operate the target control, it is necessary to select the target control while moving the focus from the initial control to the target control, such as Fig.43A As shown, the initial control is control B, and the target control is determined to be control C. When the focus is moved from control B to control C, control C needs to be selected at the same time.
[0439] In some other possible embodiments, considering that some controls may be set by technicians to be non-focusable, before executing step 703, it is necessary to determine whether the target control is a focusable control. If so, step 703 is executed. If not, there is no need to move the focus at this time. However, in order to ensure that the user can operate the target control, the target control needs to be selected. Fig.43A Take for example, the initial control is control B, the target control is determined to be control C, and control C is a non-focusable control. In this case, there is no need to switch the focus to control C. You only need to select control C. When selecting, you can Fig.43A Select as shown, or Fig.43B Select as shown.
[0440] In some possible embodiments, based on the user's operation on the terminal device, such as Fig.44 As shown, the layout of the controls in the terminal device may change. In order to ensure the accuracy of focus switching in this case, when the terminal device detects that the parameter information of the first control in the current display interface has changed, it generates a focus strategy corresponding to the current display interface based on the parameter information of the first control in the current display interface. The focus strategy corresponding to the current display interface generated based on the parameter information of the first control in the current display interface is the same as described above and will not be repeated here.
[0441] The present application also provides a control system for a terminal device, such as Fig.45 As shown, the system includes: a focus management module and a view control module (ViewRoot).
[0442] The focus management module is used to synchronize the control information in the current display interface with the terminal device, manage, maintain and save the data corresponding to the control information, and after receiving the focus switching operation, set the terminal device to enable the focus switching by calling the system request Focus interface.
[0443] When the user presses a button, ViewRoot will receive the button event, synchronize the information of all controls to the focus management module, and the focus management module will determine the focus strategy based on the control information. The specified direction corresponding to the button event is determined, and then the specified direction is sent to the focus management module. The focus management module obtains the initial control, determines the target control based on the focus strategy, and sends the target control to ViewRoot, which performs the focus switching process.
[0444] In this application, the interaction flow chart between the focus management module and ViewRoot is as follows Fig.46 As shown:
[0445] Step 4601: ViewRoot determines the current display interface corresponding to the focus switching operation;
[0446] Step 4602: ViewRoot sends the position information of all first controls in the current display interface and the corresponding relationship between the parent control and the child control of each control to the focus management module;
[0447] Step 4603: The focus management module generates a focus search strategy according to the received position information of the first control and the corresponding relationship between the parent control and the child control of each control;
[0448] Step 4604: ViewRoot determines the specified direction and initial control corresponding to the focus switching operation;
[0449] Step 4605: ViewRoot sends the initial control and the specified direction to the focus management module;
[0450] Step 4606: The focus management module determines the target control according to the initial control, the specified direction, and the focus search strategy;
[0451] Step 4607: The focus management module sends the target control to ViewRoot;
[0452] Step 4608: ViewRoot switches focus according to the target control.
[0453] Based on the same inventive concept, after introducing a control method of a terminal device provided by an embodiment of the present application, as shown in FIG. Fig.47 As shown, a terminal device control device 4700 provided in an embodiment of the present application is described below, and the device includes:
[0454] The response module 47001 is used to respond to the focus switching operation, determine the focus direction, and obtain the focus strategy corresponding to the current display interface; the focus strategy is used to characterize the focus switching relationship between various controls in the current display interface;
[0455] The target control determination module 47002 is used to determine the target control based on the initial control of the current display interface, the focus direction and the focus strategy; wherein the initial control is the focus control in the current display interface;
[0456] The focus switching module 47003 is used to move the focus of the current display interface from the initial control to the target control.
[0457] In some possible embodiments, the response module 47001 is specifically used to:
[0458] Obtaining parameter information of each first control in the current display interface;
[0459] A focus strategy corresponding to the current display interface is generated based on parameter information of each first control in the current display interface.
[0460] In some possible embodiments, the response module 47001 is specifically used to:
[0461] Determine the associated control of each first control in each specified direction based on the parameter information of each first control; wherein the specified direction includes at least one or a combination of the following: a first direction, a second direction, a third direction, and a fourth direction; the first direction, the second direction, the third direction, and the fourth direction are all different;
[0462] A focus strategy is generated based on the associated controls of each first control in each specified direction.
[0463] In some possible embodiments, the response module 47001 is specifically used to:
[0464] For each first control, determining a parent control and a child control of the first control based on position information of the first control in the current display interface;
[0465] Determining a control of the same level of the first control based on the parent control of the first control; wherein the parent control of the control of the same level is the same as the parent control of the first control;
[0466] Based on the parent control, child controls and controls at the same level of the first control, an associated control of the first control in each specified direction is determined.
[0467] In some possible embodiments, the response module 47001 is specifically used to:
[0468] If the specified direction includes a first direction, based on the positional relationship between the first control and the control at the same level in the current display interface, determine the control at the same level of the first control in the first direction, and use the control at the same level of the first control in the first direction as the associated control of the first control in the first direction; and / or,
[0469] If the specified direction includes a second direction and the first control has a sub-control, the sub-control of the first control is used as an associated control of the first control in the second direction; and / or,
[0470] If the specified direction includes a third direction and the first control has a parent control, the parent control of the first control is used as an associated control of the first control in the third direction; and / or,
[0471] If the specified direction includes a fourth direction, based on the positional relationship between the first control and the control at the same level in the current display interface, the control at the same level of the first control in the fourth direction is determined, and the control at the same level of the first control in the fourth direction is used as the associated control of the first control in the fourth direction.
[0472] In some possible embodiments, the response module 47001 is further used to:
[0473] If the specified direction includes a second direction and the first control has no child control, the parent control of the first control, the control at the same level of the first control, or the child control of the control at the same level of the first control is used as the associated control of the first control in the second direction.
[0474] In some possible embodiments, the response module 47001 is specifically used to:
[0475] If the specified direction includes a second direction and the first control has no child control, when the first control has a control at the same level and the control at the same level is located in the second direction of the first control, the control at the same level in the second direction is used as an associated control of the first control in the second direction; or
[0476] If the specified direction includes a second direction and the first control has no child controls, when the first control has controls at the same level and the controls at the same level are not located in the second direction of the first control, the controls at the same level that are not located in the second direction will be used as associated controls of the first control in the second direction.
[0477] In some possible embodiments, the response module 47001 is specifically used to:
[0478] If the designated direction includes a second direction and the first control has no child control, when the first control has no controls at the same level, the parent control of the first control is used as an associated control of the first control in the second direction.
[0479] In some possible embodiments, the response module 47001 is specifically used to:
[0480] If the specified direction includes a second direction and the first control has no sub-control, when the first control has a control at the same level in the second direction and the control at the same level has a sub-control, the sub-control of the control at the same level is used as an associated control of the first control in the second direction; or
[0481] If the specified direction includes a second direction and the first control has no child controls, when the first control has a control at the same level, the control at the same level has child controls and the control at the same level is not located in the second direction of the first control, the child controls of the control at the same level that are not located in the second direction will be used as associated controls of the first control in the second direction.
[0482] In some possible embodiments, the response module 47001 is further used to:
[0483] If the specified direction includes a third direction and the pair of controls has no parent control, the child control of the first control, the control at the same level of the first control, or the parent control of the control at the same level of the first control is used as the associated control of the first control in the third direction.
[0484] In some possible embodiments, the response module 47001 is specifically used to:
[0485] If the designated direction includes a third direction and the first control has no parent control, when the first control has no controls at the same level, a child control of the first control is used as an associated control of the first control in the third direction.
[0486] In some possible embodiments, the response module 47001 is specifically used to:
[0487] If the specified direction includes a third direction and the first control has no parent control, when there is a control at the same level as the first control and the control at the same level is located in the third direction of the first control, the control at the same level in the third direction is used as an associated control of the first control in the third direction; or
[0488] If the specified direction includes a third direction and the first control has no parent control, when the first control has a control at the same level and the control at the same level is not located in the third direction of the first control, the control at the same level that is not located in the third direction will be used as the associated control of the first control in the third direction.
[0489] In some possible embodiments, the response module 47001 is specifically used to:
[0490] Obtaining the location information of the control at the same level;
[0491] Based on the preset point coordinate information of the first control and the preset coordinate information of the control at the same level, the control at the same level of the first control in the specified direction is obtained.
[0492] In some possible embodiments, the response module 47001 is specifically used to:
[0493] Determine a first distance between the coordinate information of the preset point of the first control and the coordinate information of the preset point of each first same-level control; the first same-level control is a same-level control of the first control in the specified direction;
[0494] Based on the first same-level control with the smallest first distance, the associated control of the first control in the specified direction is obtained.
[0495] In some possible embodiments, the response module 47001 is specifically used to:
[0496] Using the first same-level control with the smallest first distance as the second same-level control;
[0497] If there is a second control at the same level, the second control at the same level is used as an associated control of the first control in the specified direction;
[0498] If there are multiple second controls at the same level, determine the second distance between the preset point and the preset origin of each of the second controls at the same level; and determine the second control at the same level with the smallest second distance as the associated control of the first control in the specified direction.
[0499] In some possible embodiments, the response module 47001 is specifically used to:
[0500] Determine a first pixel point of the current display interface based on the preset point coordinate information of the first control, where the first pixel point is a pixel point included in the first control;
[0501] Determine a second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is a first control other than the first control in the current display interface;
[0502] For each of the other controls, if the first pixel includes all the second pixel points corresponding to the other control, the other control is determined as a second control;
[0503] For each of the second controls, determine whether all the pixels corresponding to the second control are contained in other second controls; if so, use the second control as a third control;
[0504] Update the second control based on the third control to obtain an updated second control;
[0505] The updated second control is used as a child control of the first control.
[0506] In some possible embodiments, the response module 47001 is specifically used to:
[0507] Determine a first pixel point included in the first control based on the preset point coordinates of the first control;
[0508] Determine a second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is a first control other than the first control in the current display interface;
[0509] For each of the other controls: if the second pixel points corresponding to the other controls include all the first pixel points corresponding to the first control, the other controls are determined as the fourth control;
[0510] For each of the fourth controls: determining whether all the pixels in the fourth control are contained in the pixels corresponding to other fourth controls; if so, recording the fourth control as a fifth control;
[0511] Update the fourth control based on the fifth control to obtain an updated fourth control;
[0512] The updated fourth control is used as a parent control of the first control.
[0513] In some possible embodiments, the response module 47001 is specifically used to:
[0514] Obtaining a preset inclusion relationship corresponding to the current display interface; the preset inclusion relationship corresponding to the current display interface is used to record the predicted controls included in the current display interface and the inclusion relationship between each control;
[0515] Determining whether the first control is a separate first control based on the preset inclusion relationship; the separate first control is a control that exists in the current display interface and is not recorded in the preset inclusion relationship;
[0516] If yes, then obtaining preset attribute information and position information of the first control and the non-individual control; the non-individual control is the control recorded in the preset inclusion relationship;
[0517] For each non-individual control, based on the position information of the first control, the position information of the non-individual control, the preset attribute information of the first control, and the preset attribute information of the non-individual control, obtain a first score of the non-individual control;
[0518] The first highest-scoring non-individual control was identified;
[0519] Based on the non-individual control with the first highest score, a parent control of the first control is determined.
[0520] In some possible embodiments, the response module 47001 is specifically used to:
[0521] Based on the position information of each non-individual control with the highest first score, determining the distance between each non-individual control with the highest first score and a preset origin;
[0522] The first non-single control with the highest score whose distance to the preset origin is the smallest is used as the first target non-single control;
[0523] The parent control of the first target non-independent control is used as the parent control of the first control.
[0524] In some possible embodiments, the preset attribute information includes at least one of the following: attributes of the control, and the type of the control.
[0525] In some possible embodiments, the target control determination module 47002 is specifically used to:
[0526] Determining a focus direction corresponding to the focus switching operation;
[0527] The control in the focus direction of the initial control in the focus strategy is used as the target control.
[0528] In some possible embodiments, the response module 47001 is specifically used to:
[0529] Obtaining the identity of the current display interface;
[0530] A focus strategy corresponding to the current display interface is obtained from the generated focus strategies based on the identity identifier of the current display interface.
[0531] Corresponding to the above embodiments, the present application also provides an electronic device. Fig.48 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, the electronic device 4800 may include: a processor 4801, a memory 4802 and a communication unit 4803. These components communicate through one or more buses, and those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiment of the present invention, it can be a bus structure or a star structure, and can also include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0532] The communication unit 4803 is used to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices or send user data to other devices.
[0533] The processor 4801 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs and / or modules stored in the memory 4802, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 4801 can include only a central processing unit (CPU). In an embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0534] The memory 4802 is used to store the execution instructions of the processor 4801. The memory 4802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk.
[0535] When the execution instruction in the memory 4802 is executed by the processor 4801, the electronic device 4800 can execute Fig. 9 Some or all of the steps in the illustrated embodiments.
[0536] In a specific implementation, the present invention further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the terminal device control method provided by the present invention. The storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0537] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention or some parts of the embodiments.
[0538] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
Claims
1. A method for controlling a terminal device, characterized in that: The method comprises: In response to the focus switching operation, determining the focus direction, and acquiring the focus strategy corresponding to the current display interface; the focus strategy is used to characterize the focus switching relationship between various controls in the current display interface; Determine a target control based on an initial control of a current display interface, the focus direction, and the focus strategy; wherein the initial control is a focus control in the current display interface; The focus of the current display interface is moved from the initial control to the target control.
2. The method according to claim 1, characterized in that The obtaining of the focus strategy corresponding to the current display interface includes: Obtaining parameter information of each first control in the current display interface; A focus strategy corresponding to the current display interface is generated based on parameter information of each first control in the current display interface.
3. The method according to claim 2, characterized in that The generating a focus strategy corresponding to the current display interface based on the parameter information of each first control in the current display interface includes: Determine the associated control of each first control in each specified direction based on the parameter information of each first control; wherein the specified direction includes at least one or a combination of the following: a first direction, a second direction, a third direction, and a fourth direction; the first direction, the second direction, the third direction, and the fourth direction are all different; A focus strategy is generated based on the associated controls of each first control in each specified direction.
4. The method according to claim 3, characterized in that The parameter information of the first control includes position information of the first control in the current display interface; The determining, based on the parameter information of each first control, an associated control of each first control in each specified direction includes: For each first control, determining a parent control and a child control of the first control based on position information of the first control in the current display interface; Determining a control of the same level of the first control based on the parent control of the first control; wherein the parent control of the control of the same level is the same as the parent control of the first control; Based on the parent control, child controls and controls at the same level of the first control, an associated control of the first control in each specified direction is determined.
5. The method according to claim 4, characterized in that The determining the associated controls of the first control in each specified direction based on the parent control, child controls, and controls at the same level of the first control includes: If the specified direction includes a first direction, based on the positional relationship between the first control and the control at the same level in the current display interface, determine the control at the same level of the first control in the first direction, and use the control at the same level of the first control in the first direction as the associated control of the first control in the first direction; and / or, If the specified direction includes a second direction and the first control has a sub-control, the sub-control of the first control is used as an associated control of the first control in the second direction; and / or, If the specified direction includes a third direction and the first control has a parent control, the parent control of the first control is used as an associated control of the first control in the third direction; and / or, If the specified direction includes a fourth direction, based on the positional relationship between the first control and the control at the same level in the current display interface, the control at the same level of the first control in the fourth direction is determined, and the control at the same level of the first control in the fourth direction is used as the associated control of the first control in the fourth direction.
6. The method according to claim 5, characterized in that The method further comprises: If the specified direction includes a second direction and the first control has no child control, the parent control of the first control, the control at the same level of the first control, or the child control of the control at the same level of the first control is used as the associated control of the first control in the second direction.
7. The method according to claim 6, characterized in that If the specified direction includes a second direction and the first control has no child control, taking a control at the same level of the first control as an associated control of the first control in the second direction includes: If the specified direction includes a second direction and the first control has no child control, when the first control has a control at the same level and the control at the same level is located in the second direction of the first control, the control at the same level in the second direction is used as an associated control of the first control in the second direction; or If the specified direction includes a second direction and the first control has no child controls, when the first control has controls at the same level and the controls at the same level are not located in the second direction of the first control, the controls at the same level that are not located in the second direction will be used as associated controls of the first control in the second direction.
8. The method according to claim 6, characterized in that If the specified direction includes a second direction and the first control has no child control, taking the parent control of the first control as an associated control of the first control in the second direction includes: If the designated direction includes a second direction and the first control has no child control, when the first control has no controls at the same level, the parent control of the first control is used as an associated control of the first control in the second direction.
9. The method according to claim 6, characterized in that If the specified direction includes the second direction and the first control has no child control, taking the child control of the control at the same level of the first control as the associated control of the first control in the second direction includes: If the specified direction includes a second direction and the first control has no sub-control, when the first control has a control at the same level in the second direction and the control at the same level has a sub-control, the sub-control of the control at the same level is used as an associated control of the first control in the second direction; or If the specified direction includes a second direction and the first control has no child controls, when the first control has a control at the same level, the control at the same level has child controls and the control at the same level is not located in the second direction of the first control, the child controls of the control at the same level that are not located in the second direction will be used as associated controls of the first control in the second direction.
10. The method according to claim 5, characterized in that The method further comprises: If the specified direction includes a third direction and the pair of controls has no parent control, the child control of the first control, the control at the same level of the first control, or the parent control of the control at the same level of the first control is used as the associated control of the first control in the third direction.
11. The method according to claim 10, characterized in that If the specified direction includes a third direction and the pair of controls does not have a parent control, using the child control of the first control as an associated control of the first control in the third direction includes: If the designated direction includes a third direction and the first control has no parent control, when the first control has no controls at the same level, a child control of the first control is used as an associated control of the first control in the third direction.
12. The method according to claim 10, characterized in that If the specified direction includes a third direction and the pair of controls does not have a parent control, using a control at the same level of the first control as an associated control of the first control in the third direction includes: If the specified direction includes a third direction and the first control has no parent control, when there is a control at the same level as the first control and the control at the same level is located in the third direction of the first control, the control at the same level in the third direction is used as an associated control of the first control in the third direction; or If the specified direction includes a third direction and the first control has no parent control, when the first control has a control at the same level and the control at the same level is not located in the third direction of the first control, the control at the same level that is not located in the third direction will be used as the associated control of the first control in the third direction.
13. The method according to any one of claims 5 to 12, characterized in that: The position information of the first control in the current display interface includes: coordinate information of a preset point of the first control in the current display interface; Determining a control at the same level as the first control in a specified direction includes: Obtaining the location information of the control at the same level; Based on the preset point coordinate information of the first control and the preset coordinate information of the control at the same level, a control at the same level of the first control in the specified direction is obtained.
14. The method according to claim 13, characterized in that If there are multiple controls of the same level as the first control in the specified direction, taking the controls of the same level as the first control in the specified direction as associated controls of the first control in the specified direction includes: Determine a first distance between the coordinate information of the preset point of the first control and the coordinate information of the preset point of each first same-level control; the first same-level control is a same-level control of the first control in the specified direction; Based on the first same-level control with the smallest first distance, the associated control of the first control in the specified direction is obtained.
15. The method according to claim 14, characterized in that The obtaining, based on the first same-level control with the smallest first distance, an associated control of the first control in a specified direction includes: Using the first same-level control with the smallest first distance as the second same-level control; If there is a second control at the same level, the second control at the same level is used as an associated control of the first control in the specified direction; If there are multiple second controls at the same level, determine the second distance between the preset point and the preset origin of each of the second controls at the same level; and determine the second control at the same level with the smallest second distance as the associated control of the first control in the specified direction.
16. The method according to claim 4, characterized in that The position information of the first control in the current display interface includes: coordinate information of a preset point of the first control in the current display interface; The determining of the sub-control of the first control includes: Determine a first pixel point of the current display interface based on the preset point coordinate information of the first control, where the first pixel point is a pixel point included in the first control; Determine a second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is a first control other than the first control in the current display interface; For each of the other controls, if the first pixel includes all the second pixel points corresponding to the other control, the other control is determined as a second control; For each of the second controls, determine whether all the pixels corresponding to the second control are contained in other second controls; if so, use the second control as a third control; Update the second control based on the third control to obtain an updated second control; The updated second control is used as a child control of the first control.
17. The method according to claim 4, characterized in that The position information of the first control in the current display interface includes: the preset point coordinate information of the first control in the current display interface; and determining the parent control of the first control includes: Determine a first pixel point included in the first control based on the preset point coordinates of the first control; Determine a second pixel point included in each other control based on the preset point coordinates of each other control in the current display interface; the other control is a first control other than the first control in the current display interface; For each of the other controls: if the second pixel points corresponding to the other controls include all the first pixel points corresponding to the first control, the other controls are determined as the fourth control; For each of the fourth controls: determining whether all the pixels in the fourth control are contained in the pixels corresponding to other fourth controls; if so, recording the fourth control as a fifth control; Update the fourth control based on the fifth control to obtain an updated fourth control; The updated fourth control is used as a parent control of the first control.
18. The method according to claim 4, characterized in that The parameter information further includes: preset attribute information, and the determining of the parent control of the first control includes: Obtaining a preset inclusion relationship corresponding to the current display interface; the preset inclusion relationship corresponding to the current display interface is used to record the predicted controls included in the current display interface and the inclusion relationship between each control; Determining whether the first control is a separate first control based on the preset inclusion relationship; the separate first control is a control that exists in the current display interface and is not recorded in the preset inclusion relationship; If yes, then obtaining preset attribute information and position information of the first control and the non-individual control; the non-individual control is the control recorded in the preset inclusion relationship; For each non-individual control, based on the position information of the first control, the position information of the non-individual control, the preset attribute information of the first control, and the preset attribute information of the non-individual control, obtain a first score of the non-individual control; The first highest-scoring non-individual control was identified; Based on the non-individual control with the first highest score, a parent control of the first control is determined.
19. The method according to claim 18, characterized in that The determining the parent control of the first control based on the non-individual control with the highest first score comprises: Based on the position information of each non-individual control with the highest first score, determining the distance between each non-individual control with the highest first score and a preset origin; The first non-single control with the highest score whose distance to the preset origin is the smallest is used as the first target non-single control; The parent control of the first target non-independent control is used as the parent control of the first control.
20. The method according to claim 8, characterized in that The preset attribute information includes at least one of the following: attributes of the control and the type of the control.
21. The method according to claim 1, characterized in that The determining the target control based on the focus switching operation, the initial control and the focus search strategy includes: Determining a focus direction corresponding to the focus switching operation; The control in the focus direction of the initial control in the focus strategy is used as the target control.
22. The method according to claim 1, characterized in that The obtaining of the focus strategy corresponding to the current display interface includes: Obtaining the identity of the current display interface; A focus strategy corresponding to the current display interface is obtained from the generated focus strategies based on the identity identifier of the current display interface.
23. A control device for a terminal device, characterized in that: The device comprises: A response module, used to respond to the focus switching operation, determine the focus direction, and obtain the focus strategy corresponding to the current display interface; the focus strategy is used to characterize the focus switching relationship between various controls in the current display interface, and the focus strategies corresponding to different interfaces are not completely the same; A target control determination module, used to determine a target control based on an initial control of a current display interface, the focus direction, and the focus strategy; wherein the initial control is a focus control in the current display interface; A focus switching module is used to move the focus of the current display interface from the initial control to the target control.
24. An electronic device, characterized in that: It comprises a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method according to any one of claims 1 to 22.
25. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 22.