Method, device and equipment for synchronizing virtual machine messages on swan monk system and medium
By deploying a virtual machine agent service on the HarmonyOS system, messages from Windows virtual machines are monitored and synchronized in real time, solving the problem of virtual machine messages not being synchronized in real time and improving the user experience and efficiency in a hybrid operating system environment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-03
AI Technical Summary
When running a Windows virtual machine on the HarmonyOS system, the virtual machine's message notifications cannot be synchronized to the host machine in real time, causing users to frequently switch between operating systems to check messages, increasing psychological burden and the risk of information loss.
By deploying a virtual machine agent service in a Windows virtual machine, system notification bar messages, application pop-up messages, and taskbar application status messages are monitored in real time, and these messages are synchronized to the HarmonyOS system through a cross-system communication channel, enabling real-time display and fusion of messages.
It enables real-time synchronization of virtual machine messages across systems, reducing the frequency of user switching and improving the user experience and efficiency in hybrid operating system environments.
Smart Images

Figure CN121785818A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of operating system technology, specifically to a method, apparatus, device, and medium for synchronizing virtual machine messages on the HarmonyOS system. Background Technology
[0002] With the deepening of the information technology application innovation (IT innovation) strategy, the replacement of Windows with domestically developed operating systems has become an inevitable trend. HarmonyOS, Huawei's independently developed distributed operating system, has demonstrated enormous application potential in government, enterprise, education, and healthcare sectors. However, given the time required for ecosystem development, running Windows virtual machines on HarmonyOS in the short term has become the mainstream solution for the transition period. This approach avoids impacting existing Windows businesses while allowing time to develop the HarmonyOS ecosystem and gradually complete the operating system migration.
[0003] While existing virtualization technologies (such as VMware and VirtualBox) enable data exchange between the host machine and the virtual machine at the levels of file system and network traffic, significant logical isolation still exists in the message notification mechanism. This isolation causes the virtual machine to form a closed "information island." For example, when the virtual machine is running in the background or the application is minimized, users cannot perceive its internal state. As a result, professional users who rely on virtual machines for development and office work must frequently switch to check message notifications. This not only increases the user's psychological burden but may also lead to the omission of important information, thereby reducing the risk of reduced work efficiency.
[0004] It is evident that how to achieve real-time synchronization of virtual machine messages across systems to the HarmonyOS system in order to improve the user experience in a hybrid operating system environment is a problem that urgently needs to be solved. Summary of the Invention
[0005] This application provides a method, apparatus, device, and medium for synchronizing virtual machine messages on the HarmonyOS system, which enables virtual machine messages to be synchronized to the HarmonyOS system in real time across systems, thereby improving the user experience in a hybrid operating system environment.
[0006] In a first aspect, embodiments of this application provide a method for synchronizing virtual machine messages on a HarmonyOS system. The method is applied to a virtual machine agent service deployed in a Windows virtual machine, and includes the following steps: Real-time monitoring of target message types in Windows virtual machines, including system notification bar messages, application pop-up messages, and taskbar application status messages; When a message event corresponding to the target message type is detected, the target message data corresponding to the target message type is transmitted to the HarmonyOS system through a preset cross-system communication channel so that the HarmonyOS system can display the target message data.
[0007] In conjunction with the first aspect, in one implementation, the real-time monitoring of the target message type in the Windows virtual machine includes: For system notification bar messages, register a notification event listener with the Windows operating system to enable real-time monitoring of system notification bar messages through the notification event listener; For application pop-up messages, the window list in the Windows virtual machine is periodically scanned to achieve real-time monitoring of application pop-up messages through window attribute characteristics; For taskbar application status messages, a hook operation is performed on the Windows taskbar tray area to achieve real-time monitoring of taskbar application status messages.
[0008] In conjunction with the first aspect, in one implementation, after the step of detecting the generation of a message event corresponding to the target message type, the method further includes: Extract key information of the target message based on message events. The key information of the target message includes message title, message content, application icon, application name and message timestamp. The key information of the target message is encapsulated into a structured data packet to obtain the target message data.
[0009] In conjunction with the first aspect, in one implementation, when the target message data includes multiple message data among a first message data corresponding to a system notification bar message, a second message data corresponding to an application pop-up message, and a third message data corresponding to a taskbar application status message, and the multiple message data belong to the same message object, the HarmonyOS system displays the target message data, including: HarmonyOS performs duplicate and conflict detection on multiple message data and generates processed message data. The HarmonyOS system will register the processed message data to the preset target notification and display it as a reminder.
[0010] In conjunction with the first aspect, in one implementation, the HarmonyOS system retains the virtual machine source identifier when displaying target message data.
[0011] In conjunction with the first aspect, in one implementation, the cross-system communication channel is implemented using a virtual machine shared memory mechanism or a virtual network socket.
[0012] Secondly, embodiments of this application provide an apparatus for synchronizing virtual machine messages on a HarmonyOS system, comprising: a HarmonyOS system, a Windows virtual machine deployed on the HarmonyOS system, and a virtual machine agent service deployed in the Windows virtual machine; The virtual machine agent service monitors target message types in Windows virtual machines in real time, including system notification bar messages, application pop-up messages, and taskbar application status messages. When the virtual machine agent service detects a message event corresponding to the target message type, it transmits the target message data corresponding to the target message type to the HarmonyOS system through a preset cross-system communication channel, so that the HarmonyOS system can display the target message data.
[0013] In conjunction with the second aspect, in one implementation, for system notification bar messages, the virtual machine agent service registers a notification event listener with the Windows operating system to achieve real-time monitoring of system notification bar messages through the notification event listener. For application pop-up messages, the virtual machine agent service periodically scans the window list in the Windows virtual machine to monitor application pop-up messages in real time through window attribute characteristics. For taskbar application status messages, the virtual machine agent service performs a hook operation on the Windows taskbar tray area to achieve real-time monitoring of taskbar application status messages.
[0014] In conjunction with the second aspect, in one implementation, the virtual machine agent service extracts key information of the target message based on message events. The key information of the target message includes the message title, message content, application icon, application name, and message timestamp. The key information of the target message is then encapsulated into a structured data packet to obtain the target message data.
[0015] In conjunction with the second aspect, in one implementation, when the target message data includes multiple message data such as first message data corresponding to system notification bar messages, second message data corresponding to application pop-up messages, and third message data corresponding to taskbar application status messages, and the multiple message data belong to the same message object, the HarmonyOS system performs duplicate and conflict detection processing on the multiple message data to generate processed message data; the HarmonyOS system registers the processed message data to a preset target notification and displays a reminder.
[0016] In conjunction with the second aspect, in one implementation, the HarmonyOS system retains the virtual machine source identifier when displaying target message data.
[0017] In conjunction with the second aspect, in one implementation, the cross-system communication channel is implemented using a virtual machine shared memory mechanism or a virtual network socket.
[0018] Thirdly, embodiments of this application provide a device for synchronizing virtual machine messages on a HarmonyOS system. The device for synchronizing virtual machine messages on a HarmonyOS system includes a processor, a memory, and a program for synchronizing virtual machine messages on a HarmonyOS system stored in the memory and executable by the processor. When the program for synchronizing virtual machine messages on a HarmonyOS system is executed by the processor, it implements the steps of the method for synchronizing virtual machine messages on a HarmonyOS system as described above.
[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing a program for synchronizing virtual machine messages on a HarmonyOS system. When the program for synchronizing virtual machine messages on a HarmonyOS system is executed by a processor, it implements the steps of the aforementioned method for synchronizing virtual machine messages on a HarmonyOS system.
[0020] The beneficial effects of the technical solutions provided in this application include: By deploying a virtual machine agent service within a Windows virtual machine, real-time monitoring of various message types, including system notification bar messages, application pop-up messages, and taskbar application status messages, is achieved. This monitoring covers almost all immediate messages, meeting user expectations. When a message event corresponding to the monitored message type is detected, the corresponding target message data is transmitted to the HarmonyOS system via a cross-system communication channel for display. Therefore, this application breaks down the interaction barriers between the host machine (i.e., HarmonyOS system) and the virtual machine by constructing a cross-system message penetration and real-time synchronization mechanism. This allows for real-time push of message notifications from within the virtual machine to the host machine, achieving cross-platform message integration. Users can maintain overall control without frequent switching, significantly improving the efficiency and security of cross-system office work. Attached Figure Description
[0021] Figure 1 This is a flowchart illustrating an embodiment of the method for synchronizing virtual machine messages on the HarmonyOS system according to this application. Figure 2 This is a schematic diagram illustrating the data interaction between the HarmonyOS system and the virtual machine in the embodiments of this application; Figure 3 This is a schematic diagram of the functional modules of an embodiment of the device for synchronizing virtual machine messages on the HarmonyOS system according to this application; Figure 4 This is a schematic diagram of the hardware structure of the device for synchronizing virtual machine messages on the HarmonyOS system involved in the embodiments of this application. Detailed Implementation
[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0023] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0024] In a first aspect, embodiments of this application provide a method for synchronizing virtual machine messages on a HarmonyOS system.
[0025] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the method for synchronizing virtual machine messages on the HarmonyOS system according to this application. The method for synchronizing virtual machine messages on the HarmonyOS system is applied to a virtual machine agent service deployed in a Windows virtual machine, such as... Figure 1 As shown, the methods for synchronizing virtual machine messages on the HarmonyOS system include: Step S10: Monitor the target message types in the Windows virtual machine in real time. The target message types include system notification bar messages, application pop-up messages, and taskbar application status messages.
[0026] In this exemplary embodiment, a Windows virtual machine is installed on the HarmonyOS system. Specifically, first, the Harmony Ability Package (HAP) client is installed on the HarmonyOS system; then, permissions are granted to the HAP client for notifying users of messages; next, the Windows virtual machine is installed and the installation is completed; then, a virtual machine agent service is deployed inside the Windows virtual machine, that is, the virtual machine agent service runs in the Guest (also known as a client machine or virtual machine, which is one or more operating system instances running in a virtualization environment) operating system environment, and the virtual machine agent service runs automatically when the Windows virtual machine starts, has system-level permissions, and can access various message interfaces of the Windows system; finally, the HarmonyOS system can synchronize virtual machine messages in real time through the virtual machine agent service.
[0027] Based on this, a virtual machine agent service is used to listen for various messages (i.e., target message types) in the Windows virtual machine, including but not limited to... Figure 2The system displays Windows system messages (i.e., system notification bar messages), third-party application pop-up messages (i.e., application pop-up messages), and Windows taskbar application status messages (i.e., taskbar application status messages). This shows that it covers almost all real-time messages, meeting user expectations. System notification bar messages refer to Windows notification bar messages, which include system messages and some third-party application messages. Application pop-up messages refer to the common message type for most applications (including system applications and third-party applications), appearing as desktop pop-ups. Taskbar application status messages refer to the common message type including tray applications (specifically system applications and third-party applications), appearing as the status of the Windows taskbar tray icon.
[0028] Furthermore, in one embodiment, the real-time monitoring of the target message type in the Windows virtual machine includes: For system notification bar messages, register a notification event listener with the Windows operating system to enable real-time monitoring of system notification bar messages through the notification event listener; For application pop-up messages, the window list in the Windows virtual machine is periodically scanned to achieve real-time monitoring of application pop-up messages through window attribute characteristics; For taskbar application status messages, a hook operation is performed on the Windows taskbar tray area to achieve real-time monitoring of taskbar application status messages.
[0029] As an example, in this embodiment, the virtual machine agent service needs to initialize corresponding listeners for different types of message listening. Specifically, for system notification bar messages, a notification event listener (i.e., a system notification listener) is registered with the Windows operating system. This registration is done by calling the Windows operating system's application programming interface (API) (such as the ToastNotification API, which is a set of interfaces for creating, sending, and managing system-level notifications). When the Windows operating system generates a notification, a callback is triggered, thus achieving real-time listening to system notification bar messages by obtaining the notification content through the callback mechanism. In detail, the virtual machine agent service subscribes to this type of message (i.e., system notification bar messages) from the Windows operating system. After successful subscription, once a message event is triggered, the Windows operating system will notify the virtual machine agent service of the message, completing the listening to Windows operating system notification bar messages.
[0030] For the application pop-up message type, an application pop-up listener will be initialized. By calling the EnumWindows API (which is used to enumerate the handles of all top-level windows in the current system and allows developers to perform custom operations on each window through a callback mechanism), the listener will periodically (e.g., every 200ms) enumerate all windows in the Windows virtual machine. The listener will filter the windows based on window attributes such as window style and window class name to identify pop-up windows and notify the virtual machine agent service of the pop-up window message, thus completing the listening for application pop-up messages.
[0031] For taskbar application status messages, a taskbar status listener will be initialized. A hook (allowing the interception and modification of system messages or API calls) will be performed on the Shell_NotifyIconAPI (an API function for managing system tray icons, allowing developers to add, modify, or delete icons in the taskbar notification area) in the explorer.exe process (which manages the graphical user interface and file resource navigation). This intercepts applications' requests to call the Shell_NotifyIcon API. Then, taskbar application status message events are generated by analyzing changes in icon data in the request parameters, enabling real-time monitoring of taskbar application status messages. Specifically, the virtual machine agent service will monitor the taskbar tray area in real time, obtaining the blinking state or icon changes of application icons. If a taskbar application status message is confirmed, a memory read operation will be performed to obtain the icon information corresponding to the taskbar application status message, completing the monitoring of Windows taskbar application status messages.
[0032] Based on this, after the Windows virtual machine starts, the virtual machine agent service will actively listen for the above three types of messages and synchronize Windows messages to the host machine (i.e., the HarmonyOS system) in real time, thereby achieving virtual machine message puncture.
[0033] Step S20: When a message event corresponding to the target message type is detected, the target message data corresponding to the target message type is transmitted to the HarmonyOS system through a preset cross-system communication channel so that the HarmonyOS system can display the target message data.
[0034] Exemplary, see Figure 2 As shown, when any listener detects a message event, the virtual machine agent service transmits the target message data corresponding to the message event to the HarmonyOS system through the cross-system communication channel. After receiving the target message data packet, the message receiving client in the HarmonyOS system will verify the integrity and legitimacy of the message source and display a notification to the user, so that system notification bar messages, application pop-up messages, and taskbar application status messages can be synchronized at the millisecond level between the HarmonyOS side and the virtual machine side.
[0035] As can be seen, this embodiment aims to build a cross-system message penetration and real-time synchronization mechanism to break down the interaction barriers between the host machine and the virtual machine, so as to push the message notifications inside the virtual machine to the host machine system in real time, realize cross-platform message fusion, and enable users to control the overall situation without frequent switching, thereby improving the user experience in a hybrid operating system environment.
[0036] Furthermore, in one embodiment, after the step of detecting the generation of a message event corresponding to the target message type, the method further includes: Extract key information of the target message based on message events. The key information of the target message includes message title, message content, application icon, application name and message timestamp. The key information of the target message is encapsulated into a structured data packet to obtain the target message data.
[0037] As an example, in this embodiment, when any listener detects a message event, the virtual machine agent service extracts key information of the target message based on the message event, including but not limited to the message title, message content, application icon, application name, and message timestamp, and encapsulates it into a structured data packet to obtain the target message data. For example, when application A in the Windows virtual machine generates a new message pop-up (message event), the generated target message data includes: the message title is mapped to "New Message" (extracted from the window title), the message content is mapped to "Zhang San: Project Progress Update" (extracted from the pop-up text), the application icon is mapped to the application A icon (extracted from process resources), the application name is mapped to "Application A" (identified by the process name), and the message timestamp is mapped to the pop-up appearance time (obtainable through system time records).
[0038] Further, in one embodiment, when the target message data includes multiple message data among first message data corresponding to a system notification bar message, second message data corresponding to an application pop-up message, and third message data corresponding to a taskbar application status message, and the multiple message data belong to the same message object, the HarmonyOS system displays the target message data, including: HarmonyOS performs duplicate and conflict detection on multiple message data and generates processed message data. The HarmonyOS system will register the processed message data to the preset target notification and display it as a reminder.
[0039] As an example, in this embodiment, when the Windows operating system generates multiple notification messages simultaneously, the virtual machine agent service will also send multiple message data to the HarmonyOS system simultaneously. Specifically, the target message data includes at least two of the following: a first message data corresponding to the system notification bar message, a second message data corresponding to the application pop-up message, and a third message data corresponding to the taskbar application status message. In other words, the target message data may be any combination of the first, second, and third message data. For example, the target message data may include the first message data corresponding to the system notification bar message and the second message data corresponding to the application pop-up message, or the target message data may include the first message data corresponding to the application pop-up message and the second message data corresponding to the application pop-up message. The target message data includes the second message data corresponding to the message and the third message data corresponding to the application status message in the taskbar. Alternatively, the target message data may include the first message data corresponding to the system notification bar message, the second message data corresponding to the application pop-up message, and the third message data corresponding to the application status message in the taskbar. Since these message data may be message data corresponding to the same message in the same application, that is, these data have the same message object. For example, message A in application A is displayed as a pop-up reminder (which corresponds to the second message data) and also displayed as a reminder in the tray by flashing an icon (which corresponds to the third message data). It can be seen that the second message data and the third message data are duplicate data.
[0040] Based on this, see Figure 2 As shown, when the HarmonyOS system receives multiple message data sent by the virtual machine agent service, it performs message integration processing to detect duplicates and conflicts, eliminating redundant or conflicting message data to obtain processed message data. The application icon, message title, and specific message content from the processed message data are then registered in the target notification, and a system notification is displayed to the user. It should be understood that since HarmonyOS message notifications are typically presented as system banner notifications, the target notification in this embodiment is preferably a system banner notification. However, other notification methods, such as floating window notifications, can also be selected, and are not limited here.
[0041] Furthermore, in one embodiment, the HarmonyOS system retains the virtual machine source identifier when displaying target message data.
[0042] As an example, in this embodiment, when displaying target message data, the HarmonyOS system preferably retains the virtual machine source identifier, enabling users to identify that the message originates from the virtual machine environment. Specifically, when the HarmonyOS Notification API (the core interface for creating, managing, and interacting with system notifications, allowing developers to push message reminders, event notifications, etc. to users) creates a notification object, it not only sets the notification title, content, icon, and other attributes but also specifies the notification channel as "virtual machine message." For instance, regarding system notification bar message synchronization, when the Windows virtual machine generates a "Windows Update Completed" notification, the virtual machine agent service captures the event, extracts the notification content, and sends it to the HarmonyOS system via a cross-system communication channel. Upon receiving this, the HarmonyOS system displays the notification "[Virtual Machine] Windows Update Completed."
[0043] For application pop-up message synchronization, when application A in the Windows virtual machine receives a new message, a pop-up window is generated. The virtual machine agent service identifies the pop-up window through window enumeration, extracts the sender and message digest, and sends it to the HarmonyOS system. The HarmonyOS system will then display "[Virtual Machine - Application A] Zhang San: Afternoon meeting materials have been sent".
[0044] Regarding the synchronization of application status messages in the taskbar, when there is a new email in the email client in the Windows virtual machine, the email icon in the taskbar starts to flash. At this time, the virtual machine agent service detects the change in icon status, identifies the application as the email client, and sends a status change notification to the HarmonyOS system. The HarmonyOS system can then display "[Virtual Machine - Email] You have 1 new email".
[0045] Furthermore, in one embodiment, the cross-system communication channel is implemented using a virtual machine shared memory mechanism or a virtual network socket.
[0046] As an example, in this embodiment, the cross-system communication channel can be implemented using a virtual machine shared memory mechanism or a virtual network socket, which can be determined according to actual needs and is not limited here; for example, if a virtual machine shared memory mechanism is used to implement the cross-system communication channel, the virtual machine agent service writes the message data into the shared memory area, and the HarmonyOS system can read the message data through polling or interruption.
[0047] In summary, this embodiment implements a solution for synchronizing virtual machine messages on the HarmonyOS system, solving the user experience problem where messages from the guest machine running in the background cannot be synchronized to the host machine (also known as the physical machine, which is the actual physical computer device) in the foreground. Technically, unlike the traditional isolation between virtual machines and host machines, this embodiment supplements the message interoperability between the virtual machine and the HarmonyOS system, breaking down the barriers at the interaction layer. In terms of user experience, message interoperability makes the switching between the host machine and the virtual machine more seamless, achieving a fusion of the user experience. Actual verification shows that virtual machine system messages, third-party application pop-up messages, and taskbar application status messages can all be synchronized to the HarmonyOS system in real time, accurately reminding the user of the virtual machine's status.
[0048] Secondly, embodiments of this application also provide an apparatus for synchronizing virtual machine messages on the HarmonyOS system.
[0049] In one embodiment, reference is made to Figure 3 , Figure 3 This is a schematic diagram of the functional modules of an embodiment of the device for synchronizing virtual machine messages on the HarmonyOS system according to this application. Figure 3 As shown, the device for synchronizing virtual machine messages on the HarmonyOS system includes: the HarmonyOS system, a Windows virtual machine deployed on the HarmonyOS system, and a virtual machine agent service deployed in the Windows virtual machine; The virtual machine agent service monitors target message types in Windows virtual machines in real time, including system notification bar messages, application pop-up messages, and taskbar application status messages. When the virtual machine agent service detects a message event corresponding to the target message type, it transmits the target message data corresponding to the target message type to the HarmonyOS system through a preset cross-system communication channel, so that the HarmonyOS system can display the target message data.
[0050] Furthermore, in one embodiment, for system notification bar messages, the virtual machine agent service registers a notification event listener with the Windows operating system to achieve real-time monitoring of system notification bar messages through the notification event listener; for application pop-up messages, the virtual machine agent service periodically scans the window list in the Windows virtual machine to achieve real-time monitoring of application pop-up messages through window attribute characteristics; for taskbar application status messages, the virtual machine agent service performs a hook operation on the Windows taskbar tray area to achieve real-time monitoring of taskbar application status messages.
[0051] Furthermore, in one embodiment, the virtual machine agent service extracts key information of the target message based on message events. The key information of the target message includes the message title, message content, application icon, application name, and message timestamp. The key information of the target message is then encapsulated into a structured data packet to obtain the target message data.
[0052] Furthermore, in one embodiment, when the target message data includes multiple message data such as first message data corresponding to the system notification bar message, second message data corresponding to the application pop-up message, and third message data corresponding to the taskbar application status message, and the multiple message data belong to the same message object, the HarmonyOS system performs duplicate and conflict detection processing on the multiple message data to generate processed message data; the HarmonyOS system registers the processed message data to the preset target notification and displays it as a reminder.
[0053] Furthermore, in one embodiment, the HarmonyOS system retains the virtual machine source identifier when displaying target message data.
[0054] Furthermore, in one embodiment, the cross-system communication channel is implemented using a virtual machine shared memory mechanism or a virtual network socket.
[0055] The functions of each part of the device for synchronizing virtual machine messages on the HarmonyOS system correspond to the steps in the method embodiment for synchronizing virtual machine messages on the HarmonyOS system, and their functions and implementation processes will not be described in detail here.
[0056] In three aspects, embodiments of this application provide a device for synchronizing virtual machine messages on the HarmonyOS system. The device for synchronizing virtual machine messages on the HarmonyOS system can be a personal computer (PC), a laptop, a server, or other device with data processing capabilities.
[0057] Reference Figure 4 , Figure 4 This is a schematic diagram of the hardware structure of a device for synchronizing virtual machine messages on the HarmonyOS system, as described in an embodiment of this application. In this embodiment, the device for synchronizing virtual machine messages on the HarmonyOS system may include a processor, memory, a communication interface, and a communication bus.
[0058] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.
[0059] The communication interface includes input / output (I / O) interfaces, physical interfaces, and logical interfaces. These interfaces facilitate the interconnection of internal devices within the HarmonyOS system to synchronize virtual machine messages, as well as interfaces that enable interconnection between the device synchronizing virtual machine messages and other devices (such as other computing devices or user devices). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user devices can be displays, keyboards, etc.
[0060] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.
[0061] The processor can be a general-purpose processor, which can call a program stored in memory for synchronizing virtual machine messages on the HarmonyOS system and execute the method for synchronizing virtual machine messages on the HarmonyOS system provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the program for synchronizing virtual machine messages on the HarmonyOS system is called can be referred to the various embodiments of the method for synchronizing virtual machine messages on the HarmonyOS system in this application, and will not be repeated here.
[0062] Those skilled in the art will understand that Figure 4 The hardware structure shown does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0063] Fourthly, embodiments of this application also provide a computer-readable storage medium.
[0064] The present application has a program stored on a readable storage medium for synchronizing virtual machine messages on a HarmonyOS system. When the program for synchronizing virtual machine messages on a HarmonyOS system is executed by a processor, it implements the steps of the method for synchronizing virtual machine messages on a HarmonyOS system as described above.
[0065] The method implemented when the program for synchronizing virtual machine messages on the HarmonyOS system is executed can be referred to in the various embodiments of the method for synchronizing virtual machine messages on the HarmonyOS system in this application, and will not be repeated here.
[0066] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0067] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.
[0068] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.
[0069] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.
[0070] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.
[0071] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.
[0072] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A method for synchronizing virtual machine messages on a HarmonyOS system, characterized in that, The method is applied to a virtual machine agent service deployed in a Windows virtual machine, and the method includes the following steps: Real-time monitoring of target message types in Windows virtual machines, including system notification bar messages, application pop-up messages, and taskbar application status messages; When a message event corresponding to the target message type is detected, the target message data corresponding to the target message type is transmitted to the HarmonyOS system through a preset cross-system communication channel so that the HarmonyOS system can display the target message data.
2. The method for synchronizing virtual machine messages on the HarmonyOS system as described in claim 1, characterized in that, The real-time monitoring of target message types in the Windows virtual machine includes: For system notification bar messages, register a notification event listener with the Windows operating system to enable real-time monitoring of system notification bar messages through the notification event listener; For application pop-up messages, the window list in the Windows virtual machine is periodically scanned to achieve real-time monitoring of application pop-up messages through window attribute characteristics; For taskbar application status messages, a hook operation is performed on the Windows taskbar tray area to achieve real-time monitoring of taskbar application status messages.
3. The method for synchronizing virtual machine messages on the HarmonyOS system as described in claim 1, characterized in that, After the step of detecting a message event corresponding to the target message type, the method further includes: Extract key information of the target message based on message events. The key information of the target message includes message title, message content, application icon, application name and message timestamp. The key information of the target message is encapsulated into a structured data packet to obtain the target message data.
4. The method for synchronizing virtual machine messages on the HarmonyOS system as described in claim 1, characterized in that, When the target message data includes multiple message data points, such as first message data corresponding to a system notification bar message, second message data corresponding to an application pop-up message, and third message data corresponding to a taskbar application status message, and these multiple message data points belong to the same message object, the HarmonyOS system displays the target message data, including: HarmonyOS performs duplicate and conflict detection on multiple message data and generates processed message data. The HarmonyOS system will register the processed message data to the preset target notification and display it as a reminder.
5. The method for synchronizing virtual machine messages on the HarmonyOS system as described in claim 1, characterized in that: When displaying target message data, the HarmonyOS system retains the virtual machine source identifier.
6. The method for synchronizing virtual machine messages on the HarmonyOS system as described in claim 1, characterized in that: The cross-system communication channel is implemented using a virtual machine shared memory mechanism or a virtual network socket.
7. A device for synchronizing virtual machine messages on a HarmonyOS system, characterized in that, include: HarmonyOS, Windows virtual machines deployed on HarmonyOS, and virtual machine agent services deployed in Windows virtual machines; The virtual machine agent service monitors target message types in Windows virtual machines in real time, including system notification bar messages, application pop-up messages, and taskbar application status messages. When the virtual machine agent service detects a message event corresponding to the target message type, it transmits the target message data corresponding to the target message type to the HarmonyOS system through a preset cross-system communication channel, so that the HarmonyOS system can display the target message data.
8. The apparatus for synchronizing virtual machine messages on the HarmonyOS system as described in claim 7, characterized in that: For system notification bar messages, the virtual machine agent service registers a notification event listener with the Windows operating system to achieve real-time monitoring of system notification bar messages through the notification event listener. For application pop-up messages, the virtual machine agent service periodically scans the window list in the Windows virtual machine to monitor application pop-up messages in real time through window attribute characteristics. For taskbar application status messages, the virtual machine agent service performs a hook operation on the Windows taskbar tray area to achieve real-time monitoring of taskbar application status messages.
9. A device for synchronizing virtual machine messages on a HarmonyOS system, characterized in that, The device for synchronizing virtual machine messages on the HarmonyOS system includes a processor, a memory, and a program for synchronizing virtual machine messages on the HarmonyOS system stored in the memory and executable by the processor, wherein when the program for synchronizing virtual machine messages on the HarmonyOS system is executed by the processor, it implements the steps of the method for synchronizing virtual machine messages on the HarmonyOS system as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program for synchronizing virtual machine messages on the HarmonyOS system, wherein when the program for synchronizing virtual machine messages on the HarmonyOS system is executed by a processor, it implements the steps of the method for synchronizing virtual machine messages on the HarmonyOS system as described in any one of claims 1 to 6.