Debugging method, debugging system and computing device for application running based on compatibility layer

By collecting and comparing interface call information of Windows applications on Linux systems and using troubleshooting algorithms to identify anomalies in the compatibility layer, the problem of Windows applications failing to run properly on Linux systems was solved, improving migration efficiency and accuracy.

CN115309554BActive Publication Date: 2026-07-10UNIONTECH SOFTWARE TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UNIONTECH SOFTWARE TECH CO LTD
Filing Date
2022-06-29
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

The lack of application software for the Linux desktop operating system has made it impossible for industry applications to be used after Windows systems are migrated to Linux, hindering the development of Linux systems. In particular, Chinese versions of Windows applications require manual adaptation when running on the compatibility layer, which is inefficient.

Method used

By collecting interface call information of the first application on different operating systems on the first client and the second client respectively, and comparing the differences using a troubleshooting algorithm, abnormal problems in the compatibility layer are identified. The hook module is used to collect interface call information and convert it into a unified data format for comparison. The troubleshooting algorithm is used to improve the comparison efficiency and accuracy.

Benefits of technology

It enables efficient and accurate location of anomalies in Windows applications within the compatibility layer, improves the migration efficiency of Windows applications on Linux systems, and simplifies the troubleshooting process for developers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115309554B_ABST
    Figure CN115309554B_ABST
Patent Text Reader

Abstract

The application discloses an error-eliminating method, an error-eliminating system and a computing device based on a compatible layer operation, and relates to the technical field of computers and operating systems. The method is executed in a server, and the server is in communication connection with a first client and a second client. The method comprises the following steps: obtaining first interface calling information of a first application running on a first operating system from the first client, and obtaining second interface calling information of the first application running in a compatible layer from the second client; comparing the first interface calling information with the second interface calling information by using an error-eliminating algorithm to determine difference information of the first interface calling information and the second interface calling information, so as to determine abnormal information of the first application running in the compatible layer based on the difference information. According to the technical scheme of the application, the abnormal problems of the application running in the compatible layer can be efficiently and accurately located.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of invention patent application 2022107457972, filed on June 29, 2022. Technical Field

[0002] This invention relates to the field of computer and operating system technology, and in particular to a troubleshooting method, troubleshooting system and computing device for applications running on a compatibility layer. Background Technology

[0003] Currently, the Linux desktop operating system has low usage and a lack of application software. Few independent software vendors develop native Linux applications for it. This has led to a large number of industry applications becoming unusable after governments or enterprises migrate from Windows to Linux, seriously affecting the development process of Linux replacing Windows and further hindering the development of the Linux desktop operating system.

[0004] Linux system vendors typically utilize Wine, a compatibility layer for Windows systems (which enables Windows applications to run on various POSIX-compliant operating systems, including Linux, Mac OS X, and BSD), to migrate Windows applications to Linux systems. Currently, the latest version of Wine can stably run thousands of Windows applications.

[0005] Because Wine originated in a Western community, with the vast majority of its developers being Westerners, it enjoys better compatibility with Windows applications developed in Western countries. However, most Chinese-language Windows applications developed in my country require developers to adapt the compatibility layer; that is, to troubleshoot and locate errors in applications running on the compatibility layer. Only after handling these errors can the Windows application run perfectly within the compatibility layer. Therefore, improving the efficiency of developers in locating errors is crucial to accelerating the migration from Windows to Linux.

[0006] Therefore, a troubleshooting method for applications running on a compatibility layer is needed to solve the problems existing in the above solutions. Summary of the Invention

[0007] Therefore, the present invention provides a troubleshooting method and system for applications running on a compatibility layer, in order to solve or at least alleviate the problems mentioned above.

[0008] According to one aspect of the present invention, a troubleshooting method for an application running on a compatibility layer is provided, executed in a server, the server being communicatively connected to a first client and a second client respectively; the first client running a first operating system, on which a first application runs; the second client running a second operating system, on which a compatibility layer of the first operating system is arranged, and in which the first application runs; the method includes the steps of: obtaining first interface call information of the first application running on the first operating system from the first client, and obtaining second interface call information of the first application running in the compatibility layer from the second client; using a troubleshooting algorithm, comparing the first interface call information and the second interface call information to determine the difference information between the first interface call information and the second interface call information, so as to determine the abnormal information of the first application running in the compatibility layer based on the difference information.

