Cross-device hardware data synchronization method and device, electronic device and storage medium

通过监听关联设备的消息并复用数据传输通道,实现跨设备硬件的高效数据同步,解决了现有技术中同步性能低和功耗大的问题。

CN120034550APending Publication Date: 2025-05-23BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311560677.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-21
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The data synchronization performance of the existing technology of mid-span device hardware is poor, the synchronization efficiency is low and the power consumption is large.

Method used

By listening to the message of the associated device, a hardware notification message is obtained, and when the synchronization conditions are met, the multiplexed data transmission channel sends a hardware information acquisition request to the associated device, and receives and processes the returned target hardware data.

Benefits of technology

Improves data synchronization performance across device hardware, reduces power consumption and improves efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120034550A_ABST
    Figure CN120034550A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and particularly provides a cross-device hardware data synchronization method and device, electronic equipment and a storage medium. The data synchronization method for the cross-device hardware comprises the following steps: monitoring a message of an associated device to obtain a hardware notification message sent by the associated device for the cross-device hardware; the cross-device hardware is hardware in the associated device; if it is determined that the set synchronization condition is met, multiplexing a data transmission channel, and sending a hardware information acquisition request to associated equipment; the data transmission channel is a channel for receiving a hardware notification message; and receiving target hardware data of the cross-device hardware returned by the associated device through the data transmission channel. Therefore, through channel multiplexing, the performance of data synchronization is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a method, device, electronic device and storage medium for data synchronization across device hardware. Background Art

[0002] In a multi-device networking environment, users usually want to use the hardware resources of other devices in the network on one device. For example, since the camera configuration on a mobile phone is relatively high and the camera configuration on a tablet is relatively low, the tablet can call the camera of the mobile phone to take pictures to obtain the taken pictures.

[0003] To implement cross-device hardware calls, it is necessary to synchronize certain hardware in the called device, namely, the relevant data of the cross-device hardware, to the calling device.

[0004] However, under the existing technology, the performance of data synchronization across device hardware is poor, such as low synchronization efficiency and high power consumption. Therefore, how to improve the performance of data synchronization across device hardware is a problem that needs to be solved. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a method, apparatus, electronic device and storage medium for data synchronization across device hardware, so as to improve the performance of data synchronization across device hardware.

[0006] On the one hand, an embodiment of the present application provides a method for synchronizing data across device hardware, the method comprising:

[0007] Monitor messages of associated devices to obtain hardware notification messages sent by associated devices to cross-device hardware; cross-device hardware is hardware in associated devices;

[0008] If it is determined that the set synchronization conditions are met, the data transmission channel is reused to send a hardware information acquisition request to the associated device; the data transmission channel is a channel for receiving hardware notification messages;

[0009] Receive target hardware data across device hardware returned by the associated device through the data transmission channel.

[0010] In one implementation, determining that a set synchronization condition is met includes:

[0011] If it is determined based on the hardware notification message that there is a hardware update, it is determined that the set synchronization condition is met;

[0012] If it is determined that the hardware data acquisition instruction is received, it is determined that the set synchronization condition is met;

[0013] If the associated device is detected to be online, it is determined that the set synchronization conditions are met.

[0014] In one implementation, determining that there is a hardware update based on the hardware notification message includes:

[0015] If the hardware notification message is a hardware update notification, then obtaining the target hardware identifier contained in the hardware update notification;

[0016] If it is determined that no hardware identification matching the target hardware identification is stored locally, it is determined that there is a hardware update in the associated device.

[0017] In one embodiment, the method further comprises:

[0018] When it is determined that the first registration condition is met, register an online and offline listener; the online and offline listener is used to monitor online and offline notifications of associated devices;

[0019] Monitor based on online and offline monitors;

[0020] Stores the monitored online and offline notifications of associated devices.

[0021] In one implementation, before monitoring the message of the associated device, the method further includes:

[0022] When it is determined that the second registration condition is met, a transmission listener is registered; the transmission listener is used to monitor messages of the associated device.

[0023] In one embodiment, the method further comprises:

[0024] From the target hardware data, obtain the associated device information and the hardware metadata of the cross-device hardware;

[0025] Establish collaborative relationships based on associated device information and hardware metadata;

[0026] When it is determined that the hardware call conditions are met, the cross-device hardware is called based on the collaborative relationship.

[0027] In one embodiment, the method further comprises:

[0028] Multiplex the data transmission channel to send permission acquisition requests for cross-device hardware to associated devices;

[0029] Receive permission information returned by the associated device; the permission information is used to determine whether there is permission to call cross-device hardware across devices;

[0030] Stores permission information across device hardware.

[0031] In one implementation, before obtaining the hardware notification message sent by the associated device for the cross-device hardware, the method further includes:

[0032] When it is determined that the message sending conditions are met, a device interconnection message is sent to the associated device;

[0033] The receiving associated device multiplexes the device response message returned by the associated transmission channel; the associated transmission channel is the channel through which the associated device receives the device interconnection message.

[0034] On the one hand, an embodiment of the present application provides a method for synchronizing data across device hardware, the method comprising:

[0035] Send a hardware notification message to the calling device;

[0036] Receive the hardware information acquisition request returned by the multiplexed data transmission channel of the calling device; the data transmission channel is the channel for receiving hardware notification messages;

[0037] Based on the hardware information acquisition request, the data transmission channel is multiplexed to send the target hardware data across the device hardware to the calling device.

[0038] In one implementation, before sending the hardware notification message to the calling device, the method further includes:

[0039] Monitor the message and obtain the device interconnection message sent by the calling device;

[0040] The associated transmission channel is reused to return the device response message to the calling device; the associated transmission channel is the channel through which the associated device receives the device interconnection message.

