A window monitoring method, device and readable storage medium

By using pre-built interactive and proxy modules in the Linux system to monitor compatible application windows in the Wine environment, the operational difficulties and inefficiencies caused by relying on platform logs in existing technologies are solved, and efficient and visualized window analysis is achieved.

CN117349132BActive Publication Date: 2026-05-29ZHONGKE FANGDE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHONGKE FANGDE SOFTWARE CO LTD
Filing Date
2023-09-28
Publication Date
2026-05-29

Smart Images

  • Figure CN117349132B_ABST
    Figure CN117349132B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a window monitoring method, device and readable storage medium. The method comprises: running a preset interaction module, the preset interaction module displaying an interaction interface; when the preset interaction module detects that a target window is selected through the interaction interface, the preset interaction module requests a first agent module to acquire first identification information of the target window under a compatibility layer; the target window is a window of a compatible application; when the preset interaction module detects a start monitoring instruction triggered through the interaction interface, the preset interaction module executes a monitoring operation on a specified window through a monitoring module, the monitoring operation comprising monitoring window messages of the specified window and / or window change information of the specified window, and writing the acquired monitoring information into a shared memory; the specified window comprises the target window; and the preset interaction module reads the monitoring information from the shared memory and displays the monitoring information. The present application can monitor the specified window of the compatible application running in Wine, which helps to more efficiently and intuitively analyze window-related problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a window monitoring method, apparatus and readable storage medium. Background Technology

[0002] Wine is a compatibility layer that enables Windows applications to run on a variety of POSIX-compliant operating systems, such as Linux, macOS, and BSD.

[0003] During secondary development of Wine, it is necessary to analyze window issues that occur in compatible applications under the Wine environment, such as window freezing or failure to display correctly. However, currently, analyzing Wine platform logs is usually required to capture window issues in compatible applications under the Wine environment, leading to difficult operations and low efficiency. Summary of the Invention

[0004] This application provides a window monitoring method, apparatus, and readable storage medium, which can monitor specified windows of compatible applications running in Wine, helping to analyze window-related issues more efficiently and intuitively.

[0005] In a first aspect, embodiments of this application disclose a window monitoring method applied to an electronic device configured with a Linux operating system. The Linux operating system includes a compatibility layer that enables the Linux operating system to run Windows-based compatible applications. The method includes:

[0006] Run the preset interaction module, which displays an interactive interface;

[0007] When the preset interaction module detects that a target window has been selected through the interaction interface, it requests the first proxy module to obtain the first identification information of the target window under the compatibility layer; the first identification information includes the first window identifier, the first process identifier, and the container path of the target window; the target window is the window of the compatible application;

[0008] When the preset interaction module detects a start monitoring command triggered through the interaction interface, it performs a monitoring operation on a specified window through the monitoring module. The monitoring operation includes monitoring the window messages and / or window change information of the specified window, and writing the monitoring information obtained by the monitoring operation into shared memory; the specified window includes the target window.

[0009] The preset interaction module reads the monitoring information from the shared memory and displays the monitoring information.

[0010] Secondly, embodiments of this application disclose a window monitoring device applied to an electronic device equipped with a Linux operating system. The Linux operating system is equipped with a compatibility layer, which enables the Linux operating system to run compatible applications based on the Windows operating system. The device includes a preset interaction module and a first agent module; the preset interaction module displays an interactive interface.

[0011] The pre-set interaction module is used to request the first proxy module to obtain the first identification information of the target window under the compatibility layer when it detects that the target window has been selected through the interaction interface; the first identification information includes the first window identifier, the first process identifier, and the container path of the target window; the target window is the window of the compatible application;

[0012] The preset interaction module is further configured to, upon detecting a start monitoring command triggered through the interaction interface, perform a monitoring operation on a specified window through the monitoring module. The monitoring operation includes monitoring window messages and / or window change information of the specified window, and writing the monitoring information obtained by the monitoring operation into shared memory; the specified window includes the target window.

[0013] The pre-set interaction module is also used to read the monitoring information from the shared memory and display the monitoring information.

[0014] Thirdly, embodiments of this application disclose an apparatus for window monitoring, including a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs contain instructions for performing window monitoring methods as described above.

[0015] Fourthly, embodiments of this application disclose a readable storage medium storing instructions that, when executed by one or more processors of the device, cause the device to perform the window monitoring method as described above.

[0016] The embodiments of this application have the following advantages:

[0017] This application provides a visual window monitoring method that offers a user-friendly interface to specify windows of compatible applications that need monitoring. The interface can also display monitoring information, such as window messages and / or changes to the specified window. This allows the user to monitor the state of the specified window and identify any problems that may arise during operation of the compatible application. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating the steps of an embodiment of a window monitoring method according to this application;

[0020] Figure 2 This is a schematic diagram illustrating the interaction between the modules of this application;

[0021] Figure 3 This is a structural block diagram of an embodiment of a window monitoring device according to this application;

[0022] Figure 4 This is a structural block diagram of another embodiment of the window monitoring device of this application;

[0023] Figure 5 This is a block diagram of a window monitoring device 800 according to this application;

[0024] Figure 6 This is a schematic diagram of the server structure in some embodiments of this application. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0026] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, the term "and / or" in the specification and claims is used to describe the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. In the embodiments of this application, the term "multiple" refers to two or more, and other quantifiers are similar.

[0027] Reference Figure 1 The diagram illustrates a flowchart of an embodiment of a window monitoring method according to this application. The method can be applied to an electronic device configured with a Linux operating system, which includes a compatibility layer that enables the Linux operating system to run Windows-based compatible applications. The method may include the following steps:

[0028] Step 101: Run the preset interaction module, which displays an interactive interface;

[0029] Step 102: When the preset interaction module detects that a target window has been selected through the interaction interface, it requests the first proxy module to obtain the first identification information of the target window under the compatibility layer; the first identification information includes the first window identifier, the first process identifier, and the container path of the target window; the target window is the window of the compatible application;

[0030] Step 103: When the preset interaction module detects a start monitoring command triggered through the interaction interface, it performs a monitoring operation on a specified window through the monitoring module. The monitoring operation includes monitoring the window messages and / or window change information of the specified window, and writing the monitoring information obtained by the monitoring operation into shared memory; the specified window includes the target window.

[0031] Step 104: The preset interaction module reads the monitoring information from the shared memory and displays the monitoring information.

[0032] The window monitoring method of this application embodiment can be applied to electronic devices configured with a Linux operating system. The electronic device may include, but is not limited to, any of the following: server, smartphone, voice recorder, tablet computer, e-book reader, MP3 (Moving Picture Experts Group Audio Layer III) player, MP4 (Moving Picture Experts Group Audio Layer IV) player, laptop computer, in-vehicle computer, desktop computer, set-top box, smart TV, wearable device, etc.

