Window control method and device, storage medium and electronic equipment

By obtaining and matching the characteristics of the application window in the terminal device, determining and controlling the target application window, the problem of low efficiency in finding and controlling the application window in the prior art is solved, and more efficient and accurate window operations are achieved.

CN119512660APending Publication Date: 2025-02-25GUANGZHOU SHIZHEN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311000819.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-09
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

When multiple applications are opened in a terminal device, it is difficult for the prior art to efficiently find and control the target application window, especially when the number of windows is large and the content is similar, the search efficiency is inefficient and poor accuracy.

Method used

By obtaining the startup operation of the target application window, responding to and starting the application window to be tested, obtaining the window characteristics between the two to match. When the matching degree reaches or exceeds the set threshold, determine the application window to be tested as the target application window and obtain its handle for control.

Benefits of technology

Improves the search efficiency and accuracy of target application windows, and reduces the time and error rate of finding specific windows in multiple applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512660A_ABST
    Figure CN119512660A_ABST
Patent Text Reader

Abstract

The invention discloses a window control method and device, a storage medium and electronic equipment, and the method comprises the steps: obtaining a starting operation for a target application window of an application, starting a to-be-tested application window of the application in response to the starting operation, obtaining a target window feature of the target application window, and starting the to-be-tested application window of the application in response to the target window feature; matching is conducted on the basis of the target window features and to-be-tested window features of the to-be-tested application window, when the matching degree between the target window features and the to-be-tested window features is larger than or equal to a first matching threshold value, the to-be-tested application window is determined as the target application window, a handle of the target application window is obtained, and the to-be-tested application window is determined as the to-be-tested application window. And controlling the target application window based on the handle, by adopting the specification, determining the target application window by matching the to-be-detected application window according to the target window characteristics, and obtaining the handle of the target window application to control the target application window, thereby improving the search efficiency and search accuracy of the target application window.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a window control method, device, storage medium and electronic device. Background Art

[0002] Nowadays, when a terminal device opens multiple applications, in order to facilitate viewing and operating the multiple applications, there is a need to display each application through a split screen on the display interface of the terminal device. Summary of the invention

[0003] The embodiments of the present specification provide a window control method, device, storage medium and electronic device, which can determine the target application window by matching the target window characteristics with the application window to be tested, obtain the handle of the target window application to control the target application window, and thus improve the search efficiency and search accuracy of the target application window.

[0004] In a first aspect, an embodiment of the present specification provides a window control method, the method comprising:

[0005] Acquire a start operation for a target application window of an application, and start the application window to be tested of the application in response to the start operation;

[0006] Acquire a target window feature of the target application window, and match the target window feature with a window feature to be tested of the application window to be tested;

[0007] When the degree of matching between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, determining the application window to be tested as the target application window;

[0008] A handle of the target application window is obtained to control the target application window based on the handle.

[0009] In a second aspect, an embodiment of the present specification provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the above method.

[0010] In a third aspect, an embodiment of the present specification provides an electronic device, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the above method.

[0011] In an embodiment of the present specification, the application window to be tested is started by acquiring and responding to the start operation of the target application window, and the target window characteristics of the target application window are acquired and matched with the window characteristics of the application window to be tested. When the degree of match between the target window characteristics and the window characteristics to be tested is greater than or equal to a first matching threshold, the application window to be tested is determined to be the target application window, thereby determining the target application window based on the matching of the target window characteristics with the application window to be tested, and acquiring the handle of the target window application to control the target application window, thereby improving the search efficiency and search accuracy of the target application window. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in this specification or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0013] Figure 1 A system architecture diagram of a window control method provided in an embodiment of this specification;

[0014] Figure 2 A flowchart of a window control method provided in an embodiment of this specification;

[0015] Figure 3 An example schematic diagram of displaying an application window to be tested provided in an embodiment of this specification;

[0016] Figure 4 An example schematic diagram of an application title provided in an embodiment of this specification;

[0017] Figure 5 This is a schematic diagram of an example of a newly added application window provided in an embodiment of this specification;

[0018] Figure 6 An example schematic diagram of activating an application window provided in an embodiment of this specification;

[0019] Figure 7 This is another example schematic diagram of activating an application window provided in an embodiment of this specification;

[0020] Figure 8 An example schematic diagram of a window control provided in an embodiment of this specification;

[0021] Fig. 9 A flowchart of a window control method provided in an embodiment of this specification;

[0022] Fig.10A schematic diagram of the structure of a window control device provided in an embodiment of this specification;

[0023] Fig.11 A schematic diagram of the structure of a window determination unit provided in an embodiment of this specification;

[0024] Fig.12 A schematic diagram of the structure of a window control device provided in an embodiment of this specification;

[0025] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0026] In order to make the features and advantages of this specification more obvious and easy to understand, the technical solutions in this specification are described clearly and completely in conjunction with the drawings in this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this specification.

[0027] In the prior art, when displaying multiple applications through split screen, the method adopted is to traverse all existing windows in the display interface of the terminal device according to the name of the application to find the target window that needs to be split screen among the existing windows, so as to control the matching window. However, when traversing all the windows, there is a problem of low window search efficiency when the number of windows is large, and since there is a deviation between the content displayed by the activated window and the content of the target window, there is a problem of a high probability of search failure.