[0009] Optionally, in the troubleshooting method for an application running on a compatibility layer according to the present invention, the first client is adapted to: run the first application on the first operating system through a hook module, collect first interface call information of the first application running on the first operating system, and send the first interface call information to the server; the second client is adapted to: run the first application in the compatibility layer through a hook module, collect second interface call information of the first application running in the compatibility layer, and send the second interface call information to the server.

[0010] Optionally, in the troubleshooting method for an application running based on a compatibility layer according to the present invention, the step of comparing the first interface call information with the second interface call information using a troubleshooting algorithm includes: displaying the first interface call information and the second interface call information on a graphical user interface; obtaining a first target data selected from the first interface call information and a second target data selected from the second interface call information; and comparing the first target data with the second target data using a troubleshooting algorithm to determine the difference information between the first target data and the second target data.

[0011] Optionally, in the troubleshooting method for an application running based on a compatibility layer according to the present invention, the interface call information includes the number of interface calls, the interface return value, and the interface parameter value, and the number of interface calls, the interface return value, and the interface parameter value have different troubleshooting priorities; determining the difference information between the first interface call information and the second interface call information includes: determining the difference information between the first interface call information and the second interface call information based on the order of the troubleshooting priorities of the interface call information.

[0012] Optionally, in the troubleshooting method for an application running based on a compatibility layer according to the present invention, the step of comparing the first interface call information with the second interface call information using a troubleshooting algorithm includes: converting the first interface call information into corresponding first call stack data and storing it in a first associated container; converting the second interface call information into corresponding second call stack data structure and storing it in a second associated container; establishing an association between the first call stack data in the first associated container and the second call stack data in the second associated container based on the process identifier and thread identifier; traversing the first associated container and the second associated container, obtaining a first thread function call list and a second thread function call list with consistent process identifier and thread identifier from the first associated container and the second associated container; comparing the first thread function call list and the second thread function call list, and determining whether the number of interface calls, interface return values, and interface parameter values ​​in the first thread function call list and the second thread function call list are consistent, so as to determine the difference information.

[0013] Optionally, in the troubleshooting method for an application running based on a compatibility layer according to the present invention, establishing an association between the first call stack data in the first associated container and the second call stack data in the second associated container based on the process identifier and the thread identifier includes: traversing the first associated container and the second associated container; if the parameters of the process creation interface are consistent, then establishing a process association based on the same process identifier; if the parameters of the thread creation interface are consistent, then establishing a thread association based on the same thread identifier.

[0014] Optionally, in the troubleshooting method for an application running on a compatibility layer according to the present invention, the method further includes the steps of: storing the difference information in a list; and outputting the difference information for display.

[0015] Optionally, in the troubleshooting method for applications running based on a compatibility layer according to the present invention, the first operating system is a Windows operating system and the second operating system is a Linux operating system.

[0016] According to one aspect of the present invention, a troubleshooting system is provided, comprising: a first client running a first operating system, wherein a first application runs on the first operating system; a second client running a second operating system, wherein a compatibility layer of the first operating system is disposed on the second operating system, and the first application runs in the compatibility layer; and a server communicatively connected to the first client and the second client respectively, and adapted to execute the troubleshooting method described above for the application running on the compatibility layer.

[0017] According to one aspect of the present invention, a computing device is provided, comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing a troubleshooting method for an application running on a compatibility layer as described above.

[0018] According to one aspect of the present invention, a readable storage medium storing program instructions is provided, which, when read and executed by a computing device, causes the computing device to perform the troubleshooting method for an application running on a compatibility layer as described above.

[0019] According to the technical solution of the present invention, a troubleshooting method for applications running on a compatibility layer is provided. The method involves running a first application on a first operating system of a first client using a hook module, collecting first interface call information of the first application running on the first operating system; and running the first application in a compatibility layer of a second client using the same hook module, collecting second interface call information of the first application running in the compatibility layer. By converting the first / second interface call information into a unified data format for comparison using a troubleshooting algorithm, the comparison efficiency and accuracy can be improved. Furthermore, based on the differences found in the comparison, abnormal information of the first application running in the compatibility layer can be determined, thereby enabling efficient and accurate localization of abnormal problems in the first application running on the compatibility layer.