[0033] This application does not limit the type of Linux operating system. For example, the Linux operating system may include, but is not limited to, any one of Debian, Ubuntu, CentOS (Community Enterprise Operating System), UOS (Tongxin Desktop Operating System), Kylin Operating System, Fangde Operating System, etc.

[0034] The electronic device has a compatibility layer (such as Wine) configured in its Linux operating system, which enables the Linux operating system to run compatible applications based on the Windows operating system.

[0035] This application provides a visual window monitoring method that offers a user-friendly interface to specify windows of compatible applications that need monitoring. The interface can also display monitoring information, such as window messages and / or changes to the specified window. This allows the user to monitor the state of the specified window and identify any problems that may arise during operation of the compatible application.

[0036] Specifically, a pre-built interactive module is first run, which displays an interactive interface. This pre-built interactive module is a graphical interactive module that provides a visual interface. In this embodiment, the pre-built interactive module is also referred to as the lspy module. The lspy module can be an independent Linux process module that is triggered to run when the user needs to monitor a window. The lspy module supports window selection and can display monitoring information.

[0037] For example, the interface of the preset interaction module can provide a drag tool that supports mouse drag operations. When the user moves the drag tool to a window using the mouse, it indicates that the window is selected, and that window becomes the target window.

[0038] When the preset interaction module detects that a target window has been selected through the interaction interface, it requests the first agent module to obtain the first identification information of the target window under the compatibility layer; the first identification information includes the first window identifier, the first process identifier, and the container path of the target window; the target window can be the window of the compatible application.

[0039] When the preset interaction module detects that a target window has been selected through the interactive interface, it can obtain the identification information of the target window in the graphical interface (X Window), but it cannot obtain the identification information of the target window in the compatibility layer Wine. Therefore, the preset interaction module requests the first proxy module to obtain the identification information of the target window in the compatibility layer (referred to as the first identification information in this embodiment).

[0040] In its implementation, Wine consists of a dynamic link library and a service process (wineserver). This embodiment modifies the dependencies of Wine's dynamic link library to obtain a first proxy module. This first proxy module can obtain the target window's initial identification information within Wine.

[0041] The first proxy module is loaded and run when the compatible application starts. The operation of the compatible application depends on Wine's dynamic library, and the operation of Wine's dynamic library depends on the first proxy module. In this embodiment, the first proxy module is also referred to as the wspy module.

[0042] In practical implementation, the Wine compatibility layer can run multiple containers, each container can run multiple compatible applications, each compatible application can include multiple processes, each process can include multiple threads, and each window of a compatible application corresponds to one thread. There is a one-to-one correspondence between containers, WineServer, and Wine's dynamic link libraries. Therefore, after determining the target window selected by the user, it is necessary to obtain the target window's first identifier information within Wine to identify which process under which compatible application the target window belongs to, and to identify which container the compatible application to which the target window belongs belongs to.

[0043] In an optional embodiment of this application, when the preset interaction module detects that a target window has been selected through the interaction interface in step 102, it requests the first proxy module to obtain the first identification information of the target window under the compatibility layer, which may include:

[0044] Step S11: When the preset interaction module detects that a target window has been selected through the interaction interface, it obtains the second identification information of the target window in the graphical interface and sends a first request instruction to the first agent module. The first request instruction carries the second identification information of the target window. The second identification information includes the second window identifier, screen coordinates and second process identifier of the target window.

[0045] Step S12: In response to the first request instruction, the first proxy module queries whether the target window is a window created by itself based on the second window identifier of the target window; if so, it queries the first window identifier of the target window based on the second window identifier and screen coordinates; otherwise, it ignores the first request instruction.

[0046] Step S13: The first agent module queries the first process identifier and container path of the target window based on the first window identifier of the target window, and returns the first window identifier, first process identifier and container path of the target window to the preset interaction module.

[0047] When the preset interaction module detects that a target window has been selected through the interaction interface, it can obtain the identification information of the target window in the graphical interface (X Window) (referred to as the second identification information in this embodiment). The second identification information includes the second window identifier, screen coordinates, and second process identifier of the target window.

[0048] The second window identifier refers to the window identifier in the graphical interface, such as xwindowID. The screen coordinates are used to identify the display position of the target window on the screen. The second process identifier refers to the identifier of the Linux process to which the target window belongs in the graphical interface.

[0049] The preset interaction module sends a first request instruction to the first proxy module to request the first identification information of the target window in Wine. The first request instruction carries the second identification information of the target window in the graphical interface.

[0050] In response to the first request instruction, the first proxy module queries whether the target window is a window it created, based on the second window identifier (such as xwindowID) of the target window. The xwindowID is globally unique in the system, and the first proxy module stores the xwindowIDs of all compatible application windows it creates. By comparing the xwindowID of the target window with its stored xwindowIDs, it can determine whether the target window is a window of a compatible application it created. If so, the first proxy module queries the first window identifier of the target window based on the second window identifier and screen coordinates, and queries the first process identifier and container path of the target window based on the first window identifier; otherwise, the first request instruction is ignored.

[0051] The first proxy module returns the first window identifier, first process identifier, and container path of the target window to the preset interaction module. The first window identifier (e.g., represented by windowID) identifies the window of a Wine-compatible application. The first process identifier identifies the process of a Wine-compatible application. The container path identifies the container within Wine. It should be noted that one container corresponds to one WineServer.

[0052] After receiving the first identifier information of the target window returned by the first agent module, the pre-set interaction module can know which container, which compatible application, and which process the target window belongs to, thus uniquely identifying the target window and enabling monitoring operations to be performed on the target window.

[0053] The preset interaction module can provide buttons for triggering start monitoring commands and buttons for triggering stop monitoring commands through the interaction interface, so that users can trigger start monitoring commands or stop monitoring commands as needed.

[0054] When the preset interaction module detects a start monitoring command triggered through the interaction interface, it performs a monitoring operation on a specified window through the monitoring module. The monitoring operation includes monitoring the window messages and / or window change information of the specified window, and writes the monitoring information obtained by the monitoring operation into shared memory. The specified window includes the target window. The monitoring information includes the window messages and / or window change information of the specified window.