[0028] Based on this, an embodiment of the present specification provides a window control method. Using the embodiment of the present specification, the application window to be tested is started by acquiring and responding to the start operation of the target application window, and the target window characteristics of the target application window are acquired and matched with the window characteristics of the application window to be tested. When the degree of match between the target window characteristics and the window characteristics to be tested is greater than or equal to a first matching threshold, the application window to be tested is determined to be the target application window, thereby determining the target application window based on the matching of the target window characteristics with the application window to be tested, and acquiring the handle of the target window application to control the target application window, thereby improving the search efficiency and search accuracy of the target application window.

[0029] See also Figure 1 , which is a system structure diagram of a window control according to the embodiment of this specification. Figure 1As shown, the window control method provided in the embodiment of this specification can be applied to a terminal device to implement the window control process, and the system structure provided in the embodiment of this specification mainly includes a terminal device 10. The terminal device 10 can be a terminal device including but not limited to a conference tablet, a mobile phone, a personal computer, a laptop computer, smart furniture, a vehicle-mounted device, a wearable device, etc., which has the functions of terminal application installation and operation.

[0030] In an embodiment of the present specification, the terminal device 10 obtains a startup operation for a target application window of an application, starts an application window to be tested in response to the startup operation, obtains target window features of the target application window and matches them with window features to be tested of the displayed application window to be tested, and when the degree of match between the target window features and the window features to be tested is less than a first matching threshold, the application window to be tested is determined as the target application window, and the handle of the target application window is obtained to control the target application window.

[0031] In an embodiment of the present specification, the application window to be tested is started by acquiring and responding to the start operation of the target application window, and the target window characteristics of the target application window are acquired and matched with the window characteristics of the application window to be tested. When the degree of match between the target window characteristics and the window characteristics to be tested is greater than or equal to a first matching threshold, the application window to be tested is determined to be the target application window, thereby determining the target application window based on the matching of the target window characteristics with the application window to be tested, and acquiring the handle of the target window application to control the target application window, thereby improving the search efficiency and search accuracy of the target application window.

[0032] based on Figure 1 The system architecture shown below will be combined with Figure 2 , the window control method provided in the embodiments of this specification is introduced in detail.

[0033] See also Figure 2 , is a flowchart of a window control method provided in an embodiment of this specification. Figure 2 As shown, the method may include the following steps S101-S104.

[0034] S101, obtaining a start operation for a target application window of an application, and starting an application window to be tested of the application in response to the start operation;

[0035] In one embodiment, a start operation of a user on a display interface of a terminal device for a target application window is obtained, and a start or wake-up instruction of the application is initiated to the system in response to the start operation, thereby starting the application window to be tested of the application.

[0036] The target application window may be the target window on the display interface after the application corresponding to the startup operation is started. It should be noted that since the method of starting the application is to output a startup instruction to the operating system of the terminal device so that the operating system displays a window on the display interface, there may be a situation where the displayed window is not the window required for the startup operation. Therefore, the target application window is the window that the startup operation wants to display, not necessarily the window displayed on the display interface.

[0037] The application window to be tested may be a window displayed on the display interface of the terminal device in response to the startup operation. It is understandable that in order to ensure that the started window is the target application window, the window needs to be tested. Figure 3 As shown, Figure 3 The window includes the current application window displayed by the terminal device before the startup operation is obtained and the started application window to be tested.

[0038] S102, obtaining a target window feature of the target application window, and matching the target window feature with a window feature to be tested of the application window to be tested;

[0039] In one embodiment, after obtaining the start operation to start the application window to be tested, the target window feature of the target application window obtained is matched with the window feature to be tested of the application window to be tested.

[0040] The target window feature may be a feature parameter corresponding to the target window, and may specifically include a preset application tag, a window title, an application process name, a process identifier, etc. It is understandable that the target window feature and the feature to be tested include the same feature type.

[0041] The preset application tag may be a tag pre-set for each application in the terminal device, for example, the preset application tag of application A is "a", the preset application tag of application B is "b", and so on.

[0042] The window title can be the name displayed in the title bar of the window, for example Figure 4 As shown, Figure 4 The "XXX Document" in the window is the application title of the window.

[0043] Furthermore, when the application window to be tested is detected, the triggering method of the application window to be tested is judged, and when the application window to be tested is a newly added application window, the step of obtaining the target window feature of the target application window for matching is executed.

[0044] Furthermore, when the application window to be tested is an activated application window, the application type corresponding to the application window to be tested is obtained; when the application type is a single instance application, a step of obtaining target window features of the target application window for matching is performed.

[0045] Furthermore, when the application type is a multi-instance application, the activation record of the application window to be tested is obtained, at least one application window to be tested in the activation record is obtained, the window features to be tested of each application window to be tested are obtained, and matching is performed based on the window features to be tested and the target window features.

[0046] The newly added application window may be a window added on the display interface of the terminal device in response to the startup operation, for example, Figure 5 As shown, Figure 5 The display interface of the terminal device in the left figure only shows the current application window. After adding the application window to be tested, Figure 5 The right side figure in .

[0047] The activated application window may be a window that is activated but in a minimized state and the like and displayed on the display interface of the terminal device in response to the startup operation, for example, Figure 6 As shown, Figure 6 The display interface of the terminal device changes from the current application window "A" and the application "B" whose window is minimized in the left figure to Figure 6 In the right figure of , the display interface displays the current application window of application "A" and the application window to be tested of application "B" at the same time.

[0048] A single-instance application may be an application program that can have only one window on the display interface at the same time, such as a task manager.

[0049] A multi-instance application can be an application that can have multiple windows on the display interface at the same time. For example, it can be a browser. When a multi-instance application is activated, all windows of the same application that are minimized will be displayed, so that multiple application windows to be tested are displayed on the display interface at the same time. For example, Figure 7 As shown, Figure 7 The left figure shows the current application window "A" and the minimized applications "B" and "C". After receiving the start operation, application "B" is activated to display the application window "B" to be tested, and application "C" is also activated to display the application window "C" to be tested. Figure 7 The screen shown on the right.

