Data processing method, device and system
By dividing the interfaces and using a second device that supports the higher version of the interface to assist processing, the problem of hardware not supporting the higher version of the interface is solved, ensuring the normal operation of the application and the improvement of user experience.
Patent Information
- Application Number
- CN202110704081.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-24
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-06-24
AI Technical Summary
The hardware on the device does not support updated higher-version interface calls, causing the application to fail to run normally and affect the user experience.
By dividing the multiple interfaces called by the application program into the first type interface and the second type interface, the first device is assisted in data processing using a second device that supports the higher version of the interface. The first device is based on the lower version corresponding to the second type interface. The target interface is processed to ensure that the application can run normally.
The first device and the second device jointly support the call of the middle and higher version interfaces of the application to ensure the normal operation of the application and the improvement of the user experience.
Smart Images

Figure CN113485773B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer application technology, and in particular, to a data processing method, device and system. Background Art
[0002] In actual applications, when some applications are running on a device, they usually need to call a certain hardware on the device through different application programming interfaces (Application Programming Interface, referred to as API, which is a collection of a series of function specifications), referred to as interfaces, to perform corresponding data processing calculations. Specifically, when an application calls hardware based on different interfaces, the dynamic library (Dynamic Link Library, abbreviated as DLL, is a way to implement the concept of shared function library, containing one or more functions that have been compiled, linked and stored separately from the applications that use them) and the hardware driver (a special program that enables the hardware and the operating system of the device to communicate with each other) running on the device will process the interface to obtain processing instructions that the hardware can recognize, and the hardware will then perform corresponding data processing calculations based on the processing instructions. Taking a graphics processing program as an example, when the graphics processing program is running on a device, it will call the graphics card on the device through different interfaces to perform corresponding graphics processing calculations. The dynamic library and graphics card driver running on the device process the interface to obtain graphics processing instructions that the graphics card can recognize, and the graphics card will then perform corresponding graphics processing calculations based on the graphics processing instructions.
[0003] In order to provide better processing capabilities, the application interface will be updated. At this time, the hardware on the device may not support the call of the updated higher version interface, and the hardware cannot be called to perform corresponding data processing calculations, resulting in the application being unable to run normally, affecting the user experience. Summary of the invention
[0004] The embodiments of the present application provide a data processing method, device and system for solving the problem in the prior art that the hardware on the device does not support the call of the higher version interface after the application is updated, resulting in the application being unable to run normally.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, comprising:
[0006] Determining a plurality of interfaces called by an application program, the application program being executed on a first device;
[0007] Classifying the multiple interfaces into first-category interfaces and second-category interfaces according to whether the multiple interfaces are related to the operating system;
[0008] Based on the first type of interface, a first calling instruction is sent to a second device, and the second device responds to the first calling instruction, so that the second device calls the target hardware on the second device to process the data to be processed based on the first type of interface to obtain a first processing result;
[0009] Acquire the first processing result sent by the second device;
[0010] A target interface of a lower version and matching in function with the second type of interface is searched, and based on the target interface, target hardware on the first device is called to process the data to be processed to obtain a second processing result.
[0011] In a second aspect, an embodiment of the present application provides a data processing method, including:
[0012] receiving a first calling instruction sent by a first device, where the first calling instruction is generated by the first device based on a first type of interface, where the first type of interface is obtained by dividing a plurality of interfaces by the first device according to whether the plurality of interfaces are related to an operating system, and the plurality of interfaces are called by an application program running on the first device;
[0013] In response to the first calling instruction and based on the first type of interface, calling the target hardware on the second device to process the data to be processed to obtain a first processing result;
[0014] The first processing result is sent to the first device.
[0015] In a third aspect, an embodiment of the present application provides a data processing device, including:
[0016] A first processing module is configured to determine a plurality of interfaces called by an application program, the application program being run on a first device; classify the plurality of interfaces into a first type of interface and a second type of interface according to whether the plurality of interfaces are related to an operating system; send a first call instruction to a second device based on the first type of interface, and the second device responds to the first call instruction, so that the second device calls a target hardware on the second device based on the first type of interface to process the data to be processed and obtain a first processing result; and obtain the first processing result sent by the second device;
[0017] A matching module, used for searching for a target interface with a lower version and matching functionality corresponding to the second type of interface;
[0018] The second processing module is used to call the target hardware on the first device to process the to-be-processed data based on the target interface to obtain a second processing result.
[0019] In a fourth aspect, an embodiment of the present application provides a data processing device, including:
[0020] a calling module, configured to receive a first calling instruction sent by a first device, where the first calling instruction is generated by the first device based on a first type of interface, where the first type of interface is obtained by dividing a plurality of interfaces by the first device according to whether the plurality of interfaces are related to an operating system, and the plurality of interfaces are called by an application program running on the first device;
[0021] The third processing module is used to respond to the first calling instruction and based on the first type of interface, call the target hardware on the second device to process the data to be processed to obtain a first processing result; and send the first processing result to the first device.
[0022] In a fifth aspect, an embodiment of the present application provides a data processing system, including a first device and a second device;
[0023] The first device is used to determine multiple interfaces called by an application program, and the application program runs on the first device; divide the multiple interfaces into a first type of interface and a second type of interface according to whether the multiple interfaces are related to the operating system; send a first call instruction to the second device based on the first type of interface, and the second device responds to the first call instruction, so that the second device calls the target hardware on the second device based on the first type of interface to process the data to be processed to obtain a first processing result; obtain the first processing result sent by the second device; find a target interface with a lower version and matching function corresponding to the second type of interface, and based on the target interface, call the target hardware on the first device to process the data to be processed to obtain a second processing result;
[0024] The second device is used to receive a first calling instruction sent by the first device, the first calling instruction is generated by the first device based on a first type of interface, the first type of interface is obtained by dividing the first device according to whether multiple interfaces are related to the operating system, and the multiple interfaces are called by the application running on the first device; in response to the first calling instruction and based on the first type of interface, call the target hardware on the second device to process the data to be processed to obtain a first processing result; and send the first processing result to the first device.
[0025] In the embodiment of the present application, the multiple interfaces called by the application are divided into the first type of interface and the second type of interface according to whether they are related to the operating system, and based on the first type of interface, a first call instruction is sent to the second device, and the target hardware on the second device supports the first type of interface call, and can respond to the first call instruction, and process the data to be processed based on the first type of interface to obtain a first processing result; the target hardware on the first device does not support the original high-version second type of interface call, so the target interface with a low version and a function match corresponding to the second type of interface is searched, and the target hardware on the first device can support the call of the target interface, and can process the data to be processed based on the target interface to obtain a second processing result. By having the target hardware on the second device that supports the call of the high-version interface perform data processing based on the first type of interface, and the target hardware on the first device that does not support the call of the high-version interface perform data processing based on the function match corresponding to the second type of interface and a low version, it is achieved that the target hardware on the first device and the target hardware on the second device jointly support the call of the high-version interface during the operation of the application, and jointly perform data processing calculations, ensuring that the application can run normally and improving the user experience.
[0026] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1 A flow chart showing an embodiment of a data processing method provided by the present application is shown;
[0029] Figure 2 A flowchart showing another embodiment of a data processing method provided by the present application is shown;
[0030] Figure 3 A schematic diagram showing the structure of an embodiment of a data processing device provided by the present application is shown;
[0031] Figure 4 A schematic diagram showing the structure of another embodiment of a data processing device provided by the present application is shown;
[0032] Figure 5 A structural schematic diagram of an embodiment of a data processing system provided by the present application is shown. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0034] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0035] The embodiment of the present application is applicable to the scenario where the application needs to call the hardware for data processing when running. In practical applications, when some applications are running on the device, they usually need to call a certain hardware on the device through different application programming interfaces (Application Programming Interface, referred to as API, which is a collection of a series of function specifications), referred to as interfaces, to perform corresponding data processing calculations. Specifically, when the application calls the hardware based on different interfaces, the dynamic library (Dynamic Link Library, abbreviated as DLL, is a way to implement the concept of shared function library, containing one or more functions that have been compiled, linked and stored separately from the application using them) and the hardware driver (a special program that enables the hardware and the operating system of the device to communicate with each other) running on the device will process the interface to obtain the processing instructions that the hardware can recognize, and the hardware will then perform corresponding data processing calculations based on the processing instructions. Taking the graphics processing program as an example, when the graphics processing program is running on the device, it will call the graphics card on the device through different interfaces to perform corresponding graphics processing calculations. The dynamic library and graphics card driver running on the device process the interface to obtain the graphics processing instructions that the graphics card can recognize, and the graphics card will then perform corresponding graphics processing calculations based on the graphics processing instructions.
[0036] In order to provide better processing capabilities, the application interface will be updated. At this time, the hardware on the device may not support the call of the updated higher version interface, and the hardware cannot be called to perform corresponding data processing calculations, resulting in the application being unable to run normally, affecting the user experience.
[0037] In order to solve the problem that the above application cannot run normally, the inventor thought that if the hardware in the current device where the application runs does not support the call of the high version interface, other devices installed with hardware that can support the call of the above high version interface can be used to assist the current device to jointly perform corresponding data processing. Therefore, after a series of thinking and experiments, the inventor proposed the technical solution of this application, that is, determining multiple interfaces called by the application, the application runs on the first device; according to whether the multiple interfaces are related to the operating system, the multiple interfaces are divided into the first type of interface and the second type of interface; the first type of interface is sent to the second device, and the second device calls the target hardware on the second device based on the first type of interface to process the data to be processed to obtain the first processing result; obtain the first processing result sent by the second device; according to the name of the second type of interface, find the target interface corresponding to the second type of interface with a low version and matching function, and based on the target interface, call the target hardware on the first device to process the data to be processed to obtain the second processing result.
[0038] By having the target hardware on the second device that supports calling of a higher version interface perform data processing based on the first type of interface, and by having the target hardware on the first device that does not support calling of a higher version interface perform data processing based on a target interface with a lower version and matching the function corresponding to the second type of interface, it is achieved that the target hardware on the first device and the target hardware on the second device jointly support the calling of the higher version interface during the running of the application and jointly perform data processing calculations, thereby ensuring that the application can run normally and improving the user experience.
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0040] like Figure 1 FIG. 1 is a flowchart of an embodiment of a data processing method provided by the present application. The method may include the following steps:
[0041] 101: Determine multiple interfaces called by an application program, the application program can be run on a first device, wherein target hardware on the first device does not support calling of multiple interfaces.
[0042] In this embodiment, the method can be applied to a first device, wherein the first device may include a physical device such as a terminal, and may also include a virtual device such as a virtual machine (a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment).
[0043] An application may be run on the first device. When the application is running, it is necessary to call the target hardware on the device to perform data processing and calculation. The target hardware on the device may include physical hardware or virtual hardware. For example, the target hardware may be implemented as a graphics card, and the graphics card may include a physical graphics card and a virtual graphics card. The above application may include a graphics processing program or a large-scale mathematical operation program. When the graphics processing program is running, it is necessary to call the graphics card on the device to perform graphics processing and calculation, or when the large-scale mathematical operation program is running, it is necessary to call the graphics card on the device to perform fast calculations, etc.
[0044] In actual applications, the above-mentioned application calls the hardware to perform data processing and calculations through an interface. The interface refers to the Application Programming Interface (API), which is a collection of a series of function specifications. Specifically, when the application calls the hardware based on the interface, the dynamic library (Dynamic Link Library, abbreviated as DLL, is a way to implement the concept of a shared function library, containing one or more functions that have been compiled, linked and stored separately from the application that uses them) and the hardware driver (a special program that enables the hardware and the device's operating system to communicate with each other) running on the device will process the interface and obtain processing instructions that the hardware can recognize. The hardware then performs corresponding data processing calculations based on the processing instructions.
[0045] Among them, different interfaces can correspond to different data processing functions, and the above-mentioned application can call the hardware through multiple different interfaces to perform corresponding data processing calculations. Taking the graphics processing program as an example, when the graphics processing program is running, it is necessary to render the rendering data to obtain the rendered graphics. At this time, the graphics card can be called for rendering through the 3D rendering interface. The 3D rendering interface can include the Direct3D interface (a 3D graphics interface based on Microsoft's Common Object Mode (COM)) and the Open Graphics Library interface (Open Graphics Library, referred to as OpenGL, a cross-language, cross-platform interface for rendering 2D and 3D vector graphics). Specifically, OpenGL can include multiple different interfaces such as wglCreateContext (create context interface) and wglGetPixelFormat (get pixel format interface), which correspond to different rendering functions such as creating context and getting pixel format.
[0046] In this embodiment, the interface called by the application may be a higher version interface after the update. Taking OpenGL as an example, the higher version interface may be OpenGL3.3, and the lower version interface may be OpenGL1.1. The application may be an application that calls the higher version interface. At this time, the target hardware on the first device on which the application runs will not be able to support the calling of the higher version interface. Therefore, multiple interfaces called by the application may be determined so as to facilitate further processing of the multiple interfaces.
[0047] 102: Classify the multiple interfaces into first-category interfaces and second-category interfaces according to whether the multiple interfaces are related to the operating system.
[0048] After determining the multiple interfaces called by the application, since different interfaces correspond to different data processing functions, the implementation of different data processing functions has different requirements for the device, specifically, different requirements for the device's operating system. Taking the multiple 3D rendering interfaces called by the graphics processing program as an example, the graphics rendering corresponding to some 3D rendering interfaces can be, for example, drawing specific graphics such as points, lines, and surfaces. At this time, the implementation of this part of the graphics rendering has nothing to do with the device's operating system and can be rendered using hardware on other devices. The graphics rendering corresponding to other parts of the 3D rendering interface can be, for example, displaying the graphics in the window of the current interface, adjusting the window size, or setting the pixel format, etc. At this time, the implementation of this part of the graphics rendering is related to the operating system of the current device. If other devices are used to render using the target hardware of other devices, the graphics will be displayed in the window of other devices, etc., and thus cannot be rendered correctly. Therefore, for this part of the 3D rendering interface related to the operating system, it is necessary to use the target hardware on the current device for rendering.
[0049] Therefore, the multiple interfaces can be divided into first-class interfaces and second-class interfaces according to the correlation between the multiple interfaces and the operating system, that is, whether the multiple interfaces are related to the operating system. The first-class interface can be an interface that is unrelated to the operating system, or an interface that is related to the operating system, and correspondingly, the second-class interface can be an interface that is related to the operating system, or an interface that is unrelated to the operating system.
[0050] In this embodiment, the first type of interface is an interface that is unrelated to the operating system, and the second type of interface is an interface that is related to the operating system.
[0051] 103: Based on the first type interface, send a first calling instruction to the second device, and the second device responds to the first calling instruction and calls the target hardware on the second device based on the first type interface to process the data to be processed to obtain a first processing result.
[0052] 104: Obtain a first processing result sent by the second device.
[0053] Since the first type of interface is an interface independent of the operating system, the target hardware on other devices, such as the second device, can be used to perform corresponding data processing calculations. The second device can be a device different from the first device and establish a communication connection with the first device. For example, if the first device is a terminal, the second device can be a server that establishes communication with the terminal; if the first device is a virtual machine, the second device can be a host machine running the virtual machine, etc.
[0054] The target hardware on the second device can support the calling of the first type of interface. For example, if the first device is a virtual machine and the second device is a host machine running the virtual machine, the target hardware on the first device can be a virtual graphics card, and the target hardware on the second device can be a physical graphics card. In actual applications, compared with physical graphics cards and physical graphics card drivers, virtual graphics cards and virtual graphics card drivers are updated more slowly, so there may be a situation where physical graphics cards and physical graphics card drivers support the calling of higher version interfaces, while virtual graphics cards and virtual graphics card drivers do not support the calling of higher version interfaces.
[0055] Therefore, after the second device calls the target hardware to process the data to be processed based on the first type interface, it can obtain the first processing result and send the first processing result to the first device.
[0056] 105: Searching for a target interface of a lower version and matching the function corresponding to the second type of interface, and based on the target interface, calling the target hardware on the first device to process the data to be processed to obtain a second processing result.
[0057] The second type of interface is an interface related to the operating system, which needs to call the target hardware on the first device, but the second type of interface is a high-version interface, and the target hardware on the first device does not support the call of the high-version interface, and it is impossible to directly call the target hardware on the first device based on the second type of interface. Therefore, a target interface with a lower version and matching functions corresponding to the second type of interface can be searched. At this time, the target interface is a low-version interface that matches the functions corresponding to the second type of interface, and the hardware on the first device can support the call of the low-version interface.
[0058] In actual applications, since different interfaces correspond to different functions, it is possible to search for a target interface with a lower version and matching functions corresponding to the second type of interface according to the functions of the second type of interface. The target interface may include one or more interfaces. For example, for a specific high version interface, if there is a low version interface that matches its function, the low version interface can be determined as the target interface; if there is no low version interface that matches its function, but there are multiple low version interfaces that can jointly implement the corresponding function, the multiple low version interfaces can be determined as the target interface.
[0059] Based on the target interface, the target hardware on the first device is called to process the data to be processed to obtain a second processing result, and combined with the first processing result sent by the second device, the data processing calculation required for the application program to run can be implemented.
[0060] In this embodiment, multiple interfaces called by the application are divided into first-class interfaces and second-class interfaces according to whether they are related to the operating system, and based on the first-class interface, a first call instruction is sent to the second device. The target hardware on the second device supports the first-class interface call, and can respond to the first call instruction and process the data to be processed based on the first-class interface to obtain a first processing result; the target hardware on the first device does not support the original high-version second-class interface call, so it searches for a target interface with a low version that matches the function corresponding to the second-class interface. At this time, the target hardware on the first device can support the call of the target interface, and can process the data to be processed based on the target interface to obtain a second processing result. By having the target hardware on the second device that supports the call of the high-version interface perform data processing based on the first-class interface, and the target hardware on the first device that does not support the call of the high-version interface perform data processing based on the target interface with a low version that matches the function corresponding to the second-class interface, the target hardware on the first device and the target hardware on the second device that do not support the call of the high-version interface jointly support the call of the high-version interface during the operation of the application, and jointly perform data processing calculations, ensuring that the application can run normally and improving the user experience.
[0061] In actual applications, according to existing interface naming conventions, the name of an interface usually includes the name identifier of a related operating system. Therefore, in some embodiments, the method of dividing multiple interfaces into first-class interfaces and second-class interfaces according to whether the multiple interfaces are related to the operating system may include:
[0062] According to a preset interface naming specification, it is determined whether the names of multiple interfaces carry the operating system name; wherein it can be determined that the interfaces whose names do not carry the operating system name are irrelevant to the operating system, and the interfaces whose names carry the operating system name are related to the operating system;
[0063] The multiple interfaces are divided into first-class interfaces whose names do not carry the operating system name, and second-class interfaces whose names carry the operating system name.
[0064] Among them, in the preset interface naming convention, in the interface related to the operating system, the function name of the interface will usually have a function prefix identified by the operating system. Taking the multiple interfaces called by the graphics processing program as OpenGL as an example, according to the naming convention of OpenGL, the OpenGL related to the operating system can have the name prefix of the operating system in its name. For example, OpenGL related to the Windows operating system can have a wgl function prefix, such as wglCreateContext (create context interface), wglGetPixelFormat (get pixel format interface), etc. For another example, OpenGL related to the Linux operating system can have a glx function prefix, such as glxCreateContext (create context interface), glxMakeCurrent (switch context interface), etc.
[0065] OpenGL, which is independent of the operating system, will not have the name prefix of the operating system, such as glBufferData (a data storage interface that creates and initializes buffer objects), etc., and we will not give examples for this.
[0066] This embodiment provides a specific implementation method for judging the relevance of an interface to an operating system based on the interface name, which is simple and easy to implement. Of course, in actual applications, judgment can also be made based on the definition of the interface. If the data types of the input parameters and return values of the interface are both specific to a certain operating system, then it can be judged that the interface is related to the operating system. For example, the definition of wglCreateContext (create context interface) is:
[0067] HGLRC wglCreateContext(
[0068] HDC unnamedParam1 );
[0070] The data types of the input parameters and return values of this interface are specific to the Windows operating system. At this point, it can be determined that this interface is related to the operating system.
[0071] In actual applications, different interfaces may correspond to different functions. Taking OpenGL related to the Windows operating system as an example, a higher version of OpenGL may include wglCreateContextAttribsARB (create a configurable context interface), wglGetPixelFormatAttribivARB (get a configurable pixel format interface), etc., and their corresponding functions are respectively creating a context and getting a pixel format, etc. Then, the lower version interface that matches the function corresponding to the higher version of the create configurable context interface may be wglCreateContext (create a context interface), and the lower version interface that matches the function corresponding to the higher version of the get configurable pixel format interface may be wglGetPixelFormat (get a pixel format interface).
[0072] In practical applications, the above processing of the interface can be implemented through a dynamic library on the device. A dynamic library (Dynamic Link Library, abbreviated as DLL) is a way to implement the concept of a shared function library, which contains one or more functions that have been compiled, linked and stored separately from the applications that use them. In some embodiments, the first device may include a first dynamic library and a second dynamic library; the second device includes a third dynamic library;
[0073] The method of determining multiple interfaces called by the application may include:
[0074] Determine multiple interfaces called by the application program using the first dynamic library;
[0075] According to whether the multiple interfaces are related to the operating system, the method of classifying the multiple interfaces into first-category interfaces and second-category interfaces may include:
[0076] Using the first dynamic library, the multiple interfaces are divided into first-category interfaces and second-category interfaces according to whether the multiple interfaces are related to the operating system;
[0077] The method of sending a first call instruction to a second device based on a first type of interface, and having the second device respond to the first call instruction and, based on the first type of interface, calling target hardware on the second device to process the data to be processed to obtain a first processing result may include:
[0078] Using the first dynamic library, a first call instruction generated based on the first class interface is sent to the second device, the second device responds to the first call instruction, and uses the third dynamic library and the target hardware driver on the second device to process the first class interface to obtain a first processing instruction, and controls the target hardware on the second device to execute the first processing instruction;
[0079] The method of searching for a target interface of a lower version and matching in function with the second type of interface, and based on the target interface, calling the target hardware on the first device to process the data to be processed to obtain the second processing result may include:
[0080] Find a target interface with a lower version and matching function corresponding to the second type of interface;
[0081] The target interface is processed using the second dynamic library and the hardware driver on the first device to obtain a second processing instruction, and the target hardware on the first device is controlled to execute the first processing instruction.
[0082] In actual applications, the implementation of dynamic libraries is also related to the device's operating system. For example, if the application running on the device is a graphics processing program, and the multiple interfaces called by the graphics processing program are OpenGL, if the device's operating system is a Windows operating system, the dynamic library on the device can be implemented as opengl32.dll, and if the device's operating system is a Linux operating system, the dynamic library on the device can be implemented as libGL.so.
[0083] In this embodiment, the first dynamic library on the first device can be used to determine multiple interfaces called by the application, specifically all interfaces called by the application. And according to whether the multiple interfaces are related to the operating system, the multiple interfaces are classified, the multiple interfaces are divided into a first type of interface and a second type of interface, and the call instruction based on the interface is sent to the corresponding device. The second dynamic library can be used to process the target interface corresponding to the second type of interface together with the hardware driver on the first device to obtain a second processing instruction. When the application runs on the first device, multiple high-version interfaces are called. The first device can use the first dynamic library to determine the multiple high-version interfaces, that is, intercept the multiple high-version interfaces called by the application, and divide the multiple high-version interfaces into a first type of interface and a second type of interface according to whether the multiple high-version interfaces are related to the operating system, wherein the first type of interface can be a high-version interface that is not related to the operating system, and the second type of interface can be a high-version interface that is related to the operating system.
[0084] For the above-mentioned first-class interface, since the target hardware on the current first device where the application is running does not support the call of the above-mentioned high-version interface, and the first-class interface is independent of the operating system and does not need to be processed by the target hardware on the current device, the first dynamic library can be used to send the first call instruction generated based on the first-class interface to the second device installed with the target hardware supporting the call of the above-mentioned high-version interface. The second device responds to the first call instruction and calls the target hardware for processing based on the first-class interface.
[0085] Optionally, the second device may further include a calling module. The second device may use the calling module to establish a communication connection with the first device, such as establishing a communication connection through a transmission control protocol / internet protocol (TCP / IP), etc., which may be set according to actual applications and is not specifically limited here. Therefore, the first device may use the first dynamic library to send the first calling instruction to the second device, which may be to send the first calling instruction to the calling module on the second device, and then the second device may use the calling module to respond to the first calling instruction and call the first class interface. Afterwards, the second device may use the third dynamic library and the target hardware driver to process the first class interface, obtain a processing instruction that can be recognized by the target hardware, and then execute it by the target hardware.
[0086] The target hardware on the second device processes the data to be processed to obtain a first processing result, which can then be sent to the first dynamic library of the first device by calling the module, thereby calling a higher version interface that is not related to the operating system and completing the corresponding data processing.
[0087] For the above second-class interface, since the target hardware on the current first device where the application is running does not support the call of the above high-version interface, the second-class interface is related to the operating system and cannot be called by the target hardware on other devices for processing, but can only be processed by the target hardware on the current first device. Therefore, the second-class interface needs to be further processed.
[0088] Optionally, the first device may include a matching module. The first device may use the first dynamic library to send the second call instruction generated based on the second type of interface to the matching module, and the matching module may respond to the second call instruction and search for a low-version target interface that matches the function corresponding to the second type of interface, that is, a low-version interface corresponding to the second type of high-version interface. At this time, the target hardware on the first device can support the call of the low-version interface, and the first device can use the second dynamic library and the target hardware driver to process the low-version interface, obtain the processing instructions that can be recognized by the target hardware on the first device, and then execute them by the target hardware on the first device.
[0089] The target hardware on the first device processes the data to be processed to obtain a second processing result. The second processing result and the first processing result sent by the second device can be combined to jointly perform data processing in the running application to ensure that the application can run normally on the first device.
[0090] In practical applications, the application program can be implemented as a graphics processing program, the data to be processed can be implemented as rendering data, the first processing result is a first rendering graphic, the second processing result is a second rendering graphic, and the first rendering graphic and the second rendering graphic constitute a rendering graphic.
[0091] The following takes the first device as a virtual machine, the second device as a host machine running the virtual machine, the operating system of the virtual machine is a Windows operating system, the operating system of the host machine is a Linux operating system, the application running on the virtual machine is a graphics processing program, the multiple interfaces called are OpenGL, the data to be processed is rendering data, the first dynamic library and the second dynamic library on the virtual machine are opengl32.dll, and the third dynamic library on the host machine is libGL.so as an example to illustrate the method of this solution.
[0092] The graphics processing program runs on the virtual machine. When performing graphics rendering, the graphics processing program calls multiple high-version 3D rendering interfaces, such as glBufferData (a data storage interface for creating and initializing buffer objects), wglCreateContext (a context interface for creating), etc. The virtual machine intercepts the above multiple high-version interfaces using the first dynamic library, and divides the above multiple high-version interfaces into first-class interfaces that are irrelevant to the operating system, such as glBufferData (a data storage interface for creating and initializing buffer objects), etc., and second-class interfaces that are related to the operating system, such as wglCreateContextAttribsARB (a configurable context interface), wglGetPixelFormatAttribivARB (an interface for obtaining configurable pixel formats), etc., according to whether the above interfaces are related to the operating system.
[0093] Afterwards, the virtual machine uses the first dynamic library to send the first call instruction generated based on the first class interface to the call module on the host machine, and the host machine uses the call module to respond to the first call instruction and call the first class interface. At this time, the host machine uses the third dynamic library and the graphics card driver to process the first class interface and obtain a rendering instruction that can be recognized by the graphics card on the host machine. The graphics card on the host machine is called to execute the rendering instruction, perform corresponding rendering processing, and obtain a first rendered graphic.
[0094] The host machine can use the calling module to send the first rendering graphic to the first dynamic library of the virtual machine. The first device can also use the first dynamic library to send the second calling instruction generated based on the second type of interface to the matching module of the virtual machine. The matching module responds to the second calling instruction and searches for a target interface with a lower version that matches the function corresponding to the second type of interface, that is, a low version interface corresponding to a high version interface, such as a low version wglCreateContext (create context interface) corresponding to a high version wglCreateContextAttribsARB (create configurable context interface). And send the third calling instruction based on the low version interface to the second dynamic library, and the virtual machine uses the second dynamic library and the virtual graphics driver to process the low version interface, obtain the rendering instruction that can be recognized by the virtual graphics card on the virtual machine, and then the virtual graphics card on the virtual machine performs the rendering process.
[0095] The second rendered graphics obtained by the virtual graphics card on the virtual machine and the first rendered graphics obtained by the graphics card on the host machine can jointly perform data rendering in the running of the graphics processing program, ensuring that the graphics processing program on the virtual machine can run normally. The graphics card driver on the host machine calls the host machine graphics card for rendering, and the virtual graphics card driver and virtual graphics card on the virtual machine do not need to be updated, so that the above graphics processing program can be run on the virtual machine.
[0096] like Figure 2 As shown, it is a flowchart of another embodiment of a data processing method provided by the present application. The method can be applied to a second device. The method may include the following steps:
[0097] 201: Receive a first calling instruction sent by a first device, where the first calling instruction is generated by the first device based on a first type of interface, where the first type of interface is obtained by dividing a plurality of interfaces by the first device according to whether the plurality of interfaces are related to an operating system, and the plurality of interfaces are called by an application program running on the first device.
[0098] In this embodiment, the method can be applied to the second device, and the second device establishes a communication connection with the first device. For example, if the first device is a terminal, the second device can be a server that establishes communication with the terminal; if the first device is a virtual machine, the second device can be a host machine on which the virtual machine is installed, etc.
[0099] The first device runs the above application, and divides the multiple high-version interfaces called by the application into first-class interfaces and second-class interfaces, and sends a first call instruction to the second device based on the first-class interface. The process of the first device dividing the first-class interface and the second-class interface and the process of sending the second-class interface to the second device have been described in detail in the previous embodiment, and will not be repeated here.
[0100] 202: In response to the first calling instruction and based on the first type of interface, calling the target hardware on the second device to process the data to be processed to obtain a first processing result.
[0101] 203: Send the first processing result to the first device.
[0102] The target hardware on the second device can support the above-mentioned high version of the first class interface call, so based on the first class interface, the target hardware can be called to process the data to be processed to obtain the first processing result, and the first processing result is sent to the first device. The specific implementation method has also been described in detail in the previous embodiment, and will not be repeated here.
[0103] In this embodiment, multiple interfaces called by the application are divided into first-class interfaces and second-class interfaces according to whether they are related to the operating system, and the first call instruction generated based on the first-class interface is sent to the second device. The target hardware on the second device supports the first-class interface call, can respond to the first call instruction, and process the data to be processed based on the first-class interface to obtain the first processing result. By having the target hardware on the second device that supports the high-version interface call perform data processing based on the first-class interface, assisting the target hardware on the first device in data processing, the target hardware on the first device and the target hardware on the second device jointly support the call of the high-version interface during the operation of the application, and jointly perform data processing calculations, ensuring that the application can run normally and improving the user experience.
[0104] like Figure 3 FIG. 1 is a schematic diagram of a structure of an embodiment of a data processing device provided by the present application. The device may include the following modules:
[0105] The first processing module 301 is used to determine multiple interfaces called by the application program, and the application program runs on the first device; divide the multiple interfaces into first-class interfaces and second-class interfaces according to whether the multiple interfaces are related to the operating system; send a first call instruction to the second device based on the first-class interface, and the second device responds to the first call instruction, so that the second device calls the target hardware on the second device based on the first-class interface to process the data to be processed to obtain a first processing result; obtain the first processing result sent by the second device;
[0106] A matching module 302, configured to search for a target interface of a lower version and matching in function with the second type of interface;
[0107] The second processing module 303 is used to call the target hardware on the first device to process the data to be processed based on the target interface to obtain a second processing result.
[0108] In this embodiment, multiple interfaces called by the application are divided into first-class interfaces and second-class interfaces according to whether they are related to the operating system, and based on the first-class interface, a first call instruction is sent to the second device. The target hardware on the second device supports the first-class interface call, and can respond to the first call instruction and process the data to be processed based on the first-class interface to obtain a first processing result; the target hardware on the first device does not support the original high-version second-class interface call, so it searches for a target interface with a low version that matches the function corresponding to the second-class interface. At this time, the target hardware on the first device can support the call of the target interface, and can process the data to be processed based on the target interface to obtain a second processing result. By having the target hardware on the second device that supports the call of the high-version interface perform data processing based on the first-class interface, and the target hardware on the first device that does not support the call of the high-version interface perform data processing based on the target interface with a low version that matches the function corresponding to the second-class interface, the target hardware on the first device and the target hardware on the second device that do not support the call of the high-version interface jointly support the call of the high-version interface during the operation of the application, and jointly perform data processing calculations, ensuring that the application can run normally and improving the user experience.
[0109] In some embodiments, the first processing module 301 can be specifically used to determine whether the names of multiple interfaces carry an operating system name according to a preset interface naming specification; wherein the interfaces whose names do not carry the operating system name are not related to the operating system, and the interfaces whose names carry the operating system name are related to the operating system; and divide the multiple interfaces into a first category of interfaces whose names do not carry the operating system name, and a second category of interfaces whose names carry the operating system name.
[0110] In some embodiments, the first processing module 301 can be specifically used to use the first dynamic library to determine multiple interfaces called by the application; use the first dynamic library to divide the multiple interfaces into first-class interfaces and second-class interfaces according to whether the multiple interfaces are related to the operating system; use the first dynamic library to send a first call instruction generated based on the first-class interface to the second device, and the second device responds to the first call instruction, and uses the third dynamic library and the target hardware driver on the second device to process the first-class interface to obtain a first processing instruction, and control the target hardware on the second device to execute the first processing instruction.
[0111] In some embodiments, the second processing module 303 may be specifically configured to process the target interface using the second dynamic library and the hardware driver on the first device to obtain the second processing instruction, and to control the target hardware on the first device to execute the first processing instruction.
[0112] like Figure 4FIG. 1 is a schematic diagram of a structure of an embodiment of a data processing device provided by the present application. The device may include the following modules:
[0113] A calling module 401 is used to receive a first calling instruction sent by a first device, where the first calling instruction is generated by the first device based on a first type of interface, where the first type of interface is obtained by dividing a plurality of interfaces by the first device according to whether the plurality of interfaces are related to an operating system, and the plurality of interfaces are called by an application program running on the first device;
[0114] The third processing module 402 is used to respond to the first calling instruction and based on the first type of interface, call the target hardware on the second device to process the data to be processed to obtain a first processing result; and send the first processing result to the first device.
[0115] In this embodiment, multiple interfaces called by the application are divided into first-class interfaces and second-class interfaces according to whether they are related to the operating system, and the first call instruction generated based on the first-class interface is sent to the second device. The target hardware on the second device supports the first-class interface call, can respond to the first call instruction, and process the data to be processed based on the first-class interface to obtain the first processing result. By having the target hardware on the second device that supports the high-version interface call perform data processing based on the first-class interface, assisting the target hardware on the first device in data processing, the target hardware on the first device and the target hardware on the second device jointly support the call of the high-version interface during the operation of the application, and jointly perform data processing calculations, ensuring that the application can run normally and improving the user experience.
[0116] like Figure 5 , which is a schematic diagram of a structure of an embodiment of a data processing system provided by the present application, may include a first device 501 and a second device 502;
[0117] The first device 501 can be used to determine multiple interfaces called by an application program, and the application program runs on the first device; divide the multiple interfaces into a first type of interface and a second type of interface according to whether the multiple interfaces are related to the operating system; send a first call instruction to the second device based on the first type of interface, and the second device responds to the first call instruction, so that the second device calls the target hardware on the second device based on the first type of interface to process the data to be processed to obtain a first processing result; obtain the first processing result sent by the second device; find a target interface with a lower version and matching function corresponding to the second type of interface, and based on the target interface, call the target hardware on the first device to process the data to be processed to obtain a second processing result;
[0118] The second device 502 can be used to receive a first calling instruction sent by the first device, where the first calling instruction is generated by the first device based on a first type of interface, where the first type of interface is obtained by dividing the multiple interfaces by the first device according to whether the multiple interfaces are related to the operating system, and the multiple interfaces are called by an application running on the first device; in response to the first calling instruction and based on the first type of interface, the target hardware on the second device is called to process the data to be processed to obtain a first processing result; and the first processing result is sent to the first device.
[0119] In this embodiment, the multiple interfaces called by the application are divided into the first type of interface and the second type of interface according to whether they are related to the operating system, and the first call instruction generated based on the first type of interface is sent to the second device. The target hardware on the second device supports the first type of interface call, and can respond to the first call instruction and process the data to be processed based on the first type of interface to obtain the first processing result; the target hardware on the first device does not support the original high-version second type of interface call, so it searches for a target interface with a low version that matches the function corresponding to the second type of interface. At this time, the target hardware on the first device can support the call of the target interface, and can process the data to be processed based on the target interface to obtain the second processing result. By having the target hardware on the second device that supports the call of the high-version interface perform data processing based on the first type of interface, and the target hardware on the first device that does not support the call of the high-version interface perform data processing based on the target interface with a low version that matches the function corresponding to the second type of interface, the target hardware on the first device and the target hardware on the second device that do not support the call of the high-version interface jointly support the call of the high-version interface during the operation of the application, and jointly perform data processing calculations, ensuring that the application can run normally and improving the user experience.
[0120] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0121] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0122] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the traditional solution can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A data processing method, characterized in that: Applied to a first device, comprising: Determining multiple interfaces called by an application corresponding to the data to be processed, the application running on the first device, and target hardware on the first device not supporting the calling of the multiple interfaces; According to whether the multiple interfaces are related to the operating system of the first device, the multiple interfaces are divided into a first type of interface and a second type of interface, wherein the first type of interface is not related to the operating system, and the second type of interface is related to the operating system; Based on the first type of interface, a first calling instruction is sent to a second device, and the second device responds to the first calling instruction, so that the second device calls the target hardware on the second device based on the first type of interface to process a first part of the data to be processed to obtain a first processing result; Acquire the first processing result sent by the second device; Searching for a target interface of a lower version and matching in function with the second type of interface, and based on the target interface, calling the target hardware on the first device to process the second part of the data to be processed to obtain a second processing result; A processing result of the data to be processed is obtained based on the first processing result and the second processing result.
2. The method according to claim 1, characterized in that The dividing the multiple interfaces into first-category interfaces and second-category interfaces according to whether the multiple interfaces are related to the operating system comprises: According to a preset interface naming specification, determine whether the names of the multiple interfaces carry the operating system name; wherein the interfaces whose names do not carry the operating system name are irrelevant to the operating system, and the interfaces whose names carry the operating system name are related to the operating system; The multiple interfaces are divided into a first type of interfaces whose names do not carry the name of the operating system, and a second type of interfaces whose names carry the name of the operating system.
3. The method according to claim 1, characterized in that: The first device includes a first dynamic library and a second dynamic library; the second device includes a third dynamic library; The multiple interfaces called by the application program are determined to include: Determine multiple interfaces called by the application program using the first dynamic library; The dividing the multiple interfaces into first-category interfaces and second-category interfaces according to whether the multiple interfaces are related to the operating system comprises: Using the first dynamic library, the multiple interfaces are divided into first-category interfaces and second-category interfaces according to whether the multiple interfaces are related to the operating system; The sending of a first calling instruction to a second device based on the first type of interface, and the second device responding to the first calling instruction so that the second device calls the target hardware on the second device based on the first type of interface to process the data to be processed and obtain a first processing result includes: Using the first dynamic library, a first call instruction generated based on the first class interface is sent to a second device, and the second device responds to the first call instruction, so that the second device processes the first class interface using the third dynamic library and the target hardware driver on the second device to obtain a first processing instruction, and controls the target hardware on the second device to execute the first processing instruction; The searching for a target interface with a lower version and matching functions corresponding to the second type of interface, and based on the target interface, calling the target hardware on the first device to process the data to be processed to obtain a second processing result includes: Find a target interface with a lower version and matching function corresponding to the second type of interface; The target interface is processed using the second dynamic library and the target hardware driver on the first device to obtain a second processing instruction, and the target hardware on the first device is controlled to execute the second processing instruction.
4. The method according to any one of claims 1 to 3, characterized in that: The first device is a virtual machine, and the second device is a host machine running the virtual machine.
5. The method according to any one of claims 1 to 3, characterized in that: The application is a graphics processing program, the data to be processed is rendering data, the first processing result is a first rendering graphic, the second processing result is a second rendering graphic, and the first rendering graphic and the second rendering graphic constitute a rendering graphic.
6. A data processing method, characterized in that: Applied to the second device, comprising: receiving a first calling instruction sent by a first device, where the first calling instruction is generated by the first device based on a first type of interface, where the first type of interface is obtained by dividing a plurality of interfaces by the first device according to whether the plurality of interfaces are related to an operating system of the first device, where the plurality of interfaces are called by an application program running on the first device, and where the first type of interface is not related to the operating system; In response to the first calling instruction, and based on the first type of interface, calling the target hardware on the second device to process a first part of the data to be processed to obtain a first processing result, wherein the data to be processed includes the first part of the data to be processed and a second part of the data to be processed, and the second part of the data to be processed is configured as the first device searching for a target interface with a lower version and matching functions corresponding to the second type of interface, and based on the target interface, calling the target hardware on the first device to process the second part of the data to be processed to obtain a second processing result; The first processing result is sent to the first device.
7. A data processing device, characterized in that: include: A first processing module is configured to determine multiple interfaces called by an application corresponding to data to be processed, wherein the application runs on a first device; divide the multiple interfaces into a first type of interface and a second type of interface according to whether the multiple interfaces are related to an operating system of the first device, wherein the first type of interface is not related to the operating system and the second type of interface is related to the operating system; based on the first type of interface, send a first call instruction to a second device, and the second device responds to the first call instruction, so that the second device calls the target hardware on the second device based on the first type of interface to process a first part of the data to be processed to obtain a first processing result; and obtain the first processing result sent by the second device; A matching module, used for searching for a target interface with a lower version and matching functionality corresponding to the second type of interface; The second processing module is used to call the target hardware on the first device to process the second part of the data to be processed based on the target interface to obtain a second processing result; and obtain the processing result of the data to be processed based on the first processing result and the second processing result.
8. A data processing device, characterized in that: include: a calling module, configured to receive a first calling instruction sent by a first device, wherein the first calling instruction is generated by the first device based on a first type of interface, wherein the first type of interface is obtained by dividing a plurality of interfaces by the first device according to whether the plurality of interfaces are related to an operating system of the first device, and the plurality of interfaces are called by an application program running on the first device, wherein the first type of interface is not related to the operating system; A third processing module is used to respond to the first calling instruction and based on the first type of interface, call the target hardware on the second device to process the first part of the data to be processed to obtain a first processing result, wherein the data to be processed includes the first part of the data to be processed and the second part of the data to be processed, and the second part of the data to be processed is configured by the first device to search for a target interface with a lower version and matching function corresponding to the second type of interface, and based on the target interface, call the target hardware on the first device to process the second part of the data to be processed to obtain a second processing result; and send the first processing result to the first device.
9. A data processing system, characterized in that: comprising a first device and a second device; The first device is used to determine multiple interfaces called by an application corresponding to data to be processed, and the application is running on the first device; according to whether the multiple interfaces are related to the operating system of the first device, the multiple interfaces are divided into a first type of interface and a second type of interface, wherein the first type of interface is not related to the operating system, and the second type of interface is related to the operating system; based on the first type of interface, a first call instruction is sent to the second device, and the second device responds to the first call instruction, so that the second device calls the target hardware on the second device based on the first type of interface to process the first part of the data to be processed to obtain a first processing result; obtain the first processing result sent by the second device; find a target interface with a lower version and matching function corresponding to the second type of interface, and based on the target interface, call the target hardware on the first device to process the second part of the data to be processed to obtain a second processing result; obtain the processing result of the data to be processed based on the first processing result and the second processing result; The second device is used to receive a first call instruction sent by the first device, the first call instruction is generated by the first device based on a first type of interface, the first type of interface is obtained by dividing the first device according to whether multiple interfaces are related to the operating system of the first device, and the multiple interfaces are called by the application running on the first device; in response to the first call instruction, and based on the first type of interface, call the target hardware on the second device to process the first part of the data to be processed to obtain a first processing result, wherein the data to be processed includes the first part of the data to be processed and the second part of the data to be processed, the second part of the data to be processed is configured as the first device searches for a target interface with a lower version and matching function corresponding to the second type of interface, and based on the target interface, calls the target hardware on the first device to process the second part of the data to be processed to obtain a second processing result; and sends the first processing result to the first device.
