Operating system content display method and device, equipment and storage medium
By using virtualization technology and shared memory solutions in a multi-operating system environment, display data is stored in shared memory, and the system resource consumption problems caused by multiple data copying and computing in the prior art are solved, and more efficient data exchange and transmission are achieved.
Patent Information
- Application Number
- CN202411737768.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-25
AI Technical Summary
In a multi-operating system environment, by compressing the display content of other operating systems into a video stream and passing it to the display operating system, it results in multiple data copying and computing, and consumes a large amount of system resources.
Through virtualization technology and shared memory solutions, the display data of different virtualized operating systems is stored in shared memory, allowing the target operating system to directly read the corresponding display content through shared memory, simplifying the data transmission process.
It reduces the consumption of system resources, improves the efficiency of data exchange, and reduces the complexity of data transmission.
Smart Images

Figure CN119690275A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer operating systems, and in particular to an operating system content display method, device, equipment and storage medium. Background Art
[0002] In the current virtualization solution, multiple operating systems can be run on a set of hardware, and each system can independently link to one or more display screens. This means that in actual use, users often need to operate the different display contents corresponding to each operating system.
[0003] In this regard, in the prior art, the display contents of multiple operating systems can be concentrated in one of the operating systems for display. Currently, this is generally done by compressing the display contents in other operating systems into video streams and transmitting them to the operating system for display. The operating system then reads the video streams to display the contents of multiple operating systems. However, this display method requires multiple data copies and calculations, which consumes a large amount of system resources. Summary of the invention
[0004] The embodiments of the present application provide an operating system content display method, apparatus, device and storage medium, which can reduce system resource consumption.
[0005] In a first aspect, the present application provides an operating system content display method, the method is applied to an electronic device, the electronic device runs multiple virtualized operating systems, the electronic device includes multiple display devices, the multiple display devices correspond to the multiple virtualized operating systems one by one, the method includes:
[0006] When receiving a user operation instruction, virtualizing the user operation instruction into a virtual input instruction;
[0007] In a case where the virtual input instruction includes a target display instruction, determining a first virtualized operating system and a second virtualized operating system corresponding to the virtual input instruction;
[0008] Based on the virtual input instruction, the display data corresponding to the first virtualized operating system in the preset shared memory is transmitted to the virtual display device through the virtual input device interface corresponding to the first virtualized operating system;
[0009] The data in the virtual display device is processed by the second virtualized operating system so that the target display device corresponding to the second virtualized operating system displays the content corresponding to the data.
[0010] In a second aspect, the present application provides an operating system content display device, the device comprising:
[0011] A virtualization module, configured to virtualize a user operation instruction into a virtual input instruction when receiving the user operation instruction;
[0012] a determination module, configured to determine, when the virtual input instruction includes a target display instruction, a first virtualized operating system and a second virtualized operating system corresponding to the virtual input instruction;
[0013] A transmission module, configured to transmit, based on the virtual input instruction, display data corresponding to the first virtualized operating system in a preset shared memory to a virtual display device through a virtual input device interface corresponding to the first virtualized operating system;
[0014] The processing module is used to process the data in the virtual display device through the second virtualization operating system, so that the target display device corresponding to the second virtualization operating system displays the content corresponding to the data.
[0015] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the operating system content display method described above.
[0016] In a fourth aspect, the present application provides a computer-readable storage medium having computer program instructions stored thereon, and the computer program instructions, when executed by a processor, implement the operating system content display method as described above.
[0017] The operating system content display method, apparatus, device and storage medium provided in the embodiments of the present application receive user operation instructions based on the virtual input device interface corresponding to each virtualized operating system. When the user operation instruction includes a target display instruction, the first virtualized operating system and the second virtualized operating system corresponding to the target display instruction are determined. Then, based on the data identifier corresponding to the first virtualized operating system, the display data corresponding to the first virtualized operating system in the preset shared memory is added to the graphics buffer queue. Finally, the data in the graphics buffer queue is processed by the second virtualized operating system so that the target display device corresponding to the second virtualized operating system displays the content corresponding to the data. By using virtualization technology and shared memory solutions, the display data of different virtualized operating systems are stored in the shared memory, so that the target operating system can directly read the corresponding display content through the shared memory, thereby streamlining the data transmission process and reducing system resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The present application can be better understood from the following description of the specific embodiments of the present application in conjunction with the accompanying drawings, in which:
[0019] Other features, objects and advantages of the present application will become more apparent by reading the following detailed description of non-limiting embodiments with reference to the accompanying drawings, in which the same or similar reference numerals represent the same or similar features.
[0020] Figure 1 is a flowchart of an operating system content display method provided by an embodiment of the present application;
[0021] Figure 2 is a flowchart of an operating system content display method provided by another embodiment of the present application;
[0022] Figure 3 is an interactive flow chart of an operating system content display method provided by another embodiment of the present application;
[0023] Figure 4 is a system architecture diagram provided by yet another embodiment of the present application;
[0024] Figure 5 is a structural diagram of an operating system content display device provided by an embodiment of the present application;
[0025] Figure 6 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0026] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0027] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0028] In order to solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment and storage medium for displaying content of an operating system. The following first introduces the method for displaying content of an operating system provided by the embodiments of the present application.
[0029] Figure 1 FIG. 1 is a flow chart of a method for displaying content of an operating system provided by an embodiment of the present application. Figure 1 As shown, the method is applied to an electronic device, the electronic device runs multiple virtualized operating systems, and the electronic device includes multiple display devices corresponding to the multiple virtualized operating systems respectively. The method includes the following steps: S101 to S104.
[0030] S101: When receiving a user operation instruction, virtualize the user operation instruction into a virtual input instruction.
[0031] In a specific implementation, an electronic device receives user operation instructions through an input device (such as a keyboard, mouse, touch screen, etc.). These operations can be clicks, slides, text input, or other forms of interaction. In a multi-virtualized operating system environment, the user's input instructions need to be converted into "virtual input instructions" that are suitable for the virtualization system to understand. Specifically, the events of the physical input device are abstracted into virtual input signals and passed to the operating system. This is because each virtual operating system has its own virtual device interface and cannot interact with the operating system directly through a physical input device.
[0032] For example, if a user clicks an icon with a mouse, the virtualization layer can convert the click event into an input signal that adapts to the virtual environment. This signal contains information such as the mouse coordinates and the button pressed.
[0033] S102: When the virtual input instruction includes a target display instruction, determine a first virtualized operating system and a second virtualized operating system corresponding to the virtual input instruction.
[0034] In a specific implementation, when a virtual input instruction includes a target display instruction, the operating system associated with it is determined based on these instructions. Multiple virtual operating systems are run in an electronic device, and each operating system can be bound to one or more display devices. According to the user's operation, the target information in the virtual input instruction is analyzed to determine which two operating systems this input instruction is related to. Among them, the first virtualized operating system is the operating system where the content to be displayed is located, and the second virtualized operating system is responsible for displaying the content in the first virtualized operating system on the target display device. For example, the user's input instruction may require some interaction on a virtualized desktop environment. At this time, the system may determine that the first virtualized operating system needs to process the user input, and the second virtualized operating system needs to display the operation results on the virtual display device.
[0035] S103: Processing the virtual input instruction through the virtual input device interface corresponding to the first virtualized operating system, and transmitting the display data corresponding to the first virtualized operating system in the preset shared memory to the virtual display device.
[0036] Each virtual operating system has a virtual input device interface that allows the operating system to receive and process data from external virtual input commands. These interfaces are usually part of the virtualization framework and enable the virtual system to interact with the signals of the physical input device.
[0037] In a specific implementation, in a virtualized environment, multiple operating systems exchange data through shared memory, and multiple operating systems access the same memory area through shared memory. The shared memory stores the display data of each operating system. When a virtual input instruction enters the first virtualized operating system, the operating system responds according to the input content. After that, the first virtualized operating system writes its corresponding display data (such as interface content or image) into the shared memory, ready to be passed to the virtual display device.
[0038] S104: Processing the data in the virtual display device through the second virtualized operating system, so that the target display device corresponding to the second virtualized operating system displays the content corresponding to the data.
[0039] A virtual display device can be an abstract device provided by the virtualization layer, which simulates a physical display and merges the output of multiple operating systems onto one or more actual display devices. Each operating system has its own display buffer, and the virtual display device is the interface for displaying this data.
[0040] In a specific implementation, the second virtualized operating system will read the data in the shared memory through the virtual display device and process the display content. Finally, the second virtualized operating system transmits the data to the actual physical display device through the virtual display device, so that the target display device corresponding to the second virtualized operating system displays the content corresponding to the data.
[0041] As another example, the second virtualized operating system may perform graphics rendering, display data format conversion, or other processing, such as parsing graphics, adjusting resolution, etc., to ensure that the data is suitable for the format of the target display device.
[0042] The operating system content display method provided in the embodiment of the present application receives user operation instructions based on the virtual input device interface corresponding to each virtualized operating system. When the user operation instruction includes a target display instruction, the first virtualized operating system and the second virtualized operating system corresponding to the target display instruction are determined. Then, based on the data identifier corresponding to the first virtualized operating system, the display data corresponding to the first virtualized operating system in the preset shared memory is added to the graphics buffer queue. Finally, the data in the graphics buffer queue is processed by the second virtualized operating system so that the target display device corresponding to the second virtualized operating system displays the content corresponding to the data. By using virtualization technology and a shared memory solution, the display data of different virtualized operating systems are stored in the shared memory, so that the target operating system can directly read the corresponding display content through the shared memory, thereby streamlining the data transmission process and reducing system resource consumption.
[0043] In order to improve the efficiency of data exchange, in some implementations, before the above S103, the above method may further include the following steps: S1131 to S1132.
[0044] S1131: Setting a shared memory based on a shared memory service corresponding to each virtualized operating system to obtain a preset shared memory.
[0045] Shared memory is a mechanism that allows multiple processes (in this embodiment, multiple virtual operating systems) to directly access the same memory area. This memory area does not need to exchange data through traditional input and output operations, so it can significantly reduce latency and improve the efficiency of data transmission.
[0046] In the specific implementation, a "preset shared memory" area is configured and created according to the needs of each virtualized operating system. The size and format of the preset shared memory are usually set in advance to meet the requirements of sharing data between all operating systems.
[0047] S1132: Copy the display data corresponding to the above-mentioned multiple display devices to the above-mentioned preset shared memory through a zero-copy method.
[0048] Zero copy is a copy optimization technology that aims to avoid unnecessary memory copies during data transfer. Traditional data transfer processes usually go through multiple memory copies (for example, from source memory to an intermediate buffer, and then to target memory), while zero copy attempts to directly transfer data from the source location to the target location without performing an intermediate copy process, thereby reducing memory usage and data copy overhead.
[0049] In the specific implementation, suppose we have two virtual operating systems (operating system A and operating system B), each of which controls a display device. Operating system A will pass its display data directly from its memory buffer to the preset shared memory. The zero-copy method can map the display data area of operating system A to the corresponding area in shared memory through a specific memory mapping technology, avoiding the traditional data copy process. Similarly, operating system B will transfer the display data of the display device it controls to another area in shared memory through the zero-copy method. Through memory mapping, the display data of operating system B is directly written to the shared memory without any intermediate buffer or additional copy operation.
[0050] As another example, in the zero-copy process, the virtualization layer uses memory mapping technology to achieve direct data transfer. This method allows the virtual memory of different operating systems to be directly mapped to physical memory or shared memory areas.
[0051] As another example, a lock mechanism, double buffering, etc. may be used to ensure correct data transmission, ensuring that display data of one virtual operating system will not be overwritten before another operating system has processed the data.
[0052] The above-mentioned implementation method of the embodiment of the present application obtains a preset shared memory by setting a shared memory based on the service of the shared memory corresponding to each virtualized operating system, and then copies the display data corresponding to the above-mentioned multiple display devices to the above-mentioned preset shared memory through a zero-copy method, and uses memory mapping technology to perform efficient data transmission, thereby avoiding redundant data copying in the intermediate buffer, thereby improving the efficiency of data exchange.
[0053] In order to improve the efficiency of data exchange and display update, in some implementations, the above S103 may include the following steps: S1031 to S1033.
[0054] S1031: Transmitting the virtual input instruction to the first virtualized operating system through the virtual input device interface corresponding to the first virtualized operating system.
[0055] In a virtualized environment, the virtual input device interface is an abstraction layer that allows external input devices to interact with the virtual operating system in the form of virtual devices. This interface is usually provided at the virtualization platform layer, which converts signals from physical input devices into input instructions for virtual devices.
[0056] In the specific implementation, virtual input instructions are passed from the external input device to the virtual operating system through the virtual input device interface. These instructions will first be captured by the virtualization platform and passed to the corresponding virtual operating system through the virtual input device interface. Specifically, the virtualization platform maps a virtual device (such as a virtual mouse or virtual keyboard) to the input subsystem of the virtual operating system. Once the virtual operating system receives the input instruction through the virtual input device interface, it will perform corresponding processing.
[0057] S1032: according to the data identifier corresponding to the first virtualized operating system in the virtual input instruction, adding the display data corresponding to the first virtualized operating system in the preset shared memory to a graphics buffer queue.
[0058] In a specific implementation, a shared memory area has been created for each virtual operating system before, and the memory area stores the image data of the display device. The display data in the preset shared memory is generally stored in the form of pixels, image blocks or graphic elements. According to the data identifier corresponding to the first virtualized operating system in the virtual input instruction, the corresponding data area is found in the shared memory, and the display data in the shared memory is added to the graphics buffer queue.
[0059] S1033: Transmit the data in the graphics buffer queue to the virtual display device.
[0060] In a specific implementation, the data in the graphics buffer may include the display content of the entire screen, or only the update of a partial area, and the data in the graphics buffer queue is transmitted to the virtual display device for rendering.
[0061] The above-mentioned implementation method of the embodiment of the present application transmits the above-mentioned virtual input instruction to the above-mentioned first virtualization operating system through the virtual input device interface corresponding to the above-mentioned first virtualization operating system, and then according to the data identifier corresponding to the above-mentioned first virtualization operating system in the above-mentioned virtual input instruction, the display data corresponding to the above-mentioned first virtualization operating system in the preset shared memory is added to the graphics buffer queue, and then the data in the above-mentioned graphics buffer queue is transmitted to the virtual display device. Based on the cooperation of shared memory, virtual input device interface and graphics buffer, efficient data exchange and display update between the virtual operating system and the virtual display device are realized.
[0062] In order to perform display update more quickly, in some implementations, the above S1032 may include the following steps: S10321 to S10323.
[0063] S10321: Based on the data identifier corresponding to the first virtualized operating system in the virtual input instruction, the corresponding target display data is searched from the preset shared memory.
[0064] In a specific implementation, the shared memory adopts a certain structure, in which the identifier of each display data block and the corresponding display content are stored, so that the corresponding display data in the shared memory can be found according to the data identifier in the virtual input instruction.
[0065] S10322: Acquire status information of the target display data, where the status information is a rendering status of the target display data.
[0066] In a specific implementation, each display data usually contains multiple state information, such as rendering state, visibility, interaction state, etc. The rendering state indicates the current state of the display data in the graphics rendering process, such as whether it has been rendered to the screen, whether it is active, etc. The rendering state information is extracted from the target display data by directly accessing the fields of the display data or calling the rendering management module.
[0067] S10323: Add the above target display data and corresponding status information to the graphics buffer queue.
[0068] In the specific implementation, the target display data and status information are packaged into a graphics update package, which contains the display elements to be rendered and their status information. This package will be added to the graphics buffer queue, waiting for the renderer to proceed to the next step. Use memory mapping or pointers to manage the graphics buffer queue. Each time a new display data is added, the operating system will update the pointer or queue head position in the graphics buffer queue to ensure the correct rendering order.
[0069] The above-mentioned implementation method of the embodiment of the present application obtains the corresponding target display data from the above-mentioned preset shared memory based on the data identifier corresponding to the above-mentioned first virtualization operating system in the above-mentioned virtual input instruction, and then obtains the status information of the above-mentioned target display data, and the above-mentioned status information is the rendering status of the above-mentioned target display data, and then adds the above-mentioned target display data and the corresponding status information to the graphics buffer queue, retrieves data from the shared memory, obtains the current rendering status, and puts the updated data into the graphics buffer queue, so that the display can be updated more quickly.
[0070] In order to ensure that the graphical interface can be displayed correctly, in some implementations, the above S104 may include the following steps: S1041 to S1043.
[0071] S1041: Transmitting the data in the graphics buffer queue to the second virtualized operating system.
[0072] In a specific implementation, the first virtualized operating system writes the data in the graphics buffer queue into the shared memory area, and the second virtualized operating system can directly access the shared memory area to read the graphics data.
[0073] S1042: Based on the preset callback function of the second virtualized operating system, render the data in the graphics buffer queue to obtain a rendering result.
[0074] In a specific implementation, through the callback mechanism, the second virtualized operating system can perform rendering operations and generate rendering results at an appropriate time, for example, when receiving data in the graphics buffer queue. The second virtualized operating system will process the received graphics data through the callback function, specifically including parsing the data in the graphics buffer queue, extracting the content to be rendered, and calling the graphics rendering engine in the second virtualized operating system according to the parsed graphics information to render the data in the above-mentioned graphics buffer queue to obtain the rendering result.
[0075] S1043: Transmit the rendering result to a target display device corresponding to the second virtualized operating system, so that the target display device displays content corresponding to the data.
[0076] In a specific implementation, once the second virtualized operating system completes the rendering, the rendering result is transmitted to the target display device, so that the target display device displays the content corresponding to the data.
[0077] The above-mentioned implementation method of the embodiment of the present application transfers the data in the above-mentioned graphics buffer queue to the above-mentioned second virtualization operating system, and then renders the data in the above-mentioned graphics buffer queue based on the preset callback function of the above-mentioned second virtualization operating system to obtain a rendering result, and then transmits the above-mentioned rendering result to the target display device corresponding to the above-mentioned second virtualization operating system, so that the above-mentioned target display device displays the content corresponding to the above-mentioned data, ensuring that the graphical interface can be correctly presented to the user.
[0078] In order to ensure that the graphical interface can be processed effectively, in some implementations, the above S1042 may include the following steps: S10421 to S10422.
[0079] S10421: Triggering a preset callback function of the second virtualized operating system through the data in the graphics buffer queue.
[0080] In a specific implementation, the graphics processing system of the second virtualized operating system may periodically poll the graphics buffer queue to check whether there is new data. If there is data in the queue, the callback function is triggered, or an event-driven mechanism is adopted, and the operating system or application registers a listener. When the graphics data is pushed to the queue, the callback function is automatically triggered, or the callback function can be triggered by a hardware interrupt or a soft interrupt.
[0081] S10422: When the preset callback function is triggered, the data in the graphics buffer queue is rendered through a preset graphics application program interface to obtain a rendering result.
[0082] In a specific implementation, when the callback function is triggered, it first extracts the data to be rendered from the graphics buffer queue, and renders the data in the graphics buffer queue through a preset graphics application program interface to obtain a rendering result.
[0083] The above-mentioned implementation method of the embodiment of the present application triggers the preset callback function of the above-mentioned second virtualization operating system through the data in the above-mentioned graphics buffer queue. When the above-mentioned preset callback function is triggered, the data in the above-mentioned graphics buffer queue is rendered through the preset graphics application program interface to obtain the rendering result, which ensures that the graphics data can be effectively transmitted, processed and displayed in a multi-operating system environment.
[0084] In order to accurately respond to the user's interaction needs, in some embodiments, reference Figure 2 , the above-mentioned multiple display devices are display devices supporting touch input, and the above-mentioned S101 may include the following steps: S201 to S203.
[0085] S201: When the display device receives a touch input, determine a corresponding user touch input.
[0086] In a specific implementation, the display device detects the user's touch action through the sensors of the touch screen. These touch sensors can sense the contact and movement of objects such as the user's fingers or stylus. When a touch event occurs, the sensor converts the input information into an electrical signal and transmits it to the processor. The input information usually includes data such as the coordinates of the touch point, touch pressure, gestures (such as sliding, double-clicking, long pressing, etc.) and time. The processor or touch input module will parse the collected data and identify the specific type of touch.
[0087] S202: Virtualize the user touch input into a virtual touch instruction.
[0088] In a specific implementation, based on the original touch input obtained in step S201, the system will identify different types of user gestures through a predefined algorithm. After being processed, these gesture information is converted into one or more virtual touch instructions.
[0089] S203: According to the above touch input of the user, the display content in the corresponding display device is moved.
[0090] In the specific implementation, for the movement information contained in the touch command, the system will update the display position of the element on the screen according to the sliding distance and direction input by the user. For example, when dragging a finger, the system will calculate the coordinate change of the finger in real time and adjust the position of the displayed content accordingly.
[0091] The above S102 may include the following steps: S204 to S206.
[0092] S204: According to the virtual touch instruction, the state of the corresponding display content in the display device is changed.
[0093] In a specific implementation, according to the user's virtual touch instruction, the specific details of the displayed content are updated, and the state of the corresponding displayed content in the display device is changed.
[0094] S205: When the state of the display content in the corresponding display device meets a preset condition, it is determined that a target display instruction is received.
[0095] In the specific implementation, some preset conditions are defined to determine whether the current display state meets the requirements for performing a certain operation. For example, when the user slides the screen to a certain position, the state of the displayed content (such as the scroll position of the page) may meet a certain condition, and the system will determine that "the target display instruction has been received."
[0096] S206: Based on the virtual touch instruction, determine the first virtualized operating system and the second virtualized operating system corresponding to the target display instruction.
[0097] In a specific implementation, the first virtualized operating system and the second virtualized operating system corresponding to the target display instruction are determined according to a specific form of the touch input.
[0098] The above implementation of the embodiment of the present application collects, analyzes and virtualizes each touch input, and finally converts it into a specific system operation instruction, thereby driving the update of the displayed content. By refining the virtual touch instructions and coordinating the processing of multiple operating systems, the system can efficiently and accurately respond to the user's interactive needs.
[0099] At present, the in-vehicle display screen is the main interface for human-vehicle interaction. With the continuous trend of electric, intelligent and networked vehicles, the in-vehicle display screen in the car is showing a trend of large-screen and multi-screen. This solution can be applied to multiple screens and displays in the car to provide users with a better experience.
[0100] As another implementation method of the present application, multiple on-board display screens in a car and the system of the car virtual machine take the Android system (Android) as an example, which includes two screens with touch input functions, screen A and screen B, corresponding to operating system A and operating system B respectively. When the hardware is connected to two input hardware, the two input devices are virtualized to two Androids at the same time, and then Android distinguishes which screen's input event is received by binding the input. A service based on shared memory between multiple virtual machines is responsible for applying for memory management. Through the client of the shared memory service, the instance acquisition, dequeue, and enqueue interfaces are provided for the server and client to use. The server creates a buffer, provides a producer buffer for the graphic objects of the virtual display, and implements the callback function to move the application to the virtual display by receiving input events. For example, set a three-finger sliding or long press interface. After the trigger, it moves with the gesture. When the drag exceeds 50% of the screen, it will automatically slide to the other screen for display. It can also be dragged back from another screen. Such as Figure 3 As shown, in S301, in an input event, based on the user's operation on screen A, a corresponding input event is obtained.
[0101] S302, based on the virtualized input event, the corresponding display content is moved to the virtual screen. The input event is processed by the operating system A after being virtualized. The operating system A moves the corresponding display content to the virtual screen according to the input event.
[0102] S303: Send the content of the virtual screen. Operating system A sends the content of the virtual screen to operating system B.
[0103] S304, displaying the content of the virtual screen. Operating system B displays the virtual screen on screen B.
[0104] In this embodiment, Figure 4As shown, the architecture of the system includes screen A, screen B, virtual layer 401, operating system A402, and operating system B403. Screen A and screen B exchange data with operating system A and operating system B through the virtual device interface in the virtual layer. The virtual device interface, as an interface between the virtual layer and the screen, is used to transfer display data and touch screen data of the screen. It can receive data from the display data transmission service and pass it to the corresponding screen. As an intermediary between the two operating systems, the virtual layer is responsible for coordinating the transmission of display data. It can receive input events from the virtual device input interfaces of the two operating systems, obtain display data from the display buffer queue through the display data transmission service, and then pass the data to the screen through the virtual device interface.
[0105] Operating system A and operating system B process input events through the virtual device input interface. The virtual device input interface serves as an interface between the operating system and the virtual layer and is used to transmit input events. It receives data from the input event processing module and transmits it to the virtual layer.
[0106] Further, the application is processed. The application runs on its own operating system and is responsible for generating the data to be displayed. After that, the corresponding display content is added to the display buffer queue by the display management component. The display management component is responsible for managing display-related tasks, such as window management, display content scheduling, etc. It receives data from the application, processes it, and passes it to the input event processing module. The display buffer queue stores the data to be displayed as a temporary storage area for display data. It receives data from the display management component and waits for the display data transmission service of the virtual layer to obtain the data.
[0107] Finally, the corresponding display is performed through the display data transmission service in the virtual layer. The display data transmission service is responsible for obtaining display data from the display buffer queue and transmitting it to the virtual device interface, and then extracting data from the display buffer queue and preparing to send it to the screen.
[0108] Based on the operating system content display method provided in the above embodiment, the present application also provides a specific implementation of an operating system content display device. Please refer to the following embodiment.
[0109] See first Figure 5 The operating system content display device 500 provided in the embodiment of the present application includes the following modules:
[0110] The virtualization module 501 is used to virtualize the user operation instruction into a virtual input instruction when receiving the user operation instruction.
[0111] The determination module 502 is configured to determine the first virtualized operating system and the second virtualized operating system corresponding to the virtual input instruction when the virtual input instruction includes a target display instruction.
[0112] The transmission module 503 is used to process the virtual input instruction through the virtual input device interface corresponding to the first virtualized operating system, and transmit the display data corresponding to the first virtualized operating system in the preset shared memory to the virtual display device.
[0113] The processing module 504 is used to process the data in the virtual display device through the second virtualized operating system, so that the target display device corresponding to the second virtualized operating system displays the content corresponding to the data.
[0114] The operating system content display screen provided in the embodiment of the present application receives user operation instructions based on the virtual input device interface corresponding to each virtualized operating system. When the user operation instructions include a target display instruction, the first virtualized operating system and the second virtualized operating system corresponding to the target display instruction are determined, and then based on the data identifier corresponding to the first virtualized operating system, the display data corresponding to the first virtualized operating system in the preset shared memory is added to the graphics buffer queue, and finally the data in the graphics buffer queue is processed by the second virtualized operating system so that the target display device corresponding to the second virtualized operating system displays the content corresponding to the data. By using virtualization technology and a shared memory solution, the display data of different virtualized operating systems are stored in the shared memory, so that the target operating system can directly read the corresponding display content through the shared memory, thereby streamlining the data transmission process and reducing system resource consumption.
[0115] As an implementation of the present application, the operating system content display device 500 further includes:
[0116] The setting module is used to set the shared memory based on the shared memory service corresponding to each virtualized operating system to obtain the preset shared memory.
[0117] The copy module is used to copy the display data corresponding to the above-mentioned multiple display devices to the above-mentioned preset shared memory through a zero-copy method.
[0118] As an implementation of the present application, the transmission module 503 includes:
[0119] The transmission unit is used to transmit the virtual input instruction to the first virtualization operating system through the virtual input device interface corresponding to the first virtualization operating system.
[0120] The adding unit is used to add the display data corresponding to the first virtualized operating system in the preset shared memory to the graphics buffer queue according to the data identifier corresponding to the first virtualized operating system in the virtual input instruction.
[0121] The transmission unit is also used to transmit the data in the above-mentioned graphics buffer queue to the virtual display device.
[0122] As an implementation of the present application, the adding unit includes:
[0123] The search subunit is used to search for corresponding target display data from the preset shared memory based on the data identifier corresponding to the first virtualized operating system in the virtual input instruction.
[0124] The acquisition subunit is used to acquire the state information of the target display data, where the state information is the rendering status of the target display data.
[0125] The adding subunit is used to add the above target display data and corresponding status information to the graphics buffer queue.
[0126] As an implementation of the present application, the processing module 504 includes:
[0127] A transmission unit is used to transmit the data in the graphics buffer queue to the second virtualized operating system.
[0128] The rendering unit is used to render the data in the graphics buffer queue based on the preset callback function of the second virtualized operating system to obtain a rendering result.
[0129] The transmission unit is further used to transmit the rendering result to a target display device corresponding to the second virtualized operating system, so that the target display device displays the content corresponding to the data.
[0130] As an implementation of the present application, a rendering unit includes:
[0131] The triggering subunit is used to trigger the preset callback function of the second virtualized operating system through the data in the graphics buffer queue.
[0132] The rendering subunit is used to render the data in the above-mentioned graphics buffer queue through a preset graphics application program interface to obtain a rendering result when the above-mentioned preset callback function is triggered.
[0133] As an implementation of the present application, the virtual module 501 includes:
[0134] The determination unit is used to determine the corresponding user touch input when the above display device receives the touch input.
[0135] The virtual unit is used to virtualize the above-mentioned user touch input into a virtual touch instruction.
[0136] The moving unit is used to move the display content in the corresponding display device according to the above touch input of the user.
[0137] The determination module 502 includes:
[0138] The changing unit is used to change the state of the corresponding display content in the display device according to the virtual touch instruction.
[0139] The determination unit is configured to determine that a target display instruction has been received when a state of the display content in the corresponding display device satisfies a preset condition.
[0140] The determining unit is used to determine the first virtualized operating system and the second virtualized operating system corresponding to the target display instruction based on the virtual touch instruction.
[0141] The various modules in the operating system content display device provided in the embodiment of the present application can implement the various steps in the above-mentioned operating system content display method and achieve corresponding effects. For the sake of concise description, they will not be repeated here.
[0142] Figure 6 A schematic diagram of the structure of the operating system content display hardware provided in an embodiment of the present application is shown.
[0143] The operating system content display device may include a processor 601 and a memory 602 storing computer program instructions.
[0144] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0145] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory.
[0146] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the operating system content display method according to any one of the embodiments of the present disclosure.
[0147] The processor 601 implements any one of the operating system content display methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .
[0148] In one example, the operating system content display device may further include a communication interface 603 and a bus 610. Figure 6 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.
[0149] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0150] Bus 610 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 610 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0151] In addition, in combination with the method for displaying content in an operating system in the above embodiments, the present application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the methods for displaying content in an operating system in the above embodiments is implemented.
[0152] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed, implements any one of the operating system content display methods in the above embodiments.
[0153] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0154] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0155] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0156] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0157] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for displaying content of an operating system, characterized in that: The method is applied to an electronic device, the electronic device runs multiple virtualized operating systems, the electronic device includes multiple display devices, and the multiple display devices correspond to the multiple virtualized operating systems one by one. The method includes: When receiving a user operation instruction, virtualizing the user operation instruction into a virtual input instruction; In a case where the virtual input instruction includes a target display instruction, determining a first virtualized operating system and a second virtualized operating system corresponding to the virtual input instruction; Based on the virtual input instruction, the display data corresponding to the first virtualized operating system in the preset shared memory is transmitted to the virtual display device through the virtual input device interface corresponding to the first virtualized operating system; The data in the virtual display device is processed by the second virtualized operating system so that the target display device corresponding to the second virtualized operating system displays the content corresponding to the data.
2. The method for displaying operating system content according to claim 1, characterized in that: Before transmitting the display data corresponding to the first virtualized operating system in the preset shared memory to the virtual display device through the virtual input device interface corresponding to the first virtualized operating system based on the virtual input instruction, the method further includes: Setting the shared memory based on the shared memory service corresponding to each virtualized operating system to obtain the preset shared memory; The display data corresponding to the multiple display devices are copied to the preset shared memory through a zero-copy method.
3. The method for displaying operating system content according to claim 1, characterized in that: The transmitting, based on the virtual input instruction, display data corresponding to the first virtualized operating system in the preset shared memory to the virtual display device through the virtual input device interface corresponding to the first virtualized operating system, comprises: transmitting the virtual input instruction to the first virtualized operating system through a virtual input device interface corresponding to the first virtualized operating system; According to the data identifier corresponding to the first virtualized operating system in the virtual input instruction, adding the display data corresponding to the first virtualized operating system in the preset shared memory to the graphics buffer queue; The data in the graphics buffer queue is transmitted to the virtual display device.
4. The method for displaying operating system content according to claim 3, characterized in that: The adding display data corresponding to the first virtualized operating system in the preset shared memory to a graphics buffer queue according to the data identifier corresponding to the first virtualized operating system in the virtual input instruction includes: Based on the data identifier corresponding to the first virtualized operating system in the virtual input instruction, searching for corresponding target display data from the preset shared memory; Acquire status information of the target display data, where the status information is a rendering status of the target display data; The target display data and corresponding status information are added to a graphics buffer queue.
5. The method for displaying contents of an operating system according to claim 3, characterized in that: The processing of the data in the virtual display device by the second virtualized operating system so that the target display device corresponding to the second virtualized operating system displays the content corresponding to the data includes: Transmitting the data in the graphics buffer queue to the second virtualized operating system; Rendering the data in the graphics buffer queue based on a preset callback function of the second virtualized operating system to obtain a rendering result; The rendering result is transmitted to a target display device corresponding to the second virtualized operating system, so that the target display device displays content corresponding to the data.
6. The method for displaying contents of an operating system according to claim 5, characterized in that: The preset callback function based on the second virtualized operating system renders the data in the graphics buffer queue to obtain a rendering result, including: Triggering a preset callback function of the second virtualized operating system through the data in the graphics buffer queue; When the preset callback function is triggered, the data in the graphics buffer queue is rendered through a preset graphics application program interface to obtain a rendering result.
7. The method for displaying operating system content according to any one of claims 1 to 6, characterized in that: The multiple display devices are display devices supporting touch input, and when receiving a user operation instruction, virtualizing the user operation instruction into a virtual input instruction includes: When the display device receives a touch input, determining a corresponding user touch input; Virtualizing the user touch input into a virtual touch instruction; According to the touch input of the user, moving the display content in the corresponding display device; In the case where the virtual input instruction includes a target display instruction, determining the first virtualized operating system and the second virtualized operating system corresponding to the virtual input instruction includes: According to the virtual touch instruction, changing the state of the corresponding display content in the display device; When the state of the display content in the corresponding display device meets a preset condition, determining that a target display instruction is received; Based on the virtual touch instruction, a first virtualized operating system and a second virtualized operating system corresponding to the target display instruction are determined.
8. An operating system content display device, characterized in that: The device comprises: A virtualization module, configured to virtualize a user operation instruction into a virtual input instruction when receiving the user operation instruction; a determination module, configured to determine, when the virtual input instruction includes a target display instruction, a first virtualized operating system and a second virtualized operating system corresponding to the virtual input instruction; A transmission module, configured to transmit, based on the virtual input instruction, display data corresponding to the first virtualized operating system in a preset shared memory to a virtual display device through a virtual input device interface corresponding to the first virtualized operating system; The processing module is used to process the data in the virtual display device through the second virtualization operating system, so that the target display device corresponding to the second virtualization operating system displays the content corresponding to the data.
9. An electronic device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the operating system content display method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the operating system content display method according to any one of claims 1 to 7 is implemented.