[0020] Furthermore, according to the debugging algorithm of the present invention, when comparing the first interface call information with the second interface call information, the interface call information is converted into corresponding call stack data and stored in a Map container in memory. Subsequent debugging comparison data is directly read from the thread function call list in the Map container in memory, and the difference information is recorded as the index in the thread function call list. In this way, there is no data copying or data movement during the execution of the debugging algorithm, thereby ensuring that the debugging algorithm can run efficiently and stably.

[0021] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0022] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.

[0023] Figure 1 A schematic diagram of a troubleshooting system 100 according to an embodiment of the present invention is shown;

[0024] Figure 2 A schematic diagram of a computing device 200 according to an embodiment of the present invention is shown;

[0025] Figure 3 A flowchart of a troubleshooting method 300 for an application running on a compatibility layer according to an embodiment of the present invention is shown;

[0026] Figure 4 A schematic diagram illustrating the mapping relationship between processes and associated containers (Maps) according to an embodiment of the present invention is shown;

[0027] Figure 5 A schematic diagram of a troubleshooting result list according to an embodiment of the present invention is shown. Detailed Implementation

[0028] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0029] Figure 1 A schematic diagram of a troubleshooting system 100 according to an embodiment of the present invention is shown.

[0030] like Figure 1 As shown, the troubleshooting system 100 includes a server 150, a first client 110, and a second client 120. The first client 110 and the second client 120 are respectively connected to the server 150 via a network, for example, through wired or wireless means.

[0031] Server 150 can provide troubleshooting services. Specifically, server 150 can be a computing device such as a desktop computer, laptop computer, processor chip, mobile phone, or tablet computer, but is not limited to these; it can also be an application residing on the computing device.

[0032] The first client 110 and the second client 120 are terminal devices used by the user. Specifically, the first client 110 and the second client 120 can be personal computers such as desktop computers and laptops, or mobile phones, tablets, multimedia devices, smart wearable devices, etc., but are not limited to these.

[0033] According to one embodiment of the present invention, a first operating system runs on the first client 110, and a first application runs on the first operating system. It should be noted that the first application is an application built upon the first operating system and suitable for running on the first operating system. The present invention does not limit the specific type of the first application.

[0034] The second client 120 runs a second operating system, on which a compatibility layer of the first operating system is deployed, and the first application runs in the compatibility layer. Here, the compatibility layer can be implemented as Wine, for example.

[0035] It should be noted that the compatibility layer can adapt to applications built on the first operating system; in other words, applications based on the first operating system can run within the compatibility layer. By deploying the compatibility layer on the second operating system of the second client 120, applications of the first operating system (such as the first application) can run within the compatibility layer on the second operating system.

[0036] In one embodiment, the first operating system can be a Windows operating system. The second operating system can be a Linux operating system.

[0037] According to an embodiment of the present invention, a first application is run on a first operating system of a first client 110, and the first application is run in a compatibility layer on a second operating system of a second client 120. A server 150 obtains first interface call information from the first client 110 when the first application is running on the first operating system, and obtains second interface call information from the second client 120 when the first application is running in the compatibility layer. Subsequently, the server 150 can use an error-detection algorithm to compare the first interface call information and the second interface call information to obtain the difference information between them. In this way, based on the difference information, abnormal information of the first application running in the compatibility layer can be determined, thereby enabling the location of abnormal information in the first application running on the compatibility layer.

[0038] In an embodiment of the present invention, server 150 is adapted to execute the troubleshooting method 300 for applications running on a compatibility layer according to the present invention. The troubleshooting method 300 for applications running on a compatibility layer according to the present invention will be described in detail below.

[0039] In one embodiment, server 150 includes a troubleshooting device 250, which executes the troubleshooting method 300 of the present invention for applications running on a compatibility layer.

[0040] In one embodiment of the present invention, server 150 may be implemented as a computing device as shown below.