[0055] Window messages for a specified window refer to messages generated during the operation of that specified window. For example, when a user moves a specified window (such as window A), the position of window A changes. At this time, Wine's dynamic library will call the WM_MOVE and WM_WINDOWPOSCHANGED messages to change the position of window A. This embodiment of the application can monitor the generation of WM_MOVE and WM_WINDOWPOSCHANGED messages by window A and generate corresponding monitoring information written to shared memory. Furthermore, after the user stops moving window A, this embodiment of the application can also monitor the window change information of window A, such as the position information of window A before and after the movement, and generate corresponding monitoring information written to shared memory.

[0056] For example, when a user zooms in or out of a specific window (such as window B), the size of window B changes. At this time, Wine's dynamic library calls the WM_SIZE and WM_WINDOWPOSCHANGED messages to change the size of window B. This embodiment of the application can monitor the generation of WM_SIZE and WM_WINDOWPOSCHANGED messages by window B and generate corresponding monitoring information, writing it to shared memory. Furthermore, after the user stops zooming in or out of window B, this embodiment of the application can also monitor the window change information of window B, such as the size information of window B before and after zooming, and generate corresponding monitoring information, writing it to shared memory.

[0057] When the preset interaction module detects a start monitoring command triggered through the interactive interface, it can send a monitoring command to the monitoring module, which then performs monitoring operations on the specified window. This application embodiment does not limit the implementation of the monitoring module. For example, window messages and window changes for compatible application windows require implementation through Wine's dynamic library dependencies; therefore, the monitoring module can be implemented by modifying Wine's dynamic library dependencies. Exemplarily, the monitoring module can be the first proxy module, which monitors the specified window by registering a callback function and writes the acquired monitoring information to shared memory for the preset interaction module to read and display. In one example, a callback function is registered in the WM_SIZE function of the first proxy module. When the size of a specified window changes, the first proxy module calls the WM_SIZE function, which in turn calls the callback function within that WM_SIZE function. Through this callback function, it can be determined that the specified window has triggered the WM_SIZE window message, thus allowing monitoring information to be recorded.

[0058] Furthermore, in addition to monitoring the target window selected by the user through the drag tool, this embodiment of the application can also display a list of optional associated windows for the user to select before triggering the start monitoring command. This list of optional associated windows can include windows that are related to the target window, such as child windows of the target window. The preset interaction module uses the target window and the associated windows selected from the list of optional associated windows as designated windows, thereby enabling monitoring of the designated windows.

[0059] Through the embodiments of this application, visual monitoring of specified windows can be achieved, such as visual monitoring of window messages and window change information of the target window selected by the user. This allows users to more efficiently and intuitively monitor specified windows of compatible applications running via Wine in Linux systems, aiding in the analysis of window-related issues. It features ease of operation, high efficiency, and visualization.

[0060] In one optional embodiment of this application, the method may further include:

[0061] Step S21: The preset interaction module sends a second request instruction to the second proxy module, the second request instruction carrying the first identification information of the target window;

[0062] Step S22: In response to the second request instruction, the second proxy module queries the window-related information of the target window and its associated windows based on the first identification information of the target window, and writes the queried window-related information into the shared memory; the window-related information includes window state and window attributes; the associated windows include child windows of the target window;

[0063] Step S23: The preset interaction module reads the window-related information from the shared memory and displays the window-related information.

[0064] This application embodiment modifies the dependency libraries of the Wine service process (wineserver) to obtain a second proxy module. The operation of wineserver depends on the second proxy module. The second proxy module is loaded and run by wineserver.

[0065] After receiving the first identifier information of the target window returned by the first agent module, the preset interaction module can send a second request instruction to the second agent module to request the second agent module to obtain window-related information of the target window, such as the state and attributes of the target window, and the state and attributes of the child windows of the target window.

[0066] The second proxy module, supplementing the first proxy module, stores the parent-child chain information of all windows under the WineServer container, as well as the state and attributes of all windows. Therefore, the preset interaction module can request the second proxy module to obtain the state and attributes of the target window, and the state and attributes of its child windows, and other window-related information. The second proxy module queries the target window and its associated windows based on the first identifier information of the target window, and writes the retrieved window-related information into the shared memory for the preset interaction module to read and display.

[0067] The window state can include active, disabled, and abnormal states. Window properties can include window size, screen coordinates, and z-order.

[0068] zorder is a computer term used to set the order of windows. The zorder determines the stacking order of windows. Windows with higher zorder numbers are displayed further back in the list, and windows with lower zorder numbers are placed on top of windows with higher zorder numbers.

[0069] Through the embodiments of this application, window-related information of the target window and its associated windows can be intuitively displayed to the user, providing stronger technical support for analyzing window problems that occur in compatible applications under the Wine environment.

[0070] Furthermore, the associated windows may also include all other windows under the container path besides the target window. When a user selects a target window, the target window's xwindowID can be obtained, thus determining the container where the target window resides, and subsequently, information about all windows within that container can be obtained. All windows within this container can be selected as optional associated windows for the user to choose from, and the selected window can be used as the designated window for monitoring.

[0071] In an optional embodiment of this application, the window-related information may further include the first identification information of the associated window. Before the preset interaction module detects the start monitoring command triggered by the interactive interface, the method may further include: the preset interaction module displays a list of optional associated windows through the interactive interface, and determines the associated window selected in the list of optional associated windows as the specified window.

[0072] The second agent module queries the window-related information of the target window and its associated windows based on the first identifier information of the target window. This allows it to obtain not only the window-related information of the target window but also the window-related information of the associated windows. The window-related information of the associated windows may also include the first identifier information of the associated windows. Therefore, when it is determined that the selected associated window in the list of optional associated windows is a specified window, the first identifier information of that specified window can be obtained, thereby enabling monitoring of that specified window.

[0073] This application provides users with the ability to specify windows that need to be monitored, thereby enabling the monitoring of designated windows. For example, in addition to monitoring the target window selected by the drag tool, it is also possible to monitor windows related to the target window selected through an optional list of associated windows.

[0074] In one example, the preset interaction module can display a list of information for all windows under the container where the target window is located, with a checkbox displayed in front of the information for each window, and the checked window is designated as the specified window.

[0075] In one optional embodiment of this application, the method may further include: the preset interaction module displays a list of optional message types through the interaction interface, and determines that the selected message type in the list of optional message types is a specified message type;

[0076] The step 103, which involves performing a monitoring operation on a specified window via a monitoring module, may include: monitoring window messages of a specified message type for the specified window via the monitoring module; for example, the specified message type includes focus-related messages and / or zorder-related messages.

[0077] Focus-related messages can include messages indicating that a window has gained or lost focus. zorder-related messages can include messages indicating that a window's zorder number has changed. When a message type is specified, the monitoring module only monitors window messages of that type. For example, if the specified window is window A and the specified message type is focus-related messages, the monitoring module will only save the corresponding monitoring information when it detects a focus-gaining or focus-loss message triggered by window A.

