Data acquisition method and device, feature determination method and device, and electronic device
The method enables third-party applications to retrieve target data by matching pre-defined window attributes, improving data extraction efficiency and accuracy by identifying fixed attributes in running windows, addressing positional and image recognition challenges.
Patent Information
- Application Number
- CN202110200609.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-23
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-02-23
AI Technical Summary
In the prior art, third-party applications find it difficult to efficiently obtain target data from various systems, especially when window properties are not fixed or obscured, resulting in difficulty in obtaining data.
By traversing the operating system's running window, obtaining window attribute information, and using preset window attribute information to match the window to determine the target data, using fixed attributes as preset window attribute information to achieve automatic acquisition of target data.
It improves the accuracy and convenience of third-party applications to obtain target data from the operating system, solves the problem of unfixed window properties or being blocked, and ensures the reliability of data acquisition.
Smart Images

Figure CN114968437B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technologies, and more particularly, to a data acquisition method and apparatus, a feature determination method and apparatus, and an electronic device. Background Art
[0002] Third-party application programs installed in a system may need to obtain target data from other applications installed in the system to implement specific functions. For example, for a third-party payment application installed in a Windows system, when a user wishes to use the third-party payment application for payment, the third-party payment application requires at least two key pieces of information: "a deduction code actively presented by the consumer" and "the amount value to be deducted".
[0003] In the process of implementing the concept of the present disclosure, the inventors found that there are at least the following problems in the prior art. How a third-party application program obtains target data from multiple systems has become an urgent problem to be solved. Summary of the Invention
[0004] In view of this, the present disclosure provides a data acquisition method and apparatus, a feature determination method and apparatus, and an electronic device that help a third-party application program automatically obtain target data from an application program that can create a window.
[0005] One aspect of the present disclosure provides a data acquisition method executed by an electronic device, which is applied to an application program installed on an operating system and capable of creating a window. The method includes: obtaining window attribute information of a window in a running state from the operating system; and if at least one of the window attribute information of the window in the running state matches preset window attribute information, obtaining target data from the window in the running state.
[0006] According to an embodiment of the present disclosure, the preset window attribute information is determined by the following method: controlling the display data of at least one window in the running state to include target data; traversing at least part of the currently running windows to obtain at least part of the calibration window handles of the currently running windows; obtaining at least part of the calibration attribute information of the currently running windows based on the calibration window handles; and using the fixed attribute information in the calibration attribute information as the preset window attribute information, where when the value of the target data and / or the state of the window including the target data change, the fixed attribute information remains unchanged.
[0007] According to an embodiment of the present disclosure, using the fixed attribute information in the calibration attribute information as the preset window attribute information includes: repeatedly performing the following operations until the fixed information in the calibration attribute information is determined: changing the value of the target data and / or the state of the window including the target data; and obtaining the fixed information that remains unchanged in the calibration attribute information to use the fixed information as the preset window attribute information.
[0008] According to an embodiment of the present disclosure, obtaining window attribute information of a window in a running state from an operating system includes: traversing at least some of the currently running windows to obtain window handles of at least some of the currently running windows; and obtaining attribute information of at least some of the currently running windows based on the window handles.
[0009] According to an embodiment of the present disclosure, the above method further includes: obtaining a configuration selection instruction, where the configuration selection instruction includes at least one attribute information selected from a plurality of candidate window attribute information; and in response to the configuration selection instruction, encapsulating at least one attribute information selected from the plurality of candidate window attribute information to generate an attribute acquisition instruction, so as to obtain window attribute information of a window in a running state based on the attribute acquisition instruction.
[0010] According to an embodiment of the present disclosure, the configuration selection instruction is determined based on the type of an application program including target data and a mapping relationship, and the mapping relationship includes a correspondence between the type of the application program and configuration information.
[0011] According to an embodiment of the present disclosure, obtaining target data from a window in a running state includes: obtaining window title text information of a target window, where the window title text information of the target window includes the target data; or obtaining window title text information of a window in a running state, and filtering the window title text information to obtain the target data.
[0012] According to an embodiment of the present disclosure, the target data includes payment amount data.
[0013] Another aspect of the present disclosure provides a data acquisition method, which is applied to an application program installed on an operating system and capable of creating a window, and the display data of at least one window includes target data. The above method includes: repeatedly performing the following operations until a fixed attribute is determined from the window attribute information of at least some of the currently running windows: changing the value of the target data and / or the state of the target window including the target data; determining, from the window attribute information of at least some of the currently running windows, attribute information that remains fixed as the value of the target data and / or the state of the target window including the target data changes; and using the fixed attribute as a target window feature, so as to obtain the target data from the operating system based on the target window feature.
[0014] According to an embodiment of the present disclosure, the above method further includes: after using the fixed attribute as a target window feature, if it is determined that at least some of the currently running windows include a target window that matches the target window feature, obtaining the target data from the window in the running state.
[0015] Another aspect of the present disclosure provides a data acquisition device, which is applied to an application program installed on an operating system and capable of creating windows. The device includes: an attribute information acquisition module, configured to acquire window attribute information of a window in a running state from the operating system; and a target data acquisition module, configured to acquire target data from the window in the running state if at least one of the window attribute information of the window in the running state matches preset window attribute information.
[0016] Another aspect of the present disclosure provides a data acquisition device, which is applied to an application program installed on an operating system and capable of creating windows, and the display data of at least one window includes target data. The device includes: a fixed attribute determination module, configured to repeatedly perform the following operations until a fixed attribute is determined from the window attribute information of at least some currently running windows: changing the value of the target data and / or the state of the target window including the target data; determining, from the window attribute information of at least some currently running windows, the attribute information that remains fixed as the value of the target data and / or the state of the target window including the target data changes; and a window feature determination module, configured to use the fixed attribute as the target window feature, so as to acquire target data from the operating system based on the target window feature.
[0017] Another aspect of the present disclosure provides an electronic device, including one or more processors and a storage device. The storage device is configured to store executable instructions, and when the executable instructions are executed by the processors, the above methods are implemented.
[0018] Another aspect of the present disclosure provides a computer-readable storage medium, storing computer-executable instructions, and the instructions are used to implement the above methods when executed.
[0019] Another aspect of the present disclosure provides a computer program, which includes computer-executable instructions, and the instructions are used to implement the above methods when executed.
[0020] In the embodiments of the present disclosure, since the windows created by the window type application program have window attributes, for the window(s) among the one or more windows created by the application program that include target data, the window attributes may have some fixed attributes. In this way, these fixed attributes can be used as the preset window attribute information, so as to facilitate determining whether the display data of the window in the current running state includes target data based on the preset window attribute information, and further facilitate determining whether to acquire target data from the window in the running state.
[0021] In an embodiment of the present disclosure, the target data is included in the display data of a window. However, only some of the currently running windows include the target data or do not include the target data, and it is necessary to identify the windows that include the target data. Considering that for a specific application, the windows that include the target data may have specific window characteristics, the feature determination method provided by the embodiments of the present disclosure analyzes the fixed attributes in the window attribute information of the windows that include the target data, and uses this fixed attribute as the target window feature, so that the windows that include the target data can be determined from the currently running windows based on this target window feature, which helps to improve the accuracy and convenience of obtaining the target data. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, the above and other objects, features, and advantages of the present disclosure will become clearer. In the drawings:
[0023] Figure 1 Schematically shows the application scenarios of the data acquisition method and device, the feature determination method and device, and the electronic device according to the embodiments of the present disclosure;
[0024] Figure 2 Schematically shows a schematic diagram of the system architecture of the applicable data acquisition method and device, the feature determination method and device, and the electronic device according to the embodiments of the present disclosure;
[0025] Figure 3 Schematically shows a flowchart of the data acquisition method according to the embodiments of the present disclosure;
[0026] Figure 4 Schematically shows a schematic diagram of the window attribute information according to the embodiments of the present disclosure;
[0027] Figure 5 Schematically shows a schematic diagram of the window attribute information according to another embodiment of the present disclosure;
[0028] Figure 6 Schematically shows a schematic diagram of the window attribute information according to another embodiment of the present disclosure;
[0029] Figure 7 Schematically shows a schematic diagram of the traversal method according to the embodiments of the present disclosure;
[0030] Figure 8 Schematically shows a schematic diagram of the fixed attribute according to the embodiments of the present disclosure;
[0031] Figure 9 Schematically shows a schematic diagram of the candidate window attribute information according to the embodiments of the present disclosure;
[0032] Figure 10Schematically shows a logic diagram of a data acquisition method according to an embodiment of the present disclosure;
[0033] Figure 11 Schematically shows a flowchart of a feature determination method according to an embodiment of the present disclosure;
[0034] Figure 12 Schematically shows a block diagram of a data acquisition device according to an embodiment of the present disclosure;
[0035] Figure 13 Schematically shows a block diagram of a feature determination device according to an embodiment of the present disclosure; and
[0036] Figure 14 Schematically shows a block diagram of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners
[0037] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the following detailed description, for the sake of explanation, many specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure. However, obviously, one or more embodiments can also be implemented without these specific details. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts of the present disclosure.
[0038] The terms used herein are merely for describing specific embodiments and are not intended to limit the present disclosure. The terms "including", "comprising", etc. used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0039] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0040] In the case of using expressions such as "at least one of A, B, or C, etc.", generally, it should be interpreted according to the meaning commonly understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having only A, only B, only C, having A and B, having A and C, having B and C, and / or having A, B, and C). The terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more features.
[0041] Explanation of technical terms in the embodiments of the present disclosure.
[0042] The window system provides hardware device independence for programmers. The implementation of the interactive system is based on an abstract device, and operations on the abstract device are converted into operations on specific devices through device drivers. This feature can, on the one hand, simplify the development of the interactive system, and on the other hand, make the transplantation of the interactive system very convenient.
[0043] Window attributes are any data assigned to a window. Window attributes are usually handles of window-related data, but can also be arbitrary numerical values. Each window attribute is identified by a string name.
[0044] The Graphics Device Interface (GDI) is mainly responsible for the information exchange between the system and drawing programs, and processes the graphics and image output of all Windows programs. The emergence of GDI enables programmers to convert the output of application programs into the output and composition on hardware devices without having to care about hardware devices and their normal drivers, realizing the isolation between program developers and hardware devices and greatly facilitating the development work.
[0045] A thread is the smallest unit that the operating system can perform operation scheduling on. It is contained in a process and is the actual operating unit in the process. A thread refers to a single sequential control flow in a process. Multiple threads can be concurrent in a process, and each thread executes different tasks in parallel. In Unix System V and SunOS, it is also called a lightweight process, but a lightweight process more refers to a kernel thread, while a user thread is called a thread.
[0046] To facilitate the understanding of the embodiments of the present disclosure, first, an exemplary description of the method for obtaining target data from the operating system in related technologies is given. In related technologies, methods such as regional image recognition and reading from the customer display amount device port can be used to enable a third-party application to read target data from other applications installed in the operating system, such as reading transaction amount data, etc. However, these methods have their respective applicable conditions and a relatively small scope of application. For example, it is possible to identify the transaction amount from the information transmitted from the customer display amount device port.
[0047] For example, when an application containing amount text does not have the function of sending amount data to a specified hardware port (such as a customer display function), or in the scenario where the amount data is inaccurate or incomplete (such as only sending the unit price and not the total price), the port reading method cannot obtain the target data, such as payment amount data.
[0048] For example, when the position of the amount text in the amount text interface is not fixed (such as the payment amount data is below the payment amount of each commodity, and as the number of commodities to be paid increases, the position of the payment amount data gradually changes). Or due to problems such as being blocked by the background color or background image, the image recognition cannot read the correct amount text.
[0049] All of the above reasons make it inconvenient for third-party application programs (such as third-party payment applications) to read the target data generated by other application programs from the operating system.
[0050] Embodiments of the present disclosure provide a data acquisition method and apparatus, a feature determination method and apparatus, and an electronic device. The data acquisition method includes an attribute information acquisition process and a target data acquisition process. In the attribute information acquisition process, window attribute information of a window in a running state is acquired from the operating system. After the attribute information acquisition process is completed, the target data acquisition process is entered. If at least one of the window attribute information of the window in the running state matches the preset window attribute information, the target data is acquired from the window in the running state.
[0051] In the embodiments of the present disclosure, for an application program installed on the operating system and capable of creating a window, since the specific window created by the application program includes the target data, it is possible to determine whether there is a window including the target data in the currently running state window through the preset window attribute information, effectively improving the problem that third-party application programs cannot acquire the target data from other application programs installed on the operating system based on methods such as regional image recognition and reading the customer display amount device port.
[0052] Figure 1 Schematically shows an application scenario of the data acquisition method and apparatus, the feature determination method and apparatus, and the electronic device according to the embodiments of the present disclosure.
[0053] Such as Figure 1 shown, when the first application needs to create a window through a thread to display the target data, the window created by the thread can have window attribute information, such as window title name, window style, window position, window size, etc. At least part of the window attribute information can be displayed in the window. Such as Figure 1 the window in is a window with a payment collection function, which includes sub-windows such as total amount, Dongfu collection amount, and change. Among them, the window title names of the total amount sub-window and the Dongfu collection sub-window are the target data required by the second application. Therefore, the second application can acquire the target data from the specific window.
[0054] In the embodiments of the present disclosure, by traversing the windows in the running state in real time and matching them with the preset window attribute information, when it is determined that there is a window that exactly matches, it can be determined that there is a window containing the target data among the windows in the current running state, so as to obtain the target data from this window.
[0055] Figure 2 The figure schematically shows the system architecture of the applicable data acquisition method and device, the feature determination method and device, and the electronic device according to the embodiments of the present disclosure. It should be noted that, Figure 2 The shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0056] As Figure 2 shown, the system architecture 200 according to this embodiment may include terminal devices 201, 202, 203, a network 204, and a server 205. The network 204 is used to provide a medium for communication links between the terminal devices 201, 202, 203 and the server 205. The network 204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0057] Users can use the terminal devices 201, 202, 203 to interact with the server 205 through the network 204 to receive or send information, etc. Various communication client applications may be installed on the terminal devices 201, 202, 203, such as shopping applications, financial applications, database applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0058] The terminal devices 201, 202, 203 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.
[0059] For example, the terminal device may be a laptop portable computer, on which a settlement application of a merchant is installed, and an input device (such as a barcode scanner, a payment box, etc.) may also be installed to facilitate scanning and pricing of the goods purchased by the user (the pricing result may include target information required by a third-party application, such as the amount to be paid data). For another example, the terminal device may be a smart phone, on which a display screen may be set to display a payment code (which may be in the form of a two-dimensional code), or a camera may be set on the smart phone to scan the collection code (which may be in the form of a two-dimensional code) displayed on the terminal device of the merchant or the collection code on the carrier provided by the merchant to implement the payment function.
[0060] The server 205 may be a server that provides various services, such as a background management server (only for example) that supports the websites browsed by users using the terminal devices 201, 202, and 203. The background management server can analyze and process data such as user requests received (such as requests for searching for products entered by users), and feedback the processing results (such as web pages, product information, or data obtained or generated according to user requests) to the terminal devices.
[0061] It should be noted that the data acquisition method provided by the embodiments of the present disclosure can generally be executed by the terminal devices 201, 202, and 203. Correspondingly, the data acquisition device provided by the embodiments of the present disclosure can generally be set in the terminal devices 201, 202, and 203. It should be understood that the numbers of terminal devices, networks, and servers are only illustrative. According to actual needs, there can be any number of terminal devices, networks, and servers.
[0062] Figure 3 A flowchart of the data acquisition method according to an embodiment of the present disclosure is schematically shown.
[0063] As Figure 3 shown, the data acquisition method executed by an electronic device is applied to an application program installed on an operating system and capable of creating windows, and the method includes operation S302 to operation S304.
[0064] In operation S302, window attribute information of a window in a running state is obtained from the operating system.
[0065] In this embodiment, by analyzing an application program, such as an application program that cannot use area image recognition, customer display amount device port reading, etc. to obtain target data, it is determined which positions in the application program or the operating system still have the target data required by a third-party application. Through a large amount of analysis, it is found that although these application programs do not support the above several methods, the amount text still needs to be displayed on the interface of the application program for users to view.
[0066] Under the windows system, there are two ways to display the interface. One is GDI drawing. The other is to generate a window, such as displaying target data by displaying window title information. For example, in the windwos system, most controls such as input text boxes belong to windows. The embodiments of the present disclosure attempt to obtain the current windwos system window information and view the window information associated with the application program containing the amount text. After testing, it is found that for the vast majority of system processes that generate interface display information in the form of windows, the text information displayed thereon can be obtained by obtaining the window information at the corresponding positions.
[0067] For example, a settlement application is installed on an operating system. The settlement application settles the goods purchased by the user to obtain the amount to be paid. To facilitate the user to view the amount to be paid, the settlement application can create a window to display the payment amount, which facilitates the user to use a third-party payment application to make an online payment based on the amount to be paid. In addition, it can also facilitate the cashier to conduct commodity verification and offline settlement based on the amount to be paid, etc.
[0068] Since the window contains a lot of attribute information, such as: the creation style of the window, the creation class name of the window, the position information of the window, the parent window information of the window, the sibling window information of the window, etc. Therefore, it is possible to try to locate the window containing the target data (such as payment amount information) that needs to be found through these attribute information.
[0069] It should be noted that the Windows system is only for illustrative purposes and should not be construed as a limitation of the present disclosure. It can also be applied to various operating systems with a graphical user interface, such as the Apple operating system (macOS), the Android system, etc.
[0070] In one embodiment, the window includes an application window, a sub-window, and a system window.
[0071] Among them, the application window (Application Window) includes the window created by the application itself, and the window responsible for display by the system before the application runs.
[0072] Sub-window (Sub Window): A dialog box defined by the application itself, such as an input method window. The sub-window needs to be attached to a certain application window (such as setting the same token).
[0073] System window (System Window): A window designed by the system that is not attached to any application. For example, the status bar (Status Bar), the navigation bar (Navigation Bar), the wallpaper (Wallpaper), the incoming call display window (Phone), the lock screen window (KeyGuard), the information prompt window (Toast), the volume adjustment window, the mouse cursor, etc.
[0074] In one embodiment, the target data at least includes payment amount data. For example, the target data is the amount data generated in response to the cashier's scanning operation of the goods. It should be noted that the target data being payment amount data is only for illustrative purposes and should not be construed as a limitation of the present disclosure. For example, the target data can also be data such as settlement data, commodity attribute data (such as quantity, weight, date, manufacturer), payment method data, and preferential information data.
[0075] In one embodiment, the window attribute information includes, but is not limited to, at least one of the following: window thread information, window style information, window position information, window class information, window parent window information, window size information, window handle information, etc. The window handle can be used to identify the window.
[0076] Figure 4 FIG. schematically shows a schematic diagram of window attribute information according to an embodiment of the present disclosure.
[0077] As Figure 4 shown, the window attribute information may include window title text information. Referring to Figure 1 shown, the window title text information corresponding to Dongfu collection is 15.
[0078] Figure 5 FIG. schematically shows a schematic diagram of window attribute information according to another embodiment of the present disclosure.
[0079] As Figure 5 shown, the class name of the window is as follows:
[0080] WindowsForms10.EDIT.app.0.13a5ba8_r13_ad1. It should be noted that Figure 5 this is only an exemplary display schematic diagram of the class name of the window. The class name of the window can be obtained by means of function calls without the need for display.
[0081] Figure 6 FIG. schematically shows a schematic diagram of window attribute information according to another embodiment of the present disclosure.
[0082] As Figure 6 shown, the window attribute information may include window style information, such as Figure 6 includes: window style and extended style. Among them, the window style and the extended style may respectively have different identification information.
[0083] In one embodiment, obtaining the window attribute information of the windows in the running state from the operating system may include the following operations.
[0084] First, traverse at least some of the currently running windows to obtain the window handles of at least some of the currently running windows.
[0085] Then, based on the window handles, obtain the attribute information of at least some of the currently running windows.
[0086] Taking the Windows operating system as an example, for the convenience of obtaining window attribute information. The currently running windows and their window attribute information can be traversed by means of windows.
[0087] Figure 7 A schematic diagram schematically shows a traversal method according to an embodiment of the present disclosure.
[0088] As Figure 7 shown, it is possible to first attempt to traverse the system windows through the traversal window methods EnumWindows and EnumChildWindows provided by the windows system to obtain the windows in the running state and their respective child windows.
[0089] Among them, EnumWindows returns the identifier of the thread that created the specified window and the identifier of the process that created the window. Parameters: hwnd: window handle. IpdwProcessld: address of the 32-bit value that receives the process identifier. The return value is the thread identifier that created the window. In windows, a handle is a reference to a system internal data structure. For example, when operating on a window, the system will give a handle to this window.
[0090] Then, obtain the attribute information of each window and child window by the method of obtaining attributes.
[0091] Attempt to obtain various information of the traversed window through the methods of windows.
[0092] For example, obtain the process information to which the window belongs through the GetWindowThreadProcessId method.
[0093] Obtain the style information of the window through the GetWindowStyle method.
[0094] Obtain the position information of the window through the GetWindowRect method. This method returns the size information of the specified window. Such as the screen coordinates of the upper left corner and the lower right corner of the window.
[0095] Obtain the class information of the window through the GetClassName method. This method returns the class name of the class to which the specified window belongs.
[0096] Obtain the parent window information of the window through the GetParent method. This method returns the parent window handle.
[0097] In this way, the window attributes of the window in the running state can be obtained. To facilitate the use of this window attribute information, this window attribute information can be stored.
[0098] In operation S304, if at least one of the window attribute information of the window in the running state matches the preset window attribute information, target data is obtained from the window in the running state.
[0099] In this embodiment, if at least one of the window attribute information in the running state window matches the preset window attribute information, it indicates that the target data is included in the window currently in the running state. At this time, the target data can be obtained from the window based on the matching result.
[0100] In one embodiment, obtaining the target data from the window in the running state may include the following operations.
[0101] For example, obtain the window title text information of the target window, and the window title text information of the target window includes the target data.
[0102] Again, for example, obtain the window title text information of the window in the running state, and filter the window title text information to obtain the target data.
[0103] The embodiments of the present disclosure determine whether the display data of the window currently in the running state includes the target data based on the preset window attribute information, thereby facilitating the determination of whether to obtain the target data from the window in the running state.
[0104] The following gives an exemplary description of the preset window attribute information.
[0105] In one embodiment, the preset window attribute information can be determined in the following manner.
[0106] First, control the display data of at least one window in the running state to include the target data.
[0107] Then, traverse at least part of the windows currently in the running state to obtain the calibration window handles of at least part of the windows currently in the running state.
[0108] Next, obtain the calibration attribute information of at least part of the windows currently in the running state based on the calibration window handles.
[0109] Then, use the fixed attribute information in the calibration attribute information as the preset window attribute information, where when the value of the target data and / or the state of the window including the target data change, the fixed attribute information remains unchanged.
[0110] For example, it can be assumed that when the value of the target data in the application program for creating the window changes, although the value will change continuously, it will also cause some window attributes to change. However, except for the changing parts, the remaining fixed attributes can uniquely locate a certain specified window. Therefore, the window including the target data can be uniquely located through the "fixed attribute information".
[0111] In one embodiment, using the fixed attribute information in the calibration attribute information as the preset window attribute information may include the following operations.
[0112] Repeat the following operations until the fixed information in the calibration attribute information is determined: change the value of the target data and / or the state of the window including the target data; and obtain the fixed information that remains unchanged in the calibration attribute information to use the fixed information as the preset window attribute information.
[0113] For example, first, determine at least one of the changing attributes in which the attribute information changes due to the change in the value of the target data. Then, delete the changing attributes to determine the fixed attributes.
[0114] In a specific embodiment, first, attempt to traverse the system windows by using the window traversal methods EnumWindows and EnumChildWindows provided by the Windows system. Then, obtain the window attribute information of each window by using the attribute information obtaining method as shown above. Attempt to compare the window attributes one by one to determine whether the required payment window information can be located.
[0115] After testing, in actual situations, when the amount text changes, the window position changes, etc., some attribute information of the window to be searched will change. For example: position information, window class name, etc., and the attributes that change in different software systems containing the amount text are different in actual situations. Therefore, a unified default detection item cannot be formed to adapt to all situations.
[0116] In one embodiment, to address this problem, the above method may further include the following operations. Before obtaining the window attribute information, first, obtain a configuration selection instruction, where the configuration selection instruction includes at least one attribute information selected from multiple candidate window attribute information. Then, in response to the configuration selection instruction, encapsulate at least one attribute information selected from the multiple candidate window attribute information to generate an attribute acquisition instruction, so as to obtain the window attribute information of the window in the running state based on the attribute acquisition instruction.
[0117] For example, the configuration selection instruction is determined based on the type of the application program including the target data and the mapping relationship, and the mapping relationship includes the correspondence between the type of the application program and the configuration information.
[0118] In a specific embodiment, by further analyzing the matching results, it is found that although the fixed window attributes of the windows created by each application program are different (which can also be understood as different invariant items), for the same application program, the fixed window attributes are the same. Therefore, an attribute selection function is designed, default configuration options are added, and certain detection items can be manually selected to be enabled or disabled for different types of software systems. Once set, a general configuration can be formed for a certain software system, and the target window including the target data can be determined according to this configuration.
[0119] Figure 8 A schematic diagram showing fixed attributes according to an embodiment of the present disclosure is schematically illustrated.
[0120] As Figure 8 shown, for the target window of the application as Figure 1 shown, when the value 15 in the window is modified to 13, the position information, window style information, and extended style information in the window attribute information do not change. Therefore, these fixed attribute information can be used as preset window attribute information.
[0121] Figure 9 A schematic diagram showing candidate window attribute information according to an embodiment of the present disclosure is schematically illustrated.
[0122] As Figure 9 shown, the candidate window attribute information includes but is not limited to at least one of: window destruction customer display zeroing, detecting window position change, detecting whether the window is visible, detecting window class name, detecting window style, detecting parent window information, detecting parent window subsequence, or detecting sibling window information. This facilitates the user to select fixed window attributes from the above-mentioned multiple candidate window attribute information based on the category of the application. As Figure 9 shown, detecting window position change is not selected because the position of the target window created by the application changes with the change of the target data, but other window attributes are fixed.
[0123] Figure 10 A logic diagram showing a data acquisition method according to an embodiment of the present disclosure is schematically illustrated.
[0124] As Figure 10 shown, for an application that needs to set target data. Set the target data in the window of the application. Therefore, the window running in the operating system includes the target data. Determine whether there is a window that matches the preset window attribute information. If so, obtain the window title text and filter the window title text to obtain the target data. If there is no window that matches the preset window attribute information, terminate obtaining the target data.
[0125] Another aspect of the present disclosure provides a feature determination method.
[0126] Figure 11 A flowchart showing a feature determination method according to an embodiment of the present disclosure is schematically illustrated.
[0127] As Figure 11 shown, the feature determination method executed by an electronic device is applied to an application installed on an operating system and capable of creating a window. The display data of at least one window includes target data. The method includes operations S1101 to S1103.
[0128] In operation S1101, the following operations are repeatedly performed until a fixed attribute is determined from the window attribute information of at least some of the currently running state windows: changing the value of the target data and / or the state of the target window including the target data; determining, from the window attribute information of at least some of the currently running state windows, the attribute information that remains fixed as the value of the target data and / or the state of the target window including the target data changes.
[0129] In operation S1103, the fixed attribute is used as the target window feature to obtain the target data from the operating system based on the target window feature.
[0130] In one embodiment, after using the fixed attribute as the target window feature, the above method may further include the following operations.
[0131] If it is determined that at least some of the currently running state windows include a target window that matches the target window feature, the target data is obtained from the running state windows.
[0132] The feature determination method provided by the embodiments of the present disclosure extracts the fixed attributes of the window including the target data and uses them as the target window features when the target data cannot be obtained by methods such as port reading and image recognition, so as to determine whether the currently running windows include a target window with the target data based on the target window features.
[0133] It should be noted that the above operations can refer to the relevant parts in the data acquisition method and will not be elaborated here.
[0134] Another aspect of the present disclosure provides a data acquisition device.
[0135] Figure 12 A block diagram of the data acquisition device according to the embodiments of the present disclosure is schematically shown.
[0136] As Figure 12 shown, the data acquisition device 1200 is applied to an application installed on the operating system and capable of creating windows. The device 1200 includes: an attribute information acquisition module 1210 and a target data acquisition module 1220.
[0137] Among them, the attribute information acquisition module 1210 is used to obtain the window attribute information of the running state windows from the operating system.
[0138] The target data acquisition module 1220 is used to obtain the target data from the running state windows if at least one of the window attribute information of the running state windows matches the preset window attribute information.
[0139] Another aspect of the present disclosure provides a feature determination device, which is applied to an application installed on an operating system and capable of creating a window, and the display data of at least one window includes target data.
[0140] Figure 13 FIG. schematically shows a block diagram of a feature determination device according to an embodiment of the present disclosure.
[0141] As Figure 13 shown, the feature determination device 1300 includes a fixed attribute determination module 1310 and a window feature determination module 1320.
[0142] Among them, the fixed attribute determination module 1310 is configured to repeatedly perform the following operations until a fixed attribute is determined from the window attribute information of at least some currently running windows: changing the value of the target data and / or the state of the target window including the target data; determining, from the window attribute information of at least some currently running windows, the attribute information that remains fixed as the value of the target data and / or the state of the target window including the target data changes.
[0143] The window feature determination module 1320 is configured to use the fixed attribute as the target window feature, so as to obtain the target data from the operating system based on the target window feature.
[0144] Any multiple of the modules according to the embodiments of the present disclosure, or at least part of the functions of any of them, can be implemented in one module. Any one or more of the modules according to the embodiments of the present disclosure can be split into multiple modules for implementation. Any one or more of the modules according to the embodiments of the present disclosure can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by any other reasonable way of integrating or packaging the circuit in hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in an appropriate combination of any several of them. Alternatively, one or more of the modules according to the embodiments of the present disclosure can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding functions can be executed.
[0145] For example, any number of the attribute information acquisition module 1210 and the target data acquisition module 1220 may be combined and implemented in one module, or any one of them may be split into multiple modules. Or, at least part of the functions of one or more of these modules may be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the attribute information acquisition module 1210 and the target data acquisition module 1220 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner that can integrate or package circuits, etc., implemented by hardware or firmware, or implemented in any one of the three implementation manners of software, hardware, and firmware, or in any suitable combination of several of them. Or, at least one of the attribute information acquisition module 1210 and the target data acquisition module 1220 may be at least partially implemented as a computer program module, and when the computer program module is run, it can execute corresponding functions.
[0146] Figure 14 Schematically shows a block diagram of an electronic device according to an embodiment of the present disclosure. Figure 14 The illustrated electronic device is merely an example and should not impose any limitation on the functions and usage scope of the embodiments of the present disclosure.
[0147] As Figure 14 shown, the electronic device 1400 according to an embodiment of the present disclosure includes a processor 1401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1402 or the program loaded from the storage section 1408 into the random access memory (RAM) 1403. The processor 1401 may include, for example, a general microprocessor (such as a CPU), an instruction set processor, and / or a related chipset, and / or a dedicated microprocessor (such as an application specific integrated circuit (ASIC)), and so on. The processor 1401 may also include on-board memory for caching purposes. The processor 1401 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiments of the present disclosure.
[0148] In the RAM 1403, various programs and data required for the operation of the system 1400 are stored. The processor 1401, the ROM 1402, and the RAM 1403 are connected to each other via a bus 1404. The processor 1401 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 1402 and / or the RAM 1403. It should be noted that the program can also be stored in one or more memories other than the ROM 1402 and the RAM 1403. The processor 1401 can also perform various operations of the method flow according to the embodiments of the present disclosure by executing programs stored in one or more memories.
[0149] According to an embodiment of the present disclosure, the system 1400 may further include an input / output (I / O) interface 1405, and the input / output (I / O) interface 1405 is also connected to the bus 1404. The system 1400 may further include one or more of the following components connected to the I / O interface 1405: an input section 1406 including a keyboard, a mouse, etc.; an output section 1407 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a LAN card, a modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the I / O interface 1405 as needed. A removable medium 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1410 as needed so that a computer program read from it can be installed into the storage section 1408 as needed.
[0150] According to an embodiment of the present disclosure, the method flow according to the embodiments of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable storage medium, and the computer program includes program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1409 and / or installed from the removable medium 1411. When the computer program is executed by the processor 1401, the above-described functions defined in the system according to the embodiments of the present disclosure are executed. According to an embodiment of the present disclosure, the above-described system, device, apparatus, module, unit, etc. can be implemented by computer program modules.
[0151] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the foregoing embodiments; or may exist independently without being assembled into the device / apparatus / system. The foregoing computer-readable storage medium carries one or more programs, and when the one or more programs are executed, the methods according to the embodiments of the present disclosure are implemented.
[0152] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, and may include, for example, but not limited to: portable computer disks, hard disks, random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include one or more memories other than the foregoing ROM 1402 and / or RAM 1403 and / or ROM 1402 and RAM 1403.
[0153] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the foregoing module, program segment, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in an order different from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0154] Embodiments of the present disclosure further include a computer program product, which includes a computer program. The computer program contains program codes for executing the methods provided in the embodiments of the present disclosure. When the computer program product runs on an electronic device, the program codes are used to cause the electronic device to implement the image model training method or the image processing method provided in the embodiments of the present disclosure.
[0155] When the computer program is executed by the processor 1401, the above functions defined in the system / apparatus of the embodiments of the present disclosure are executed. According to the embodiments of the present disclosure, the above-described systems, apparatuses, modules, units, etc. can be implemented by computer program modules.
[0156] In one embodiment, the computer program can rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program can also be transmitted and distributed in the form of signals on a network medium, and be downloaded and installed through the communication part 1409, and / or be installed from the removable medium 1411. The program code included in the computer program can be transmitted by any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0157] According to the embodiments of the present disclosure, the program code for executing the computer program provided by the embodiments of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level procedures and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include but are not limited to, such as Java, C++, python, the "C" language, or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (e.g., by using an Internet service provider to connect through the Internet).
[0158] Those skilled in the art can understand that the features recited in the various embodiments and / or claims of the present disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly recited in the present disclosure. These embodiments are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the above embodiments are described separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art can make various substitutions and modifications, and these substitutions and modifications should all fall within the scope of the present disclosure.
Claims
1. A data acquisition method executed by an electronic device, applied to an application installed on an operating system and capable of creating windows, the method comprising: Obtaining window attribute information of a window in a running state from the operating system; And If at least one of the window attribute information of the window in the running state matches preset window attribute information, obtaining target data from the window in the running state, wherein the preset window attribute information is determined by the following method: Controlling the display data of at least one window in the running state to include the target data; Traversing at least part of the currently running windows to obtain at least part of the calibration window handles of the currently running windows; Obtaining at least part of the calibration attribute information of the currently running windows based on the calibration window handles; and Taking the fixed attribute information in the calibration attribute information as the preset window attribute information, wherein when the value of the target data and / or the state of the window including the target data change, the fixed attribute information remains unchanged.
2. The method according to claim 1, wherein, The taking the fixed attribute information in the calibration attribute information as the preset window attribute information includes: Repeatedly performing the following operations until the fixed information in the calibration attribute information is determined: Changing the value of the target data and / or the state of the window including the target data; and Obtaining the fixed information that remains unchanged in the calibration attribute information to take the fixed information as the preset window attribute information.
3. The method according to claim 1, wherein, The obtaining window attribute information of a window in a running state from the operating system includes: Traversing at least part of the currently running windows to obtain at least part of the window handles of the currently running windows; and Obtaining the attribute information of at least part of the currently running windows based on the window handles.
4. The method according to claim 1, further comprising: Obtaining a configuration selection instruction, the configuration selection instruction including at least one attribute information selected from a plurality of candidate window attribute information; And In response to the configuration selection instruction, encapsulating at least one attribute information selected from the plurality of candidate window attribute information to generate an attribute acquisition instruction, so as to obtain the window attribute information of a window in a running state based on the attribute acquisition instruction.
5. The method according to claim 4, wherein The configuration selection instruction is determined based on the type of the application including the target data and a mapping relationship, and the mapping relationship includes the corresponding relationship between the type of the application and the configuration information.
6. The method according to claim 1, wherein The obtaining target data from the window in the running state includes: Obtaining the window title text information of a target window, the window title text information of the target window including the target data; Or Obtaining the window title text information of the window in the running state, and filtering the window title text information to obtain the target data.
7. The method according to any one of claims 1 to 6, wherein, The target data includes payment amount data.
8. A feature determination method executed by an electronic device, applied to an application installed on an operating system and capable of creating windows, the display data of at least one window including target data, the method comprising: Repeat the following operations until a fixed attribute is determined from the window attribute information of at least some of the currently running windows: change the value of the target data and / or the state of the target window including the target data; from the window attribute information of at least some of the currently running windows, determine the attribute information that remains fixed as the value of the target data and / or the state of the target window including the target data changes; and Use the fixed attribute as a target window feature to obtain the target data from the operating system based on the target window feature.
9. The method according to claim 8, further comprising: After using the fixed attribute as the target window feature, If it is determined that at least some of the currently running windows include a target window that matches the target window feature, obtain the target data from the running windows.
10. A data acquisition device, which is applied to an application installed on an operating system and capable of creating windows, the device includes: An attribute information acquisition module, configured to acquire window attribute information of running windows from the operating system; And A target data acquisition module, configured to, if at least one of the window attribute information of the running windows matches preset window attribute information, acquire target data from the running windows, where the preset window attribute information is determined by the following method: Control the display data of at least one running window to include the target data; Traverse at least some of the currently running windows to obtain the calibration window handles of at least some of the currently running windows; Obtain the calibration attribute information of at least some of the currently running windows based on the calibration window handles; and Use the fixed attribute information in the calibration attribute information as the preset window attribute information, where the fixed attribute information remains fixed when the value of the target data and / or the state of the window including the target data change.
11. A feature determination device, which is applied to an application installed on an operating system and capable of creating windows, and the display data of at least one window includes target data, the device includes: A fixed attribute determination module, configured to repeat the following operations until a fixed attribute is determined from the window attribute information of at least some of the currently running windows: change the value of the target data and / or the state of the target window including the target data; from the window attribute information of at least some of the currently running windows, determine the attribute information that remains fixed as the value of the target data and / or the state of the target window including the target data changes; And A window feature determination module, configured to use the fixed attribute as a target window feature to obtain the target data from the operating system based on the target window feature.
12. An electronic device, including: One or more processors; And A storage device, configured to store executable instructions, and when the executable instructions are executed by the processor, implement the method according to any one of claims 1 to 7, or implement the method according to claim 8 or 9.
13. A computer-readable storage medium having executable instructions stored thereon, which when executed by a processor implement the method according to any one of claims 1 to 7, or implement the method according to claim 8 or 9.
14. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 7, or implements the method according to claim 8 or 9.
Citation Information
Patent Citations
Information acquisition method and apparatus for application window and computing device
CN106126217A
Watermark adding method and device
CN111382399A