[0041] Figure 2 A schematic diagram of a computing device 200 according to an embodiment of the present invention is shown. Figure 2 As shown, in a basic configuration, computing device 200 includes at least one processing unit 202 and system memory 204. According to one aspect, depending on the configuration and type of the computing device, the processing unit 202 may be implemented as a processor. System memory 204 includes, but is not limited to, volatile memory (e.g., random access memory), non-volatile memory (e.g., read-only memory), flash memory, or any combination of such memories. According to one aspect, system memory 204 includes an operating system 205.

[0042] According to one aspect, operating system 105 is, for example, suitable for controlling the operation of computing device 200. Furthermore, the example is practiced in conjunction with graphics libraries, other operating systems, or any other applications, and is not limited to any particular application or system. Figure 2 The basic configuration is illustrated by the components within the dashed lines. According to one aspect, the computing device 200 has additional features or functions. For example, according to one aspect, the computing device 200 includes additional data storage devices (removable and / or non-removable), such as disks, optical discs, or magnetic tapes. This additional storage... Figure 2 The middle part is shown by removable storage device 209 and non-removable storage device 210.

[0043] As stated above, according to one aspect, a program module is stored in system memory 204. According to one aspect, the program module may include one or more applications. The invention does not limit the type of application; for example, applications may include: email and contact applications, word processing applications, spreadsheet applications, database applications, slideshow applications, drawing or computer-aided applications, web browser applications, etc. In an embodiment of the invention, the application in the program module may include a troubleshooting processing device 250, configured to execute the troubleshooting method 300 for applications running on a compatibility layer according to the invention.

[0044] According to one aspect, examples can be practiced on circuits including discrete electronic components, packaged or integrated electronic chips containing logic gates, circuits utilizing microprocessors, or on a single chip containing electronic components or a microprocessor. For example, it can be practiced via wherein... Figure 2 Each or many of the components shown can be implemented as an example by integrating a System-on-a-Chip (SOC) on a single integrated circuit. According to one aspect, such an SOC device may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all integrated (or “burned in”) as a single integrated circuit onto a chip substrate. When operating via the SOC, the functions described herein can be operated via dedicated logic integrated on a single integrated circuit (chip) with other components of the computing device 200. Embodiments of the invention can also be implemented using other techniques capable of performing logical operations (e.g., AND, OR, and NOT), including but not limited to mechanical, optical, fluid, and quantum technologies. Additionally, embodiments of the invention can be implemented within a general-purpose computer or in any other circuit or system.

[0045] According to one aspect, computing device 200 may also have one or more input devices 212, such as a keyboard, mouse, pen, voice input device, touch input device, etc. It may also include output devices 214, such as a display, speaker, printer, etc. The foregoing devices are examples and other devices may also be used. Computing device 200 may include one or more communication connections 216 that allow communication with other computing devices 218. Examples of suitable communication connections 216 include, but are not limited to: RF transmitter, receiver and / or transceiver circuitry; Universal Serial Bus (USB), parallel and / or serial ports.

[0046] As used herein, the term computer-readable medium includes computer storage medium. Computer storage medium can include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information (e.g., computer-readable instructions, data structures, or program modules). System memory 204, removable storage device 209, and non-removable storage device 210 are examples of computer storage media (i.e., memory storage). Computer storage media can include random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic tape, disk storage or other magnetic storage devices, or any other article of manufacture that can be used to store information and is accessible by computing device 200. According to one aspect, any such computer storage medium can be part of computing device 200. Computer storage media does not include carrier waves or other transmitted data signals.

[0047] According to one aspect, a communication medium is implemented by computer-readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., a carrier wave or other transmission mechanism), and includes any information transmission medium. According to one aspect, the term "modulated data signal" describes a signal having one or more sets of characteristics or altered in a manner that encodes information in the signal. By way of example and not limitation, a communication medium includes wired media such as wired networks or direct wired connections, and wireless media such as acoustic, radio frequency (RF), infrared, and other wireless media.

[0048] In an embodiment of the invention, computing device 200 is configured to execute a troubleshooting method 300 for an application running on a compatibility layer according to the invention. Computing device 200 includes one or more processors and one or more readable storage media storing program instructions that, when configured to be executed by the one or more processors, cause the computing device to execute the troubleshooting method 300 for an application running on a compatibility layer according to the embodiment of the invention.