[0078] It should be noted that the above-mentioned specified message types are only illustrative examples, and the embodiments of this application do not limit the specified message types.

[0079] This application embodiment can provide users with the function of specifying the types of window messages that need to be monitored, thereby monitoring window messages of the specified message types. In one example, the preset interaction module can display a preset list of selectable message types, with a checkbox displayed in front of each message type, and the checked message type is used as the specified message type.

[0080] In one optional embodiment of this application, the monitoring module may include the first agent module; the step 103 of performing a monitoring operation on the specified window through the monitoring module may include:

[0081] Step S31: The preset interaction module sends a first monitoring instruction to the first agent module, the first monitoring instruction carrying the first identification information of the specified window;

[0082] Step S32: The first proxy module queries whether the container path carried by the first monitoring instruction corresponds to its own container path; if so, in response to the first monitoring instruction, it monitors the window messages of the specified window based on the first identification information of the specified window and writes the monitored window messages into shared memory; otherwise, it ignores the first monitoring instruction.

[0083] In this embodiment, the first proxy module (wspy module) can function as a monitoring module, capable of monitoring the window and message type specified by the first monitoring instruction. If the first monitoring instruction does not specify a message type, the wspy module can monitor window messages of the default message type for the specified window. The default message type can be preset. If the first monitoring instruction specifies a message type, the wspy module can monitor window messages of the specified message type for the specified window.

[0084] In practice, there is a one-to-one correspondence between containers, WineServer, and Wine's dynamic link libraries. That is, each container corresponds to one wspy module and one sspy module. Therefore, after receiving the first monitoring command from the lspy module, the wspy module checks whether the container path carried in the first monitoring command corresponds to its own container path. If so, in response to the first monitoring command, it monitors the window messages of the specified window based on the first identifier information of the specified window and writes the monitored window messages to shared memory; otherwise, it ignores the first monitoring command.

[0085] The first proxy module contains window message handling functions for different message types, such as WM_SIZE, WM_WINDOWPOSCHANGED, and WM_MOVE. When a window of a compatible application running in Wine responds to a user's action, Wine's dynamic library calls the relevant window message handling function. In this embodiment, a callback function is pre-registered in each window message handling function within the first proxy module to monitor window messages for a specified window. For example, a callback function is registered in the window message handling function for message type A, and another in the window message handling function for message type B, and so on. When Wine's dynamic library calls the window message handling function for message type A for a specified window, it calls the callback function within that function. Through this callback function, it can be determined that the specified window has triggered a window message of message type A, and this triggering of a window message of message type A can be written as monitoring information to shared memory.

[0086] Furthermore, window messages can be categorized into queued messages and non-queued messages based on their sending method. Queued messages are sent using the `PostMessage` function. Non-queued messages are generally sent using the `SendMessage` function. For queued messages, a callback function can be registered in the `DispatchMessage` function; for non-queued messages, a callback function can be registered in the `SendMessage` function, enabling monitoring of window messages sent using different methods.

[0087] In one optional embodiment of this application, the monitoring module may include a second agent module; the step 103 of performing a monitoring operation on the specified window through the monitoring module may include:

[0088] Step S41: The preset interaction module sends a second monitoring instruction to the second agent module, the second monitoring instruction carrying the first identification information of the specified window;

[0089] Step S42: The second agent module queries whether the container path carried by the second monitoring instruction corresponds to its own container path; if so, in response to the second monitoring instruction, it monitors the window change information of the specified window based on the first identification information of the specified window, and writes the monitored window change information into shared memory; otherwise, it ignores the second monitoring instruction.

[0090] In this embodiment, the second proxy module (sspy module) can serve as a monitoring module, used to monitor window change information of a specified window. This includes monitoring changes in the attributes of the specified window, such as changes in the window's size, screen coordinates, z-order, etc.

[0091] In practice, there is a one-to-one correspondence between containers, WineServer, and Wine's dynamic link libraries. That is, each container corresponds to one wspy module and one sspy module. Therefore, after receiving the second monitoring command from the lspy module, the sspy module checks whether the container path carried in the second monitoring command corresponds to its own container path. If so, in response to the second monitoring command, it monitors the window change information of the specified window based on the first identifier information of the specified window and writes the monitored window change information into shared memory; otherwise, it ignores the second monitoring command.

[0092] The second proxy module contains numerous window-related processing functions, such as functions for modifying window attributes. For example, when a user interacts with a specified window, causing its position to change, Wine's dynamic library sends a request to WineServer to change the window's position, such as calling the `set_window_pos` function. Therefore, in this embodiment, callback functions can be pre-registered in each window-related processing function within the second proxy module. Thus, when Wine's dynamic library calls the `set_window_pos` function to change the specified window's position, the registered function within `set_window_pos` is invoked. This registered function reveals that the specified window's attributes (such as its position) have changed, allowing the acquisition of this position change information, which is then written as monitoring information to shared memory, thereby achieving the effect of monitoring window change information.

[0093] The methods for monitoring other types of window change information are similar and will not be elaborated here.

[0094] It should be noted that during the monitoring process of the first and second agent modules, the user can continue to perform operations on the compatible application. Both the first and second agent modules can monitor window messages and window change information generated by user operations.

[0095] Furthermore, the preset interaction module's interface can also include a button for triggering a stop monitoring command. When the preset interaction module detects a stop monitoring command triggered through this interface, it can send the stop monitoring command to both the first agent module and the second agent module. Upon receiving the stop monitoring command, the first and second agent modules cease their current monitoring operations.

[0096] In one optional embodiment of this application, the step 104 of displaying the monitoring information may include: displaying the monitoring information according to a preset display method; the preset display method includes any one or more of the following: classifying and displaying the monitoring information according to message type, classifying and displaying the monitoring information according to the thread to which it belongs, and displaying the monitoring information in chronological order.

[0097] After receiving the first monitoring instruction, the first agent module monitors the window messages of the specified window based on the first identification information carried in the first monitoring instruction, and writes the monitored window messages into shared memory for the preset interaction module to read and display.

[0098] After receiving the second monitoring instruction, the second agent module monitors the window change information of the specified window based on the first identification information carried in the second monitoring instruction, and writes the obtained window change information into shared memory for the preset interaction module to read and display.

[0099] During the monitoring process by the first and second agent modules, users can interact with the windows of compatible applications running in the system. During this process, a specified window may generate window messages and / or window change information. The first agent module can write the monitored window messages generated by the specified window to shared memory, and the second agent module can write the monitored window change information generated by the specified window to shared memory for the preset interaction module to read and display. This allows for real-time display of the monitoring information of the specified window.