[0050] It should be noted that, in order to improve the search efficiency of the target application window, a feasible method is to match the window features only for the window after the startup operation is obtained.

[0051] S103, when the matching degree between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, determining the application window to be tested as the target application window;

[0052] In one embodiment, when the application window to be tested is a newly added application window, or the application window to be tested is an activated application window and the application type is a single-instance application, when the degree of match between the target window characteristics and the window characteristics to be tested is greater than or equal to a first matching threshold, the setting status of the default startup program of the application file corresponding to the application window to be tested is obtained, and when the setting status indicates that the application file is set with a default startup program, the application window to be tested is determined as the target application window.

[0053] The application file may be a file displayed by the application window under test using an application. For example, if application A is used to display file "file 1" through the application window under test, "file 1" is the application file corresponding to the application window under test.

[0054] The default startup program can be the default application used to open the application file. For example, "File 1" is a text file, and the preset default startup program of the file is "TXT Reader". When opening "File 1", the "TXT Reader" application is used by default to open it.

[0055] The first matching threshold may be a threshold for measuring the matching degree between the target window feature and the window feature to be tested, for example, 90%, etc. The specific value of the first matching threshold may be set according to actual conditions, and different values ​​may be set for different applications.

[0056] Further, when the setting status indicates that the application file is set with a startup program, the suffix data of the application file is matched with the window title of the application window to be tested, and when the suffix data and the window title are required, the application window to be tested is determined as the target application window.

[0057] Furthermore, when the degree of match between the target window features and the window features to be tested is less than a first matching threshold, the window matching duration is obtained; when the window matching duration is greater than or equal to a preset matching duration, the window features to be tested are matched with the target window features; when the degree of match between the window features to be tested is greater than a second matching threshold, the application window to be tested is determined as the target application window.

[0058] The window matching duration may be the duration from acquisition to start of the operation, and the window matching duration is compared with the preset matching duration in real time to determine whether the window matching duration is greater than or equal to the preset matching duration.

[0059] The preset matching time can be a pre-set time. It can be understood that different applications require different startup times. In order to avoid the situation where the target application window is mistakenly believed to have not been successfully started due to the startup time of the application being too long and the waiting time being too short, a feasible method is to set a corresponding preset matching time for each application, such as three seconds.

[0060] It should be noted that, in order to improve the search efficiency of the target application window, a feasible method is to only perform window feature matching on the window events detected within the preset matching duration, and not match the windows displayed before the window matching duration is started. It is understandable that, since the target application window is the window corresponding to the start operation, the window before the start operation is obtained can be considered not to be the target application window.

[0061] It should be noted that when the window matching duration is less than the preset matching duration, it can be considered that there is a situation where the application window to be tested with a matching degree greater than or equal to the first matching threshold has not been started, so the window addition or activation event detection is still performed.

[0062] Furthermore, when the window matching duration is greater than or equal to the preset matching duration, in order to ensure accuracy, the window features to be tested of the application window to be tested are matched with the target window features again. If, after the second matching, the degree of matching between the window features to be tested and the target window features is greater than or equal to the first matching threshold, the application window to be tested corresponding to the window features to be tested is determined as the target application window; if the degree of matching between the window features to be tested and the target window features is less than the first matching threshold, it is further compared with the second matching threshold.

[0063] The second matching threshold may be a value less than the first matching threshold, for example, 80%, etc. It is understandable that by setting multiple levels of matching thresholds to judge the characteristics of the window to be tested, the application window to be tested can be confirmed multiple times, thereby improving the search accuracy of the target application window.

[0064] Furthermore, when the application type is a multi-instance application, when there is a window feature under test whose matching degree with the target window feature is greater than a first matching threshold among the window features under test, the application window under test corresponding to the window feature under test greater than the first matching threshold is determined as the target application window.

[0065] Furthermore, when the application type is a multi-instance application and a new window is added, the window characteristics of the application window to be tested are obtained, and the window characteristics to be tested are matched based on the target window characteristics. When the degree of match between the target window characteristics and the window characteristics to be tested is greater than or equal to a first matching threshold, the application window to be tested is determined as the target application window.

[0066] When the degree of match between the target window feature and the window feature to be tested is less than a first matching threshold, the window matching duration is obtained; when the window matching duration is greater than or equal to a preset matching duration, an application window to be tested whose degree of match in the window feature to be tested is obtained and whose degree of match is greater than a second matching threshold, and the application window to be tested with the highest degree of match in the window feature to be tested is selected as the target application window.

[0067] It can be understood that since the second matching threshold is smaller than the first matching threshold and the application type of the application window to be tested is a multi-instance application, there may be a situation in which there are multiple application windows to be tested with a matching degree greater than the second matching threshold, and then the application window to be tested with the largest matching degree in the characteristics of the window to be tested is selected as the target application window to improve the accuracy of finding the target application window.

[0068] Further, when the matching degree of the characteristics of the window to be tested is less than the second matching threshold, the application window to be tested with the largest window size among the application windows to be tested is selected as the target application window.

[0069] It should be noted that the window size may be the size displayed on the display interface when the application window to be tested is activated. If the window sizes of the application windows to be tested are the same, it can be considered that there is no target application window in the current application window to be tested.

[0070] S104, acquiring a handle of the target application window to control the target application window based on the handle;