[0049] According to one embodiment of the present invention, a debugging processing device 250 in a computing device 200 is configured to execute a debugging method 300 for an application running on a compatibility layer according to the present invention. The debugging processing device 250 includes a plurality of program instructions for executing the debugging method 300 for an application running on a compatibility layer according to the present invention, which can instruct a processor to execute the debugging method 300 for an application running on a compatibility layer according to the present invention.

[0050] Figure 3A flowchart of a troubleshooting method 300 for an application running on a compatibility layer according to an embodiment of the present invention is shown. Method 300 is adapted to be executed in a server 150 (e.g., the aforementioned computing device 200), specifically in a troubleshooting processing apparatus 250 of the server 150.

[0051] As described above, server 150 is communicatively connected to first client 110 and second client 120. First client 110 runs a first operating system and a first application runs on that first operating system. Second client 120 runs a second operating system, on which a compatibility layer (Wine) for the first operating system is deployed, and the first application runs within the compatibility layer. It should be noted that the first application is an application built upon and suitable for running on the first operating system. This invention does not limit the specific type of the first application.

[0052] According to an embodiment of the present invention, a first application is run on a first operating system of a first client 110, and the first application is run in a compatibility layer on a second operating system of a second client 120. Furthermore, the server 150 can execute the troubleshooting method 300 of the present invention for applications running in the compatibility layer.

[0053] like Figure 3 As shown, method 300 begins with step S310.

[0054] In step S310, the first interface call information of the first application running on the first operating system is obtained from the first client 110, and the second interface call information of the first application running in the compatibility layer is obtained from the second client 120.

[0055] Subsequently, in step S320, an error-detection algorithm is used to compare the first interface call information with the second interface call information to obtain the difference information between the two. This allows for the determination of any anomalies in the first application running within the compatibility layer based on these differences, thereby enabling the localization of anomalies in the first application running within the compatibility layer.

[0056] It should be noted that the compatibility layer can adapt to applications built on the first operating system; in other words, applications based on the first operating system can run within the compatibility layer. By deploying the compatibility layer on the second operating system of the second client 120, applications of the first operating system (such as the first application) can run within the compatibility layer on the second operating system.

[0057] In one embodiment, the first operating system may be a Windows operating system. The second operating system may be a Linux operating system. However, it should be noted that the present invention is not limited to the specific types of the first and second operating systems.

[0058] According to one embodiment of the present invention, both the first client 110 and the second client 120 can run the first application and collect the interface call information during the runtime of the first application through the hook module.

[0059] Specifically, the first client 110 can run the first application on its first operating system via a hook module, and collect the first interface call information of the first application running on the first operating system. Then, the first interface call information is sent to the server 150.

[0060] The second client 120 can run the first application in its compatibility layer via a hook module, and collect the second interface call information of the first application running in the compatibility layer. Then, the second interface call information is sent to the server 150.

[0061] In one embodiment, after obtaining the first interface call information and the second interface call information, the server 150 can store the first interface call information and the second interface call information in the server 150's cache (Redis).

[0062] It should be noted that the hook module is the same as the Hook module. A hook is a hook function. Before the program calls a function, the hook function gains control. At this time, the hook function can process (change) the execution behavior of the function, or it can forcibly terminate the function without calling the actual function.

[0063] In one implementation, before running the first application on the first operating system of the first client 110 and in the compatibility layer on the second operating system of the second client 120, the Hook module can be implemented as follows: A Hook module is created, and an interface database is pre-loaded. The interface database stores all interface prototypes and interface information of the first operating system, including parameter types, parameter values, number of parameters, and return values. Subsequently, the Import Address Table (IAT) can be loaded from the PE (Portable Executable) file of the first application, and each interface address in the IAT is replaced with an intercepted function address. The calling process and calling thread information are also recorded.

[0064] In this way, the first application can be run on the first operating system of the first client 110 and in the compatibility layer of the second client 120 through the Hook module, and the interface call information of the first application during runtime can be collected.

[0065] According to one embodiment of the present invention, the first interface call information and the second interface call information are compared using an error-detection algorithm, which can be specifically performed in the following manner.

[0066] First, the first and second interface call information are displayed on a graphical user interface. This graphical user interface is displayed on a display device connected to the server 150 to output and display the interface call information. In this way, the user can view the first and second interface call information from the graphical user interface and select the target data for comparison from the first and second interface call information.

