Transplanting method and device for Wayland embedded graphic application
Through automated toolchain configuration and standardized source code processing, the Wayland protocol transplantation process on embedded systems is simplified, and the complex transplantation process and compatibility problems in the existing technology are solved, and efficient and stable Wayland protocol transplantation is achieved to ensure that the application is Domestic architecture is operating normally.
Patent Information
- Application Number
- CN202411042131.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-29
AI Technical Summary
The porting process of the existing Wayland protocol on embedded systems is complex and cumbersome, the tool chain acquisition and environment configuration are complex, the source code configuration is prone to errors, and dependency problems and compatibility problems are often encountered during the compilation process, and stability and compatibility are difficult to guarantee.
Through automated toolchain configuration, standardized source code configuration and automated compilation and testing, the porting process of Wayland protocol is simplified, ensuring that the toolchain is accurately matched with the target platform, reducing manual intervention, and solving stability and compatibility issues.
It significantly simplifies the porting process of Wayland protocol on embedded systems, improves system stability and application compatibility, ensures that the application runs normally on the Linux operating system with domestic architectures, and improves graphics processing efficiency and response speed.
Smart Images

Figure CN119045882A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of embedded system and graphics application development, and in particular to a transplantation method and apparatus, computing device and storage medium of a Wayland embedded graphics application. Background Art
[0002] In the current field of embedded system and graphics application development, the existing porting process includes tool chain acquisition and environment configuration, source code acquisition and configuration, compilation and construction, adaptation and optimization. However, there are many problems in porting the Wayland protocol, which are mainly reflected in the following aspects:
[0003] 1. Toolchain acquisition and environment configuration:
[0004] oObtaining a compilation toolchain suitable for a target platform is often complex because it requires an exact match of the target platform's architecture (e.g., ARM, x86, etc.) and operating system version (e.g., different Linux distributions).
[0005] oThe environment configuration process is tedious and complicated, requiring careful setting of various environment variables and paths to ensure that the toolchain can work correctly on the target platform.
[0006] 2. Source code acquisition and configuration:
[0007] oSource code configuration usually requires manual modification of a series of configuration files, which increases the possibility of errors.
[0008] oIn some cases, it may also be necessary to manually add patch files to fix known issues or implement specific features.
[0009] 3. Compile and build:
[0010] oDependency issues often occur during compilation, where some required libraries or header files are missing.
[0011] oCompile errors are also common problems. These errors may be caused by incompatible configuration options or other technical obstacles.
[0012] 4. Adaptation and optimization:
[0013] oStability issues are another challenge, especially when graphics drivers are incompatible or hardware acceleration is unstable.
[0014] o Compatibility issues will also arise, as different graphics libraries and applications may require different adaptation layers to support the Wayland protocol. Summary of the invention
[0015] In view of the above problems in the prior art, the present application provides a method and apparatus for porting a Wayland embedded graphics application, a computing device, and a storage medium, so as to simplify the porting process of the Wayland embedded graphics application.
[0016] To achieve the above-mentioned purpose, the first aspect of the present application provides a method for porting a Wayland embedded graphics application, which is applied to a development platform and includes:
[0017] Receive the hardware architecture of the target platform for transplanting the Wayland embedded graphics application, the target operating system and the image library adapted to the hardware architecture of the target platform selected by the user;
[0018] The kernel of the target operating system is configured to support the Wayland protocol, and the graphics library is configured to be compatible with the hardware architecture of the target platform and the target operating system;
[0019] Selecting and installing a cross-compilation tool chain based on the hardware architecture of the target platform, and configuring the cross-compilation tool chain to be suitable for the hardware architecture of the target platform;
[0020] Configuring the development environment of the target operating system to support building and running of embedded graphics applications;
[0021] Obtaining the source code of the Wayland protocol, modifying the source code of the Wayland protocol to be suitable for the target operating system, using the cross-compilation tool chain to compile the modified source code of the Wayland protocol to generate a first file, and sending the first file to the target platform;
[0022] Obtaining the source code of the graphics library, using the cross-compilation tool chain to compile the source code of the graphics library to generate a second file, and sending the second file to the target platform;
[0023] The source code of the embedded graphics application is obtained, the source code of the embedded graphics application is modified to be suitable for the target operating system, the modified source code of the embedded graphics application is compiled using the cross-compilation tool chain to generate a third file, and the third file is sent to the target platform.
[0024] From the above, this application selects the cross-compilation tool chain installation configuration based on the hardware architecture of the target platform selected by the user, the target operating system and the image library adapted to the hardware architecture of the target platform, so as to ensure that the cross-compilation tool chain is accurately matched with the target platform. Automatically configure the kernel, graphics library, and cross-compilation tool chain of the target operating system, and automatically modify the source code of the Wayland protocol and the source code of the embedded graphics application. The configuration process is simple and can reduce the need for manual intervention. Use the configured cross-compilation tool chain to automatically compile the modified source code of the Wayland protocol, the source code of the graphics library, and the modified source code of the embedded graphics application to ensure the smooth progress of the compilation process. Because the selected image library and cross-compilation tool chain are adapted to the hardware architecture and target operating system of the target platform, stability and compatibility issues can be solved.
[0025] As a possible implementation of the first aspect, configuring the cross-compilation tool chain to be suitable for the hardware architecture of the target platform includes:
[0026] Add the executable file path of the cross-compilation toolchain to the system's PATH environment variable;
[0027] Configuring the applicable hardware architecture of the cross-compilation tool chain to be the hardware architecture of the target platform;
[0028] Configuring the cross-compilation tool chain to be suitable for the hardware architecture of the target platform also includes: configuring one or more of the following tool chain parameters:
[0029] Configure the compilation optimization level and code generation options of the cross-compilation toolchain.
[0030] As a possible implementation of the first aspect, modifying the source code of the Wayland protocol to be applicable to the target operating system includes one or more of the following:
[0031] Modify the corresponding input device source code, window manager source code, and rendering pipeline source code in the Wayland source code.
[0032] As a possible implementation manner of the first aspect, modifying the source code of the embedded graphics application to be applicable to the target operating system includes:
[0033] Modify the compilation options, path settings, and library linking methods in the source code of the embedded graphics application.
[0034] As a possible implementation of the first aspect, the following also includes:
[0035] Check whether the libraries and components that the source code of the embedded graphics application depends on are missing. If missing, obtain the missing dependent libraries and components for installation and configuration.
[0036] As a possible implementation of the first aspect, the following also includes:
[0037] Receive a test request selected by a user;
[0038] According to the test request, the first file, the second file and the third file are sent to the target platform for testing.
[0039] To achieve the above-mentioned purpose, the second aspect of the present application provides a method for porting a Wayland embedded graphics application, which is applied to a target platform and includes:
[0040] Receive a first file sent by a development platform, wherein the first file is generated by compiling the modified Wayland protocol source code by the development platform using a cross-compilation tool chain, the cross-compilation tool chain is adapted to the hardware architecture of the target platform, and the Wayland protocol is deployed and installed based on the first file;
[0041] Receive a second file sent by the development platform, wherein the second file is generated by compiling the source code of the graphics library by the development platform using a cross-compilation tool chain, the graphics library is adapted to the hardware architecture of the target platform, and the graphics library is deployed and installed based on the second file;
[0042] A third file sent by a development platform is received, wherein the third file is generated by compiling the modified source code of the embedded graphics application by the development platform using a cross-compilation tool chain, the modified source code of the embedded graphics application is applicable to the target operating system, and the embedded graphics application is run based on the third file.
[0043] To achieve the above-mentioned purpose, the third aspect of the present application provides a Wayland embedded graphics application transplantation device, which is applied to a development platform and includes:
[0044] A target platform selection module is used to receive the hardware architecture of the target platform for transplanting the Wayland embedded graphics application, the target operating system and the image library adapted to the hardware architecture of the target platform selected by the user;
[0045] An automatic configuration module, configured to configure the kernel of the target operating system to support the Wayland protocol, configure the graphics library to be compatible with the hardware architecture of the target platform and the target operating system; configure the development environment of the target operating system to support the construction and operation of embedded graphics applications;
[0046] A cross-compilation tool chain installation and configuration module, used to select and install a cross-compilation tool chain based on the hardware architecture of the target platform, and configure the cross-compilation tool chain to run on the hardware architecture of the target platform;
[0047] A transplantation module is used to obtain the source code of the Wayland protocol, modify the source code of the Wayland protocol to be suitable for the target operating system, and use the cross-compilation tool chain to compile the modified source code of the Wayland protocol to generate a first file, wherein the first file is used for transplanting to the target platform; obtain the source code of the graphics library, and use the cross-compilation tool chain to compile the source code of the graphics library to generate a second file, wherein the second file is used for transplanting to the target platform; obtain the source code of the embedded graphics application, modify the source code of the embedded graphics application to be suitable for the target operating system, and use the cross-compilation tool chain to compile the modified source code of the embedded graphics application to generate a third file, wherein the third file is used for transplanting to the target platform.
[0048] To achieve the above-mentioned purpose, the fourth aspect of the present application provides a Wayland embedded graphics application transplantation device, which is applied to a target platform and includes:
[0049] A first receiving and installing module is used to receive a first file sent by a development platform, wherein the first file is generated by compiling the modified Wayland protocol source code by the transplantation platform using a cross-compilation tool chain, the cross-compilation tool chain is adapted to the hardware architecture of the target platform, and the Wayland protocol is deployed and installed based on the first file;
[0050] A second receiving and installing module is used to receive a second file sent by a development platform, wherein the second file is generated by compiling the source code of the modified graphics library on which the Wayland protocol depends using a cross-compilation tool chain on the porting platform, the graphics library is adapted to the hardware architecture of the target platform, and the graphics library is deployed and installed based on the second file;
[0051] The third receiving and installing module is used to receive a third file sent by the development platform, wherein the third file is generated by compiling the modified source code of the embedded graphics application by the transplantation platform using a cross-compilation tool chain, the modified source code of the embedded graphics application is suitable for the target operating system, and the embedded graphics application is run based on the third file.
[0052] A fifth aspect of the present application provides a computing device, including:
[0053] processor, and
[0054] A memory having program instructions stored thereon, wherein when the program instructions are executed by the processor, the processor executes any of the methods described in the first aspect above.
[0055] In a sixth aspect, the present application provides a computer-readable storage medium having program instructions stored thereon, wherein when the program instructions are executed by a computer, the computer implements any of the methods described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a flowchart of an embodiment of a method for porting a Wayland embedded graphics application provided in an embodiment of the present application;
[0057] Figure 2 A flowchart of a specific implementation method of a Wayland embedded graphics application transplantation method provided in an embodiment of the present application;
[0058] Figure 3 This is a schematic diagram of selecting a target platform and an operating system provided in Example 1 of the present application;
[0059] Figure 4 This is a schematic diagram of the automatic configuration environment provided in Example 1 of the present application;
[0060] Figure 5 A schematic diagram of transplanting the Wayland protocol and graphics library provided in Example 1 of the present application;
[0061] Figure 6 This is a schematic diagram of transplanting and compiling a VLC media player provided in Embodiment 1 of the present application;
[0062] Figure 7 This is a schematic diagram of running and testing the VLC media player provided in Embodiment 1 of the present application;
[0063] Figure 8 This is a schematic diagram of the result feedback provided in Example 1 of the present application;
[0064] Fig. 9 A schematic structural diagram of a Wayland embedded graphics application transplantation device (applied to a development platform) provided in an embodiment of the present application;
[0065] Fig.10 It is a structural schematic diagram of a computing device provided in an embodiment of the present application.
[0066] It should be understood that the size and shape of each block diagram in the above structural diagram are for reference only and should not constitute an exclusive interpretation of the embodiment of the present invention. The relative position and inclusion relationship between the blocks presented in the structural diagram are only schematic representations of the structural association between the blocks, and do not limit the physical connection method of the embodiment of the present invention. DETAILED DESCRIPTION
[0067] The technical solution provided by the present application is further described below with reference to the accompanying drawings and examples. It should be understood that the system structure and business scenarios provided in the examples of the present application are mainly to illustrate the possible implementation methods of the technical solution of the present application and should not be interpreted as the only limitation on the technical solution of the present application. It is known to those of ordinary skill in the art that with the evolution of the system structure and the emergence of new business scenarios, the technical solution provided by the present application is also applicable to similar technical problems.
[0068] It should be understood that the transplantation solution of the Wayland embedded graphics application provided in the embodiment of the present application includes a transplantation method and device of the Wayland embedded graphics application. Since the principles of solving the problems in these technical solutions are the same or similar, some repetitions may not be repeated in the introduction of the following specific embodiments, but it should be regarded as that these specific embodiments have been referenced to each other and can be combined with each other.
[0069] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present application. In case of any inconsistency, the meaning described in this specification or the meaning derived from the contents recorded in this specification shall prevail. In addition, the terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0070] [First embodiment of the transplantation method of Wayland embedded graphics application]
[0071] In order to solve the problems existing in the existing transplantation of the Wayland protocol, the first embodiment of the present application provides a transplantation method for a Wayland embedded graphics application, which is applied to a development platform such as Figure 1 As shown, including:
[0072] S110: receiving the hardware architecture of the target platform for porting the Wayland embedded graphics application, the target operating system and the image library adapted to the hardware architecture of the target platform selected by the user;
[0073] S120: configuring the kernel of the target operating system to support the Wayland protocol, and configuring the graphics library to be compatible with the hardware architecture of the target platform and the target operating system;
[0074] S130: Selecting and installing a cross-compilation tool chain based on the hardware architecture of the target platform, and configuring the cross-compilation tool chain to be suitable for the hardware architecture of the target platform;
[0075] S140: Configuring the development environment of the target operating system to support the construction and operation of embedded graphics applications;
[0076] S150: Obtain the source code of the Wayland protocol, modify the source code of the Wayland protocol to be suitable for the target operating system, use the cross-compilation tool chain to compile the modified source code of the Wayland protocol to generate a first file, and send the first file to the target platform;
[0077] S160: Acquire the source code of the graphics library, use the cross-compilation tool chain to compile the source code of the graphics library to generate a second file, and send the second file to the target platform;
[0078] S170: Obtain source code of the embedded graphics application, modify the source code of the embedded graphics application to be suitable for the target operating system, use the cross-compilation tool chain to compile the modified source code of the embedded graphics application to generate a third file, and send the third file to the target platform.
[0079] From the above, this application selects the cross-compilation tool chain installation configuration based on the hardware architecture of the target platform selected by the user, the target operating system and the image library adapted to the hardware architecture of the target platform, so as to ensure that the cross-compilation tool chain is accurately matched with the target platform. Automatically configure the kernel, graphics library, and cross-compilation tool chain of the target operating system, and automatically modify the source code of the Wayland protocol and the source code of the embedded graphics application. The configuration process is simple and can reduce the need for manual intervention. Use the configured cross-compilation tool chain to automatically compile the modified source code of the Wayland protocol, the source code of the graphics library, and the modified source code of the embedded graphics application to ensure the smooth progress of the compilation process. Because the selected image library and cross-compilation tool chain are adapted to the hardware architecture and target operating system of the target platform, stability and compatibility issues can be solved.
[0080] The following describes in detail the steps of the method for porting the Wayland embedded graphics application proposed in this application.
[0081] In some embodiments, S110 and S120 are specifically performed as follows:
[0082] 1. Determine the target platform architecture
[0083] In the implementation of this application, the user needs to determine the hardware architecture of the target platform through the graphical user interface. The clear definition of the hardware architecture type will directly affect the subsequent software and hardware selection and the execution of the entire porting process. The differences in instruction sets, register layouts, byte orders, etc. between different hardware architectures will affect the porting of embedded graphics applications. The hardware platform can be a general hardware architecture, such as x86, ARM, MIPS, etc., or it can be a domestically developed hardware architecture platform, such as Phytium and Longson architectures. When deciding the target platform, it is necessary to consider the performance requirements of embedded graphics applications, the availability of hardware resources, and the degree of support for domestically developed platforms.
[0084] 2. Determine the target operating system version and kernel configuration
[0085] After clarifying the architecture type of the target platform's hardware architecture, you need to ensure that the selected hardware architecture is coordinated with the selected operating system version.
[0086] According to the characteristics of the hardware architecture of the target platform selected above, select the applicable operating system version, such as Linux distribution, Windows version, Android version, real-time operating system (RTOS) and domestic operating system, etc., and the selected operating system version must support the Wayland protocol.
[0087] Then the kernel of the operating system needs to be configured to support the functions and drivers required by Wayland. Kernel configuration is a key step in the development and porting of embedded systems, especially when porting Wayland embedded graphics applications. In order for the operating system to provide graphics display through Wayland, the kernel needs to be correctly configured and compiled to include the necessary functions and drivers. The kernel configuration needs to include enabling or configuring functional modules related to graphics display and input devices. The kernel configuration involves settings such as file system support, device drivers, and porting of Wayland embedded graphics applications.
[0088] Among them, (1) file system supports:
[0089] (11) The kernel needs to support the file system type used to store and access application data. For example, file systems such as ext4, Btrfs, or F2FS are commonly used to store user data and system configuration.
[0090] (12) For Wayland, special attention may need to be paid to the tmpfs and shm (shared memory) file systems, as they are often used for temporary storage of graphics data and inter-process communication.
[0091] (2) Device driver:
[0092] (21) Drivers are the bridge between hardware and software. For graphics display, they are the drivers of GPU (Graphics Processing Unit), which are responsible for processing graphics commands sent from the CPU.
[0093] (22) For Wayland, you may need to ensure that the kernel supports frameworks like DRM (Direct Rendering Manager), which provides an interface for interacting with the GPU. DRM drivers such as Intel i915, AMD Radeon, or NVIDIA Tegra may need to be enabled or configured, depending on the hardware.
[0094] (3) Porting of Wayland embedded graphics applications:
[0095] (31)Wayland takes advantage of the features of modern GPUs and displays, which typically requires extensive porting and buffer swapping mechanisms for Wayland embedded graphics applications.
[0096] (32) The kernel's Wayland embedded graphics application porting subsystem should be configured to efficiently handle large contiguous memory areas, which is required for graphics rendering.
[0097] (4) Graphics and input device related functional modules:
[0098] (41) Kernel modules related to graphics display and input devices need to be enabled or configured. This may include the input subsystem (such as evdev), as well as modules related directly or indirectly to display output.
[0099] (42) Some modules may require additional configuration, such as IOMMU (I / O Memory Management Unit) support, which can improve graphics performance in virtualized environments and is necessary for some modern GPUs.
[0100] This application provides standardized configuration templates and scripts, so the above kernel configuration can be configured by selecting the configuration template of the existing operating system kernel configuration. The kernel configuration is performed through configuration tools such as menuconfig, nconfig or guiconfig, which provide a graphical or text interface to select and configure kernel modules. In the automated migration tool, this process can be automatically executed by scripts to ensure the consistency and accuracy of each configuration.
[0101] If users want to customize the kernel configuration they need, they can also use configuration tools such as menuconfig, nconfig or guiconfig to modify the configuration template, select and configure different kernel options.
[0102] Once configured, the kernel is recompiled to produce a new kernel image which is then deployed to the target platform to support Wayland or any other desired system features.
[0103] 3. Determine the graphics library and configuration
[0104] Graphics library selection and configuration is an important part of the embedded graphics application migration process, which directly affects the performance and compatibility of the application. Therefore, after the above operating system selection and kernel configuration and customization, it is necessary to select and configure a graphics library suitable for the hardware architecture of the target platform, such as OpenGL, Vulkan or other embedded graphics libraries, to ensure that the selected graphics library is compatible with the target operating system and hardware platform. Different hardware architectures require different graphics library implementations.
[0105] Then, according to the characteristics and performance requirements of the hardware architecture of the target platform, the graphics library is configured to optimize its performance and ensure that it can fully utilize the hardware characteristics of the target platform. This usually includes:
[0106] (1) Set rendering parameters: for example, select the best pixel format, anti-aliasing mode, blending mode, etc. to improve rendering quality or speed.
[0107] (2) Optimize the rendering pipeline: Adjust the settings of the rendering pipeline, such as the use of vertex shaders, fragment shaders, and rendering state settings, to achieve optimal rendering performance.
[0108] (3) Manage textures and buffers, etc.: Rationally allocate and manage the memory of textures and buffers to avoid unnecessary memory copies and reduce bandwidth consumption.
[0109] This application provides standardized configuration templates and scripts, so the above-mentioned graphics library configuration can be configured by selecting an existing configuration template. In the automated migration tool, this process can be automatically executed by a script to ensure the consistency and accuracy of each configuration.
[0110] If the user wants to customize the graphics library configuration that he needs, he can also modify it based on the configuration template, select and configure different graphics library parameter options.
[0111] In some embodiments, configuring the cross-compilation tool chain to be suitable for the hardware architecture of the target platform includes:
[0112] Add the executable file path of the cross-compilation toolchain to the system's PATH environment variable;
[0113] Configuring the applicable hardware architecture of the cross-compilation tool chain to be the hardware architecture of the target platform;
[0114] Configuring the cross-compilation tool chain to be suitable for the hardware architecture of the target platform also includes: configuring one or more of the following tool chain parameters:
[0115] Configure the compilation optimization level and code generation options of the cross-compilation toolchain.
[0116] S130 is specifically performed as follows:
[0117] A cross-compilation toolchain is a set of key tools used to develop, compile, and build software on one computer architecture to run on another computer architecture. A cross-compilation toolchain typically includes, but is not limited to, the following components:
[0118] Compiler: Such as GCC (GNU Compiler Collection), used to convert source code into target machine language.
[0119] Linker: Used to connect compiled target files and library files to generate executable files.
[0120] Assembler: Converts assembly language into machine language.
[0121] Binary Utilities: including objcopy, objdump, etc., used to process target files.
[0122] First, select the appropriate cross-compilation tool chain according to the architecture type of the target hardware platform (such as ARM, MIPS, PowerPC, etc.), then obtain the selected cross-compilation tool chain and install it, and ensure that the executable file path of the cross-compilation tool chain is added to the system's PATH environment variable, so that when the compiler is called in the command line, the system can find the correct cross-compiler. After completing the installation of the cross-compilation tool chain, you need to set the tool chain parameters such as the default target platform architecture, compilation optimization level, and code generation options. When these parameters are set and the tool chain configuration is completed, you can start writing code and use make or similar tools for cross-compilation. During compilation, the tool chain will generate executable binary files for the target platform according to the parameters you set.
[0123] Among them, (1) Target platform architecture: This is usually specified in the prefix of the cross-compilation toolchain, such as arm-linux-gcc.
[0124] (2) Compilation optimization level: This determines the degree of optimization for speed and size when the compiler generates code. Common options include -00 (no optimization), -01 (moderate optimization), -02 (further optimization), and -03 (maximum optimization).
[0125] (3) Code generation options: This can include whether to enable debugging information, whether to use position-independent code (PIC), etc.
[0126] This application provides standardized configuration templates and scripts, so the above cross-compilation tool chain parameter configuration can be configured by selecting an existing configuration template. In the automated migration tool, this process can be automatically executed by a script to ensure the consistency and accuracy of each configuration.
[0127] If the user wants to customize the cross-compilation toolchain configuration that he needs, he can also modify it based on the configuration template of the cross-compilation toolchain parameters, and select and configure different cross-compilation toolchain parameter options.
[0128] In some embodiments, S140 is specifically performed as follows:
[0129] In the process of porting embedded graphics applications, after successfully configuring the cross-compilation tool chain, the next step is to configure the development environment of the target operating system, which involves installing the necessary development tools and libraries on the development platform according to the selected operating system version, setting environment variables, configuring build tools, and possibly selecting a suitable IDE so that the application can be correctly built and run on the target platform.
[0130] The necessary development tools and libraries include but are not limited to cross-compilation library device drivers, debugging tools, etc. to support the construction and operation of embedded applications on the target operating system. The details are as follows:
[0131] (1) Cross-compilation libraries: These libraries are designed to be compatible with the target platform and usually include standard C / C++ libraries, graphics libraries (such as OpenGL ES and Vulkan), input device libraries (such as libinput), etc. They must match the cross-compilation toolchain you choose.
[0132] (2) Device drivers: To support graphics and input devices, that is, applications need to interact with hardware, and drivers compatible with the target hardware need to be installed. These drivers are usually included in the kernel, but may also require additional user space components. For example, if you use a GPU for graphics processing, you may need to install the header files and libraries of the device drivers related to the target platform.
[0133] (3) Debugging tools: In order to debug the application on the target platform, you can install debugging tools such as GDB (GNU Debugger) or LLDB. In addition, hardware tools such as serial port or JTAG debugger may also be required.
[0134] Then, set the environment variables so that the compiler and build tools can find the libraries and tools installed above.
[0135] Then, configure build tools such as Make, CMake, or Autotools, and configure these tools to build the applications required by users. Configuring build tools is to ensure that these build tools can recognize and use the cross-compilation chain and target platform libraries.
[0136] Then, choose a development environment (IDE). Using an IDE that supports cross-compilation and embedded development can simplify the development process. For example, Keil, CodeSourcery, Eclipse CDT, etc. all provide embedded development support. IDE can integrate compilation, debugging and project management functions to provide a unified development interface.
[0137] After the above configuration selection process, a complete development environment can be created for the user's embedded graphics application, so that the application can be built, tested and debugged on the target platform.
[0138] This application provides standardized configuration templates and scripts, so the above development environment configuration can be configured by selecting an existing configuration template. In the automated migration tool, this process can be automatically executed by a script to ensure the consistency and accuracy of each configuration.
[0139] If users want to customize the development environment configuration they need, they can also modify it based on the configuration template of the development environment, select and configure different development environment options.
[0140] In some embodiments, the source code of the Wayland protocol is modified to be applicable to the target operating system, including one or more of the following:
[0141] Modify the corresponding input device source code, window manager source code, and rendering pipeline source code in the Wayland source code.
[0142] S150 is specifically performed as follows:
[0143] According to the operating system of the above target platform, we have a deep understanding of its architecture, kernel version, graphics subsystem and supported graphics library to ensure the compatibility of the target operating system with the Wayland protocol, then obtain the Wayland source code from the Wayland official source code repository and analyze the working principle and dependencies on the existing platform, and then adapt (i.e. modify) the Wayland source code according to the selected target platform operating system, which involves modifying the input device, window manager, rendering pipeline and other parts. After completing the above modifications, we can also check the cross-compilation tool chain to confirm that the cross-compilation tool chain is compatible with the architecture and compiler of the target operating system to avoid architecture mismatch problems during the compilation process. Then use the cross-compilation tool chain constructed above to compile the modified Wayland source code into a binary file (i.e. the first file) suitable for the target operating system, transfer the binary file to the target operating system, deploy and install it on the target platform through an automated script or package management tool, and run it, and perform functional and performance tests to verify whether the compilation and deployment process is successful.
[0144] Among them, (1) Input devices: The integration of libinput may need to be modified to adapt to the input device characteristics of the target platform, such as touch screen, keyboard and mouse.
[0145] (2) Window manager: If you use Weston as the default Wayland compositor, you may need to adjust it to suit your specific hardware and software environment.
[0146] (3) Rendering pipeline: Depending on the graphics hardware and libraries of the target platform, the rendering pipeline may need to be modified to take full advantage of hardware acceleration and avoid performance bottlenecks.
[0147] This application provides standardized configuration templates and scripts, so the above cross-compilation tool chain configuration can be configured by selecting an existing configuration template. In the automated migration tool, this process can be automatically executed by a script to ensure the consistency and accuracy of each configuration.
[0148] If the user wants to customize the cross-compilation tool chain configuration that he needs, he can also modify it based on the configuration template of the cross-compilation tool chain, and select and configure different development environment options.
[0149] In some embodiments, S160 is specifically performed as follows:
[0150] To ensure that the graphics libraries (such as EGL, OpenGL, QT, etc.) that Wayland depends on are available on the target operating system, first, obtain the source code from the official code repository of the graphics library, use the cross-compilation tool chain built above to compile the graphics library source code into a binary file (i.e., the second file) suitable for the target operating system, transfer the binary file to the target operating system, deploy and install it through automated scripts or package management tools, and test and adjust whether the graphics library can be used normally.
[0151] In some embodiments, modifying the source code of the embedded graphics application to be suitable for the target operating system includes:
[0152] Modify the compilation options, path settings, and library linking methods in the source code of the embedded graphics application.
[0153] In some embodiments, it also includes:
[0154] Check whether the libraries and components that the source code of the embedded graphics application depends on are missing. If missing, obtain the missing dependent libraries and components for installation and configuration.
[0155] S170 is specifically performed as follows:
[0156] After the above steps S150 and S160, the Wayland protocol is successfully ported to the target operating system, and the target operating system has support for the Wayland protocol, that is, the system has graphics display and window management capabilities compatible with the Wayland protocol. The next step is to port the embedded graphics application to the target operating system that supports the Wayland protocol.
[0157] First, receiving the source code path of the embedded graphics application input by the user, obtaining the source code of the embedded graphics application based on the source code path, and modifying its compilation options, path settings, and library linking methods based on the characteristics and requirements of the operating system of the target platform determined above, wherein:
[0158] (1) Compilation options: Adjust the compilation options according to the characteristics of the target platform, such as processor architecture, compiler version, etc. This may include optimization level, warning level, generation of debugging information, etc.
[0159] (2) Path settings: Update the paths of header files and libraries in the source code to reflect the locations on the target operating system. This usually involves modifying the path configuration in Makefile, CMakeLists.txt or other build scripts.
[0160] (3) Library linking method: Confirm whether the library linking method in the application's build script is suitable for the target platform. This includes the selection of static linking and dynamic linking, and whether the library search path is correct.
[0161] Then, check whether the libraries and components that the source code depends on are available on the target operating system (including graphics libraries, input device libraries, network libraries, etc.). If there are missing dependencies and components, they need to be installed and configured on the target operating system to meet the application's running requirements.
[0162] Then, the embedded graphics application is constructed and compiled using the cross-compilation tool chain constructed above for the source code of the modified embedded application. Before compiling, modify the Makefile or CmakeList.txt to construct the configuration file, correctly pass the required compilation options and path settings during the compilation process, and perform the compilation operation after configuration (run the Make or Cmake&&Make command to start the compilation process) to generate an executable file (i.e., the third file) of the embedded graphics application ported to the target platform. After the compilation is completed, use a file transfer tool or a version control system to move the generated executable file and other necessary resource files such as images, fonts, and configuration files to the directory of the target operating system.
[0163] In some embodiments, it also includes:
[0164] Receive a test request selected by a user;
[0165] According to the test request, the first file, the second file and the third file are sent to the target platform for testing.
[0166] In the specific implementation, an option is provided to allow the user to choose whether to automatically run the test on the target platform. If yes is selected, the development platform accepts the user's test request, and then automatically transfers the first file, the second file, and the third file (i.e., the transplanted application and related resource files) to the target platform according to the test request, and then runs the transplanted application to verify the availability and stability of the transplanted application on the target operating system, start the application, monitor its behavior and performance and perform functional tests on it, verify whether the various functions of the transplanted application are normal, and perform performance tests to evaluate its performance, and finally perform compatibility tests to ensure that the application can run normally under various circumstances.
[0167] In some embodiments, the present application provides real-time progress feedback and log information throughout the entire migration process, displays errors or warnings that occur during the migration process, and provides corresponding solutions.
[0168] In summary, in order to solve the problems existing in the above-mentioned existing Wayland protocol transplantation process, the transplantation method of Wayland embedded graphics application proposed in this application simplifies the transplantation process of Wayland protocol on embedded system through the following four key aspects:
[0169] Automated toolchain configuration: Simplify the download, installation, and configuration of toolchains through automated scripts and tools, ensuring an exact match to the target platform.
[0170] Standardized source code configuration: Provides standardized configuration templates and scripts to automatically handle common configuration modifications and patch applications, reducing the need for manual intervention.
[0171] Automated compilation and testing: Integrate automated compilation and testing frameworks to ensure the smooth progress of the compilation process, and automatically execute tests after compilation to verify the quality of the software.
[0172] · Optimization and adaptation tools: Develop specialized adaptation and optimization tools to solve stability issues and improve graphics performance.
[0173] And ensure good compatibility between different graphics libraries and applications.
[0174] The transplantation method provided in this application can significantly simplify the transplantation process of the Wayland protocol on the embedded system, improve the system stability and application compatibility after transplantation, and ensure that the application can run normally on the Linux operating system of the domestic architecture. Secondly, the transplantation expands the scope of application of the application, so that it can meet a wider range of needs. The transplantation of embedded graphics applications based on Wayland can improve the performance of graphics applications, so that they have higher graphics processing efficiency and faster response speed. In addition, the transplantation application can also strengthen the integration between software and hardware platforms, give full play to the advantages of the domestic architecture, and provide a more stable and efficient graphics application solution.
[0175] Embodiment 1:
[0176] Combination Figure 1 In this specific embodiment, a method for porting an embedded graphics application based on Wayland is introduced in detail. In this embodiment, the hardware architecture of the target platform selected is Feiteng D2000, the operating system of the target platform is the Liunx distribution built by Yocto, and the selected embedded graphics application is VLC (VideoLAN).
[0177] Feiteng Tengrui D2000 is a high-performance desktop CPU that integrates 8 high-performance processor cores FTC663 independently developed by Feiteng, compatible with the 64-bit ARMv8 instruction set, with a main frequency of 2.3-2.6GHz, a TDP power consumption of 25W, and integrates a very rich I / O interface. It supports Feiteng's self-defined processor security architecture standard PSPA1.0, meeting the performance and security requirements in more complex application scenarios.
[0178] VLC (VideoLAN Client) is a popular free, open source media player and cross-platform multimedia framework. It was developed by the VideoLAN project and can run on multiple operating systems, including Windows, macOS, Linux, iOS, Android, etc.
[0179] The specific steps of this implementation use case are as follows Figure 2 As shown, including:
[0180] Step 1: Determine the target platform and configuration
[0181] Step 1.1 Determine the target platform architecture
[0182] In the implementation of this application, the first step is to clarify the hardware architecture of the target platform. In this embodiment, Figure 3 The selection interface provided selects the hardware platform architecture, and the choice is Feiteng D2000. Feiteng D2000 is a high-performance desktop CPU with excellent processing power and diverse hardware resources. The Feiteng D2000 architecture integrates a rich I / O interface and supports the connection of multiple devices, including high-speed networks, storage devices, sensors, etc. In addition, it also complies with the processor security architecture standard PSPA1.0 defined by Feiteng to ensure data security and system reliability. When selecting the target platform, considering the powerful performance and flexibility of Feiteng D2000, it is an ideal hardware foundation for porting and running embedded graphics applications.
[0183] Step 1.2 Determine the target operating system version, kernel configuration, and graphics library
[0184] In the implementation of this application, step 1.1 defines the hardware architecture of the target platform as Feiteng D2000, and then determines the target operating system version, kernel configuration and graphics library.
[0185] 1. Target operating system version:
[0186] In order to meet the requirements of this embodiment, based on the transplantation of embedded graphics applications Figure 3 The selection interface provided allows you to choose a Linux distribution built based on Yocto.
[0187] 2. Kernel configuration and customization:
[0188] For the operating system version selected in the previous step, the kernel needs to be configured to support the functions and drivers required by Wayland. You can select the kernel configuration template corresponding to the Linux distribution built on Yocto for configuration, including enabling or configuring functional modules related to graphics display and input devices. The kernel configuration involves file system support, device drivers, and porting of Wayland embedded graphics applications.
[0189] 3. Graphics library selection and configuration:
[0190] After the above operating system selection and kernel configuration, further select and configure the graphics library suitable for Feiteng D2000. Figure 3 The selection interface provided selects the OpenGL graphics library. OpenGL is a cross-platform graphics library that is applicable to various hardware platforms and has wide support on the Linux operating system. The selected OpenGL version is OpenGL ES2.0, which is applicable to Feiteng D2000. In view of the characteristics and performance requirements of Feiteng D2000, OpenGL needs to be configured. You can choose to configure it based on the graphics library parameter configuration template corresponding to Feiteng D2000, including setting rendering parameters, optimizing rendering pipelines, pipeline textures and buffers, etc.
[0191] Step 2: Install and configure the cross-compilation tool chain and target operating system development environment
[0192] After determining the hardware architecture and operating system version of the target platform for the transplanted application in step 1, the next step is to configure the development environment for the target platform, which includes the following two steps:
[0193] Step 2.1 Install and configure the cross-compilation toolchain for the target platform architecture
[0194] In the process of porting embedded graphics applications, the second step of the embodiment of the present invention is to install and configure a cross-compilation tool chain suitable for the hardware architecture of the target platform. According to the selected hardware architecture of the target platform, the cross-compilation tool chain is generated by building the SDK package provided by Feiteng based on Yocto. First, enter the directory where the Feiteng SDK package is located. In this directory, use .. / setup-env-m d2000 to configure the environment variables (such as Figure 4 After the configuration is complete, use Yocto's bitbake tool to compile the cross-toolchain. After the build is complete, a cross-compilation toolchain suitable for the Feiteng D2000 hardware platform is generated.
[0195] Step 2.2 Configure the development environment for the target operating system
[0196] In this embodiment, after successfully configuring the cross-compilation tool chain of Feiteng D2000 in step 2.1, the development environment of the target operating system (such as Figure 4 First, install the development tools and libraries according to the version of the Linux operating system selected in step 1.2, including cross-compilation library device drivers, debugging tools, etc. to support the construction and operation of VLC, then set environment variables, configure build tools and select an appropriate integrated development environment.
[0197] Step 3: Port the Wayland protocol and graphics library to the target operating system
[0198] To ensure that the transplanted embedded application runs smoothly on the target platform, step three specifically includes the following steps:
[0199] Step 3.1 Porting Wayland protocol to the target operating system
[0200] According to the target platform operating system determined in step 1.2, deeply understand its architecture, kernel version, graphics subsystem and supported graphics library to ensure the compatibility of the target operating system with the Wayland protocol. Then obtain the Wayland source code from the Wayland official source code repository and analyze the working principle and dependencies on the existing platform. According to the target platform operating system selected in step 1.2, modify and adapt the Wayland source code, which involves modifying the input device, window manager, rendering pipeline and other parts, such as Figure 5 As shown, after completing the above modifications, use the cross-compilation tool chain built in step 2.1 to compile the modified Wayland source code into a binary file suitable for the target operating system, ensuring that the cross-compilation tool chain is compatible with the architecture and compiler of the target operating system.
[0201] Step 3.2 Porting the graphics library
[0202] After step 3.1, the porting of the Wayland protocol to the target operating system is completed. In order to ensure that the libraries that Wayland depends on are available on the target operating system, the libraries that the Wayland protocol depends on, such as EGL, OpenGL or other graphics libraries, are ported and configured. Figure 5 As shown in the figure, after completing the above porting and configuration, use the debugging tools of the target operating system to test whether the Wayland protocol runs normally in the new environment.
[0203] Step 4: Port, build, compile and run VLC media player
[0204] After step three, the Wayland protocol is successfully ported to the target operating system, and the target operating system has support for the Wayland protocol, that is, the system has graphics display and window management capabilities compatible with the Wayland protocol. The next step is to port the embedded graphics application to the target operating system that supports the Wayland protocol.
[0205] Step 4.1 Porting VLC media player source code to the target operating system
[0206] like Figure 6 As shown, based on the source code path of the VLC media player provided by the user, the source code of the VLC media player is selected and downloaded from the path, and according to the characteristics and requirements of the operating system of the target platform determined in step 1.2, the compilation options, path settings, and library linking methods of the source code of the VLC media player are modified, and it is checked whether the libraries and components on which the source code depends are available in the target operating system. If there are missing dependencies and components, they are installed and configured to meet the running requirements of the application.
[0207] Step 4.2 Build and compile the ported VLC media player
[0208] like Figure 6 As shown, in this step, use the cross-compilation tool chain built in step 2.1 and the VLC media player source code modified in step 4.1 to build and compile VLC. Before compiling, modify the Makefile or CmakeList.txt configuration file, correctly pass the required compilation options and path settings during the compilation process, and execute the compilation operation after configuration to generate the executable file of the transplanted embedded graphics application. After the compilation is completed, use the file transfer tool or version control system to move the generated executable file and other necessary resource files such as images, fonts, configuration files, etc. to the directory of the target operating system.
[0209] Step 4.3 Run the ported VLC media player
[0210] After step 4.2, the VLC media player is successfully built and compiled, and an executable binary file on the target operating system is generated, and the last step of this application is entered, such as Figure 7 As shown, an option of running and testing the VLC media player is provided. When the user chooses to run and test the VLC media player application, the ported application is run on the target operating system to verify the availability and stability of the ported application on the target operating system, start the application, monitor its behavior and performance, and perform functional tests on it to verify whether the various functions of the ported application are normal, perform performance tests to evaluate its performance, and finally perform compatibility tests to ensure that the application can run normally in various situations.
[0211] This application also provides Figure 8 The result feedback interface shown is used to provide real-time progress feedback and log information during the entire migration process, display errors or warnings that occur during the migration process, and provide corresponding solutions.
[0212] The above steps successfully ported VLC to the hardware architecture and operating system of the target platform, achieving the goal of running VLC media player on Feiteng D2000.
[0213] [Second embodiment of the transplantation method of Wayland embedded graphics application]
[0214] The second embodiment of the present application provides a method for porting a Wayland embedded graphics application, which is applied to a target platform and includes:
[0215] Receive a first file sent by a development platform, wherein the first file is generated by compiling the modified Wayland protocol source code by the development platform using a cross-compilation tool chain, the cross-compilation tool chain is adapted to the hardware architecture of the target platform, the modified Wayland protocol source code is adapted to the hardware architecture of the target platform and the target operating system, the target operating system is adapted to the hardware architecture of the target platform, and the Wayland protocol is deployed and installed based on the first file;
[0216] Receive a second file sent by the development platform, wherein the second file is generated by compiling the source code of the graphics library by the development platform using a cross-compilation tool chain, the graphics library is adapted to the hardware architecture of the target platform and the target operating system, and the graphics library is deployed and installed based on the second file;
[0217] A third file sent by the development platform is received, wherein the third file is generated by compiling the modified source code of the embedded graphics application by the development platform using a cross-compilation tool chain, and the embedded graphics application is run based on the third file.
[0218] [The first embodiment of the transplantation device of the Wayland embedded graphics application of the present application]
[0219] like Fig. 9 As shown, the embodiment of the present application provides a Wayland embedded graphics application transplantation device, which is applied to a development platform. The Wayland embedded graphics application transplantation device can be used to implement the Wayland embedded graphics application transplantation method in the above embodiment, such as Fig. 9As shown, the transplantation device for the Wayland embedded graphics application comprises a target platform selection module 901 , an automatic configuration module 902 , a cross-compilation tool chain installation and configuration module 903 , and a transplantation module 904 .
[0220] A target platform selection module is used to receive the hardware architecture of the target platform for transplanting the Wayland embedded graphics application, the target operating system and the image library adapted to the hardware architecture of the target platform selected by the user;
[0221] An automatic configuration module, configured to configure the kernel of the target operating system to support the Wayland protocol, configure the graphics library to be compatible with the hardware architecture of the target platform and the target operating system; configure the development environment of the target operating system to support the construction and operation of embedded graphics applications;
[0222] A cross-compilation tool chain installation and configuration module, used to select and install a cross-compilation tool chain based on the hardware architecture of the target platform, and configure the cross-compilation tool chain to run on the hardware architecture of the target platform;
[0223] A transplantation module is used to obtain the source code of the Wayland protocol, modify the source code of the Wayland protocol to be suitable for the target operating system, and use the cross-compilation tool chain to compile the modified source code of the Wayland protocol to generate a first file, wherein the first file is used for transplanting to the target platform; obtain the source code of the graphics library, and use the cross-compilation tool chain to compile the source code of the graphics library to generate a second file, wherein the second file is used for transplanting to the target platform; obtain the source code of the embedded graphics application, modify the source code of the embedded graphics application to be suitable for the target operating system, and use the cross-compilation tool chain to compile the modified source code of the embedded graphics application to generate a third file, wherein the third file is used for transplanting to the target platform.
[0224] Among them, the target platform selection module, automatic configuration module, and cross-compilation tool chain installation and configuration module provide necessary preliminary preparations for the entire transplantation process, allowing users to easily select target configurations, configure development environments, and obtain the correct compilation tool chain.
[0225] The function of the migration module is to migrate the Wayland protocol, graphics library and application selected by the user to the target platform, providing automated support for the migration process of the entire embedded graphics application.
[0226] In addition, a test module is provided, whose functions include:
[0227] (1) Automatically run the test: Provides an option to allow users to choose whether to automatically run the test on the target platform. If selected, the ported application and related resource files are automatically transferred to the target platform, and then the test program is run to collect performance and compatibility data.
[0228] (2) Result feedback: Provide real-time progress feedback and log information throughout the migration process, display errors or warnings that occur during the migration process, and provide corresponding solutions. This provides users with comprehensive test feedback, allowing them to track each step of the migration process, deal with potential problems in a timely manner, and ensure the success of the migration and the stability of the application.
[0229] For details, please refer to the detailed description in the method embodiment, which will not be repeated here.
[0230] This application provides the beneficial effects obtained by the above-mentioned Wayland embedded graphics application transplantation device:
[0231] This application provides an automatic configuration module, so that users can easily select the kernel configuration, graphics library configuration, and configuration development environment of the target operating system of the target configuration. Through the cross-compilation tool chain installation and configuration module, users can easily obtain the correct compilation tool chain. Through the transplantation module, automatic support is provided for the transplantation of the Wayland protocol, graphics library, and application selected by the user on the target platform. Through the test module, comprehensive test feedback is provided to users to help them track the steps in the transplantation process, deal with potential problems in a timely manner, and ensure the success of the transplantation and the stability of the application. In summary, the purpose of this application is to simplify the process of transplanting Wayland embedded graphics applications, improve the transplantation efficiency of Wayland embedded graphics applications, reduce the difficulty of user operation, and ensure the reliability and stability of the application on the target platform.
[0232] [Second embodiment of the transplantation device of the Wayland embedded graphics application of the present application]
[0233] The embodiment of the present application provides a Wayland embedded graphics application transplantation device, which is applied to a target platform. The Wayland embedded graphics application transplantation device can be used to implement the Wayland embedded graphics application transplantation method in the above embodiment. The Wayland embedded graphics application transplantation device has:
[0234] A first receiving and installing module is used to receive a first file sent by a development platform, wherein the first file is generated by compiling the modified Wayland protocol source code by the development platform using a cross-compilation tool chain, the cross-compilation tool chain is adapted to the hardware architecture of the target platform, the modified Wayland protocol source code is adapted to the hardware architecture of the target platform and the target operating system, the target operating system is adapted to the hardware architecture of the target platform, and the Wayland protocol is deployed and installed based on the first file;
[0235] A second receiving and installing module is used to receive a second file sent by the development platform, wherein the second file is generated by compiling the source code of the graphics library by the development platform using a cross-compilation tool chain, the graphics library is adapted to the hardware architecture of the target platform and the target operating system, and the graphics library is deployed and installed based on the second file;
[0236] The third receiving and installing module is used to receive a third file sent by the development platform, wherein the third file is generated by compiling the modified source code of the embedded graphics application by the transplantation platform using a cross-compilation tool chain, the modified source code of the embedded graphics application is suitable for the target operating system, and the embedded graphics application is run based on the third file.
[0237] [Embodiment of the computing device of the present application]
[0238] Fig.10 900 is a schematic structural diagram of a computing device 900 provided in an embodiment of the present application. The computing device can be used as a transplantation device for a Wayland embedded graphics application, and executes each optional embodiment of the transplantation method for a Wayland embedded graphics application. The computing device can be a terminal, or a chip or chip system inside a terminal. Fig.10 As shown, the computing device 900 includes: a processor 910 , a memory 920 , and a communication interface 930 .
[0239] It should be understood that Fig.10 The communication interface 930 in the computing device 900 shown may be used to communicate with other devices, and may specifically include one or more transceiver circuits or interface circuits.
[0240] The processor 910 may be connected to a memory 920. The memory 920 may be used to store the program code and data. Therefore, the memory 920 may be a storage unit inside the processor 910, or an external storage unit independent of the processor 910, or a component including a storage unit inside the processor 910 and an external storage unit independent of the processor 910.
[0241] Optionally, the computing device 900 may further include a bus. The memory 920 and the communication interface 930 may be connected to the processor 910 via the bus. The bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 A line without an arrow is used to represent the bus, but this does not mean that there is only one bus or one type of bus.
[0242] It should be understood that in the embodiment of the present application, the processor 910 may adopt a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Alternatively, the processor 910 may adopt one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiment of the present application.
[0243] The memory 920 may include a read-only memory and a random access memory, and provides instructions and data to the processor 910. A portion of the processor 910 may also include a nonvolatile random access memory. For example, the processor 910 may also store information on the device type.
[0244] When the computing device 900 is running, the processor 910 executes the computer-executable instructions in the memory 920 to perform any operation step of the above method and any optional embodiment thereof.
[0245] It should be understood that the computing device 900 according to the embodiment of the present application can correspond to the corresponding subjects in the methods according to the embodiments of the present application, and the above-mentioned and other operations and / or functions of each module in the computing device 900 are respectively for implementing the corresponding processes of each method of the present embodiment. For the sake of brevity, they will not be repeated here.
[0246] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0247] 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.
[0248] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0249] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0250] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0251] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0252] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it is used to execute the above method, which includes at least one of the solutions described in the above embodiments.
[0253] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive lists) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing programs, which can be used by instruction execution systems, devices or devices or used in combination with them.
[0254] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0255] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0256] Computer program code for performing the operation of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., using an Internet service provider to connect through the Internet).
[0257] In addition, the words "first, second, third, etc." or module A, module B, module C and other similar terms in the specification and claims are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0258] In the above description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps will be executed in this manner. If permitted, the order of the steps can be interchanged or they can be executed simultaneously.
[0259] The term "comprising" as used in the description and claims should not be interpreted as being limited to what is listed thereafter; it does not exclude other elements or steps. Therefore, it should be interpreted as specifying the presence of the features, integers, steps or components mentioned, but does not exclude the presence or addition of one or more other features, integers, steps or components and groups thereof. Therefore, the expression "a device comprising means A and B" should not be limited to a device consisting of components A and B only.
[0260] References to "one embodiment" or "an embodiment" in this specification mean that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in at least one embodiment of the present application. Therefore, the phrases "in one embodiment" or "in an embodiment" appearing in various places in this specification do not necessarily refer to the same embodiment, but may refer to the same embodiment. In addition, in one or more embodiments, the particular features, structures, or characteristics can be combined in any appropriate manner, as would be apparent to one of ordinary skill in the art from this disclosure.
[0261] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may also include more other equivalent embodiments without departing from the concept of the present application, all of which belong to the scope of protection of the present application.
Claims
1. A method for porting a Wayland embedded graphics application, characterized in that: Applied to development platforms, including: Receive the hardware architecture of the target platform for transplanting the Wayland embedded graphics application, the target operating system and the image library adapted to the hardware architecture of the target platform selected by the user; The kernel of the target operating system is configured to support the Wayland protocol, and the graphics library is configured to be compatible with the hardware architecture of the target platform and the target operating system; Selecting and installing a cross-compilation tool chain based on the hardware architecture of the target platform, and configuring the cross-compilation tool chain to be suitable for the hardware architecture of the target platform; Configuring the development environment of the target operating system to support building and running of embedded graphics applications; Obtaining the source code of the Wayland protocol, modifying the source code of the Wayland protocol to be suitable for the target operating system, using the cross-compilation tool chain to compile the modified source code of the Wayland protocol to generate a first file, and sending the first file to the target platform; Obtaining the source code of the graphics library, using the cross-compilation tool chain to compile the source code of the graphics library to generate a second file, and sending the second file to the target platform; The source code of the embedded graphics application is obtained, the source code of the embedded graphics application is modified to be suitable for the target operating system, the modified source code of the embedded graphics application is compiled using the cross-compilation tool chain to generate a third file, and the third file is sent to the target platform.
2. The method according to claim 1, characterized in that Configuring the cross-compilation tool chain to be suitable for the hardware architecture of the target platform includes: Add the executable file path of the cross-compilation toolchain to the system's PATH environment variable; Configuring the applicable hardware architecture of the cross-compilation tool chain to be the hardware architecture of the target platform; Configuring the cross-compilation tool chain to be suitable for the hardware architecture of the target platform also includes: configuring one or more of the following tool chain parameters: Configure the compilation optimization level and code generation options of the cross-compilation toolchain.
3. The method according to claim 1, characterized in that Modify the source code of the Wayland protocol to be applicable to the target operating system, including one or more of the following: Modify the corresponding input device source code, window manager source code, and rendering pipeline source code in the Wayland source code.
4. The method according to claim 1, characterized in that The step of modifying the source code of the embedded graphics application to be suitable for the target operating system includes: Modify the compilation options, path settings, and library linking methods in the source code of the embedded graphics application.
5. The method according to claim 1, characterized in that Also includes: Check whether the libraries and components that the source code of the embedded graphics application depends on are missing. If missing, obtain the missing dependent libraries and components for installation and configuration.
6. The method according to claim 1, characterized in that Also includes: Receive a test request selected by a user; According to the test request, the first file, the second file and the third file are sent to the target platform for testing.
7. A method for porting a Wayland embedded graphics application, characterized in that: Applicable to target platforms, including: Receive a first file sent by a development platform, wherein the first file is generated by compiling the modified Wayland protocol source code by the development platform using a cross-compilation tool chain, the cross-compilation tool chain is adapted to the hardware architecture of the target platform, the modified Wayland protocol source code is adapted to the hardware architecture of the target platform and the target operating system, the target operating system is adapted to the hardware architecture of the target platform, and the Wayland protocol is deployed and installed based on the first file; Receive a second file sent by the development platform, wherein the second file is generated by compiling the source code of the graphics library by the development platform using a cross-compilation tool chain, the graphics library is adapted to the hardware architecture of the target platform and the target operating system, and the graphics library is deployed and installed based on the second file; A third file sent by a development platform is received, wherein the third file is generated by compiling the modified source code of the embedded graphics application by the development platform using a cross-compilation tool chain, the modified source code of the embedded graphics application is applicable to the target operating system, and the embedded graphics application is run based on the third file.
8. A transplantation device for a Wayland embedded graphics application, characterized in that: Applicable to transplantation platforms, including: A target platform and configuration selection module, used to receive the hardware architecture of the target platform for transplanting the Wayland embedded graphics application, the target operating system and the image library adapted to the hardware architecture of the target platform selected by the user; An automatic configuration module, configured to configure the kernel of the target operating system to support the Wayland protocol, configure the graphics library to be compatible with the hardware architecture of the target platform and the target operating system; configure the development environment of the target operating system to support the construction and operation of embedded graphics applications; A cross-compilation tool chain installation and configuration module, used to select and install a cross-compilation tool chain based on the hardware architecture of the target platform, and configure the cross-compilation tool chain to run on the hardware architecture of the target platform; A transplantation module is used to obtain the source code of the Wayland protocol, modify the source code of the Wayland protocol to be suitable for the target operating system, and use the cross-compilation tool chain to compile the modified source code of the Wayland protocol to generate a first file, wherein the first file is used for transplanting to the target platform; obtain the source code of the graphics library, and use the cross-compilation tool chain to compile the source code of the graphics library to generate a second file, wherein the second file is used for transplanting to the target platform; obtain the source code of the embedded graphics application, modify the source code of the embedded graphics application to be suitable for the target operating system, and use the cross-compilation tool chain to compile the modified source code of the embedded graphics application to generate a third file, wherein the third file is used for transplanting to the target platform.
9. A transplantation device for a Wayland embedded graphics application, characterized in that: Applicable to target platforms, including: A first receiving and installing module is used to receive a first file sent by a development platform, wherein the first file is generated by compiling the modified Wayland protocol source code by the development platform using a cross-compilation tool chain, the cross-compilation tool chain is adapted to the hardware architecture of the target platform, the modified Wayland protocol source code is adapted to the hardware architecture of the target platform and the target operating system, the target operating system is adapted to the hardware architecture of the target platform, and the Wayland protocol is deployed and installed based on the first file; A second receiving and installing module is used to receive a second file sent by the development platform, wherein the second file is generated by compiling the source code of the graphics library by the development platform using a cross-compilation tool chain, the graphics library is adapted to the hardware architecture of the target platform and the target operating system, and the graphics library is deployed and installed based on the second file; The third receiving and installing module is used to receive a third file sent by the development platform, wherein the third file is generated by compiling the modified source code of the embedded graphics application by the transplantation platform using a cross-compilation tool chain, the modified source code of the embedded graphics application is suitable for the target operating system, and the embedded graphics application is run based on the third file.
10. A computing device, characterized in that: include: processor, and A memory having program instructions stored thereon, wherein when the program instructions are executed by the processor, the processor is caused to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Apple mobile equipment application program generation method and device, equipment and medium
CN120029626A
Method, device and medium for generating apple mobile device application
CN120029626B