[0041] On the one hand, an embodiment of the present application provides a data synchronization device across device hardware, including:

[0042] A monitoring unit, used to monitor messages of associated devices, and obtain hardware notification messages sent by associated devices to cross-device hardware; cross-device hardware is hardware in the associated devices;

[0043] A multiplexing unit is used to multiplex the data transmission channel and send a hardware information acquisition request to the associated device if it is determined that the set synchronization condition is met; the data transmission channel is a channel for receiving hardware notification messages;

[0044] The receiving unit is used to receive target hardware data across device hardware returned by the associated device through the data transmission channel.

[0045] In one implementation, the multiplexing unit is used to:

[0046] If it is determined based on the hardware notification message that there is a hardware update, it is determined that the set synchronization condition is met;

[0047] If it is determined that the hardware data acquisition instruction is received, it is determined that the set synchronization condition is met;

[0048] If the associated device is detected to be online, it is determined that the set synchronization conditions are met.

[0049] In one implementation, the multiplexing unit is used to:

[0050] If the hardware notification message is a hardware update notification, then obtaining the target hardware identifier contained in the hardware update notification;

[0051] If it is determined that no hardware identification matching the target hardware identification is stored locally, it is determined that there is a hardware update in the associated device.

[0052] In one implementation, the multiplexing unit is further used for:

[0053] When it is determined that the first registration condition is met, register an online and offline listener; the online and offline listener is used to monitor online and offline notifications of associated devices;

[0054] Monitor based on online and offline monitors;

[0055] Stores the monitored online and offline notifications of associated devices.

[0056] In one implementation, the monitoring unit is further configured to:

[0057] When it is determined that the second registration condition is met, a transmission listener is registered; the transmission listener is used to monitor messages of the associated device.

[0058] In one implementation, the receiving unit is further configured to:

[0059] From the target hardware data, obtain the associated device information and the hardware metadata of the cross-device hardware;

[0060] Establish collaborative relationships based on associated device information and hardware metadata;

[0061] When it is determined that the hardware call conditions are met, the cross-device hardware is called based on the collaborative relationship.

[0062] In one implementation, the receiving unit is further configured to:

[0063] Multiplex the data transmission channel to send permission acquisition requests for cross-device hardware to associated devices;

[0064] Receive permission information returned by the associated device; the permission information is used to determine whether there is permission to call cross-device hardware across devices;

[0065] Stores permission information across device hardware.

[0066] In one implementation, the monitoring unit is further configured to:

[0067] When it is determined that the message sending conditions are met, a device interconnection message is sent to the associated device;

[0068] The receiving associated device multiplexes the device response message returned by the associated transmission channel; the associated transmission channel is the channel through which the associated device receives the device interconnection message.

[0069] On the one hand, an embodiment of the present application provides a data synchronization device across device hardware, including:

[0070] A sending unit, used for sending a hardware notification message to a calling device;

[0071] A return unit, used to receive a hardware information acquisition request returned by calling a multiplexed data transmission channel of a device; the data transmission channel is a channel for receiving hardware notification messages;

[0072] The transmission unit is used to multiplex the data transmission channel based on the hardware information acquisition request and send the target hardware data across the device hardware to the calling device.

[0073] In one implementation, the sending unit is further configured to:

[0074] Monitor the message and obtain the device interconnection message sent by the calling device;

[0075] The associated transmission channel is reused to return the device response message to the calling device; the associated transmission channel is the channel through which the associated device receives the device interconnection message.

[0076] On the one hand, an embodiment of the present application provides an electronic device, including:

[0077] Processor; and

[0078] The memory stores computer instructions, wherein the computer instructions are used to cause the processor to execute the steps of the method provided in any of the various optional implementations of data synchronization across device hardware as described above.

[0079] On the one hand, an embodiment of the present application provides a storage medium storing computer instructions for causing a computer to execute steps of a method provided in any of the above-mentioned various optional implementations of data synchronization across device hardware.

[0080] The data synchronization method of cross-device hardware in the embodiment of the present application includes monitoring the messages of the associated devices, obtaining the hardware notification message sent by the associated devices to the cross-device hardware; the cross-device hardware is the hardware in the associated devices; if it is determined that the set synchronization conditions are met, then multiplexing the data transmission channel to send a hardware information acquisition request to the associated devices; the data transmission channel is the channel for receiving the hardware notification message; receiving the target hardware data of the cross-device hardware returned by the associated devices through the data transmission channel. In this way, the performance of data synchronization is improved through channel multiplexing. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0082] Figure 1 This is an example diagram of the architecture of a calling device in an embodiment of the present application.

[0083] Figure 2 It is an interaction diagram of a method for data synchronization initialization in an embodiment of the present application.

[0084] Figure 3 It is a flowchart of a data synchronization method across device hardware in an embodiment of the present application.

[0085] Figure 4 It is an example table of hardware metadata in an embodiment of the present application.

[0086] Figure 5 This is an example diagram of a database structure in an embodiment of the present application.

[0087] Figure 6 This is an example diagram of a data table structure in an embodiment of the present application.

[0088] Figure 7 It is a structural block diagram of a data synchronization device across device hardware in an embodiment of the present application.

[0089] Figure 8 It is a structural block diagram of another cross-device hardware data synchronization device in an embodiment of the present application.

[0090] Fig. 9 It is a structural schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0091] The technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described implementation methods are part of the implementation methods of the present application, rather than all of the implementation methods. Based on the implementation methods in the present application, all other implementation methods obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In addition, the technical features involved in the different implementation methods of the present application described below can be combined with each other as long as they do not conflict with each other.

[0092] First, some terms involved in the embodiments of the present application are explained to facilitate understanding by those skilled in the art.