[0067] Subsequently, server 150 can obtain the first target data selected by the user from the first interface call information displayed in the graphical user interface, and the second target data selected from the second interface call information. Then, server 150 uses a troubleshooting algorithm to compare the first target data and the second target data to determine the differences between them.

[0068] According to one embodiment of the present invention, the interface call information may include the number of interface calls, the interface return value, and the interface parameter values. The number of interface calls, the interface return value, and the interface parameter values ​​have different debugging priorities.

[0069] When determining the differences between the first interface call information and the second interface call information, the server 150 can determine the differences between the first interface call information and the second interface call information in order of the error-checking priority of the interface call information.

[0070] In one embodiment, the troubleshooting priority of interface call information is as follows: number of interface calls, interface return value, and interface parameter value.

[0071] According to one embodiment of the present invention, the first interface call information and the second interface call information can be compared by following the steps below.

[0072] First, the first interface call information and the second interface call information are serialized into stack data structures. Specifically, the first interface call information is converted into corresponding first call stack data and stored in a first associated container. The second interface call information is converted into corresponding second call stack data structures and stored in a second associated container.

[0073] Here, the first and second associative containers are in-memory data storage containers, such as Map containers. A Map is a collection that stores elements consisting of keys and values ​​in a specific order. For example, the first associative container could be Map1, and the second associative container could be Map2.

[0074] It should be noted that Map corresponds to the process (of the first application), and the process can contain multiple threads, each of which can correspond to a list of thread function calls. Figure 4 A schematic diagram illustrating the mapping relationship between processes and associated containers (Maps) according to an embodiment of the present invention is shown. Figure 4 As shown, a process can contain a first thread, a second thread, and a third thread, corresponding to the function call lists of the first thread, the second thread, and the third thread, respectively. In the associative container Map of this invention, the association between each thread within a process and its corresponding thread function call list can be established based on the process identifier and thread identifier (as key values), thus storing each thread within a process and its corresponding thread function call list in the associative container Map. That is, the process identifier and thread identifier are used as key values, and the thread function call list corresponding to the thread is used as the mapping value associated with the key value.

[0075] In this way, the first interface call information when the first application runs on the first operating system of the first client 110 can be converted into first call stack data, and the association between each thread and the corresponding thread function call list can be established based on the first association container; the second interface call information when the first application runs in the compatibility layer of the second client 120 can be converted into first call stack data, and the association between each thread and the corresponding thread function call list can be established based on the first association container.

[0076] Next, based on the process identifier and thread identifier, the first call stack data in the first associated container is associated with the second call stack data in the second associated container. That is, the first call stack data corresponding to the first interface call information is associated with the second call stack data corresponding to the second interface call information.

[0077] Specifically, by traversing the first and second associated containers, the interface for creating processes is located, and the parameters of the interface are compared. If the parameters match, the corresponding processes in the first and second associated containers are associated based on their process identifiers. Specifically, the process identifiers in the first and second associated containers can be modified to the same process identifier. Furthermore, the interface for creating each thread is located in the first and second associated containers, and the parameters of the interface are compared. If the parameters match, the corresponding threads in the first and second associated containers are associated based on their thread identifiers. Specifically, the thread identifiers in the first and second associated containers can be modified to the same thread identifier. In other words, by traversing the first and second associated containers, if the parameters of the process creation interface are consistent, a process association is established based on the same process identifier; if the parameters of the thread creation interface are consistent, a thread association is established based on the same thread identifier.

[0078] Next, the first and second associated containers are traversed. The process identifier and thread identifier are compared to see if they match. If they match, one or more lists of thread function calls with the same process identifier and thread identifier can be obtained from the first and second associated containers. Here, the first associated container retrieves the first thread function call list, and the second associated container retrieves the second thread function call list. That is, one or more lists of first and second thread function calls with the same process identifier and thread identifier are sequentially retrieved from the first and second associated containers.

[0079] Furthermore, by comparing the data in the first thread function call list with that in the second thread function call list, it can be determined whether the number of interface calls, interface return values, and interface parameter values ​​are consistent between the two lists. This allows us to identify the differences between the first and second thread function call lists. Here, simply recording the indices of all the differences between the first and second thread function call lists is sufficient to identify the differences between the first and second interface call information.