[0100] The monitoring information can be displayed according to a user-defined display method. Preset display methods include, but are not limited to, any one of the following: displaying by message type, displaying by thread, and displaying in chronological order.

[0101] Of course, the above-described preset display methods are merely illustrative examples, and this application embodiment does not limit the preset display methods. In specific implementations, window messages belong to a specific window, which in turn belongs to a specific thread, which in turn belongs to a specific process, and which in turn belongs to a specific compatible application. Therefore, monitoring information can be categorized and displayed according to the compatible application it belongs to, or according to the process it belongs to, or according to the thread it belongs to, or according to the message category, and so on. For example, the preset interactive module can display monitoring information graphically, such as showing which specified windows triggered which window messages during the monitoring period, which attributes of which specified windows changed, and so on.

[0102] Furthermore, the preset interaction module can also display a list of selectable attribute types through the interactive interface, allowing the user to specify the type of window attribute to be monitored. The selected attribute type is then used as the specified attribute type. For example, if the specified attribute type is window size and window style, the monitoring module will save the monitoring information when it detects a change in the size and / or style of the specified window.

[0103] It should be noted that, in specific implementations, the monitoring module may include a first proxy module, which monitors the window messages and window change information of a specified window. Alternatively, the monitoring module may include a first proxy module and a second proxy module, with the first proxy module monitoring the window messages of a specified window and the second proxy module monitoring the window change information of the specified window. Wine's dynamic library involves numerous API functions that modify window properties. Registering callback functions for each API would be cumbersome; and since these numerous APIs that modify window properties ultimately send change information to the wineserver, monitoring window change information through the sspy module is more efficient.

[0104] In one optional embodiment of this application, the preset interaction module interacts with the peer module through multicast messages in a preset protocol format; the peer module includes a first proxy module and a second proxy module; the multicast message includes a first request instruction, a second request instruction, a first monitoring instruction, and a second monitoring instruction; the preset protocol format includes a protocol value field, which is used to indicate the source and destination of the multicast message.

[0105] In this embodiment, the Wine may further include a common communication protocol processing module (also known as a comspy module), which can be used to implement communication between the preset interaction module, the first proxy module, and the second proxy module. The comspy module is responsible for implementing the inter-module communication protocol, which defines a preset protocol format based on multicast technology. This preset protocol format includes a protocol value field, which indicates the source and destination of the multicast message. Of course, the preset protocol format may also include other communication-related fields, such as the definition of the multicast address, the definition of the port number, the implementation of the data sending interface, and the implementation of the data receiving interface.

[0106] See Table 1 for an example of the different protocol values ​​defined in this application and their meanings.

[0107] Table 1

[0108]

[0109]

[0110] It is understood that the representation of the protocol values ​​and their corresponding functions shown in Table 1 above are only illustrative examples.

[0111] Furthermore, in the 32-bit protocol value, the highest four bits can represent the transmission direction of the multicast message. For example, the transmission direction represented by the highest four bits can be defined as follows: 0x1 represents lspy requesting wspy; 0x2 represents wspy requesting lspy; 0x3 represents lspy requesting sspy; and 0x4 represents sspy requesting lspy.

[0112] In one example, the structure of multicast messages between modules can be defined as follows:

[0113] typedef struct{

[0114] int magic; / / 0x9cc9, message start marker

[0115] int msglen; / / Total message length

[0116] int mver; / / Major version number

[0117] int ver; / / Subversion number

[0118] int prot; / / Protocol value

[0119] int datalen; / / Length of the data string

[0120] char data[1]; / / Specific data

[0121] }ST_PROTINFO;

[0122] Here, `prot` represents the protocol value, and `data` represents the actual data. The fields `prot`, `datalen`, and `data` may differ for different request messages, while all other fields remain the same.

[0123] For example, for the first monitoring command, the value of the `prot` field is 0x1002; the `data` field can include the `windowID` of the specified window and the specified message type to monitor window messages of the specified message type for the specified window. For instance, the content of the `data` field is as follows: `{int windowID, int msgtype1, int msgtype2,...}`. The `msgtype` field represents the specified message type, and the meaning of the `msgtype` value can be predefined, such as `msgtype1` representing focus-related messages, `msgtype2` representing zorder-related messages, etc.

[0124] For the second monitoring command, the value of the `prot` field is 0x3001; the `data` field can include the `windowID` of the specified window and the specified property type to monitor window change information of the specified property type of the specified window. For example, the content of the `data` field is as follows: `{int windowID, int propertytype1, int propertytype2,...}`. The `propertytype` field indicates the specified property type, and the meaning of the `propertytype` value can be predefined, such as `propertytype1` representing window size, `propertytype2` representing window style, etc.

[0125] For the stop monitoring command sent to the first agent module, the value of the prot field is 0x1003, and the content of the data field is as follows: {int windowID}.

[0126] For the stop monitoring command sent to the second agent module, the value of the prot field is 0x3002, and the content of the data field is as follows: {int windowID}.

[0127] In specific implementation, the pre-set interaction module, the first proxy module, and the second proxy module load the comspy module into their respective process spaces for execution.

[0128] In this embodiment, the preset interaction module (lspy module) sends a first request instruction to the first proxy module (wspy module). This can be achieved by the lspy module sending the first request instruction as a multicast message according to a preset protocol format. All process modules under Wine can receive this first request instruction. By parsing the protocol value 0x1001, the wspy module can determine that the first request instruction was sent by the lspy module to itself to request the first identification information of the target window. Therefore, the wspy module can respond to the first request instruction.

[0129] For example, the lspy module sending a first monitoring command to the wsp module can be done as follows: the lspy module sends the first monitoring command as a multicast message according to a preset protocol format. All process modules under Wine can receive this first monitoring command. The wsp module, by parsing the protocol value 0x1002, can know that the first monitoring command was sent by the lspy module to itself, requesting monitoring of window messages of a specified message type for a specified window. The wsp module determines whether it should process the first monitoring command based on whether the container path carried in the first monitoring command corresponds to its own container path; if they correspond, the wsp module can respond to the first monitoring command.

[0130] The processing of the second request command and the second monitoring command is similar, and will not be described in detail here.

[0131] Under Wine, multiple compatible applications and multiple containers may run. Therefore, communication between modules can all be carried out using the multicast method described above.