[0093] Terminal device: can be a mobile terminal, a fixed terminal or a portable terminal, such as a mobile phone, a station, a unit, a device, a multimedia computer, a multimedia tablet, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a personal communication system device, a personal navigation device, a personal digital assistant, an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a gaming device or any combination thereof, including accessories and peripherals of these devices or any combination thereof. It is also foreseeable that the terminal device can support any type of interface for the user (such as a wearable device), etc.

[0094] Server: It can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms.

[0095] In a multi-device networking environment, users usually want to use the hardware resources of other devices in the network on one device. For example, since the camera configuration on the mobile phone is relatively high and the camera configuration on the tablet is relatively low, the tablet can call the camera of the mobile phone to take pictures to obtain the taken pictures. If cross-device hardware calls are to be implemented, some hardware in the called device, i.e., the relevant data of the cross-device hardware, needs to be synchronized to the calling device.

[0096] However, in traditional methods, data synchronization is usually achieved in the following ways:

[0097] In the two devices, register listeners respectively. Take device A and device B as an example. When device A sends a message to device B, device A is used as the client and device B as the server. A message sending channel S1 is established. Device A sends messages to device B through channel S1. When device B sends a message to device A, a new channel needs to be re-established, that is, device B is used as the client and device A is used as the server. A message sending channel S2 is established. Device B sends messages to device A through S2.

[0098] However, since two devices need to establish channels separately when sending messages to each other, this will result in greater power consumption and lower efficiency.

[0099] Based on the defects of the above-mentioned related technologies, the embodiments of the present application provide a data synchronization method, apparatus, electronic device and storage medium across device hardware, aiming to improve the performance of data synchronization across device hardware.

[0100] An embodiment of the present application provides a method for data synchronization across device hardware. The method can be applied to electronic devices. The present application does not limit the type of electronic device. It can be any type of device suitable for implementation, such as a terminal device and a server, etc. The present application will not go into details about this.

[0101] In the embodiment of the present application, the application of calling a device is used as an example for explanation. Figure 1 Describes the calling device. Figure 1 The figure shows an example diagram of the architecture of a calling device.

[0102] Figure 1 In the example, the calling device includes virtual hardware service, hardware coordination service interface and distributed hardware coordination service. Virtual hardware service includes virtual camera service, virtual audio service and virtual peripheral service.

[0103] Among them, the virtual hardware service can call the distributed hardware collaboration service through the hardware collaboration service interface, that is, the hardware collaboration service application programming interface (API), to obtain the online and offline notifications of the associated devices, the target hardware data of the cross-device hardware, and the collaboration relationship, etc. It can also call the distributed hardware collaboration service through the hardware collaboration service interface to realize cross-device calls to the hardware in the calling device.

[0104] Among them, the distributed hardware collaboration service can include the following multiple modules: local hardware management module, remote hardware management module, persistent storage module, remote communication module, hardware online and offline management module, and permission and security module. The distributed hardware collaboration service can be used to initialize each module and manage the hardware based on each module to realize the core service of calling the local hardware and the hardware in the associated devices.

[0105] Among them, the local hardware management module is used to scan the local hardware, obtain the local hardware data corresponding to each local hardware, and store and manage the local hardware data of the calling device; the remote hardware management module is used to obtain and manage the hardware metadata of the cross-device hardware in the associated device; the persistent storage module is used to store the hardware-related information of the local hardware and cross-device hardware (such as local hardware data, associated device identification, hardware metadata and collaborative relationships, etc.); the remote communication module is used for message monitoring, and to synchronize the target hardware data between the calling device and the associated device, and to add, delete, modify, check and exchange data of the target hardware data. The hardware online and offline management module is used to monitor the online and offline of the associated device, store and manage the online and offline notifications of the associated device, and obtain the basic information of the device; the permission and security module is used for permission application, storage and management of cross-device hardware calls, as well as network authentication testing.

[0106] In an embodiment of the present application, the distributed hardware collaboration service adopts a unified global hardware resource pool abstract model to manage the distributed hardware of each device, and can dynamically obtain the hardware metadata of different devices, realize cross-device hardware metadata synchronization, and realize cross-device permission management of hardware of different devices. It also realizes online and offline monitoring of associated devices, providing a basis for cross-device calls of hardware in associated devices.

[0107] In the embodiment of the present application, after the calling device discovers the associated device, it can first be initialized, and then data synchronization across device hardware is performed with the associated device.

[0108] Figure 2 This is an interaction diagram of a method for data synchronization initialization. Figure 1 and 2 The method is described below. The specific implementation process of the method is as follows:

[0109] Step 200: The associated device sends a device online wake-up message to the calling device.

[0110] Among them, the calling device and the associated device can be different devices logged in with the same account and located in the same communication network. If different devices logged in with the same account can communicate through communication networks such as Bluetooth or local area network, it is determined that these devices form an ad hoc network. The calling device and the associated device are in a calling and called relationship. Any two devices in the ad hoc network can be used as the calling device and the associated device respectively to make cross-device hardware calls. That is, the calling device can call the hardware of the associated device across devices. The associated device can be one or more. The calling device can make cross-device hardware calls to one or more associated devices in the ad hoc network.

[0111] In one implementation, when the associated device determines that the set wake-up condition is met, it sends an online wake-up message to other devices in the ad hoc network.

[0112] As an example, after the associated device goes online (such as logging into an account), a device detection is performed. If a calling device with no connection relationship is detected in the self-organizing network, it is determined that the set wake-up conditions are met and a device online wake-up message is sent to the calling device.

[0113] As another example, the associated device and the calling device are both equipped with the Tianqin interoperability architecture, and based on this architecture, a static service distrbutedHardware is registered. After the associated device is online, the distrbutedHardware service is used to detect the device to determine whether there are devices in the same ad hoc network. If it is determined that there are devices in the same ad hoc network (i.e., the calling device), a device online wake-up message is sent to the device.