[0080] For example, the differences may include: the second thread function call list is missing one or more thread information compared to the first thread function call list, the number of interface calls is different, the interface return value is different, and the interface parameter values ​​are different.

[0081] It is understandable that the difference information reflects the differences between the second interface call information and the first interface call information. Therefore, based on the difference information, the abnormal information that the first application will encounter when running in the compatibility layer of the second operating system can be determined.

[0082] In one embodiment, after determining the differences between the first interface call information and the second interface call information, all the differences (corresponding indices) can be stored in a list to obtain a list of troubleshooting results. Figure 5 A schematic diagram of a troubleshooting result list according to an embodiment of the present invention is shown. Figure 5 As shown, the difference information in the error checking results list may include: tagResultNode.checktype = 0x0001; tagResultNode.checktype = 0x0002; tagResultNode.checktype = 0x0004.

[0083] It should be noted that, according to the debugging algorithm of the present invention, when comparing the first interface call information with the second interface call information, the interface call information is converted into the corresponding call stack data and stored in a Map container in memory. The subsequent debugging comparison data is directly read from the thread function call list in the Map container in memory, and the comparison result (difference information) records the index in the thread function call list. In this way, there is no data copying or data movement, which can ensure that the debugging algorithm can run efficiently and stably. Moreover, no modification is required to the list data, which is beneficial for adding other extended logic algorithms later.

[0084] In one embodiment, after determining the differences between the first interface call information and the second interface call information, the difference information can be output for display; that is, a list of troubleshooting results can be displayed. For example, the difference information (the list of troubleshooting results) can be sent to a display device connected to the server, and the difference information can be displayed on the display device for the user to view.

[0085] According to the troubleshooting method for applications running in a compatibility layer of the present invention, a first application is run on a first operating system of a first client using a Hook module to collect first interface call information of the first application running on the first operating system; and the first application is run in the compatibility layer of a second client using the same Hook module to collect second interface call information of the first application running in the compatibility layer. By converting the first / second interface call information into a unified data format for comparison using a troubleshooting algorithm, the comparison efficiency and accuracy can be improved. Furthermore, based on the differences found in the comparison, abnormal information of the first application running in the compatibility layer can be determined, thereby enabling efficient and accurate localization of abnormal problems in the first application running in the compatibility layer.

[0086] Furthermore, according to the debugging algorithm of the present invention, when comparing the first interface call information with the second interface call information, the interface call information is converted into corresponding call stack data and stored in a Map container in memory. Subsequent debugging comparison data is directly read from the thread function call list in the Map container in memory, and the difference information is recorded as the index in the thread function call list. In this way, there is no data copying or data movement during the execution of the debugging algorithm, thereby ensuring that the debugging algorithm can run efficiently and stably.

[0087] The various techniques described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, can take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD-ROM, or any other machine-readable storage medium, wherein when the program is loaded into and executed by a machine such as a computer, the machine becomes an apparatus for practicing the present invention.

[0088] When the program code is executed on a programmable computer, the mobile terminal generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device. The memory is configured to store program code; the processor is configured to execute the troubleshooting method for the application running on the compatibility layer of this invention according to instructions in the program code stored in the memory.

[0089] By way of example, and not limitation, readable media include readable storage media and communication media. Readable storage media stores information such as computer-readable instructions, data structures, program modules, or other data. Communication media generally embodies computer-readable instructions, data structures, program modules, or other data in the form of modulated data signals such as carrier waves or other transmission mechanisms, and includes any information delivery medium. Any combination of the above is also included within the scope of readable media.

[0090] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages ​​is for the purpose of disclosing the best mode of implementation of the invention.

[0091] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0092] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more aspects of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the invention.

[0093] Those skilled in the art will understand that modules, units, or components of the devices disclosed in the examples herein can be arranged in the devices described in this embodiment, or alternatively, can be located in one or more devices different from the devices in this example. The modules in the foregoing examples can be combined into a single module or, in addition, can be divided into multiple sub-modules.

[0094] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.

[0095] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features but not others included in other embodiments, combinations of features from different embodiments are intended to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments can be used in any combination.