[0071] In one embodiment, after the target application window is determined, the handle of the target application window is obtained, so as to control the display of the target application window in a preset or input manner based on the handle of the target application window.

[0072] For example, Figure 8 As shown, Figure 8 The left side shows the state of the application window under test when it is created or activated. Figure 8 The figure on the right shows the display mode after the target application window and the current application window are controlled by the preset or input method.

[0073] It should be noted that Figure 8 What is shown here is only the process of controlling the window. In actual application, Figure 8 The content in the left figure may not be displayed on the display interface. The handle of the current application window may be obtained in advance, so the two windows can be controlled after the target application window is obtained.

[0074] The display mode after controlling the target application window and the current application window can be set according to actual needs. The display transmission can be set in advance or can be set when the user starts the application.

[0075] The content of controlling the window includes but is not limited to controlling the size and position of the window.

[0076] Furthermore, when the target application window is not detected, prompt information is output to prompt that the target application window is found. The prompt information can be output in the form of text, audio or video, which can be set according to actual needs.

[0077] It should be noted that the credential for not detecting the target application window may be that when the application type is a single-instance application, the matching degree is less than the second matching threshold, or when the application type is a multi-instance application, the matching degree is less than the second matching threshold and the sizes of the application windows to be tested are the same.

[0078] In an embodiment of the present specification, the application window to be tested is started by acquiring and responding to the start operation of the target application window, and the target window characteristics of the target application window are acquired and matched with the window characteristics of the application window to be tested. When the degree of match between the target window characteristics and the window characteristics to be tested is greater than or equal to a first matching threshold, the application window to be tested is determined to be the target application window, thereby determining the target application window based on the matching of the target window characteristics with the application window to be tested, and acquiring the handle of the target window application to control the target application window, thereby improving the search efficiency and search accuracy of the target application window.

[0079] See also Fig. 9 , is a flowchart of a window control method provided in an embodiment of this specification. Fig. 9 As shown, the method may include the following steps S201-S210.

[0080] S201, obtaining a start operation for a target application window of an application, and starting an application window to be tested of the application in response to the start operation;

[0081] In one embodiment, a start operation of a user on a display interface of a terminal device for a target application window is obtained, and a start or wake-up instruction of the application is initiated to the system in response to the start operation, thereby starting the application window to be tested of the application.

[0082] The target application window may be the target window on the display interface after the application corresponding to the startup operation is started. It should be noted that since the method of starting the application is to output a startup instruction to the operating system of the terminal device so that the operating system displays a window on the display interface, there may be a situation where the displayed window is not the window required for the startup operation. Therefore, the target application window is the window that the startup operation wants to display, not necessarily the window displayed on the display interface.

[0083] The application window to be tested may be a window displayed on the display interface of the terminal device in response to the startup operation. It is understandable that in order to ensure that the started window is the target application window, the window needs to be tested. Figure 3 As shown, Figure 3The window includes the current application window displayed by the terminal device before the startup operation is obtained and the started application window to be tested.

[0084] S202, obtaining a target window feature of the target application window, and matching the target window feature with a window feature to be tested of the application window to be tested;

[0085] In one embodiment, after obtaining the start operation to start the application window to be tested, the target window feature of the target application window obtained is matched with the window feature to be tested of the application window to be tested.

[0086] The target window feature may be a feature parameter corresponding to the target window, and may specifically include a preset application tag, a window title, an application process name, a process identifier, etc. It is understandable that the target window feature and the feature to be tested include the same feature type.

[0087] The preset application tag may be a tag pre-set for each application in the terminal device, for example, the preset application tag of application A is "a", the preset application tag of application B is "b", and so on.

[0088] The window title can be the name displayed in the title bar of the window, for example Figure 4 As shown, Figure 4 The "XXX Document" in the window is the application title of the window.

[0089] Furthermore, when the application window to be tested is detected, the triggering method of the application window to be tested is judged, and when the application window to be tested is a newly added application window, the step of obtaining the target window feature of the target application window for matching is executed.

[0090] Furthermore, when the application window to be tested is an activated application window, the application type corresponding to the application window to be tested is obtained; when the application type is a single instance application, a step of obtaining target window features of the target application window for matching is performed.

[0091] Furthermore, when the application type is a multi-instance application, the activation record of the application window to be tested is obtained, at least one application window to be tested in the activation record is obtained, the window features to be tested of each application window to be tested are obtained, and matching is performed based on the window features to be tested and the target window features.

[0092] The newly added application window may be a window added on the display interface of the terminal device in response to the startup operation, for example, Figure 5 As shown, Figure 5 The display interface of the terminal device in the left figure only shows the current application window. After adding the application window to be tested, Figure 5 The right side figure in .

[0093] The activated application window may be a window that is activated but in a minimized state and the like and displayed on the display interface of the terminal device in response to the startup operation, for example, Figure 6 As shown, Figure 6 The display interface of the terminal device changes from the current application window "A" and the application "B" whose window is minimized in the left figure to Figure 6 In the right figure of , the display interface displays the current application window of application "A" and the application window to be tested of application "B" at the same time.

[0094] A single-instance application may be an application program that can have only one window on the display interface at the same time, such as a task manager.

[0095] A multi-instance application can be an application that can have multiple windows on the display interface at the same time. For example, it can be a browser. When a multi-instance application is activated, all windows of the same application that are minimized will be displayed, so that multiple application windows to be tested are displayed on the display interface at the same time. For example, Figure 7 As shown, Figure 7 The left figure shows the current application window "A" and the minimized applications "B" and "C". After receiving the start operation, application "B" is activated to display the application window "B" to be tested, and application "C" is also activated to display the application window "C" to be tested. Figure 7 The screen shown on the right.

