CN110874252A - Focus control method, device and equipment - Google Patents

Focus control method, device and equipment Download PDF

Info

Publication number
CN110874252A
CN110874252A CN201811000902.XA CN201811000902A CN110874252A CN 110874252 A CN110874252 A CN 110874252A CN 201811000902 A CN201811000902 A CN 201811000902A CN 110874252 A CN110874252 A CN 110874252A
Authority
CN
China
Prior art keywords
focus
control
moving
application program
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811000902.XA
Other languages
Chinese (zh)
Inventor
孙向作
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TCL Corp
TCL Research America Inc
Original Assignee
TCL Research America Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TCL Research America Inc filed Critical TCL Research America Inc
Priority to CN201811000902.XA priority Critical patent/CN110874252A/en
Publication of CN110874252A publication Critical patent/CN110874252A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/167Audio in a user interface, e.g. using voice commands for navigating, audio feedback

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Telephone Function (AREA)

Abstract

The invention is suitable for the technical field of Android application, and provides a method, a device and equipment for focus control.

Description

Focus control method, device and equipment
Technical Field
The invention belongs to the technical field of focus control, and particularly relates to a focus control method, a device and equipment.
Background
The focus moving operation of a UI (User Interface) based on an Android platform follows the recent principle, and the moving unit is 1. That is, if an up operation is performed at the current focus, the focus jumps to the nearest upper UI control of the current focus. Downward, leftward, and rightward operations are similar, except in different directions.
Currently, the focus movement operation of the UI interface is controlled based on voice recognition by recognizing corresponding voice, converting the recognized voice into a corresponding command, and finally executing the corresponding operation through the command to implement the focus movement operation of the UI interface. At present, Android only supports focus operation with a movement unit of 1, for example, only supports 1 focus operation of moving right, so that the focus movement efficiency is low, and the user experience is very poor.
Disclosure of Invention
In view of this, embodiments of the present invention provide a focus control method, a focus control device, and a terminal device, so as to solve the problems of low efficiency of controlling focus movement and poor user experience in the existing focus movement process.
A first aspect of an embodiment of the present invention provides a focus control method, including:
acquiring and analyzing voice information input by a user;
judging whether the analyzed voice information contains focus moving digits;
and if the analyzed voice information contains the focus moving digit, triggering a focus monitoring callback function of a control to which the current focus belongs, and carrying out moving control on the current focus according to the focus moving digit.
A second aspect of an embodiment of the present invention provides a focus control apparatus, including:
the voice information acquisition unit is used for acquiring and analyzing voice information input by a user;
a parameter judgment unit for judging whether the analyzed voice message contains focus moving digit;
and the focus control unit is used for triggering a focus monitoring callback function of the control to which the current focus belongs if the analyzed voice information contains the focus moving digit, and controlling the movement of the current focus according to the focus moving digit. A third aspect of an embodiment of the present invention provides a terminal device, including:
the focus control method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the focus control method provided by the first aspect of the embodiments of the present invention when executing the computer program.
Wherein the computer program comprises:
the voice information acquisition unit is used for acquiring and analyzing voice information input by a user;
a parameter judgment unit for judging whether the analyzed voice message contains focus moving digit;
and the focus control unit is used for triggering a focus monitoring callback function of the control to which the current focus belongs if the analyzed voice information contains the focus moving digit, and controlling the movement of the current focus according to the focus moving digit. A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium storing a computer program, where the computer program, when executed by a processor, implements the steps of the focus control method provided by the first aspect of the embodiments of the present invention.
Wherein the computer program comprises:
the voice information acquisition unit is used for acquiring and analyzing voice information input by a user;
a parameter judgment unit for judging whether the analyzed voice message contains focus moving digit;
and the focus control unit is used for triggering a focus monitoring callback function of the control to which the current focus belongs if the analyzed voice information contains the focus moving digit, and controlling the movement of the current focus according to the focus moving digit.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: after voice information input by a user is acquired and analyzed, and when the analyzed voice information contains a focus moving digit, a focus monitoring callback function of a control to which a current focus belongs is triggered, the current focus is subjected to movement control according to the focus moving digit, the movement control of the focus by the voice is realized through the focus monitoring callback function, the focus moving efficiency is improved, and the user experience is better.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating an implementation of a focus control method according to an embodiment of the present invention;
fig. 2 is a flowchart of a specific implementation of a method for controlling movement of a current focus according to the number of focus movement bits according to a second embodiment of the present invention;
FIG. 3 is a schematic diagram of a focus shift of 2 units according to a second embodiment of the present invention;
fig. 4 is a flowchart illustrating a specific implementation of a method for adding a focus listening callback function to a control according to a third embodiment of the present invention;
fig. 5 is a flowchart of a specific implementation of a method for obtaining a control address according to a third embodiment of the present invention;
fig. 6 is a flowchart of a specific implementation of a method for modifying an event distribution function in a system source code file according to a third embodiment of the present invention;
fig. 7 is a flowchart illustrating an implementation of a method for adding a focus snoop callback function to an application being installed according to a fourth embodiment of the present invention;
fig. 8 is a schematic diagram of a focus control apparatus according to a fifth embodiment of the present invention;
fig. 9 is a schematic diagram of a focus control apparatus according to a sixth embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Example one
Referring to fig. 1, fig. 1 shows an implementation flow of a focus control method provided by an embodiment of the present invention, which is detailed as follows:
in step S101, voice information input by the user is acquired and analyzed.
In the embodiment of the invention, when detecting that a user operates, firstly, judging whether the operation currently performed by the user is a key operation or a voice operation, if the operation currently performed by the user is the key operation, moving the current focus according to 1 moving unit, for example, moving the current focus to the right by one unit; if the operation currently performed by the user is a voice operation, step S101 is performed.
In step S102, it is determined whether the parsed voice message includes the focus shift digits.
After step S102, when it is determined that the analyzed voice message does not include the focus movement digit, the current focus is controlled to move in a key operation manner, and the current focus is moved in one movement unit.
In step S103, if the analyzed voice message includes a focus movement bit number, a focus listening callback function of the control to which the current focus belongs is triggered, and the current focus is controlled to move according to the focus movement bit number.
In the embodiment of the present invention, each control is provided with a focus listening callback function, and the focus listening callback function includes: whether the parameters include parameters such as the number of focal point moving bits, the moving direction, the number of each page, the number of each line of control, the number of lines of each page and the like; the focus monitoring callback function is specifically used for triggering the focus monitoring callback function of the control to which the current focus belongs when the analyzed voice information contains the focus moving digit, transmitting the content of the voice information to the control to which the current focus belongs to obtain the position parameter of the control to which the current focus belongs, and calculating according to the focus moving digit contained in the analyzed voice information and the position parameter of the control to which the current focus belongs to determine the final focus position, namely, the focus to be controlled by the content of the voice information is realized, and the current focus is directly moved to the determined final focus position.
In the embodiment of the invention, after the voice information input by the user is acquired and analyzed, and when the analyzed voice information contains the focus moving digit, the focus monitoring callback function of the control to which the current focus belongs is triggered, the current focus is subjected to movement control according to the focus moving digit, and the movement control of the voice focus is realized through the focus monitoring callback function, so that the focus moving efficiency is improved, and the user experience is better.
Example two
Referring to fig. 2, fig. 2 shows a specific implementation flow of a method for controlling the movement of the current focus according to the focus movement bits according to the second embodiment of the present invention, which is detailed as follows:
in step S201, a position parameter of a control to which the current focus belongs is obtained through the focus listening callback function.
In the embodiment of the present invention, the incoming parameters are obtained through a focus listening callback function, where the incoming parameters include a parameter v, a parameter direction, a parameter offset, a parameter numOfPage, a parameter numOfClow, and a parameter clowns. The parameter v is an incoming control, the parameter direction is an operation direction, the parameter offset is a focus movement bit number, the parameter numOfPage is the total number of controls included in each interface, the parameter numOfClow is the number of controls in each line, and the parameter clowns is the number of lines of controls in each interface.
Here, the control to which the current focus belongs is specifically a control corresponding to the currently selected focus. The position parameter is specifically a coordinate value of the control on the interface to which the control belongs, the coordinate value is not an actual coordinate, but is only a numerical value, for example, one page in one interface includes 6 rows, the number of the controls in each 1 row is 7, that is, the page includes 42 controls, the control to which the current focus belongs is on the third row and the third row in the page, when the Android displays the control, the coordinate of the control is calculated from 0, then the coordinate value of the control to which the current focus belongs is 16, that is, the position parameter of the control to which the current focus belongs is 16.
Here, since the acquired position parameter of the control to which the current focus belongs is only one coordinate value, it is not clear that the position parameter is specifically located in the row, and the position of the current focus needs to be further determined according to the position parameter to realize accurate focus movement control.
In step S202, it is determined whether the position parameter is smaller than N multiplied by the number of controls in each row, where N is a positive integer.
In step S203, if the position parameter is smaller than N times the number of controls in each row, it is determined that the current focus is located in the nth row.
In the embodiment of the invention, whether the position parameter of the control to which the current focus belongs is less than 1 times the number of the controls in the first row of the page where the control is located is judged, and if so, the current focus is determined to be located in the first row of the page where the control belongs.
And if the position parameter of the control to which the current focus belongs is smaller than the number of the rows of each page multiplied by the number of the controls in each row, determining that the current focus is positioned in the last row.
That is, after step S202, the following steps are further included:
and if the position parameter is greater than or equal to N multiplied by the number of the controls in each line, judging whether the position parameter is less than N +1 multiplied by the number of the controls in each line.
In step S204, a corresponding position determination method is determined according to the moving direction in the voice message.
In the embodiment of the present invention, determining a corresponding position determination manner according to the moving direction specifically includes:
when the moving direction is rightward movement, determining that the position judgment mode is to judge whether the sum of the position parameter of the control to which the current focus belongs and the focus moving digit is larger than the maximum position parameter of the Nth row;
and when the moving direction is leftward movement, determining the position judgment mode as judging whether the difference between the position parameter of the control to which the current focus belongs and the focus moving digit is smaller than the minimum position parameter of the Nth row.
And when the moving direction is upward movement, determining whether the position judgment mode is to judge whether the difference between the position parameter of the control to which the current focus belongs and the product of the number of the focus moving bits and the number of the controls in each line is smaller than the minimum position parameter in the first line.
And when the moving direction is downward movement, determining whether the position judgment mode is to judge whether the sum of the position parameter of the control to which the current focus belongs and the product of the focus moving bit number and the number of the controls in each line is larger than the maximum position parameter of the last line.
In step S205, the position to be moved by the current focus is determined by the position determination method and the focus movement digit, and the current focus is moved to the determined position.
In the embodiment of the invention, when the position to be moved of the current focus is determined by judging whether the sum of the position parameter of the control to which the current focus belongs and the focus moving digit is greater than the maximum position parameter of the Nth row, if the sum of the position parameter and the focus moving digit is greater than the maximum position parameter of the Nth row, the current focus is moved to the position corresponding to the maximum position parameter of the Nth row; and if the sum of the position parameter and the focus moving digit is less than or equal to the maximum position parameter of the Nth row, moving the current focus to the position corresponding to the sum of the position parameter and the focus moving digit of the Nth row.
When the position to be moved of the current focus is determined by judging whether the difference between the position parameter of the control to which the current focus belongs and the focus moving digit is smaller than the minimum position parameter of the Nth row, if the sum of the position parameter and the focus moving digit is smaller than the minimum position parameter of the Nth row, the current focus is moved to the position corresponding to the minimum position parameter of the Nth row; and if the difference between the position parameter and the focus moving bit number is greater than or equal to the minimum position parameter of the Nth row, moving the current focus to a position corresponding to the difference between the position parameter of the Nth row and the focus moving bit number.
When the position to be moved of the current focus is determined by judging whether the difference between the position parameter of the control to which the current focus belongs and the product of the focus movement digit and the number of the controls in each line is smaller than the minimum position parameter of the first line or not, if the difference between the position parameter of the control to which the current focus belongs and the product of the focus movement digit and the number of the controls in each line is smaller than the minimum position parameter of the first line, moving the current focus to the position corresponding to the sum obtained by adding the difference between the position parameter of the control to which the current focus belongs and the product of the focus movement digit and the number of the controls in each line; and if the difference between the position parameter of the control to which the current focus belongs and the product of the focus moving digit and the number of the controls in each line is greater than or equal to the minimum position parameter in the first line, moving the current focus to a position corresponding to the difference between the position parameter of the control to which the current focus belongs and the product of the focus moving digit and the number of the controls in each line.
When judging whether the sum of the position parameter of the control to which the current focus belongs and the product of the focus movement digit and the number of the controls in each line is greater than the maximum position parameter of the last line to determine the position to which the current focus needs to move, if the sum of the position parameter of the control to which the current focus belongs and the product of the focus movement digit and the number of the controls in each line is greater than the maximum position parameter of the last line, moving the current focus to the position corresponding to the difference obtained by subtracting the sum of the position parameter of the control to which the current focus belongs and the product of the focus movement digit and the number of the controls in each line from the number of the controls in each line; and if the sum of the position parameter of the control to which the current focus belongs and the product of the focus moving digit and the number of the controls in each line is less than or equal to the maximum position parameter of the last line, moving the current focus to a position corresponding to the sum of the position parameter of the control to which the current focus belongs and the product of the focus moving digit and the number of the controls in each line.
Referring to fig. 3, fig. 3 is a schematic diagram illustrating a focus shift of 2 units according to a second embodiment of the present invention, and details of the second embodiment of the present invention are described with reference to fig. 2.
Here, since the position parameter of the control to which the current focus belongs is 16, the number of focus movement bits in the voice information is 2, and the movement direction is rightward, it is determined whether the sum of the position parameter 16 and the number of focus movement bits 2, that is, 16+2 is 18 larger than the maximum position parameter of the current line number. The maximum position parameter calculation method of the current line number is that the current line number N is multiplied by the number of the controls in each line, and then 1 is subtracted, that is, 3 × 7-1 is equal to 20, that is, the sum of the position parameter and the focal point moving digit is smaller than the maximum position parameter of the current line number, then the current focal point is moved to the position corresponding to the sum of the position parameter and the focal point moving digit, that is, the position of 18, and the movement of the position parameter of the control to which the current focal point belongs from the position 16 to the position 18, that is, the control is moved by 2 units to the right.
EXAMPLE III
Referring to fig. 4, fig. 4 shows a specific implementation flow of a method for adding a focus listening callback function to a control according to a third embodiment of the present invention, which is detailed as follows:
in step S401, a control address is obtained, and a corresponding control is searched according to the control address.
In the embodiment of the invention, after disassembling and analyzing the application program file, a layout file of each interface of the application program file, namely the corresponding interface, is obtained, and then the layout file is analyzed, a control address corresponding to each control in the interface can be obtained, namely the control address can be obtained from the layout file, and after the control address is obtained, the corresponding control is searched according to the control address, so that a focus monitoring callback function is added to the control.
It can be understood that, in order to add the focus listening callback function to all the controls in the application file, the corresponding controls may be found one by one according to the acquired control addresses, and the focus listening callback function is added to the controls, so as to achieve the purpose of adding the focus listening callback function to all the controls in the application file.
Optionally, referring to fig. 5, fig. 5 shows a specific implementation flow of a method for obtaining a control address according to a third embodiment of the present invention, which is detailed as follows:
in step S501, the system directory is scanned by the application management service, and an application file is acquired.
In the embodiment of the invention, in the starting process of the Android system, an application management service PackageManagerservice is started, and the service is responsible for scanning a specific directory in the system, finding out application files in the system, namely files taking apk as suffix, analyzing the files to obtain the related information of the application, and storing the related information in member variables of the files. According to the embodiment of the invention, by modifying the system source code file of the application program management service, when the apk is analyzed, the interface name corresponding to each application program is obtained, so that all controls in the interface are obtained
In step S502, the application program file is analyzed by using a disassembling tool, so as to obtain each interface of the application program file and a layout file of the interface.
In the embodiment of the invention, the smali code of the Android application program can be obtained through the disassembling tool. The disassembling tool used here is an apktool tool, which can disassemble apk to obtain resource files such as the smali code, the picture and the XML configuration file of the application program. After the apk file is decompiled by using an apktool tool, a smali file is generated under a decompiled engineering directory, all the decompiled smali files are stored in the smali file, the files can generate corresponding directories according to the hierarchy of a program package, and all classes in a program can generate independent smali files under the corresponding directories.
And traversing the smali file to acquire each interface of the application program and a layout file of the interface according to the acquired interface name of the application program.
In step S503, the layout file is analyzed to obtain each control address in the layout file.
In the embodiment of the present invention, each interface of the application corresponds to one layout file, elements shown in each interface are located in the corresponding layout file, each element corresponds to one control in the layout file, and by obtaining an address of an interface element, an address corresponding to the control is correspondingly obtained, that is, each obtained layout file is analyzed to obtain each control address in the layout file.
In step S402, the focus listening callback function is added to the control.
In the embodiment of the invention, in order to accurately move the current focus to the position to which the current focus is to be moved, a focus listening callback function needs to be added on each control, the position parameter of the control to which the current focus belongs is obtained through the focus listening callback function, and then the movement control of the current focus is realized according to the position parameter and the focus moving digit number in the voice message.
Here, the adding of the focus listening callback function to the control actually calls a pre-programmed program code, and the program code includes the focus listening callback function to implement the focus listening function, that is, the function of controlling the focus movement by monitoring the voice information of the user.
For example, the pseudo code that the program is instead defined as follows:
public Class OnFocusCtrlListener{
voidonFoucsCtrl(View v,Enum direction,int offset,int numOfPage,intnumOfClow,int clowNums){
if the number of focus shift bits is greater than 1
According to the content of the voice information, the position parameter of the current focus and the parameter transmitted by the control, the position of the focus to be finally determined for execution is calculated
else
Quit
}
The parameter v is an incoming control, the parameter direction is an operation direction, the parameter offset is a focus movement bit number, the parameter numOfPage is the total number of controls included in each interface, the parameter numOfClow is the number of controls in each line, and the parameter clowns is the number of lines of controls in each interface. . Enum is a custom set of directions including up, down, left, and right.
In step S403, the event distribution function in the system source code file is modified.
In the embodiment of the present invention, a system source code file needs to be modified, specifically, a preset focus movement control program segment is added to a dispatchTouchEvent () function of View.
The pseudo code logic of the preset focus movement control program segment is as follows:
whether or not to carry a parameter
If it is
Performing focus as a parameter-carrying operation
Otherwise
Performing a focus operation in units of 1
The specific determination of whether the voice information carries parameters is to determine whether the voice information contains focus moving digits, moving directions, and the like.
Optionally, referring to fig. 6, fig. 6 shows a specific implementation flow of a method for modifying an event distribution function in a system source code file according to a third embodiment of the present invention, which is detailed as follows:
in step S601, the event distribution function is searched in a system source code file.
In step S602, a preset focus movement control program segment is added to the event distribution function to implement movement control of the current focus.
In the embodiment of the invention, event distribution functions are searched in a system source code file in a traversing manner, a preset focus movement control program segment is added in all the event distribution functions until all the controls are provided with focus monitoring callback functions, so that the movement control of the current focus is realized.
In step S404, the modified system source code file is compiled again and packaged into an Android installation package.
In the embodiment of the invention, after the corresponding smali file is modified, the modified system source code file needs to be compiled and packaged again to form apk, namely the Android installation package. The tool used here is an apktool tool, commanded as apktoolnewapk.
Example four
Referring to fig. 7, fig. 7 shows a specific implementation flow of a method for adding a focus snoop callback function to an application program being installed according to a fourth embodiment of the present invention, which is detailed as follows:
in step S701, when it is detected that an application is being installed, an application management service is invoked to analyze the currently installed application, so as to obtain installation information of the application.
In step S702, according to the installation information, a focus listening callback function is added to the control in each interface of the application program.
In step S703, an event distribution function in the system source code file corresponding to the application program is modified.
In step S704, the modified system source code file is compiled and packaged again into an Android installation package, and then a subsequent installation process is executed.
In the embodiment of the invention, a user installs other application programs in the actual operation process of using the terminal equipment, and the controls in the application programs do not increase the focus monitoring callback function and only can execute focus movement with the movement unit of 1, so that the user experience is not good, when detecting that the application program is installed, the application program management service is called to the currently installed application program to obtain the installation information of the application program, then the focus monitoring callback function is added to the control in each interface in the application program according to the methods provided by the first embodiment, the second embodiment and the embodiments of the invention, the event distribution function in the system source code file of the application program is correspondingly modified, then the modified system source code file is compiled and packaged into the Android installation package again, and then the subsequent installation process is executed, the method and the device enable the installed application program to realize focus movement control on the voice information including the focus movement digit, so that the focus movement efficiency is higher, and the user experience is better.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
EXAMPLE five
Fig. 8 is a schematic diagram of a focus control apparatus according to a fifth embodiment of the present invention, which corresponds to a focus control method according to the foregoing embodiments, and only shows portions related to the embodiments of the present invention for convenience of description.
Referring to fig. 8, the apparatus includes:
a voice information acquiring unit 81 for acquiring and analyzing voice information input by a user;
a parameter determining unit 82, configured to determine whether the parsed voice information includes a focus moving digit;
and the focus control unit 83 is configured to trigger a focus listening callback function of the control to which the current focus belongs if the analyzed voice information includes the focus movement digit, and perform movement control on the current focus according to the focus movement digit. Optionally, the focus control unit 83 includes:
the position parameter acquiring subunit is used for acquiring the position parameter of the control to which the current focus belongs through the focus monitoring callback function;
the parameter judging subunit is used for judging whether the position parameter is smaller than N multiplied by the number of the controls in each line, wherein N is a positive integer;
a row number determining subunit, configured to determine that the current focus is located in an nth row if the position parameter is smaller than N times the number of controls in each row;
the position judgment mode determining subunit is used for determining a corresponding position judgment mode according to the moving direction in the voice information;
and the focus movement control subunit is used for determining the position to be moved of the current focus by the position judgment mode and moving the current focus to the determined position.
Optionally, the apparatus further comprises:
the control address acquisition unit is used for acquiring a control address and searching a corresponding control according to the control address;
a first function adding unit, configured to add the focus listening callback function to the control;
the first function modification unit is used for modifying an event distribution function in a system source code file;
and the first recompilation unit is used for recompiling and packaging the modified system source code file into an Android installation package.
Optionally, the recompiling unit is specifically configured to:
searching the event distribution function in a system source code file;
and adding a preset focus movement control program segment in the event distribution function to realize the movement control of the current focus.
Optionally, the control address obtaining unit includes:
an application program file acquisition subunit, configured to scan a system directory through an application program management service, and acquire an application program file;
the application program file analysis subunit is used for analyzing the application program file by using a disassembling tool to obtain each interface of the application program file and a layout file of the interface;
and the control address acquisition subunit is used for analyzing the layout file to acquire each control address in the layout file.
Optionally, the focus listening callback function includes: whether the focus moving number, the moving direction, the number of each page, the number of each line of control, and the number of each page line are included.
Optionally, the apparatus further comprises:
the installation information acquisition unit is used for calling application program management service to analyze the currently installed application program to obtain the installation information of the application program when detecting that the application program is being installed;
a second function adding unit, configured to add a focus listening callback function to a control in each interface in the application program according to the installation information;
the second function modification unit is used for modifying the event distribution function in the system source code file corresponding to the application program;
and the second recompilation unit is used for recompiling and packaging the modified system source code file into an Android installation package and then executing a subsequent installation process.
In the embodiment of the invention, after the voice information input by the user is acquired and analyzed, and when the analyzed voice information contains the focus moving digit, the focus monitoring callback function of the control to which the current focus belongs is triggered, the current focus is subjected to movement control according to the focus moving digit, and the movement control of the voice focus is realized through the focus monitoring callback function, so that the focus moving efficiency is improved, and the user experience is better.
When detecting that an application program is being installed, calling an application program management service to the currently installed application program to obtain installation information of the application program, adding a focus monitoring callback function to a control in each interface in the application program according to the methods provided by the first embodiment, the second embodiment and the embodiments of the present invention, correspondingly modifying an event distribution function in a system source code file of the application program, compiling and packaging the modified system source code file into an Android installation package, and executing a subsequent installation process, so that the installed application program can realize focus movement control on the focus movement number contained in the voice information, and the focus movement efficiency is higher, and the user experience is better.
EXAMPLE six
Fig. 9 is a schematic diagram of a focus control apparatus according to an embodiment of the present invention. As shown in fig. 9, the focus control apparatus 9 of this embodiment includes: a processor 90, a memory 91 and a computer program 92 stored in said memory 91 and executable on said processor 90. The processor 90, when executing the computer program 92, implements the steps in the various focus control method embodiments described above, such as steps 101 to 103 shown in fig. 1. Alternatively, the processor 90, when executing the computer program 92, implements the functions of the units in the system embodiments, such as the functions of the modules 81 to 83 shown in fig. 8.
Illustratively, the computer program 92 may be divided into one or more units, which are stored in the memory 91 and executed by the processor 90 to carry out the invention. The one or more units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 92 in the focus control device 9. For example, the computer program 92 may be divided into a voice information acquisition unit 81, a parameter determination unit 82, and a focus control unit 83, and the specific functions of each unit are as follows:
a voice information acquiring unit 81 for acquiring and analyzing voice information input by a user;
a parameter determining unit 82, configured to determine whether the parsed voice information includes a focus moving digit;
and the focus control unit 83 is configured to trigger a focus listening callback function of the control to which the current focus belongs if the analyzed voice information includes the focus movement digit, and perform movement control on the current focus according to the focus movement digit. Optionally, the focus control unit 83 includes:
the position parameter acquiring subunit is used for acquiring the position parameter of the control to which the current focus belongs through the focus monitoring callback function;
the parameter judging subunit is used for judging whether the position parameter is smaller than N multiplied by the number of the controls in each line, wherein N is a positive integer;
a row number determining subunit, configured to determine that the current focus is located in an nth row if the position parameter is smaller than N times the number of controls in each row;
the position judgment mode determining subunit is used for determining a corresponding position judgment mode according to the moving direction in the voice information;
and the focus movement control subunit is used for determining the position to be moved of the current focus by the position judgment mode and moving the current focus to the determined position.
Optionally, the apparatus further comprises:
the control address acquisition unit is used for acquiring a control address and searching a corresponding control according to the control address;
a first function adding unit, configured to add the focus listening callback function to the control;
the first function modification unit is used for modifying an event distribution function in a system source code file;
and the first recompilation unit is used for recompiling and packaging the modified system source code file into an Android installation package.
Optionally, the recompiling unit is specifically configured to:
searching the event distribution function in a system source code file;
and adding a preset focus movement control program segment in the event distribution function to realize the movement control of the current focus.
Optionally, the control address obtaining unit includes:
an application program file acquisition subunit, configured to scan a system directory through an application program management service, and acquire an application program file;
the application program file analysis subunit is used for analyzing the application program file by using a disassembling tool to obtain each interface of the application program file and a layout file of the interface;
and the control address acquisition subunit is used for analyzing the layout file to acquire each control address in the layout file.
Optionally, the focus listening callback function includes: whether the focus moving number, the moving direction, the number of each page, the number of each line of control, and the number of each page line are included.
Optionally, the apparatus further comprises:
the installation information acquisition unit is used for calling application program management service to analyze the currently installed application program to obtain the installation information of the application program when detecting that the application program is being installed;
a second function adding unit, configured to add a focus listening callback function to a control in each interface in the application program according to the installation information;
the second function modification unit is used for modifying the event distribution function in the system source code file corresponding to the application program;
and the second recompilation unit is used for recompiling and packaging the modified system source code file into an Android installation package and then executing a subsequent installation process.
The focus control device 9 may be a terminal device such as a desktop computer, a notebook, a palm computer, and a smart phone. The focus control device 9 may include, but is not limited to, a processor 90, a memory 91. It will be understood by those skilled in the art that fig. 9 is only an example of the focus control device 9, and does not constitute a limitation of the focus control device 9, and may include more or less components than those shown, or combine some components, or different components, for example, the focus control device may also include an input-output device, a network access device, a bus, etc.
The Processor 90 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 91 may be an internal storage unit of the focus control device 9, such as a hard disk or a memory of the focus control device 9. The memory 91 may also be an external storage device of the focus control device 9, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the focus control device 9. Further, the memory 91 may also include both an internal storage unit and an external storage device of the focus control device 9. The memory 91 is used to store the computer program and other programs and data required by the focus control apparatus. The memory 91 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the system is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed system/terminal device and method can be implemented in other ways. For example, the above-described system/terminal device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, systems or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or system capable of carrying said computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, etc. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A focus control method, characterized in that the method comprises:
acquiring and analyzing voice information input by a user;
judging whether the analyzed voice information contains focus moving digits;
and if the analyzed voice information contains the focus moving digit, triggering a focus monitoring callback function of a control to which the current focus belongs, and carrying out movement control on the current focus according to the focus moving digit.
2. The method of claim 1, wherein the step of performing movement control of the current focus according to the focus movement bit number comprises:
acquiring a position parameter of a control to which a current focus belongs through a focus monitoring callback function;
judging whether the position parameter is smaller than N multiplied by the number of the controls in each line, wherein N is a positive integer;
if the position parameter is smaller than N multiplied by the number of controls in each row, determining that the current focus is positioned in the Nth row;
determining a corresponding position judgment mode according to the moving direction in the voice information;
and determining the position of the current focus to be moved according to the position judgment mode and the focus moving digit, and moving the current focus to the determined position.
3. The method of claim 1, wherein the method further comprises:
acquiring a control address, and searching a corresponding control according to the control address;
adding the focus monitoring callback function on the control;
modifying an event distribution function in a system source code file;
and compiling and packaging the modified system source code file again to form the Android installation package.
4. The method of claim 3, wherein the step of modifying the event distribution function in the system source code file comprises:
searching the event distribution function in a system source code file;
and adding a preset focus movement control program segment in the event distribution function to realize the movement control of the current focus.
5. The method of claim 3, wherein the step of obtaining the control address comprises:
scanning a system directory through an application management service to obtain an application file;
analyzing the application program file by using a disassembling tool to obtain each interface of the application program file and a layout file of the interface;
and analyzing the layout file to obtain each control address in the layout file.
6. The method of claim 1, wherein the focus snoop callback function comprises: whether the focus moving number, the moving direction, the number of each page, the number of each line of control, and the number of each page line are included.
7. The method of any of claims 1 to 6, further comprising, prior to the step of obtaining and parsing the voice information input by the user:
when detecting that an application program is being installed, calling an application program management service to analyze the currently installed application program to obtain installation information of the application program;
adding a focus monitoring callback function to the control in each interface in the application program according to the installation information;
modifying an event distribution function in a system source code file corresponding to the application program;
and compiling and packaging the modified system source code file again to form an Android installation package, and then executing a subsequent installation process.
8. A focus control apparatus, characterized by comprising:
the voice information acquisition unit is used for acquiring and analyzing voice information input by a user;
a parameter judgment unit for judging whether the analyzed voice message contains focus moving digit;
and the focus control unit is used for triggering a focus monitoring callback function of the control to which the current focus belongs if the analyzed voice information contains the focus moving digit, and carrying out movement control on the current focus according to the focus moving digit.
9. A focus control apparatus comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the focus control method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the focus control method according to any one of claims 1 to 7.
CN201811000902.XA 2018-08-30 2018-08-30 Focus control method, device and equipment Pending CN110874252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811000902.XA CN110874252A (en) 2018-08-30 2018-08-30 Focus control method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811000902.XA CN110874252A (en) 2018-08-30 2018-08-30 Focus control method, device and equipment

Publications (1)

Publication Number Publication Date
CN110874252A true CN110874252A (en) 2020-03-10

Family

ID=69714346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811000902.XA Pending CN110874252A (en) 2018-08-30 2018-08-30 Focus control method, device and equipment

Country Status (1)

Country Link
CN (1) CN110874252A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127056A (en) * 2021-05-17 2021-07-16 马上消费金融股份有限公司 Information processing method, device, equipment and readable storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110121169A (en) * 2010-04-30 2011-11-07 주식회사 인프라웨어 Mouse pointer control method using voice
CN103473055A (en) * 2013-09-06 2013-12-25 乐视致新电子科技(天津)有限公司 Focus movement control method and device
CN103823547A (en) * 2012-11-16 2014-05-28 中国电信股份有限公司 Mobile terminal and cursor control method thereof
CN103888799A (en) * 2012-12-20 2014-06-25 联想(北京)有限公司 Control method and control device
CN105739819A (en) * 2016-01-22 2016-07-06 努比亚技术有限公司 Cursor positioning method and device and mobile terminal
CN105786291A (en) * 2014-12-15 2016-07-20 广州市动景计算机科技有限公司 Method, device and system for browser control
CN106250711A (en) * 2016-08-18 2016-12-21 青岛海信医疗设备股份有限公司 A kind of cursor-moving method, device and armarium shown for medical treatment
CN107358953A (en) * 2017-06-30 2017-11-17 努比亚技术有限公司 Sound control method, mobile terminal and storage medium
CN107786886A (en) * 2017-11-01 2018-03-09 深圳市雷鸟信息科技有限公司 Smart television focus control method, smart television and storage medium
CN107783753A (en) * 2016-08-29 2018-03-09 法乐第(北京)网络科技有限公司 A kind of cursor control method and device
JP2018120326A (en) * 2017-01-24 2018-08-02 株式会社プロフィールド Commodity information management device, commodity information management method and program

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110121169A (en) * 2010-04-30 2011-11-07 주식회사 인프라웨어 Mouse pointer control method using voice
CN103823547A (en) * 2012-11-16 2014-05-28 中国电信股份有限公司 Mobile terminal and cursor control method thereof
CN103888799A (en) * 2012-12-20 2014-06-25 联想(北京)有限公司 Control method and control device
CN103473055A (en) * 2013-09-06 2013-12-25 乐视致新电子科技(天津)有限公司 Focus movement control method and device
CN105786291A (en) * 2014-12-15 2016-07-20 广州市动景计算机科技有限公司 Method, device and system for browser control
CN105739819A (en) * 2016-01-22 2016-07-06 努比亚技术有限公司 Cursor positioning method and device and mobile terminal
CN106250711A (en) * 2016-08-18 2016-12-21 青岛海信医疗设备股份有限公司 A kind of cursor-moving method, device and armarium shown for medical treatment
CN107783753A (en) * 2016-08-29 2018-03-09 法乐第(北京)网络科技有限公司 A kind of cursor control method and device
JP2018120326A (en) * 2017-01-24 2018-08-02 株式会社プロフィールド Commodity information management device, commodity information management method and program
CN107358953A (en) * 2017-06-30 2017-11-17 努比亚技术有限公司 Sound control method, mobile terminal and storage medium
CN107786886A (en) * 2017-11-01 2018-03-09 深圳市雷鸟信息科技有限公司 Smart television focus control method, smart television and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113127056A (en) * 2021-05-17 2021-07-16 马上消费金融股份有限公司 Information processing method, device, equipment and readable storage medium
CN113127056B (en) * 2021-05-17 2022-03-29 马上消费金融股份有限公司 Information processing method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN109814524B (en) Vehicle diagnosis method, device and system
CN105302710A (en) Method and apparatus for determining test case in need of regression testing
CN108833459B (en) Data reporting method and terminal equipment
CN106294134A (en) The collapse localization method of code and device
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN109739700B (en) Interface testing method and device
CN104361285A (en) Method and device for detecting security of application programs of mobile devices
CN111200744B (en) Multimedia playing control method and device and intelligent equipment
CN110874252A (en) Focus control method, device and equipment
CN111130828A (en) Intelligent network distribution method and device and terminal equipment
CN110750295B (en) Information processing method, device, electronic equipment and storage medium
CN109976751B (en) Model operation method, related device and computer readable storage medium
CN109324838B (en) Execution method and execution device of single chip microcomputer program and terminal
CN107085532A (en) Task monitor method and device
US10740218B2 (en) Method and device for determining usage log
CN113342553A (en) Data acquisition method and device, electronic equipment and storage medium
CN110719274B (en) Network security control method, device, equipment and storage medium
CN103914304A (en) Method for converting different structure type parameters on basis of SAP (service access point) platforms
CN112612474A (en) Product transplanting method and device, storage medium and electronic equipment
AU2013206622B2 (en) Download management method and device based on Android browser
CN113468446A (en) Method, system and equipment for supporting identification of third-party two-dimensional code data
CN112486497A (en) Compiling configuration file generation method and device, electronic equipment and storage medium
CN108304188B (en) Data type conversion method and terminal
CN105988804B (en) Software transfer method and terminal
CN108694249B (en) Data processing method, data processing device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200310

RJ01 Rejection of invention patent application after publication