[0132] Of course, in practical implementation, communication between modules can also be achieved using a combination of multicast and unicast (or pipes). For example, when a user selects a target window, the lspy module cannot yet determine which container the target window belongs to, and therefore cannot identify the corresponding wspy and sspy modules. Therefore, the lspy module can send a first request command via multicast, carrying the xwindowID of the target window. Each wspy module corresponding to a container under Wine will receive this first request command and determine whether the target window was created by itself by identifying the xwindowID in the command; if so, it responds to the command; otherwise, it ignores it. After receiving the first identifier returned in response to the first request command, the lspy module can determine that the wspy module that returned the identifier corresponds to a container with the target window. Afterward, the lspy module can communicate with the wspy module via unicast.

[0133] In other words, the lspy module can use multicast communication when it first communicates with the wspy module, and after confirming that the wspy module is on the other end, it can use unicast communication thereafter. Similarly, the lspy module can use multicast communication when it first communicates with the sspy module, and after confirming that the sspy module is on the other end, it can use unicast communication thereafter.

[0134] In one optional embodiment of this application, the step 103 of writing the monitoring information obtained by the monitoring operation into shared memory may include: writing the monitored window messages into shared memory in a sequential structure; and writing the monitored window change information into shared memory in a tree-linked list structure.

[0135] In this embodiment of the application, in order to facilitate the storage and retrieval of the same data by different modules, the data stored in the shared memory should conform to a preset data structure.

[0136] In this embodiment, Wine may further include a common data structure processing module (also known as the datspy module), which is mainly responsible for processing data structures between modules. Specifically, the datspy module is responsible for defining and using shared memory between modules, defining specific data structures, and implementing operation interfaces. In a specific implementation, the pre-set interaction module, the first proxy module, and the second proxy module load the datspy module into their respective process spaces for execution.

[0137] The shared memory can support two data structures: tree-linked list structure and sequential structure. The tree-linked list structure primarily handles window-centric data, and it is more convenient for displaying and processing parent-child relationships between windows. Parent windows and child windows form a tree-linked list structure in the shared memory. The sequential structure primarily handles message-centric data.

[0138] In one example, a tree-linked list structure is defined as follows:

[0139] struct ST_WININFO{

[0140] int hwnd; / / Window ID

[0141] void *parent; / / Parent window node

[0142] void *first_child; / / zorder order, the first child node.

[0143] void *next_slibing; / / zorder order, the next sibling node

[0144] int zorder; / / zorder sequence number, starting from 1.

[0145] int x; / / Window x-coordinate, relative to the parent window's client area

[0146] int y; / / Window y-coordinate, relative to the parent window's client area

[0147] int width; / / Window width

[0148] int height; / / Window height

[0149] int g_x; / / Screen coordinates

[0150] int g_y; / / Screen coordinates

[0151] int visible; / / Whether it is visible

[0152] int thread_id; / / The ID of the thread to which it belongs

[0153] int change_flag; / / Stores window attribute changes using bitwise OR format, 0x1 represents size change; 0x2 represents z-order change; 0x4 represents coordinate change; 0x8 represents focus change, etc.

[0154] char text

[64] ; / / Window title string, UTF-8 encoding

[0155] };

[0156] In one example, the sequential structure is defined as follows:

[0157] struct ST_MSGINFO{

[0158] int hwnd; / / Window ID

[0159] int msg; / / Message ID

[0160] int wparam; / / Message wparam parameter

[0161] int lparam; / / Message lparam parameter

[0162] int thread_id; / / The ID of the thread to which it belongs

[0163] void *win_info; / / Pointer to the address of window information in shared memory

[0164] };

[0165] Reference Figure 2 This diagram illustrates the interaction between the modules of this application. Figure 2 As shown, the `lspy` module represents the pre-built interactive module, the `wspy` module represents the first proxy module, the `sspy` module represents the second proxy module, the `comspy` module represents the common communication protocol processing module, and the `datspy` module represents the common data structure processing module. The `lspy`, `wspy`, and `sspy` modules load the `comspy` module into their respective process spaces for execution. Similarly, the `lspy`, `wspy`, and `sspy` modules load the `datspy` module into their respective process spaces for execution.

[0166] In practice, when the lspy module detects that the user has selected the target window, it determines the xwindowID of the target window and calls the datspy module to establish shared memory.

[0167] The lspy module multicasts the first request command and receives the first identifier information of the target window returned by the wspy module on the other end.

[0168] The lspy module multicasts the second request command, and after receiving the response message from the peer's sspy module, it reads and displays the window-related information of the target window and associated windows from shared memory.

[0169] The `lspy` module multicasts the first monitoring command, whose protocol value is 0x1002. When a `wspy` module receives the first monitoring command with protocol value 0x1002, it determines whether to process the command based on the container path it carries. If it determines that it needs to process the command, the `wspy` module monitors window messages of a specified window or window messages of a specified message type. When a corresponding window message is detected, it calls the relevant interface of the `datspy` module to write the monitored window message into shared memory according to the appropriate data structure.

[0170] The lspy module multicasts a second monitoring command with a protocol value of 0x3001. When an lspy module receives this second monitoring command with a protocol value of 0x3001, it determines whether to process it based on the container path it carries. If it determines that it needs to process the second monitoring command, the lspy module monitors the specified window. When it detects changes in the specified window, it calls the relevant interface of the datspy module to write the monitored window change information into shared memory according to the corresponding data structure.

[0171] The lspy module can call the relevant interfaces of the datspy module to read monitoring information from shared memory and display it.

[0172] Optionally, after the wspy and sspy modules finish monitoring, the lspy module can call the relevant interfaces of the datspy module to classify the monitoring information stored in shared memory, such as classifying it by thread identifier or by message type, and then display it graphically.

[0173] In summary, this application provides a window monitoring method that offers a visual interface to users, allowing them to specify windows of compatible applications that need monitoring. This application can also display monitoring information to users through this visual interface. For example, it can display window messages of the monitored specified window, and / or display window change information of the monitored specified window. Therefore, during user operation of the compatible application, the changes in the specified window can be displayed to the user in real time, enabling the user to more intuitively and efficiently analyze the state of the specified window and any problems that arise.

[0174] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.

[0175] Reference Figure 3 The diagram shows a structural block diagram of an embodiment of a window monitoring device according to this application. The device can be applied to an electronic device configured with a Linux operating system. The Linux operating system is configured with a compatibility layer, which enables the Linux operating system to run compatible applications based on the Windows operating system. The device includes a preset interaction module 301 and a first agent module 302. The preset interaction module 301 displays an interactive interface.

[0176] The preset interaction module 301 is used to request the first proxy module 302 to obtain the first identification information of the target window under the compatibility layer when it detects that the target window has been selected through the interaction interface; the first identification information includes the first window identifier, the first process identifier, and the container path of the target window; the target window is the window of the compatible application;