[0096] It should be noted that, in order to improve the search efficiency of the target application window, a feasible method is to match the window features only for the window after the startup operation is obtained.

[0097] S203, when the matching degree between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, obtaining a setting state of a default startup program of an application file corresponding to the application window to be tested;

[0098] In one embodiment, when the application window to be tested is a newly added application window, or the application window to be tested is an activated application window and the application type is a single-instance application, when the degree of match between the target window characteristics and the window characteristics to be tested is greater than or equal to a first matching threshold, the setting status of the default startup program of the application file corresponding to the application window to be tested is obtained.

[0099] The application file may be a file displayed by the application window under test using an application. For example, if application A is used to display file "file 1" through the application window under test, "file 1" is the application file corresponding to the application window under test.

[0100] The default startup program can be the default application used to open the application file. For example, "File 1" is a text file, and the preset default startup program of the file is "TXT Reader". When opening "File 1", the "TXT Reader" application is used by default to open it.

[0101] The first matching threshold may be a threshold for measuring the matching degree between the target window feature and the window feature to be tested, for example, 90%, etc. The specific value of the first matching threshold may be set according to actual conditions, and different values ​​may be set for different applications.

[0102] S204, when the setting state indicates that the application file is set with a default startup program, determining the application window to be tested as the target application window;

[0103] In one embodiment, when the application window to be tested is a newly added application window or an activated application window, and the activated application window is a single-instance application, when the degree of match between the target window characteristics and the window characteristics to be tested is greater than or equal to a first matching threshold, the application file corresponding to the application window to be tested is set with a default startup program, then the application window to be tested is determined to be the target application window.

[0104] Furthermore, when the application type is a multi-instance application, when there is a window feature under test whose matching degree with the target window feature is greater than a first matching threshold among the window features under test, the application window under test corresponding to the window feature under test greater than the first matching threshold is determined as the target application window.

[0105] Furthermore, when the application type is a multi-instance application and a new window is added, the window characteristics of the application window to be tested are obtained, and the window characteristics to be tested are matched based on the target window characteristics. When the degree of match between the target window characteristics and the window characteristics to be tested is greater than or equal to a first matching threshold, the application window to be tested is determined as the target application window.

[0106] S205, when the setting status indicates that the application file is not set with a default startup program, matching the suffix data of the application file with the window title of the application window to be tested;

[0107] In one embodiment, when the setting status indicates that the application file is set with a default startup program, suffix data of the application file is obtained, and the suffix data is matched with the window title of the application window to be tested.

[0108] The suffix data may include a file title of the file, and the file title is matched with the window title of the application window to be tested.

[0109] S206, when the suffix data matches the window title, determining the application window to be tested as the target application window;

[0110] S207, when the matching degree between the target window feature and the window feature to be tested is less than the first matching threshold, obtaining the window matching duration;

[0111] In one embodiment, the window matching duration may be the duration measured from the acquisition to the start of the operation, and the window matching duration is compared with the preset matching duration in real time to determine whether the window matching duration is greater than or equal to the preset matching duration.

[0112] S208, when the window matching time is greater than or equal to the preset matching time, matching the feature of the window to be tested with the feature of the target window;

[0113] In one embodiment, the preset matching time may be a pre-set time. It is understandable that different applications require different startup times. In order to avoid mistaking the target application window for unsuccessful startup due to the application startup time being too long and the waiting time being too short, a feasible method is to set a corresponding preset matching time for each application, such as three seconds.

[0114] It should be noted that, in order to improve the search efficiency of the target application window, a feasible method is to only perform window feature matching on the window events detected within the preset matching duration, and not match the windows displayed before the window matching duration is started. It is understandable that, since the target application window is the window corresponding to the start operation, the window before the start operation is obtained can be considered not to be the target application window.

[0115] It should be noted that when the window matching duration is less than the preset matching duration, it can be considered that there is a situation where the application window to be tested with a matching degree greater than or equal to the first matching threshold has not been started, so the window addition or activation event detection is still performed.

[0116] S209, when the matching degree of the feature of the window to be tested is greater than a second matching threshold, determining the application window to be tested as a target application window;

[0117] In one embodiment, when the application window to be tested is a newly added application window or an activated application window, and the activated application window is a single-instance application, when the window matching duration is greater than or equal to the preset matching duration, in order to ensure accuracy, the window features to be tested of the application window to be tested are matched with the target window features again. If the matching degree between the window features to be tested and the target window features is greater than or equal to the first matching threshold after the second matching, the application window to be tested corresponding to the window features to be tested is determined as the target application window; if the matching degree between the window features to be tested and the target window features is less than the first matching threshold, the comparison is further performed with the second matching threshold.

[0118] The second matching threshold may be a value less than the first matching threshold, for example, 80%, etc. It is understandable that by setting multiple levels of matching thresholds to judge the characteristics of the window to be tested, the application window to be tested can be confirmed multiple times, thereby improving the search accuracy of the target application window.

[0119] Furthermore, in the case where the application type is a multi-instance application, when the degree of match between the target window features and the window features to be tested is less than a first matching threshold, the window matching duration is obtained; when the window matching duration is greater than or equal to a preset matching duration, the application window to be tested whose matching degree in the window features to be tested is greater than a second matching threshold is obtained, and the application window to be tested whose matching degree in the window features to be tested is the largest is selected as the target application window.