[0096] Furthermore, some of the embodiments described herein are methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the methods or method elements forms means for implementing the methods or method elements. Furthermore, the elements described herein in the apparatus embodiments are examples of means for implementing the functions performed by elements for the purposes of carrying out the invention.

[0097] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.

[0098] Although the invention has been described with respect to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and edibility purposes, and not for the purpose of interpreting or limiting the subject matter of the invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the invention is illustrative rather than restrictive, and the scope of the invention is defined by the appended claims.

Claims

1. A troubleshooting method for an application running on a compatibility layer, executed in a server, wherein the server is communicatively connected to a first client and a second client respectively; The first client runs a first operating system, and the first operating system runs a first application; The second client runs a second operating system, on which a compatibility layer of the first operating system is deployed, and the first application runs in the compatibility layer; The method includes the following steps: Obtain first interface call information of the first application running on the first operating system from the first client, and obtain second interface call information of the first application running in the compatibility layer from the second client; Using a troubleshooting algorithm, the first interface call information is compared with the second interface call information, wherein... The interface call information is converted into corresponding call stack data and stored in an associated container in memory. Data is read from the thread function call list in the associated container and compared to determine the difference information between the first interface call information and the second interface call information, so as to determine the abnormal information of the first application running in the compatibility layer based on the difference information.

2. The method as described in claim 1, wherein, The first client is adapted to: run the first application on the first operating system through a hook module, collect the first interface call information of the first application when it runs on the first operating system, and send the first interface call information to the server; The second client is adapted to: run the first application in the compatibility layer through the hook module, collect the second interface call information of the first application when it runs in the compatibility layer, and send the second interface call information to the server.

3. The method as described in claim 1, wherein, The steps for comparing the first interface call information with the second interface call information using an error-detection algorithm include: Display the first interface call information and the second interface call information in the graphical user interface; Obtain the first target data selected from the first interface call information and the second target data selected from the second interface call information; Using an error-detection algorithm, the first target data and the second target data are compared to determine the differences between them.

4. The method according to any one of claims 1-3, wherein, The API call information includes the number of API calls, the API return value, and the API parameter values, and the number of API calls, the API return value, and the API parameter values ​​have different debugging priorities; The information used to determine the differences between the first interface call information and the second interface call information includes: Based on the error-checking priority order of the interface call information, the differences between the first interface call information and the second interface call information are determined.

5. The method according to any one of claims 1-3, wherein, The steps for comparing the first interface call information with the second interface call information using an error-detection algorithm include: The first interface call information is converted into corresponding first call stack data and stored in the first associated container; the second interface call information is converted into corresponding second call stack data structure and stored in the second associated container. Based on process identifier and thread identifier, the first call stack data in the first associated container is associated with the second call stack data in the second associated container; Traverse the first associated container and the second associated container, and obtain the first thread function call list and the second thread function call list that have the same process ID and thread ID from the first associated container and the second associated container; The first thread function call list is compared with the second thread function call list to determine whether the number of interface calls, interface return values, and interface parameter values ​​in the first thread function call list and the second thread function call list are consistent, so as to identify the difference information.

6. The method of claim 5, wherein, Based on process identifiers and thread identifiers, an association is established between the first call stack data in the first associated container and the second call stack data in the second associated container, including: Traverse the first and second associated containers. If the parameters of the process creation interface are the same, establish a process association based on the same process identifier; if the parameters of the thread creation interface are the same, establish a thread association based on the same thread identifier.

7. The method according to any one of claims 1-3, wherein, The method further includes the following steps: Store the difference information in a list; The difference information is output for display.

8. The method according to any one of claims 1-3, wherein, The first operating system is Windows, and the second operating system is Linux.

9. A troubleshooting system, comprising: The first client runs on the first operating system, and the first application runs on the first operating system; The second client runs a second operating system, on which a compatibility layer of the first operating system is deployed, and the first application runs in the compatibility layer; The server is communicatively connected to the first client and the second client, respectively, and is adapted to execute the troubleshooting method for applications running based on the compatibility layer as described in any one of claims 1-8.

10. A computing device, comprising: At least one processor; as well as A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions including instructions for performing the method as described in any one of claims 1-8.

11. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-8.