[0114] In actual applications, the wake-up condition can be set according to the actual application scenario and is not limited here.

[0115] Step 201: The hardware online and offline management module performs device access management operations based on the device online wake-up message.

[0116] In one implementation, when the calling device determines that a device online wake-up message is received, basic device information included in the device online wake-up message is acquired and the basic device information is stored.

[0117] As an example, the basic device information may include an associated device identifier and a device name.

[0118] In actual applications, basic device information can be set according to actual application scenarios and is not restricted here.

[0119] Step 202: The hardware online and offline management module registers an online and offline listener.

[0120] In one implementation, when registering an online and offline listener, the following steps may be used:

[0121] S2021: When it is determined that the first registration condition is met, register an online and offline listener.

[0122] Specifically, when receiving a device online wake-up message sent by an associated device, it is determined that the first registration condition is met, and the online and offline listener is registered through the hardware online and offline management module, and all associated devices in the same ad hoc network are monitored through the online and offline listener.

[0123] Among them, the online and offline listener is used to monitor the online and offline notifications of the associated devices. Online and offline notifications include device online notifications and device offline notifications. For example, if an account is logged in to the device, it is determined that the device is in the device online notification. If the account in the device is logged out, it is determined that the device is in the device offline notification.

[0124] Optionally, the first registration condition may also call for device startup. In actual applications, the first registration condition may be set according to actual application scenarios and is not limited here.

[0125] It should be noted that, since the online and offline listener can monitor the online and offline of multiple devices, only one registration is required. Therefore, if it is determined that the online and offline listener already exists, step 202 may not be performed.

[0126] For example, there are two associated devices. After the first associated device comes online, the device registration online and offline listener is called. Then, after the second associated device comes online, there is no need to register the online and offline listener again.

[0127] Step 203: The local hardware management module scans the local hardware to obtain local hardware data.

[0128] In one implementation, the local hardware may be scanned in real time or periodically to obtain local hardware data.

[0129] It should be noted that if it is determined that local hardware data has been stored, step 203 may not be performed.

[0130] Step 204: The remote communication module registers a transmission listener.

[0131] The transmission listener is used to monitor messages from associated devices.

[0132] In one implementation, when it is determined that a device online wake-up message is received and the second registration condition is met, a transmission listener is registered and message monitoring is performed through the transmission listener. As an example, after the remote communication module registers the transmission listener, it monitors a success response message sent by the associated device.

[0133] Optionally, the second registration condition may also be when the calling device is started, when an associated device is found to exist, or when other associated devices are determined to be online.

[0134] In actual applications, the second registration condition can be set according to the actual application scenario and is not limited here.

[0135] It should be noted that, based on a principle similar to that of online and offline listeners, if it is determined that a transmission listener has been registered in the calling device, step 204 may not be performed.

[0136] Furthermore, the associated device and the calling device may both be provided with the Tianqin interoperability architecture, and both may register the dynamic service publicMetadataVersion based on the Tianqin interoperability architecture. The associated device may send a message to the calling device based on the publicMetadataVersion. The calling device may receive the message through a transmission listener. Among them, publicMetadataVersion is a service for data transmission. As an example, the data field of publicMetadataVersion may be used to transmit information such as version number.

[0137] Step 205: The persistent storage module stores local hardware data.

[0138] In one implementation, the local hardware management module scans the local hardware, obtains the local hardware data, and sends the local hardware data to the persistent storage module. The persistent storage module receives and stores the local hardware data.

[0139] In the embodiment of the present application, after the calling device is initialized, the data of the hardware in the associated device can be synchronized. Figure 3 FIG. 1 is a flowchart of a method for synchronizing data across device hardware in an embodiment of the present application. Figure 1 and Figure 3 The method is described below. The specific implementation process of the method is as follows:

[0140] Step 300: Monitor messages of associated devices to obtain hardware notification messages sent by associated devices for cross-device hardware.

[0141] In one implementation, when the calling device determines that the second registration condition is met, it registers a transmission listener and monitors messages through the transmission listener. The associated device sends a hardware notification message to the calling device, and the calling device monitors the hardware notification message.

[0142] The transmission listener is used to monitor messages of the associated device. The cross-device hardware is the hardware in the associated device. Specifically, the cross-device hardware is the hardware in the associated device that can be called by the calling device.

[0143] As an example, after the calling device registers a transmission listener, if an associated device sends a hardware notification message to the calling device, the calling device can listen to the hardware notification message through the transmission listener, and send the hardware notification message to the data transmission channel of the calling device as the data transmission channel for subsequent data transmission, that is, channel multiplexing.

[0144] Step 301: If it is determined that the set synchronization condition is met, a data transmission channel is reused to send a hardware information acquisition request to an associated device; the data transmission channel is a channel for receiving hardware notification messages.

[0145] Specifically, if it is determined that the set synchronization condition is met, the device multiplexing data transmission channel is called to send a hardware information acquisition request to the associated device. The associated device receives the hardware information acquisition request returned by the multiplexing data transmission channel of the calling device, and based on the hardware information acquisition request, multiplexes the data transmission channel to send the target hardware data across the device hardware to the calling device.

[0146] In one implementation, when it is determined that the set synchronization condition is met, any of the following methods may be used:

[0147] Method 1: If it is determined based on the hardware notification message that there is a hardware update, it is determined that the set synchronization condition is met.

[0148] Optionally, when it is determined that there is a hardware update, you can take the following steps:

[0149] S3011: If the hardware notification message is a hardware update notification, obtain the target hardware identifier contained in the hardware update notification.

[0150] The target hardware identifier is used to identify the hardware and its version, so as to determine whether there is any addition or deletion of the hardware, and whether there is any version change of the hardware.