[0177] The preset interaction module 301 is further configured to, when a start monitoring command triggered through the interaction interface is detected, perform a monitoring operation on a specified window through the monitoring module. The monitoring operation includes monitoring the window messages and / or window change information of the specified window, and writing the monitoring information obtained by the monitoring operation into shared memory; the specified window includes the target window.

[0178] The preset interaction module 301 is also used to read the monitoring information from the shared memory and display the monitoring information.

[0179] Optionally, the preset interaction module is specifically used to obtain the second identification information of the target window in the graphical interface when it detects that the target window has been selected through the interaction interface, and send a first request instruction to the first agent module. The first request instruction carries the second identification information of the target window. The second identification information includes the second window identifier, screen coordinates and second process identifier of the target window.

[0180] The first proxy module is specifically configured to respond to the first request instruction by querying whether the target window is a window created by itself based on the second window identifier of the target window; if so, querying the first window identifier of the target window based on the second window identifier and screen coordinates; querying the first process identifier and container path of the target window based on the first window identifier of the target window, and returning the first window identifier, first process identifier and container path of the target window to the preset interaction module; otherwise, ignoring the first request instruction.

[0181] Reference Figure 4 The diagram shows a structural block diagram of another embodiment of the window monitoring device of this application, wherein the window monitoring device further includes a second agent module 303;

[0182] The preset interaction module is also used to send a second request instruction to the second agent module, the second request instruction carrying the first identification information of the target window;

[0183] The second proxy module is configured to respond to the second request instruction by querying window-related information of the target window and its associated windows based on the first identification information of the target window, and writing the queried window-related information into the shared memory; the window-related information includes window state and window attributes; the associated windows include child windows of the target window;

[0184] The preset interaction module is also used to read the window-related information from the shared memory and display the window-related information.

[0185] Optionally, the window-related information may also include the first identification information of the associated window;

[0186] The preset interaction module is also used to display a list of optional associated windows through the interactive interface, and to determine the selected associated window in the list of optional associated windows as the specified window.

[0187] Optionally, the preset interaction module is further configured to display a list of optional message types through the interactive interface, and determine that the selected message type in the list of optional message types is the specified message type;

[0188] The preset interaction module is specifically used to monitor window messages of the specified message type of the specified window through the monitoring module.

[0189] Optionally, the monitoring module includes the first agent module;

[0190] The preset interaction module is specifically used to send a first monitoring instruction to the first agent module, wherein the first monitoring instruction carries the first identification information of the specified window;

[0191] The first proxy module is specifically used to query whether the container path carried by the first monitoring instruction corresponds to its own container path; if so, in response to the first monitoring instruction, it monitors the window messages of the specified window based on the first identification information of the specified window and writes the monitored window messages into shared memory; otherwise, it ignores the first monitoring instruction.

[0192] Optionally, the monitoring module includes a second agent module;

[0193] The preset interaction module is specifically used to send a second monitoring instruction to the second agent module, wherein the second monitoring instruction carries the first identification information of the specified window;

[0194] The second proxy module is specifically used to query whether the container path carried by the second monitoring instruction corresponds to its own container path; if so, in response to the second monitoring instruction, it monitors the window change information of the specified window based on the first identification information of the specified window, and writes the monitored window change information into shared memory; otherwise, it ignores the second monitoring instruction.

[0195] Optionally, the preset interaction module is specifically used to display the monitoring information according to a preset display method; the preset display method includes any one or more of the following: classifying and displaying the monitoring information according to message type, classifying and displaying the monitoring information according to the thread to which it belongs, and displaying the monitoring information in chronological order.

[0196] Optionally, the preset interaction module interacts with the peer module through multicast messages in a preset protocol format; the peer module includes a first proxy module and a second proxy module; the multicast message includes a first request instruction, a second request instruction, a first monitoring instruction, and a second monitoring instruction; the preset protocol format includes a protocol value field, which is used to indicate the source and destination of the multicast message.

[0197] Optionally, the monitoring module is specifically used to write the monitored window messages into shared memory in a sequential structure; and to write the monitored window change information into shared memory in a tree-linked list structure.

[0198] This application provides a visual window monitoring device that offers a user-friendly interface. Users can specify windows of compatible applications to be monitored through this interface. The device can also display monitoring information to the user through this interface. For example, it can display window messages of the monitored specified window, and / or display window change information of the monitored specified window. Therefore, during user operation of the compatible application, the changes in the specified window can be displayed to the user in real time, allowing for a more intuitive and efficient analysis of the window's status and any problems that may arise.

[0199] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0200] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0201] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0202] This application provides an apparatus for window monitoring, including a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors, and the one or more programs include methods for performing the window monitoring methods described in one or more of the above embodiments.

[0203] Figure 5 This is a block diagram illustrating a device 800 for window monitoring according to an exemplary embodiment. For example, device 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0204] Reference Figure 5 The device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0205] Processing component 802 typically controls the overall operation of device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0206] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of this data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0207] Power supply component 806 provides power to various components of device 800. Power supply component 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 800.

[0208] Multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0209] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when device 800 is in an operating mode, such as call mode, recording mode, and voice information processing mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0210] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0211] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of device 800. For example, sensor assembly 814 can detect the on / off state of device 800, the relative positioning of components such as the display and keypad of device 800, and can also detect changes in the position of device 800 or a component of device 800, the presence or absence of user contact with device 800, the orientation or acceleration / deceleration of device 800, and temperature changes of device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0212] Communication component 816 is configured to facilitate wired or wireless communication between device 800 and other devices. Device 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency information processing (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0213] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0214] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0215] Figure 6 This is a schematic diagram of the server structure in some embodiments of this application. The server 1900 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 1922 (e.g., one or more processors) and memory 1932, and one or more storage media 1930 (e.g., one or more mass storage devices) for storing application programs 1942 or data 1944. The memory 1932 and storage media 1930 can be temporary or persistent storage. The program stored in the storage media 1930 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the CPU 1922 may be configured to communicate with the storage media 1930 and execute the series of instruction operations in the storage media 1930 on the server 1900.

[0216] Server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input / output interfaces 1958, one or more keyboards 1956, and / or one or more operating systems 1941, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0217] A non-transitory computer-readable storage medium that, when instructions in the storage medium are executed by a processor of a device (server or terminal), enables the device to perform... Figure 1The window monitoring method shown is described above. It will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer program products or computer program embodiments involved in this application, please refer to the description of the method embodiments of this application.