[0120] It can be understood that since the second matching threshold is smaller than the first matching threshold and the application type of the application window to be tested is a multi-instance application, there may be a situation in which there are multiple application windows to be tested with a matching degree greater than the second matching threshold, and then the application window to be tested with the largest matching degree in the characteristics of the window to be tested is selected as the target application window to improve the accuracy of finding the target application window.

[0121] Further, when the matching degree of the characteristics of the window to be tested is less than the second matching threshold, the application window to be tested with the largest window size among the application windows to be tested is selected as the target application window.

[0122] It should be noted that the window size may be the size displayed on the display interface when the application window to be tested is activated. If the window sizes of the application windows to be tested are the same, it can be considered that there is no target application window in the current application window to be tested.

[0123] S210, acquiring a handle of the target application window to control the target application window based on the handle;

[0124] In one embodiment, after the target application window is determined, the handle of the target application window is obtained, so as to control the display of the target application window in a preset or input manner based on the handle of the target application window.

[0125] For example, Figure 8 As shown, Figure 8 The left side shows the state of the application window under test when it is created or activated. Figure 8 The figure on the right shows the display mode after the target application window and the current application window are controlled by the preset or input method.

[0126] It should be noted that Figure 8 What is shown here is only the process of controlling the window. In actual application, Figure 8 The content in the left figure may not be displayed on the display interface. The handle of the current application window may be obtained in advance, so the two windows can be controlled after the target application window is obtained.

[0127] The display mode after controlling the target application window and the current application window can be set according to actual needs. The display transmission can be set in advance or can be set when the user starts the application.

[0128] The content of controlling the window includes but is not limited to controlling the size and position of the window.

[0129] Furthermore, when the target application window is not detected, prompt information is output to prompt that the target application window is found. The prompt information can be output in the form of text, audio or video, which can be set according to actual needs.

[0130] It should be noted that the credential for not detecting the target application window may be that when the application type is a single-instance application, the matching degree is less than the second matching threshold, or when the application type is a multi-instance application, the matching degree is less than the second matching threshold and the sizes of the application windows to be tested are the same.

[0131] In an embodiment of the present specification, the application window to be tested is started by acquiring and responding to a start operation of the target application window, a target window feature of the target application window is acquired and matched with a window feature to be tested of the application window to be tested, the target window feature and the window feature to be tested are matched according to the window type of the application window to be tested and the application type corresponding to the application window to be tested, the matching degree is measured based on a first matching threshold and a second matching threshold, and thus the target application window is determined according to the matching of the target window feature with the application window to be tested, and a handle of the target window application is acquired to control the target application window, thereby improving the search efficiency and search accuracy of the target application window.

[0132] based on Figure 1 The system architecture shown below will be combined with Figure 10-12 , the window control device provided in the embodiment of this specification is introduced in detail. It should be noted that, Figure 10-12The window control device in the embodiment of the present specification is used to execute Figure 2-Figure 9 For the convenience of explanation, only the part related to the embodiment of this specification is shown. For the specific technical details not disclosed, please refer to the embodiment of this specification. Figure 2-Figure 9 The embodiment shown.

[0133] See also Fig.10 , is a schematic diagram of the structure of a window control device provided in an embodiment of this specification. Fig.10 As shown, the window control device 1 of the embodiment of this specification may include: a window starting unit 11, a feature matching unit 12, a window determining unit 13 and a handle acquiring unit 14.

[0134] A window starting unit 11, configured to obtain a starting operation for a target application window of an application, and start the application window to be tested of the application in response to the starting operation;

[0135] A feature matching unit 12, configured to obtain a target window feature of the target application window, and match the target window feature with a window feature to be tested of the application window to be tested;

[0136] The window determination unit 13 is used to determine the application window to be tested as the target application window when the matching degree between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold;

[0137] The handle acquisition unit 14 is used to acquire the handle of the target application window to control the target application window based on the handle.

[0138] Optional, such as Fig.11 As shown, the window determination unit 13 includes:

[0139] The state acquisition subunit 131 is used to acquire the setting state of the default startup program of the application file corresponding to the application window to be tested when the matching degree between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold;

[0140] The window determining subunit 132 is configured to determine the application window to be tested as the target application window when the setting status indicates that the application file is set with a default startup program.

[0141] Optional, such as Fig.11 As shown, the window determination unit 13 also includes:

[0142] The title matching subunit 133 is used to match the suffix data of the application file with the window title of the application window to be tested when the setting state indicates that the application file is not set with a default startup program;

[0143] The window determination subunit 132 is further configured to determine the application window to be tested as the target application window when the suffix data matches the window title.

[0144] Optionally, the window starting unit 11 is further used for:

[0145] When the application window to be tested is a newly added application window, the step of obtaining the target window feature of the target application window is executed;

[0146] When the application window to be tested is an activated application window, the application type corresponding to the application window to be tested is obtained; when the application type is a single instance application, the step of obtaining the target window feature of the target application window is executed.

[0147] Optional, such as Fig.12 As shown, the window control device 1 also includes:

[0148] A duration acquisition unit 15, configured to acquire a window matching duration when the matching degree between the target window feature and the window feature to be tested is less than the first matching threshold;

[0149] The feature matching unit 12 is further configured to match the feature of the window to be tested with the feature of the target window when the window matching duration is greater than or equal to a preset matching duration;

[0150] The window determination unit 13 is further configured to determine the application window to be tested as a target application window when the matching degree of the feature of the window to be tested is greater than a second matching threshold, and the second matching threshold is less than the first matching threshold.