[0151] In one implementation, when the associated device determines that there is a hardware update locally, it obtains the target hardware identifier of the updated hardware and sends a hardware update notification including the target hardware identifier to the calling device.

[0152] S3012: If it is determined that no hardware identification matching the target hardware identification is stored locally, it is determined that there is a hardware update in the associated device.

[0153] As an example, obtain a locally stored hardware identification set, determine the matching degree between the target hardware identification and each hardware identification in the hardware identification set, if the maximum value of each matching degree is higher than the set matching degree (such as 0.9), it is determined that the hardware has not been updated, otherwise, it is determined that a hardware update has occurred.

[0154] As another example, the calling device receives an onServiceChange message (ie, a hardware notification message) sent by an associated device, and determines the hardware version number (ie, the hardware identifier) ​​through the data field in the onServiceChange message. If the hardware version number is inconsistent with the local version number, it is determined that a hardware update has occurred.

[0155] As another example, a specified character in the target hardware identification is obtained. If a hardware identification containing the specified character exists in the locally stored hardware identification set, it is determined that there is a matching hardware identification, and then the hardware in the associated device is not updated. Otherwise, it is determined that there is a hardware update.

[0156] In actual applications, the matching degree can be set according to the actual application scenario and is not limited here.

[0157] In one implementation, if it is determined that there is a hardware update, a data transmission channel is reused to send a hardware information acquisition request for obtaining updated hardware in the associated device to the associated device. As an example, a hardware information acquisition request containing a target hardware identifier of the updated hardware is sent.

[0158] Method 2: If it is determined that the hardware data acquisition instruction is received, it is determined that the set synchronization condition is met.

[0159] In one implementation, when a new associated device is added to the ad hoc network, the associated device sends a hardware data acquisition instruction to the calling device, and the calling device reuses the data transmission channel to send a hardware information acquisition request to the associated device.

[0160] In one implementation, if an associated device in the ad hoc network goes offline and then comes online again, the associated device also sends a hardware data acquisition instruction to the calling device. The calling device reuses the data transmission channel and sends a hardware information acquisition request to the associated device.

[0161] The hardware information acquisition request may also include hardware filtering conditions to obtain hardware metadata of cross-device hardware in the associated devices that meets the hardware filtering conditions. The hardware filtering conditions may be to set the hardware type, or to set the hardware name or hardware identifier. For example, the hardware filtering conditions are: filter cameras and displays. This is because the calling device may only need to call one or more hardware in the associated devices, so it is not necessary to obtain data for all hardware in the associated devices.

[0162] In this way, when the associated device finds hardware updates, it can promptly notify the calling device to trigger data synchronization.

[0163] Method 3: If the associated device is detected to be online, it is determined that the set synchronization conditions are met.

[0164] In one implementation, when it is determined that the first registration condition is met, an online and offline listener is registered; the online and offline listener is used to monitor online and offline notifications of associated devices; based on the online and offline listener, if an online notification is monitored, it is determined that the set synchronization condition is met. Furthermore, the monitored online and offline notifications of associated devices can also be stored.

[0165] In actual applications, the synchronization conditions can be set according to the actual application scenario and are not limited here.

[0166] In this way, data synchronization can be triggered when it is determined that the associated device is online.

[0167] Step 302: Receive target hardware data across device hardware returned by the associated device through the data transmission channel.

[0168] In one implementation, the hardware information acquisition request includes hardware filtering conditions, and the associated device filters the local hardware according to the hardware filtering conditions, obtains the filtered cross-device hardware, obtains the target hardware data of the filtered cross-device hardware, and returns the target hardware data to the calling device through the data transmission channel.

[0169] The target hardware data may include hardware metadata of cross-device hardware, and may also include associated device information (eg, device identification) as well.

[0170] Furthermore, the calling device may also set a unique identifier for all cross-device hardware in each associated device, and obtain a unique identifier dhID for each cross-device hardware to distinguish different hardware.