[0218] Furthermore, it should be noted that this application also provides a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions, causing the computer device to perform the aforementioned actions. Figure 1 The description of the window monitoring method in the corresponding embodiments is already provided and will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For any technical details not disclosed in the computer program products or computer program embodiments related to this application, please refer to the description of the method embodiments of this application.

[0219] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the application disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0220] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

[0221] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

[0222] The above provides a detailed description of a window monitoring method, a window monitoring device, and a readable storage medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and its core ideas. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A window monitoring method, characterized in that, The method, applicable to electronic devices configured with a Linux operating system, wherein the Linux operating system has a compatibility layer that enables the Linux operating system to run Windows-based compatible applications, comprises: Run the preset interaction module, which displays an interactive interface; When the preset interaction module detects that a target window has been selected through the interaction interface, it requests the first proxy module to obtain the first identification information of the target window under the compatibility layer; the first identification information includes the first window identifier, the first process identifier, and the container path of the target window; the target window is the window of the compatible application; When the preset interaction module detects a start monitoring command triggered through the interaction interface, it performs a monitoring operation on a specified window through the monitoring module. The monitoring operation includes monitoring the window messages and / or window change information of the specified window, and writing the monitoring information obtained by the monitoring operation into shared memory; the specified window includes the target window. The preset interaction module reads the monitoring information from the shared memory and displays the monitoring information.

2. The method according to claim 1, characterized in that, When the preset interaction module detects that a target window has been selected through the interaction interface, it requests the first proxy module to obtain the first identification information of the target window under the compatibility layer, including: When the preset interaction module detects that a target window has been selected through the interaction interface, it obtains the second identification information of the target window in the graphical interface and sends a first request instruction to the first agent module. The first request instruction carries the second identification information of the target window. The second identification information includes the second window identifier, screen coordinates and second process identifier of the target window. In response to the first request instruction, the first proxy module queries whether the target window is a window created by itself based on the second window identifier of the target window; if so, it queries the first window identifier of the target window based on the second window identifier and screen coordinates; otherwise, it ignores the first request instruction. The first proxy module queries the first process identifier and container path of the target window based on the first window identifier of the target window, and returns the first window identifier, first process identifier and container path of the target window to the preset interaction module.

3. The method according to claim 1, characterized in that, The method further includes: The preset interaction module sends a second request instruction to the second agent module, the second request instruction carrying the first identification information of the target window; In response to the second request instruction, the second proxy module queries the window-related information of the target window and its associated windows based on the first identification information of the target window, and writes the queried window-related information into the shared memory; the window-related information includes window state and window attributes; the associated windows include child windows of the target window; The preset interaction module reads the window-related information from the shared memory and displays the window-related information.

4. The method according to claim 3, characterized in that, The window-related information also includes the first identification information of the associated window. Before the preset interaction module detects the start monitoring command triggered through the interactive interface, the method further includes: The preset interaction module displays a list of optional associated windows through the interactive interface, and determines the selected associated window in the list of optional associated windows as the specified window.

5. The method according to claim 1, characterized in that, The method further includes: The preset interaction module displays a list of selectable message types through the interactive interface and determines that the selected message type in the list of selectable message types is the specified message type; The step of performing monitoring operations on a specified window through the monitoring module includes: The monitoring module monitors the window messages of the specified message type for the specified window.

6. The method according to claim 1, characterized in that, The monitoring module includes the first agent module; the step of performing monitoring operations on a specified window through the monitoring module includes: The preset interaction module sends a first monitoring instruction to the first agent module, and the first monitoring instruction carries the first identification information of the specified window; The first proxy module queries whether the container path carried by the first monitoring instruction corresponds to its own container path; if so, it responds to the first monitoring instruction, monitors the window messages of the specified window based on the first identification information of the specified window, and writes the monitored window messages into shared memory; otherwise, it ignores the first monitoring instruction.

7. The method according to claim 1, characterized in that, The monitoring module includes a second agent module; the step of performing monitoring operations on a specified window through the monitoring module includes: The preset interaction module sends a second monitoring instruction to the second agent module, and the second monitoring instruction carries the first identification information of the specified window; The second agent module queries whether the container path carried by the second monitoring instruction corresponds to its own container path; if so, it responds to the second monitoring instruction, monitors the window change information of the specified window based on the first identification information of the specified window, and writes the monitored window change information into shared memory; otherwise, it ignores the second monitoring instruction.

8. The method according to claim 1, characterized in that, The display of the monitoring information includes: The monitoring information is displayed according to a preset display method; the preset display method includes any one or more of the following: classifying and displaying the monitoring information according to message type, classifying and displaying the monitoring information according to the thread to which it belongs, and displaying the monitoring information in chronological order.

9. The method according to claim 1, characterized in that, The preset interaction module interacts with the peer module through multicast messages in a preset protocol format; the peer module includes a first proxy module and a second proxy module; the multicast message includes a first request instruction, a second request instruction, a first monitoring instruction, and a second monitoring instruction; the preset protocol format includes a protocol value field, which is used to indicate the source and destination of the multicast message.

10. The method according to claim 1, characterized in that, The step of writing the monitoring information obtained by the monitoring operation into shared memory includes: The monitored window messages are written to shared memory in a sequential structure; the monitored window change information is written to shared memory in a tree-linked list structure.

11. A window monitoring device, characterized in that, An electronic device configured with a Linux operating system, wherein the Linux operating system is configured with a compatibility layer that enables the Linux operating system to run Windows-based compatible applications, the device includes a pre-configured interaction module and a first agent module; the pre-configured interaction module displays an interactive interface; The pre-set interaction module is used to request the first proxy module to obtain the first identification information of the target window under the compatibility layer when it detects that the target window has been selected through the interaction interface; the first identification information includes the first window identifier, the first process identifier, and the container path of the target window; the target window is the window of the compatible application; The preset interaction module is further configured to, upon detecting a start monitoring command triggered through the interaction interface, perform a monitoring operation on a specified window through the monitoring module. The monitoring operation includes monitoring window messages and / or window change information of the specified window, and writing the monitoring information obtained by the monitoring operation into shared memory; the specified window includes the target window. The pre-set interaction module is also used to read the monitoring information from the shared memory and display the monitoring information.

12. A device for window monitoring, characterized in that, It includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors, wherein the one or more programs contain instructions for performing the window monitoring method as described in any one of claims 1 to 10.

13. A readable storage medium having instructions stored thereon that, when executed by one or more processors of a device, cause the device to perform the window monitoring method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • WINE (wine is not an emulator) compatibility automatic checking method on OMS (open mobile system) platform

    CN102331968A

  • Interface window management method and related device

    CN113821142A