[0151] Optionally, the window starting unit 11 is further configured to, when the application type is a multi-instance application, obtain an activation record of the application window to be tested, and obtain at least one application window to be tested in the activation record;

[0152] The feature matching unit 12 is further used to obtain the window feature of each of the application windows to be tested, and match the window feature of the target application based on the window feature of each of the application windows to be tested;

[0153] The window determination unit 13 is further configured to determine the application window to be tested corresponding to the window feature to be tested that is greater than the first matching threshold as the target application window when there is a window feature to be tested whose matching degree with the target window feature is greater than a first matching threshold among the window features to be tested.

[0154] Optionally, the feature matching unit 12 is further configured to, when the application type is a multi-instance application and a window is newly added, obtain the window feature to be tested of the application window to be tested, and match the window feature to be tested based on the target window feature;

[0155] The window determination unit 13 is further configured to determine the application window to be tested as the target application window when the degree of matching between the target window feature and the application window to be tested is greater than or equal to a first matching threshold.

[0156] Optionally, the duration acquisition unit 15 is further configured to acquire the window matching duration when the matching degree between the target window feature and the window feature to be tested is less than the first matching threshold;

[0157] The feature matching unit 12 is further configured to obtain the application window to be tested whose matching degree in the feature of the window to be tested is greater than a second matching threshold when the window matching duration is greater than or equal to a preset matching duration;

[0158] The window determination unit 13 is further configured to select the application window to be tested with the greatest matching degree among the features of the window to be tested as the target application window.

[0159] Optionally, the window determining unit 13 is further configured to select the application window to be tested with the largest window size among the application windows to be tested as the target application window when the matching degree of the characteristics of the window to be tested is less than the second matching threshold.

[0160] Optional, such as Fig.12 As shown, the window control device 1 also includes:

[0161] The prompt output unit 16 is used to output prompt information to prompt that the target application window is not found when the target application window is not detected.

[0162] In an embodiment of the present specification, the application window to be tested is started by acquiring and responding to a start operation of the target application window, a target window feature of the target application window is acquired and matched with a window feature to be tested of the application window to be tested, the target window feature and the window feature to be tested are matched according to the window type of the application window to be tested and the application type corresponding to the application window to be tested, the matching degree is measured based on a first matching threshold and a second matching threshold, and thus the target application window is determined according to the matching of the target window feature with the application window to be tested, and a handle of the target window application is acquired to control the target application window, thereby improving the search efficiency and search accuracy of the target application window.

[0163] The present specification also provides a computer storage medium, which can store a plurality of program instructions, which are suitable for being loaded and executed by a processor as described above. Figure 1-Figure 9 The method steps of the embodiment shown in the figure can be found in the specific execution process. Figure 1-Figure 9 The specific description of the illustrated embodiment will not be repeated here.

[0164] See also Fig.13 , is a schematic diagram of the structure of an electronic device provided in the embodiment of this specification. Fig.13 As shown, the electronic device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, an input / output interface 1003, a memory 1005, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As shown in FIG. Fig.13 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, an input / output interface module, and a window control application.

[0165] exist Fig.13 In the electronic device 1000 shown, the input-output interface 1003 is mainly used to provide an input interface for the user and obtain data input by the user.

[0166] In one embodiment, the processor 1001 may be used to call the window control application stored in the memory 1005, and specifically perform the following operations:

[0167] Acquire a start operation for a target application window of an application, and start the application window to be tested of the application in response to the start operation;

[0168] Acquire a target window feature of the target application window, and match the target window feature with a window feature to be tested of the application window to be tested;

[0169] When the degree of matching between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, determining the application window to be tested as the target application window;

[0170] A handle of the target application window is obtained to control the target application window based on the handle.

[0171] Optionally, when the processor 1001 determines the application window to be tested as the target application window when the degree of match between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, the processor 1001 specifically performs the following operations:

[0172] When the degree of match between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, obtaining a setting state of a default startup program of an application file corresponding to the application window to be tested;

[0173] When the setting status indicates that the application file is set with a default startup program, the application window to be tested is determined as the target application window.

[0174] Optionally, the processor 1001 further performs the following operations:

[0175] When the setting state indicates that the application file is not set with a default startup program, matching the suffix data of the application file with the window title of the application window to be tested;

[0176] When the suffix data matches the window title, the application window to be tested is determined as the target application window.

[0177] Optionally, after executing the start-up operation to start the application window to be tested of the application, the processor 1001 further performs the following operations:

[0178] When the application window to be tested is a newly added application window, the step of obtaining the target window feature of the target application window is executed;

[0179] When the application window to be tested is an activated application window, the application type corresponding to the application window to be tested is obtained; when the application type is a single instance application, the step of obtaining the target window feature of the target application window is executed.

[0180] Optionally, the processor 1001 further performs the following operations:

[0181] When the degree of match between the target window feature and the window feature to be tested is less than the first matching threshold, obtaining a window matching duration;

[0182] When the window matching time length is greater than or equal to the preset matching time length, matching the feature of the window to be tested with the feature of the target window;

[0183] When the matching degree of the feature of the window to be tested is greater than a second matching threshold, the application window to be tested is determined as a target application window, and the second matching threshold is less than the first matching threshold.

[0184] Optionally, the processor 1001 further performs the following operations:

[0185] When the application type is a multi-instance application, acquiring an activation record of the application window to be tested, and obtaining at least one application window to be tested in the activation record;

[0186] Acquire the window characteristics of each of the application windows to be tested, and match the window characteristics of each of the application windows to be tested with the target application window characteristics;