[0171] Combine the following Figure 4 Provides an example of hardware metadata. Figure 4 is an example table of hardware metadata. The parameters of hardware metadata include Owner, Type, Attibute and dhID, and their corresponding meanings are: owner, type, attribute and unique ID. Among them, Owner is the name of the provider that provides services for hardware (such as camera), such as com.xiaomi.vtcamera. Type is the hardware type, such as CAMERA, and Attibute is the attribute information of the hardware, such as {"version":1, "attr":[{"cameraId":0, "facing":"back", "orientation":90, "character":{"preview":{"fps":[{"lower":30, "upper":30}], "sizes":[{"width":1440, "height":3080"audio":{"codec":"aac","bit_rate":96000,"sample_rate":48000,"channels":1}]}. dhID is used to uniquely identify hardware and is automatically generated by the calling device to distinguish different hardware, such as 9FAeraCA04.

[0172] It should be noted that in the traditional method, both devices have registered listeners. Taking device A and device B as an example, when device A sends a message to device B, device A is used as the client and device B is used as the server to establish channel S1. When device B sends a message to device A, a new channel needs to be re-established, that is, device B is used as the client and device A is used as the server to establish channel S2. However, in the traditional technology, since two devices need to establish channels separately when sending messages to each other, it will cause power consumption, low efficiency, and large performance loss. In the embodiment of the present application, there is no need to re-establish a new channel, and the same channel can be reused, which reduces power consumption and improves efficiency and performance.

[0173] Furthermore, a collaborative relationship may be established and stored based on associated device information and hardware metadata.

[0174] In one implementation, the implementation process of step 302 may further include:

[0175] S3021: Obtain associated device information and hardware metadata of cross-device hardware from target hardware data.

[0176] S3022: Establish a collaborative relationship based on associated device information and hardware metadata.

[0177] Among them, the collaborative relationship is used to call the virtual hardware service of the device to make cross-device calls to cross-device hardware. After establishing the collaborative relationship, the virtual hardware service in the calling device can call the distributed hardware collaborative service through the hardware collaborative service interface, and based on the collaborative relationship, the hardware call instructions and data streams are exchanged with the associated devices to realize cross-device calls to cross-device hardware.

[0178] In one implementation, corresponding data tables are established for associated device information, hardware metadata, and collaborative relationships for data storage, and parameters, data types, primary keys, and parameter necessity of each data table are set.

[0179] Combine the following Figure 5 , describing the storage of target hardware data and collaborative relationships. Figure 5 The following is an example diagram of a database structure. Figure 5In the database, there are three data tables, and the table names are: device_info, hardware_info, and association_info. The purpose of device_info is to store associated device information, and the primary key is device_id. The purpose of hardware_info is to store hardware metadata, and the primary key is dh_id. The purpose of association_info is to store collaborative relationships, and the primary keys are dh_id and remoted_device_id.

[0180] Combine the following Figure 6 , the structure of each data table is illustrated with examples. Figure 6 The following is an example diagram of a data table structure. Figure 6 In the figure, there are data structure examples of the three data tables device_info, hardware_info and association_info, that is, the parameters contained in each data table, as well as the data type of each parameter, whether it is a primary key and whether it is a required parameter, etc.

[0181] In this way, a data table can be generated according to the set data structure, and the associated device information, target hardware data and collaborative relationship can be stored separately through each data table in the database.

[0182] S3023: When it is determined that the hardware calling conditions are met, the cross-device hardware is called based on the collaborative relationship.

[0183] In one implementation, when it is determined that a hardware call instruction is received from the virtual hardware service through the hardware coordination service interface, it is determined that the hardware call condition is met.

[0184] As an example, the virtual camera service in the device is called through the hardware collaborative service interface, and based on the collaborative relationship, the camera in the associated device is called to perform a photo-taking operation.

[0185] Furthermore, permission information of cross-device hardware can also be obtained.

[0186] In one implementation, a data transmission channel is multiplexed to send a permission request for cross-device hardware to an associated device; permission information returned by the associated device is received; and the permission information is used to determine whether there is permission to call cross-device hardware across devices to store permission information for cross-device hardware.

[0187] Furthermore, if the associated device does not send a hardware notification message to the calling device, the associated device may also establish an associated transmission channel between the two according to the channel for receiving the message.

[0188] In one implementation, when the call determines that the message sending conditions are met, a device interconnection message is sent to the associated device; the associated device monitors the message, obtains the device interconnection message sent by the calling device, and reuses the associated transmission channel to return a device response message to the calling device; the calling device receives the device response message returned by the associated device using the multiplexed associated transmission channel; the associated transmission channel is the channel through which the associated device receives the device interconnection message.

[0189] It should be noted that the associated transmission channel and the data transmission channel are both channels for transmission between the two. After any one of the associated transmission channel and the data transmission channel is established, the channel can be reused for data transmission without establishing a new channel. The embodiment of the present application can be applied to systems such as Android, Windows, and Linux, and the systems of the calling device and the associated device can be the same or different (i.e., supporting cross-platform data synchronization), and the stability, efficiency, and scalability of cross-device hardware data synchronization are all high.

[0190] In the embodiment of the present application, the online and offline listeners can be used to monitor to determine the online and offline notifications of the associated devices, and the transmission listeners can be used to monitor to determine the hardware notifications of the associated devices, and the data transmission channel when receiving the hardware notification can be used to synchronize the data across the device hardware, so that there is no need to re-establish a new channel, which reduces the power consumption, improves efficiency and performance, and the local hardware data of the calling device, the target hardware data of the associated device, and the permission information of the cross-device hardware can be synchronized, stored and managed through the distributed hardware collaborative service, thereby realizing the hardware resource management of the calling device and the associated device. Furthermore, it can be applied to a variety of systems, and can support cross-platform data synchronization, with a wide range of applications. Furthermore, through the management of hardware resources, the calling device can coordinate the cross-device hardware in the associated device to implement the business of the calling device, providing a good foundation for the calling of cross-device hardware.

[0191] Based on the same inventive concept, a data synchronization device across device hardware is also provided in the embodiment of the present application. Since the principle of solving the problem by the above device and the device is similar to that of a data synchronization method across device hardware, the implementation of the above device can refer to the implementation of the method, and the repeated parts will not be repeated. The device can be applied to electronic devices. The present application does not limit the type of electronic devices. It can be any type of device suitable for implementation, such as terminal devices and servers, etc., and the present application will not repeat them.

[0192] See also Figure 7 , which is a structural block diagram of a data synchronization device across device hardware in an embodiment of the present application. In some implementations, the data synchronization device across device hardware in the example of the present application includes:

[0193] On the one hand, an embodiment of the present application provides a data synchronization device across device hardware, including:

[0194] The monitoring unit 701 is used to monitor the messages of the associated device and obtain the hardware notification message sent by the associated device to the cross-device hardware; the cross-device hardware is the hardware in the associated device;

[0195] The multiplexing unit 702 is used to multiplex the data transmission channel and send a hardware information acquisition request to the associated device if it is determined that the set synchronization condition is met; the data transmission channel is a channel for receiving hardware notification messages;

[0196] The receiving unit 703 is used to receive the cross-device hardware target data returned by the associated device through the data transmission channel.

[0197] In one implementation, the multiplexing unit 702 is used to:

[0198] If it is determined based on the hardware notification message that there is a hardware update, it is determined that the set synchronization condition is met;

[0199] If it is determined that the hardware data acquisition instruction is received, it is determined that the set synchronization condition is met;

[0200] If the associated device is detected to be online, it is determined that the set synchronization conditions are met.

[0201] In one implementation, the multiplexing unit 702 is used to:

[0202] If the hardware notification message is a hardware update notification, then obtaining the target hardware identifier contained in the hardware update notification;

[0203] If it is determined that no hardware identification matching the target hardware identification is stored locally, it is determined that there is a hardware update in the associated device.

[0204] In one implementation, the multiplexing unit 702 is further configured to:

[0205] When it is determined that the first registration condition is met, register an online and offline listener; the online and offline listener is used to monitor online and offline notifications of associated devices;

[0206] Monitor based on online and offline monitors;

[0207] Stores the monitored online and offline notifications of associated devices.

[0208] In one implementation, the monitoring unit 701 is further configured to:

[0209] When it is determined that the second registration condition is met, a transmission listener is registered; the transmission listener is used to monitor messages of the associated device.

[0210] In one implementation, the receiving unit 703 is further configured to:

[0211] From the target hardware data, obtain the associated device information and the hardware metadata of the cross-device hardware;

[0212] Establish collaborative relationships based on associated device information and hardware metadata;

[0213] When it is determined that the hardware call conditions are met, the cross-device hardware is called based on the collaborative relationship.

[0214] In one implementation, the receiving unit 703 is further configured to:

[0215] Multiplex the data transmission channel to send permission acquisition requests for cross-device hardware to associated devices;

[0216] Receive permission information returned by the associated device; permission information is used to determine whether there is permission to call cross-device hardware across devices

[0217] Stores permission information across device hardware.

[0218] In one implementation, the monitoring unit 701 is further configured to:

[0219] When it is determined that the message sending conditions are met, a device interconnection message is sent to the associated device;

[0220] The receiving associated device multiplexes the device response message returned by the associated transmission channel; the associated transmission channel is the channel through which the associated device receives the device interconnection message.

[0221] See also Figure 8 FIG. 1 is a block diagram of another cross-device hardware data synchronization apparatus in an embodiment of the present application. In some implementations, the cross-device hardware data synchronization apparatus in the present application example includes:

[0222] The sending unit 801 is used to send a hardware notification message to the calling device;

[0223] The return unit 802 is used to receive the hardware information acquisition request returned by the multiplexed data transmission channel of the calling device; the data transmission channel is a channel for receiving hardware notification messages;

[0224] The transmission unit 803 is used to multiplex the data transmission channel based on the hardware information acquisition request and send the target hardware data across the device hardware to the calling device.

[0225] In one implementation, the sending unit is further configured to:

[0226] Monitor the message and obtain the device interconnection message sent by the calling device;

[0227] The associated transmission channel is reused to return the device response message to the calling device; the associated transmission channel is the channel through which the associated device receives the device interconnection message.

[0228] The data synchronization method of cross-device hardware in the embodiment of the present application includes monitoring the messages of the associated devices, obtaining the hardware notification message sent by the associated devices to the cross-device hardware; the cross-device hardware is the hardware in the associated devices; if it is determined that the set synchronization conditions are met, then multiplexing the data transmission channel to send a hardware information acquisition request to the associated devices; the data transmission channel is the channel for receiving the hardware notification message; receiving the target hardware data of the cross-device hardware returned by the associated devices through the data transmission channel. In this way, the performance of data synchronization is improved through channel multiplexing.

[0229] In an embodiment of the present application, an electronic device is provided, including:

[0230] Processor; and

[0231] The memory stores computer instructions, where the computer instructions are used to enable the processor to execute the method of any of the above embodiments.

[0232] In an embodiment of the present application, a storage medium is provided, which stores computer instructions, and the computer instructions are used to enable a computer to execute a method in any of the above-mentioned embodiments. Fig. 9 FIG. 9 is a schematic diagram showing the structure of an electronic device 9000. Fig. 9 As shown, the electronic device 9000 includes: a processor 9010 and a memory 9020 , and optionally, may also include a power supply 9030 , a display unit 9040 , and an input unit 9050 .

[0233] The processor 9010 is the control center of the electronic device 9000. It connects various components using various interfaces and lines, and performs various functions of the electronic device 9000 by running or executing software programs and / or data stored in the memory 9020, thereby monitoring the electronic device 9000 as a whole.

[0234] In the embodiment of the present application, the processor 9010 executes the various steps in the above embodiment when calling the computer program stored in the memory 9020.

[0235] Optionally, the processor 9010 may include one or more processing units; preferably, the processor 9010 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 9010. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips.

[0236] The memory 9020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, various applications, etc.; the data storage area may store data created according to the use of the electronic device 9000, etc. In addition, the memory 9020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices, etc.

[0237] The electronic device 9000 also includes a power source 9030 (such as a battery) for supplying power to various components. The power source can be logically connected to the processor 9010 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.

[0238] The display unit 9040 may be used to display information input by the user or information provided to the user and various menus of the electronic device 9000, and in the embodiment of the present application, is mainly used to display the display interface of each application in the electronic device 9000 and objects such as text and pictures displayed in the display interface. The display unit 9040 may include a display panel 9041. The display panel 9041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0239] The input unit 9050 may be used to receive information such as numbers or characters input by the user. The input unit 9050 may include a touch panel 9051 and other input devices 9052. The touch panel 9051, also known as a touch screen, may collect touch operations of the user on or near it (such as operations of the user using a finger, a touch pen, or any other suitable object or accessory on or near the touch panel 9051).

[0240] Specifically, the touch panel 9051 can detect the user's touch operation, detect the signal brought by the touch operation, convert these signals into touch point coordinates, send them to the processor 9010, and receive and execute the command sent by the processor 9010. In addition, the touch panel 9051 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices 9052 can include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.

[0241] Of course, the touch panel 9051 can cover the display panel 9041. When the touch panel 9051 detects a touch operation on or near it, it transmits it to the processor 9010 to determine the type of touch event, and then the processor 9010 provides corresponding visual output on the display panel 9041 according to the type of touch event. Fig. 9 In the embodiment, the touch panel 9051 and the display panel 9041 are used as two independent components to realize the input and output functions of the electronic device 9000, but in some embodiments, the touch panel 9051 and the display panel 9041 can be integrated to realize the input and output functions of the electronic device 9000.

[0242] The electronic device 9000 may also include one or more sensors, such as a pressure sensor, a gravity acceleration sensor, a proximity light sensor, etc. Of course, according to the needs of specific applications, the electronic device 9000 may also include other components such as a camera. Since these components are not the key components used in the embodiments of the present application, Fig. 9 It is not shown and will not be described in detail.

[0243] Those skilled in the art will understand that Fig. 9 The electronic device is merely an example and does not limit the electronic device, and may include more or less components than those shown in the figure, or may combine certain components, or may include different components.

[0244] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0245] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the embodiments. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. The obvious changes or modifications derived therefrom are still within the scope of protection created by this application.

Claims

1. A data synchronization method across device hardware, It is characterized in that The method comprises: Monitoring messages of associated devices to obtain hardware notification messages sent by the associated devices to cross-device hardware; the cross-device hardware is hardware in the associated devices; If it is determined that the set synchronization condition is met, multiplexing the data transmission channel to send a hardware information acquisition request to the associated device; the data transmission channel is a channel for receiving the hardware notification message; The target hardware data of the cross-device hardware is received, which is returned by the associated device through the data transmission channel.

2. The method according to claim 1, It is characterized in that The determining that the set synchronization condition is met includes: If it is determined based on the hardware notification message that there is a hardware update, then it is determined that the set synchronization condition is met; If it is determined that the hardware data acquisition instruction is received, it is determined that the set synchronization condition is met; If it is monitored that the associated device is online, it is determined that the set synchronization condition is met.

3. The method according to claim 1, It is characterized in that The determining that there is a hardware update based on the hardware notification message includes: If the hardware notification message is a hardware update notification, obtaining the target hardware identifier contained in the hardware update notification; If it is determined that no hardware identification matching the target hardware identification is stored locally, it is determined that there is a hardware update in the associated device.

4. The method according to claim 2, It is characterized in that The method further comprises: When it is determined that the first registration condition is met, registering an online and offline listener; the online and offline listener is used to monitor online and offline notifications of the associated device; Monitoring based on the online and offline monitors; The monitored online and offline notifications of the associated device are stored.

5. The method according to any one of claims 1 to 4, It is characterized in that Before monitoring the message of the associated device, the method further includes: When it is determined that the second registration condition is met, a transmission listener is registered; the transmission listener is used to monitor messages of the associated device.

6. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Acquire associated device information and hardware metadata of the cross-device hardware from the target hardware data; Establishing a collaborative relationship based on the associated device information and the hardware metadata; When it is determined that the hardware calling condition is met, the cross-device hardware is called based on the collaborative relationship.

7. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Reusing the data transmission channel to send a permission acquisition request for the cross-device hardware to the associated device; Receive the permission information returned by the associated device; the permission information is used to determine whether there is permission to call the cross-device hardware across devices The permission information of the cross-device hardware is stored.

8. The method according to any one of claims 1 to 4, It is characterized in that Before obtaining the hardware notification message sent by the associated device for the cross-device hardware, the method further includes: When it is determined that the message sending condition is met, sending a device interconnection message to the associated device; Receive a device response message returned by the associated device through a multiplexed associated transmission channel; the associated transmission channel is a channel through which the associated device receives the device interconnection message.

9. A data synchronization method across device hardware, It is characterized in that The method comprises: Send a hardware notification message to the calling device; Receiving a hardware information acquisition request returned by the calling device multiplexing data transmission channel; the data transmission channel is a channel for receiving the hardware notification message; Based on the hardware information acquisition request, the data transmission channel is reused to send target hardware data across device hardware to the calling device.

10. The method according to claim 9, It is characterized in that Before sending the hardware notification message to the calling device, the method further includes: Monitor the message and obtain the device interconnection message sent by the calling device; The associated transmission channel is reused to return a device response message to the calling device; the associated transmission channel is a channel for the associated device to receive the device interconnection message.

11. A data synchronization device across device hardware, It is characterized in that The device comprises: A monitoring unit, configured to monitor messages of associated devices, and obtain hardware notification messages sent by the associated devices for cross-device hardware; the cross-device hardware is hardware in the associated devices; A multiplexing unit, configured to multiplex a data transmission channel to send a hardware information acquisition request to the associated device if it is determined that the set synchronization condition is met; the data transmission channel is a channel for receiving the hardware notification message; A receiving unit is used to receive the target hardware data of the cross-device hardware returned by the associated device through the data transmission channel.

12. A data synchronization device across device hardware, It is characterized in that The device comprises: A sending unit, used for sending a hardware notification message to a calling device; A returning unit, configured to receive a hardware information acquisition request returned by the calling device multiplexing data transmission channel; the data transmission channel is a channel for receiving the hardware notification message; The transmission unit is used to multiplex the data transmission channel based on the hardware information acquisition request to send the target hardware data across the device hardware to the calling device.

13. An electronic device, It is characterized in that include: processor; as well as A memory storing computer instructions, wherein the computer instructions are used to enable the processor to execute the method according to any one of claims 1 to 10.

14. A storage medium, It is characterized in that Computer instructions are stored, and the computer instructions are used to make a computer execute the method according to any one of claims 1 to 10.