[0187] When there is a window feature to be tested whose matching degree with the target window feature is greater than a first matching threshold among the window features to be tested, the application window to be tested corresponding to the window feature to be tested greater than the first matching threshold is determined as the target application window.

[0188] Optionally, the processor 1001 further performs the following operations:

[0189] When the application type is a multi-instance application and a window is newly added, obtaining the window feature to be tested of the application window to be tested, and matching the window feature to be tested based on the target window feature;

[0190] When the degree of matching between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, the application window to be tested is determined as the target application window.

[0191] Optionally, the processor 1001 further performs the following operations:

[0192] When the degree of match between the target window feature and the window feature to be tested is less than the first matching threshold, obtaining a window matching duration;

[0193] When the window matching time length is greater than or equal to the preset matching time length, obtaining the application window to be tested whose matching degree in the window feature to be tested is greater than a second matching threshold;

[0194] The application window to be tested with the greatest matching degree among the characteristics of the window to be tested is selected as the target application window.

[0195] Optionally, the processor 1001 further performs the following operations:

[0196] When the matching degree of the characteristics of the window to be tested is less than the second matching threshold, the application window to be tested with the largest window size among the application windows to be tested is selected as the target application window.

[0197] Optionally, the processor 1001 further performs the following operations:

[0198] When the target application window is not detected, prompt information is output to prompt that the target application window is not found.

[0199] In an embodiment of the present specification, the application window to be tested is started by acquiring and responding to a start operation of the target application window, a target window feature of the target application window is acquired and matched with a window feature to be tested of the application window to be tested, the target window feature and the window feature to be tested are matched according to the window type of the application window to be tested and the application type corresponding to the application window to be tested, the matching degree is measured based on a first matching threshold and a second matching threshold, and thus the target application window is determined according to the matching of the target window feature with the application window to be tested, and a handle of the target window application is acquired to control the target application window, thereby improving the search efficiency and search accuracy of the target application window.

[0200] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0201] The above disclosure is only the preferred embodiment of this specification, which certainly cannot be used to limit the scope of rights of this specification. Therefore, equivalent changes made according to the claims of this specification are still within the scope covered by this specification.

Claims

1. A window control method, characterized in that: The method comprises: Acquire a start operation for a target application window of an application, and start the application window to be tested of the application in response to the start operation; Acquire a target window feature of the target application window, and match the target window feature with a window feature to be tested of the application window to be tested; When the degree of matching between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, determining the application window to be tested as the target application window; A handle of the target application window is obtained to control the target application window based on the handle.

2. The method according to claim 1, characterized in that When the degree of matching between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, determining the application window to be tested as the target application window includes: When the degree of match between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, obtaining a setting state of a default startup program of an application file corresponding to the application window to be tested; When the setting status indicates that the application file is set with a default startup program, the application window to be tested is determined as the target application window.

3. The method according to claim 2, characterized in that The method further comprises: When the setting state indicates that the application file is not set with a default startup program, matching the suffix data of the application file with the window title of the application window to be tested; When the suffix data matches the window title, the application window to be tested is determined as the target application window.

4. The method according to claim 1, characterized in that: After starting the application window to be tested of the application in response to the starting operation, the method further includes: When the application window to be tested is a newly added application window, the step of obtaining the target window feature of the target application window is executed; When the application window to be tested is an activated application window, the application type corresponding to the application window to be tested is obtained; when the application type is a single instance application, the step of obtaining the target window feature of the target application window is executed.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the degree of match between the target window feature and the window feature to be tested is less than the first matching threshold, obtaining a window matching duration; When the window matching time length is greater than or equal to the preset matching time length, matching the feature of the window to be tested with the feature of the target window; When the matching degree of the feature of the window to be tested is greater than a second matching threshold, the application window to be tested is determined as a target application window, and the second matching threshold is less than the first matching threshold.

6. The method according to claim 4, characterized in that The method further comprises: When the application type is a multi-instance application, acquiring an activation record of the application window to be tested, and obtaining at least one application window to be tested in the activation record; Acquire the window characteristics of each of the application windows to be tested, and match the window characteristics of each of the application windows to be tested with the target application window characteristics; When there is a window feature to be tested whose matching degree with the target window feature is greater than a first matching threshold among the window features to be tested, the application window to be tested corresponding to the window feature to be tested greater than the first matching threshold is determined as the target application window.

7. The method according to claim 6, characterized in that The method further comprises: When the application type is a multi-instance application and a window is newly added, obtaining the window feature to be tested of the application window to be tested, and matching the window feature to be tested based on the target window feature; When the degree of matching between the target window feature and the window feature to be tested is greater than or equal to a first matching threshold, the application window to be tested is determined as the target application window.

8. The method according to any one of claims 6-7, characterized in that: The method further comprises: When the degree of match between the target window feature and the window feature to be tested is less than the first matching threshold, obtaining a window matching duration; When the window matching time length is greater than or equal to the preset matching time length, obtaining the application window to be tested whose matching degree in the window feature to be tested is greater than a second matching threshold; The application window to be tested with the greatest matching degree among the characteristics of the window to be tested is selected as the target application window.

9. The method according to claim 8, characterized in that The method further comprises: When the matching degree of the characteristics of the window to be tested is less than the second matching threshold, the application window to be tested with the largest window size among the application windows to be tested is selected as the target application window.

10. The method according to claim 1, characterized in that The method further comprises: When the target application window is not detected, prompt information is output to prompt that the target application window is not found.

11. A computer storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the method according to any one of claims 1 to 10.

12. An electronic device comprising: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method according to any one of claims 1 to 10.