Data synchronization method and related device

By acquiring and verifying synchronization permissions between electronic devices, the problem of uncontrollable data synchronization range in existing technologies is solved, and secure and controllable data synchronization is achieved.

CN115017227BActive Publication Date: 2026-01-13HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110425903.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-03-05
Filing Date
2021-04-20
Publication Date
2026-01-13
Estimated Expiration
2041-04-20

Smart Images

  • Figure CN115017227B_ABST
    Figure CN115017227B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data synchronization method and related equipment. The method comprises: obtaining policy data corresponding to business data; checking synchronization permissions of a first electronic device and a second electronic device according to the policy data; and if the synchronization permissions of the first electronic device and the second electronic device are checked successfully, synchronizing the business data between the first electronic device and the second electronic device. The embodiments can realize controllable data synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of terminals, and in particular, to a data synchronization method and related equipment. BACKGROUND

[0002] With the development of terminal technology, the number of electronic devices owned by users is increasing, and the scenario of users using multiple electronic devices simultaneously is also becoming more and more common. When users operate multiple electronic devices, cross-device data synchronization is often required.

[0003] Distributed data services provide the ability for application programs to synchronize data between different devices. How to achieve range-controllable and security-controllable data synchronization between multiple electronic devices is an urgent problem to be solved. SUMMARY

[0004] Embodiments of the present application disclose a data synchronization method and related equipment, which achieve range-controllable data synchronization.

[0005] A first aspect of the present application discloses a data synchronization method applied to a first electronic device, the data synchronization method comprising: obtaining policy data corresponding to business data; checking synchronization permissions of the first electronic device and a second electronic device according to the policy data; and if the synchronization permissions of the first electronic device and the second electronic device are successfully checked, synchronizing the business data between the first electronic device and the second electronic device.

[0006] Generally, the range of distributed data synchronization between multiple electronic devices cannot be dynamically controlled according to the actual needs of the business. Embodiments of the present application can check the synchronization permissions of the first electronic device and the second electronic device according to the policy data, thereby controlling the range of electronic devices that can synchronize data with the first electronic device, and achieving range-controllable and security-controllable data synchronization.

[0007] In some optional embodiments, obtaining the policy data corresponding to the business data comprises: obtaining a data synchronization condition; and if the data synchronization condition is triggered, obtaining the policy data corresponding to the business data.

[0008] By adopting this technical solution, data synchronization can be controlled through a synchronization condition.

[0009] In some optional embodiments, obtaining the policy data corresponding to the business data comprises: obtaining first policy sub-data corresponding to the business data of the first electronic device; and obtaining second policy sub-data corresponding to the business data of the second electronic device.

[0010] In some optional embodiments, the checking the synchronization permission of the first electronic device and the second electronic device according to the policy data comprises: checking the synchronization permission from the first electronic device to the second electronic device according to the policy data; and / or checking the synchronization permission from the second electronic device to the first electronic device according to the policy data.

[0011] By adopting the technical scheme, the direction-controllable synchronization permission checking can be realized.

[0012] In some optional embodiments, the checking the synchronization permission from the first electronic device to the second electronic device according to the policy data comprises: judging whether the synchronization range of the first electronic device includes the second electronic device according to the policy data; if the synchronization range of the first electronic device includes the second electronic device, the checking of the synchronization permission from the first electronic device to the second electronic device is successful; and if the synchronization range of the first electronic device does not include the second electronic device, the checking of the synchronization permission from the first electronic device to the second electronic device is failed.

[0013] In some optional embodiments, the checking the synchronization permission from the first electronic device to the second electronic device according to the policy data comprises: judging whether the synchronization range of the first electronic device includes the second electronic device according to the policy data; if the synchronization range of the first electronic device includes the second electronic device, judging whether the application program corresponding to the service data has the synchronization permission according to the application type corresponding to the service data; if the application program corresponding to the service data has the synchronization permission, the checking of the synchronization permission from the first electronic device to the second electronic device is successful; and if the synchronization range of the first electronic device does not include the second electronic device or the application program corresponding to the service data does not have the synchronization permission, the checking of the synchronization permission from the first electronic device to the second electronic device is failed.

[0014] By adopting the technical scheme, the synchronization permission can be controlled by the application program.

[0015] In some optional embodiments, the judging whether the synchronization range of the first electronic device includes the second electronic device according to the policy data comprises: judging whether the remote device label of the first policy sub-data in the policy data includes the local device label of the second policy sub-data in the policy data; if the remote device label of the first policy sub-data includes the local device label of the second policy sub-data, it is determined that the synchronization range of the first electronic device includes the second electronic device; and if the remote device label of the first policy sub-data does not include the local device label of the second policy sub-data, it is determined that the synchronization range of the first electronic device does not include the second electronic device.

[0016] By adopting the technical scheme, the judging whether the synchronization range of the first electronic device includes the second electronic device according to the policy data can be realized.

[0017] In some alternative embodiments, the step of checking the synchronization permission from the second electronic device to the first electronic device according to the policy data comprises: judging whether the synchronization range of the second electronic device includes the first electronic device according to the policy data; and if the synchronization range of the second electronic device includes the first electronic device, checking the synchronization permission from the second electronic device to the first electronic device successfully; and if the synchronization range of the second electronic device does not include the first electronic device, checking the synchronization permission from the second electronic device to the first electronic device unsuccessfully.

[0018] In some alternative embodiments, the step of checking the synchronization permission from the second electronic device to the first electronic device according to the policy data comprises: judging whether the synchronization range of the second electronic device includes the first electronic device according to the policy data; and if the synchronization range of the second electronic device includes the first electronic device, judging whether the application program corresponding to the service data has the synchronization permission according to the application type corresponding to the service data; and if the application program corresponding to the service data has the synchronization permission, checking the synchronization permission from the second electronic device to the first electronic device successfully; and if the synchronization range of the second electronic device does not include the first electronic device or the application program corresponding to the service data does not have the synchronization permission, checking the synchronization permission from the second electronic device to the first electronic device unsuccessfully.

[0019] In some alternative embodiments, the step of judging whether the synchronization range of the second electronic device includes the first electronic device according to the policy data comprises: judging whether the remote device label of the second policy sub-data in the policy data includes the local device label of the first policy sub-data in the policy data; and if the remote device label of the second policy sub-data in the policy data includes the local device label of the first policy sub-data in the policy data, determining that the synchronization range of the second electronic device includes the first electronic device; and if the remote device label of the second policy sub-data in the policy data does not include the local device label of the first policy sub-data in the policy data, determining that the synchronization range of the second electronic device does not include the first electronic device.

[0020] In some alternative embodiments, if the synchronization permission between the first electronic device and the second electronic device is checked successfully, the step of synchronizing the service data between the first electronic device and the second electronic device comprises: if the synchronization permission from the first electronic device to the second electronic device is checked successfully, synchronizing the service data to the second electronic device; and / or if the synchronization permission from the second electronic device to the first electronic device is checked successfully, receiving the service data from the second electronic device.

[0021] In some alternative embodiments, if the synchronization permission between the first electronic device and the second electronic device is checked successfully, the step of synchronizing the service data between the first electronic device and the second electronic device comprises: if the synchronization permission from the first electronic device to the second electronic device is checked successfully and the synchronization permission from the second electronic device to the first electronic device is checked successfully, synchronizing the service data to the second electronic device.

[0022] In some optional embodiments, if the synchronization permission check between the first electronic device and the second electronic device is successful, synchronizing the service data between the first electronic device and the second electronic device comprises: if the synchronization permission check from the first electronic device to the second electronic device is successful and the synchronization permission check from the second electronic device to the first electronic device is successful, receiving the service data from the second electronic device.

[0023] In some optional embodiments, the synchronization priority of the policy data is higher than the synchronization priority of the service data.

[0024] By using the technical solution, the policy data can be synchronized first, and then the service data, which facilitates the permission check.

[0025] The second aspect of the present application discloses an electronic device, comprising a processor and a memory; the memory is used to store instructions; the processor is used to call the instructions in the memory, so that the electronic device executes the data synchronization method.

[0026] The third aspect of the present application discloses a computer readable storage medium, which stores at least one instruction, and the data synchronization method is realized when the at least one instruction is executed by a processor.

[0027] The technical effects brought by the second aspect to the third aspect can be referred to the description of the methods related to the methods involved in the above method part, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 is a data synchronization system architecture diagram.

[0029] Figure 2 is a data synchronization system architecture diagram provided by an embodiment of the present application.

[0030] Figure 3 is a data synchronization schematic diagram provided by an embodiment of the present application.

[0031] Figure 4 is a metadata model provided by an embodiment of the present application.

[0032] Figure 5 is a service data synchronization range schematic diagram provided by an embodiment of the present application.

[0033] Figure 6 is a data synchronization method flowchart provided by an embodiment of the present application.

[0034] Figure 7 is a one-way synchronization permission check schematic diagram provided by an embodiment of the present application.

[0035] Figure 8is a synchronization permission bidirectional verification schematic diagram provided by an embodiment of the present application.

[0036] Figure 9 is another data synchronization flowchart provided by an embodiment of the present application.

[0037] Figure 10 is a structural schematic diagram of an electronic device provided by an embodiment of the present application.

[0038] Figure 11 is a software structural block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0039] It should be noted that, in the embodiments of the present application, “at least one” means one or more, and “multiple” means two or more than two. “And / or” describes the association relationship of the associated objects, which means that there can be three kinds of relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. The terms “first”, “second”, “third”, “fourth” and the like (if any) in the specification and claims of the present application and the drawings are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0040] The data synchronization method is applied to an electronic device, which can include a mobile phone, a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), and the like.

[0041] Generally, data synchronization between distributed electronic devices can be completed through cloud services. Figure 1 is a data synchronization system architecture diagram. As shown in Figure 1As shown, the distributed data service (DDS, Distributed Data Service) provides the application with the ability of distributed database data between different devices. Between devices with trusted authentication, the distributed data service supports mutual synchronization of application data, and provides users with a consistent data access experience on multiple electronic devices. The distributed data service provides two synchronization modes, namely manual synchronization mode and automatic synchronization mode. The manual synchronization mode triggers data synchronization through application program interface, and supports specifying the device list and synchronization mode (PULL, PUSH and PULL_PUSH three synchronization modes) of synchronization. In the automatic synchronization mode, the attribute AutoSync of the configuration parameter class Option can be set to true, indicating that the distributed data service will trigger data synchronization at a specific time (for example, the synchronization time can include device online, application program data modification, etc.), and the business (such as the contact application program) can not be aware of the synchronization operation.

[0042] The distributed data service provides a simple usage for the business, so that the business can complete the synchronization of data between multiple devices without being aware of the synchronization operation. However, this data synchronization mode also has limitations, and cannot dynamically control the synchronization range of distributed data according to the actual needs of the business.

[0043] Figure 2 It is a data synchronization system architecture provided by an embodiment of the present application. When an electronic device creates a database for a business (calendar, weather, contact, etc. application program), the attribute autoSync of the configuration parameter class Option is set to true, indicating that the automatic synchronization mode is started. The business sets the synchronization strategy through the external interface setSyncRange, the distributed data service constructs the synchronization strategy model, and stores the strategy data corresponding to the business data into the meta database. Through the device online and offline priority control module, the synchronization order of the meta database and the business database when the automatic synchronization device is online is controlled. The electronic device relies on the automatic synchronization capability of the distributed data service to synchronize the strategy data in the meta database first, and uses the synchronized strategy data in the synchronization permission verification, thereby supporting the capability of dynamically controlling the synchronization range of distributed data according to the actual needs of the business. The data synchronization system framework provided by the embodiment of the present application can dynamically control the synchronization range of distributed data between EMUI and EMUI, EMUI and Hongmeng, and Hongmeng and Hongmeng.

[0044] Figure 3FIG. 1 is a schematic diagram of data synchronization provided by an embodiment of the present application. A business can set an automatic synchronization mode of a distributed data service, so that full data synchronization is automatically performed when distributed data access is performed on an online electronic device or when a business data is modified by an application in the electronic device. The business can control the synchronization range of the business data by configuring or modifying the policy data corresponding to the business data, so that the data synchronization of the business data is performed between specified electronic devices.

[0045] The electronic device can query the policy data from the meta database through the synchronization permission verification module. The policy data is meta data from the meta database, and can be directly verified by the synchronization permission. The electronic device can perform synchronization permission verification on the business data according to the policy data corresponding to the business data and / or the application type corresponding to the business data.

[0046] The electronic device can determine the synchronization order of the meta database and the business database in the electronic device through the device priority control module. One business corresponds to one business database, for example, a calendar application corresponds to a calendar business database, and the calendar business database is used to store data related to the calendar application. The business database stores business data, and the meta database stores policy data corresponding to the business data. The device priority control module sets the device listening mode of the meta database to HIGH mode and the device listening mode of the business database to LOW mode. When the device priority control module iterates through all the device listening, the device priority control module preferentially registers the device listening of the HIGH mode to the bottom layer of the electronic device, so that the synchronization of the meta database storage data between the electronic devices is preferentially completed.

[0047] The meta database in the electronic device can be updated in real time. The electronic device can synchronize the policy data in the meta database when the policy data in the meta database is modified or when the electronic device is online.

[0048] Figure 4 FIG. 6 is a meta data model provided by an embodiment of the present application. The meta database stores database meta data and policy meta data.

[0049] The database metadata is data describing (or defining) database data, and the policy metadata is data describing (or defining) policy data. The database metadata (i.e., KvStoreMetaData) includes an application type (i.e., appType), which can include an Android type (ANDROID), a default type (default), and a Harmony type (HARMONY). Among them, the EMUI side business database appType is ANDROID, the meta database appType is default, and the Harmony side business database appType is HARMONY, that is, {EMUI app db: android; Meta db: default; Harmony app db: harmony}.

[0050] The capability range (CapabilityRange) in the policy metadata (StrategyMetaData) includes a local end device label (localLabel) and a remote end device label (remoteLabel). Among them, the local end device label represents a local end device type, and the remote end device label represents a remote end device type allowed to synchronize business data. For example, the localLabel of a mobile phone device is [phone], and the remoteLabel is [tv watch phone], indicating that the local end device type is a mobile phone, and the remote end devices allowed to synchronize business data of the local end device include a television, a watch, and a mobile phone. The localLabel of a device Tv is [tv], and the remoteLabel is [phone], indicating that the local end device type is a television, and the remote end devices allowed to synchronize business data of the local end device include a mobile phone. The localLabel of a device Watch is [watch], and the remoteLabel is [phone], indicating that the local end device type is a watch, and the remote end devices allowed to synchronize business data of the local end device include a mobile phone. Figure 5 is a business data synchronization range schematic diagram provided by an embodiment of the present application, as Figure 5 shown, a television and a watch can synchronize business data to a mobile phone through a distributed data service.

[0051] The electronic device can acquire the remoteLabel on the local device, and receive the localLabel of the policy data of the remote device, traverse all remoteLabels on the local device, if the localLabel of the policy data of the remote device includes any remoteLabel on the local device, the synchronization range check is successful, and the business data synchronization with the remote device can be performed through the distributed data service. Understandably, "remoteLabel of local device contains localLabel of remote device? true: false;", that is, the judgment formula that the remoteLabel of the local device contains the localLabel of the remote device is true, and the synchronization range check is successful; the judgment formula that the remoteLabel of the local device contains the localLabel of the remote device is false, and the synchronization range check fails.

[0052] Figure 6 is a data synchronization method flowchart provided by an embodiment of the application, applied to a first electronic device, and specifically, the data synchronization method comprises:

[0053] S601, acquiring policy data corresponding to business data.

[0054] The business data can include data of application programs such as calendar, weather, and contacts, for example, calendar business data of a calendar application program, weather business data of a weather application program, and contact application data of a contact application program.

[0055] In an embodiment of the application, acquiring the policy data corresponding to the business data comprises: acquiring a data synchronization condition; and if the data synchronization condition is triggered, acquiring the policy data corresponding to the business data.

[0056] Specifically, the data synchronization condition can include device online or application program modification of business data. The first electronic device can acquire the policy data corresponding to the business data when it is online, or when the application program corresponding to the business data modifies the business data. That is, the data synchronization is triggered through the online of the electronic device or the modification of the business data by the application program in the electronic device.

[0057] In an embodiment of the application, acquiring the policy data corresponding to the business data comprises: acquiring first policy sub-data corresponding to the business data of the first electronic device; and acquiring second policy sub-data corresponding to the business data of the second electronic device.

[0058] Specifically, the first strategy sub-data is the strategy data corresponding to the business data of the first electronic device, used to record the synchronization strategy of the business data of the first electronic device. It can be written by the application corresponding to the business data and stored in the metadata database of the first electronic device. The second strategy sub-data can be the strategy data corresponding to the business data synchronized by the first electronic device from the second electronic device, used to record the synchronization strategy of the business data of the second electronic device. Users and applications can control the synchronization range of business data by configuring or modifying the strategy data.

[0059] For example, in the first electronic device, the local device label of the first policy sub-data can be [phone], and the remote device label of the first policy sub-data can be [tv watch phone]. This indicates that the local device type of the first electronic device is a mobile phone, and the remote devices that the first electronic device allows to synchronize business data include televisions, watches, and mobile phones. Similarly, the local device label of the second policy sub-data can be [tv], and the remote device label can be [phone]. This indicates that the device type of the second electronic device is a television, and the remote devices that the second electronic device allows to synchronize business data are mobile phones.

[0060] S602, verify the synchronization permissions of the first electronic device and the second electronic device according to the policy data.

[0061] In one embodiment of this application, verifying the synchronization permissions of the first electronic device and the second electronic device according to policy data includes: verifying the synchronization permissions from the first electronic device to the second electronic device according to policy data; and / or verifying the synchronization permissions from the second electronic device to the first electronic device according to policy data.

[0062] Specifically, taking two electronic devices as an example, the two synchronization permission checks can be performed on the same side of the electronic device or on opposite sides. When performing synchronization permission checks on the same side, the same electronic device performs two synchronization permission checks: the first electronic device checks the synchronization permission from itself to the second electronic device based on policy data; and the second electronic device checks the synchronization permission from itself to itself based on policy data. When performing synchronization permission checks on opposite sides, each of the two electronic devices performs one synchronization permission check, specifically including: the first electronic device checks the synchronization permission from itself to itself to the second electronic device based on policy data; and the second electronic device checks the synchronization permission from itself to itself to the first electronic device based on policy data. Understandably, when the first electronic device checks the synchronization permission from itself to itself to the second electronic device based on policy data, and the second electronic device checks the synchronization permission from itself to itself to the first electronic device based on policy data, if both synchronization permission checks are successful, the synchronization permission check between the first and second electronic devices is successful; if the synchronization permission check of either electronic device fails, the synchronization permission check between the first and second electronic devices fails.

[0063] The first electronic device can verify either one-way or two-way synchronization permissions between itself and the second electronic device. For example, it can verify synchronization permissions from the first electronic device to the second electronic device separately based on policy data; or it can verify synchronization permissions from the first electronic device to the second electronic device and from the second electronic device to the first electronic device simultaneously based on policy data.

[0064] Optionally, if the synchronization permission verification from the first electronic device to the second electronic device is successful, then the synchronization permission verification between the first electronic device and the second electronic device is successful.

[0065] For example, when the first electronic device (Tv) initiates automatic synchronization, if the TV's remoteLabel does not contain the second electronic device's localLabel, the verification result is false (synchronization permission verification failed), so the TV cannot synchronize data to the Watch. Conversely, if the first electronic device (Watch) initiates automatic synchronization, and the Watch's remoteLabel contains the second electronic device's (Tv) localLabel, the verification result is true (synchronization permission verification successful), so the Watch can synchronize data to the TV.

[0066] Optionally, if the synchronization permission verification from the second electronic device to the first electronic device is successful, then the synchronization permission verification between the first electronic device and the second electronic device is successful.

[0067] Optionally, if the synchronization permission verification from the first electronic device to the second electronic device is successful and the synchronization permission verification from the second electronic device to the first electronic device is successful, then the synchronization permission verification between the first electronic device and the second electronic device is successful.

[0068] In one embodiment of this application, verifying the synchronization permission from the first electronic device to the second electronic device according to policy data includes: determining whether the synchronization range of the first electronic device includes the second electronic device according to the policy data; if the synchronization range of the first electronic device includes the second electronic device, the synchronization permission verification from the first electronic device to the second electronic device is successful; if the synchronization range of the first electronic device does not include the second electronic device, the synchronization permission verification from the first electronic device to the second electronic device fails.

[0069] Alternatively, verifying the synchronization permission from the first electronic device to the second electronic device based on the policy data includes: determining whether the synchronization range of the first electronic device includes the second electronic device based on the policy data; if the synchronization range of the first electronic device includes the second electronic device, determining whether the application corresponding to the business data has synchronization permission based on the application type corresponding to the business data; if the application corresponding to the business data has synchronization permission, the synchronization permission verification from the first electronic device to the second electronic device is successful; if the synchronization range of the first electronic device does not include the second electronic device or the application corresponding to the business data does not have synchronization permission, the synchronization permission verification from the first electronic device to the second electronic device fails.

[0070] Specifically, before determining whether the application corresponding to the business data has synchronization permissions based on the application type corresponding to the business data, the first electronic device can query the database metadata corresponding to the business data from the metadata database of the first electronic device. If the database metadata corresponding to the business data is found, the application corresponding to the business data is determined to have synchronization permissions based on the application type in the database metadata corresponding to the business data. If the database metadata corresponding to the business data is not found, the synchronization permission verification from the first electronic device to the second electronic device fails.

[0071] If the application type in the database metadata corresponding to the business data is Android, the application corresponding to the business data has synchronization permissions. If the application type in the database metadata corresponding to the business data is HarmonyOS, the first electronic device queries the application configuration information to determine whether the application corresponding to the business data has synchronization permissions. If a negative result is found in the application configuration information, the application corresponding to the business data does not have synchronization permissions; or, if a positive result is found in the application configuration information, the application corresponding to the business data has synchronization permissions. Understandably, users and applications can set application synchronization permissions in the application configuration information according to business needs.

[0072] Understandably, the application type corresponding to the metadata in the metadata database is the default type. When the first electronic device performs synchronization permission verification, if the application type corresponding to the data is the default type, the synchronization permission verification from the first electronic device to the second electronic device is successful. Similarly, if the application type corresponding to the data is the default type, the synchronization permission verification from the second electronic device to the first electronic device is successful.

[0073] In one embodiment of this application, determining whether the synchronization range of the first electronic device includes the second electronic device based on the policy data includes: determining whether the remote device tag of the first policy sub-data in the policy data includes the local device tag of the second policy sub-data in the policy data; if the remote device tag of the first policy sub-data includes the local device tag of the second policy sub-data, it is determined that the synchronization range of the first electronic device includes the second electronic device; if the remote device tag of the first policy sub-data does not include the local device tag of the second policy sub-data, it is determined that the synchronization range of the first electronic device does not include the second electronic device.

[0074] Understandably, "remoteLabel of local device contains localLabel of remotedevice? true:false;" can mean that the synchronization range of the first electronic device is determined based on the policy data to determine whether the second electronic device is included. That is, if the discriminant that the remoteLabel of the first electronic device contains the localLabel of the second electronic device is true, then the synchronization range of the first electronic device includes the second electronic device; if the discriminant that the remoteLabel of the first electronic device contains the localLabel of the second electronic device is false, then the synchronization range of the first electronic device does not include the second electronic device.

[0075] Specifically, the first electronic device can determine the data synchronization direction by checking the value of the `flag` parameter in the permission check function. The synchronization direction can include both sending and receiving directions. The `flag` parameter has values ​​of 1 and 2, representing `push` and `pull`, respectively. During automatic synchronization, the initiator pushes data, so the value of the `flag` parameter on the initiator is 1; the value of the `flag` parameter on the receiver is 2. When performing synchronization range policy verification, the first electronic device can determine whether it is the initiator or the receiver using the condition `if(flag == 1)`.

[0076] The first electronic device can perform a synchronization permission check when initiating data synchronization via a permission check function, or it can perform a synchronization permission check when receiving synchronized data, acting as a receiver. When the first electronic device acts as a receiver, if the synchronization permission check fails, it sends an acknowledgment character (ACK) to the sender as feedback.

[0077] In one embodiment of this application, verifying the synchronization permission from the second electronic device to the first electronic device according to policy data includes: determining whether the synchronization range of the second electronic device includes the first electronic device according to the policy data; if the synchronization range of the second electronic device includes the first electronic device, the synchronization permission verification from the second electronic device to the first electronic device is successful; if the synchronization range of the second electronic device does not include the first electronic device, the synchronization permission verification from the second electronic device to the first electronic device fails.

[0078] Alternatively, verifying the synchronization permission from the second electronic device to the first electronic device based on the policy data includes: determining whether the synchronization range of the second electronic device includes the first electronic device based on the policy data; if the synchronization range of the second electronic device includes the first electronic device, determining whether the application corresponding to the business data has synchronization permission based on the application type corresponding to the business data; if the application corresponding to the business data has synchronization permission, the synchronization permission verification from the second electronic device to the first electronic device is successful; if the synchronization range of the second electronic device does not include the first electronic device or the application corresponding to the business data does not have synchronization permission, the synchronization permission verification from the second electronic device to the first electronic device fails.

[0079] Specifically, before determining whether the application corresponding to the business data has synchronization permissions based on the application type corresponding to the business data, the first electronic device can query the database metadata corresponding to the business data from the metadata database of the first electronic device. If the database metadata corresponding to the business data is found, the application corresponding to the business data is determined to have synchronization permissions based on the application type in the database metadata corresponding to the business data. If the database metadata corresponding to the business data is not found, the synchronization permission verification from the second electronic device to the first electronic device fails.

[0080] In one embodiment of this application, determining whether the synchronization range of the second electronic device includes the first electronic device based on the policy data includes: determining whether the remote device tag of the second policy sub-data in the policy data includes the local device tag of the first policy sub-data in the policy data; if the remote device tag of the second policy sub-data in the policy data includes the local device tag of the first policy sub-data in the policy data, it is determined that the synchronization range of the second electronic device includes the first electronic device; if the remote device tag of the second policy sub-data in the policy data does not include the local device tag of the first policy sub-data in the policy data, it is determined that the synchronization range of the second electronic device does not include the first electronic device.

[0081] S603 If the synchronization permission verification between the first electronic device and the second electronic device is successful, business data is synchronized between the first electronic device and the second electronic device.

[0082] In one embodiment of this application, if the synchronization permission verification between the first electronic device and the second electronic device is successful, synchronizing service data between the first electronic device and the second electronic device includes: if the synchronization permission verification from the first electronic device to the second electronic device is successful, synchronizing service data to the second electronic device.

[0083] Figure 7 This is a schematic diagram illustrating a one-way synchronization permission verification method provided in an embodiment of this application. For example... Figure 7 As shown, the local device label for device TV is [tv], and the remote device label is [phone]; the local device label for device Watch is [watch], and the remote device label is [tv]. Device TV's remoteLabel does not contain device Watch's localLabel, meaning the verification result is false; device Watch's remoteLabel contains device TV's localLabel, meaning the verification result is true. When device TV's flag value is 1, indicating it's the initiator of automatic synchronization, it's determined that device TV's remoteLabel does not contain device Watch's localLabel, resulting in a false verification result, so device TV cannot synchronize data to device Watch. When device Watch's flag value is 1, indicating it's the initiator of automatic synchronization, it's determined that device Watch's remoteLabel contains device TV's localLabel, resulting in a true verification result, so device Watch can synchronize data to device Watch.

[0084] In one embodiment of this application, if the synchronization permission verification between the first electronic device and the second electronic device is successful, synchronizing service data between the first electronic device and the second electronic device includes: if the synchronization permission verification from the second electronic device to the first electronic device is successful, receiving service data from the second electronic device.

[0085] In another embodiment of this application, if the synchronization permission verification between the first electronic device and the second electronic device is successful, the synchronization of service data between the first electronic device and the second electronic device includes: if the synchronization permission verification from the first electronic device to the second electronic device is successful and the synchronization permission verification from the second electronic device to the first electronic device is successful, then the service data is synchronized to the second electronic device.

[0086] Figure 8 This is a schematic diagram illustrating a two-way synchronization permission verification method provided in an embodiment of this application. For example... Figure 8 As shown, in the bidirectional matching scenario between the two electronic devices, the remoteLabel of device Phone (the first electronic device) contains the localLabel of device TV, meaning the verification result is true. Similarly, the remoteLabel of device TV (the second electronic device) contains the localLabel of device Phone, meaning the verification result is also true. The bidirectional synchronization permission verification between the two electronic devices is successful, and the first electronic device can synchronize business data to the second electronic device.

[0087] In the event of a bidirectional mismatch between two electronic devices, the remoteLabel of device Tv (the first electronic device) does not contain the localLabel of device Watch, resulting in a false verification result. Similarly, the remoteLabel of device Watch (the second electronic device) does not contain the localLabel of device Tv, resulting in a false verification result. The bidirectional synchronization permission verification between the two electronic devices fails, and the first electronic device cannot synchronize business data to the second electronic device.

[0088] If the two electronic devices are mismatched in either direction, the remoteLabel of device Tv (the first electronic device) will not contain the localLabel of device Watch, resulting in a false verification result. Conversely, the remoteLabel of device Watch (the second electronic device) will contain the localLabel of device Tv, resulting in a true verification result. The synchronization permission verification from the first electronic device to the second electronic device fails, and the first electronic device cannot synchronize business data with the second electronic device.

[0089] In one embodiment of this application, if the synchronization permission verification between the first electronic device and the second electronic device is successful, synchronizing service data between the first electronic device and the second electronic device includes: if the synchronization permission verification from the first electronic device to the second electronic device is successful and the synchronization permission verification from the second electronic device to the first electronic device is successful, receiving service data from the second electronic device.

[0090] In one embodiment of this application, the synchronization priority of policy data is higher than that of business data. The first electronic device can synchronize data according to the synchronization priority, synchronizing data with higher priority first and data with lower priority later.

[0091] Figure 9 This is another data synchronization flowchart provided in this application embodiment. The synchronization permission verification module queries the metadata corresponding to the data from the metadata database. If the query fails, the synchronization permission verification fails; if the query succeeds, it determines whether the appType of the metadata is default. If the appType of the metadata is default, the synchronization permission verification passes; if the appType of the data is not default, the latest policy data is synchronized. Synchronization permission verification is performed based on the policy data. If the synchronization permission verification based on the policy data fails, the synchronization permission verification fails; if the synchronization permission verification based on the policy data passes, it determines whether the appType of the data is ANDROID. If the appType of the data is ANDROID, the synchronization permission verification passes; if the appType of the data is not ANDROID (i.e., the appType of the data can be HARMONY), it determines whether the application corresponding to the data has synchronization permission. If the application corresponding to the data has synchronization permission, the synchronization permission verification passes; if the application corresponding to the data does not have synchronization permission, the synchronization permission verification fails.

[0092] Understandably, the synchronization permission verification module can query the metadata corresponding to data (such as policy data or business data) from the metadata database. If the query fails, the corresponding metadata does not exist in the metadata database, and the synchronization permission verification fails. If the query succeeds, it checks whether the appType of the metadata is "default". If the appType of the metadata is "default", meaning the data can be policy data, the synchronization permission verification for the policy data passes. If the appType of the data is not "default", the data can be business data, and the policy data corresponding to the business data is synchronized. Synchronization permission verification is then performed based on the policy data. If the synchronization permission verification based on the policy data fails, the synchronization permission verification for the business data fails. If the synchronization permission verification based on the policy data passes, it checks whether the appType of the business data is "ANDROID". If the appType of the business data is "ANDROID", the synchronization permission verification for the business data passes. If the appType of the business data is not "ANDROID" (i.e., the appType of the business data can be "HARMONY"), it checks whether the application corresponding to the business data has synchronization permissions. If the application corresponding to the business data has synchronization permissions, the synchronization permission verification passes; if the application corresponding to the business data does not have synchronization permissions, the synchronization permission verification fails.

[0093] Understandably, if the data is metadata, it will be directly verified through synchronization permissions. This embodiment can achieve controlled data synchronization between EMUI and EMUI, EMUI and HarmonyOS, and HarmonyOS and HarmonyOS.

[0094] Figure 10This is a schematic diagram of the structure of the electronic device 100 provided in the embodiments of this application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0095] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0096] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0097] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0098] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0099] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0100] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.

[0101] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0102] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0103] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0104] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.

[0105] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0106] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0107] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0108] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.

[0109] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0110] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0111] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.

[0112] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0113] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0114] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0115] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), 5G (the 5th Generation of wireless communication system), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0116] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0117] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0118] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0119] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0120] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.

[0121] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0122] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0123] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0124] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0125] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0126] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.

[0127] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0128] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.

[0129] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.

[0130] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0131] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0132] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example: when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0133] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0134] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0135] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0136] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.

[0137] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0138] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0139] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0140] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.

[0141] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

[0142] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.

[0143] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.

[0144] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.

[0145] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0146] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0147] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0148] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.

[0149] Figure 11 This is a software structure block diagram of the electronic device 100 provided in this application embodiment. The layered architecture divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer may include a series of application packages.

[0150] like Figure 11 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0151] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0152] like Figure 11 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0153] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0154] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0155] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0156] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).

[0157] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0158] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0159] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0160] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0161] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0162] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0163] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0164] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0165] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0166] A 2D graphics engine is a graphics engine for 2D drawing.

[0167] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0168] If the modules integrated in the electronic device 100 are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium, and when executed by a processor, they can implement the steps of the various method embodiments described above. The computer-readable instructions include computer-readable instruction code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying the computer-readable instruction code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), etc.

[0169] This embodiment also provides a computer storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the data synchronization method described in the above embodiment.

[0170] This embodiment also provides a computer program product that, when run on an electronic device, causes the electronic device to perform the aforementioned related steps to realize the data synchronization method described in the above embodiment.

[0171] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the data synchronization methods in the above-described method embodiments.

[0172] In this embodiment, the electronic device, computer storage medium, computer program product or chip are all used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding method provided above, and will not be repeated here.

[0173] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0174] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0175] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.

[0176] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0177] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0178] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data synchronization method applied in a first electronic device, characterized in that, The data synchronization method comprises: obtaining policy data corresponding to business data, the business data being data of a preset application program; checking synchronization permissions of the first electronic device and the second electronic device according to the policy data; if the synchronization permissions of the first electronic device and the second electronic device are checked successfully, synchronizing the business data between the first electronic device and the second electronic device; the obtaining of the policy data corresponding to the business data comprises: obtaining a data synchronization condition, the data synchronization condition comprising modification of the business data by the preset application program; if the data synchronization condition is triggered, obtaining first policy sub-data corresponding to business data of the first electronic device and / or second policy sub-data corresponding to business data of the second electronic device.

2. The data synchronization method of claim 1, wherein, The data synchronization condition further comprises device online.

3. The data synchronization method of claim 1, wherein, The checking of the synchronization permissions of the first electronic device and the second electronic device according to the policy data comprises: checking synchronization permissions from the first electronic device to the second electronic device according to the policy data; and / or checking synchronization permissions from the second electronic device to the first electronic device according to the policy data.

4. The data synchronization method of claim 3, wherein, The checking of the synchronization permissions from the first electronic device to the second electronic device according to the policy data comprises: determining whether the synchronization range of the first electronic device includes the second electronic device according to the policy data; if the synchronization range of the first electronic device includes the second electronic device, the synchronization permissions from the first electronic device to the second electronic device are checked successfully; if the synchronization range of the first electronic device does not include the second electronic device, the synchronization permissions from the first electronic device to the second electronic device are checked unsuccessfully.

5. The data synchronization method of claim 3, wherein, The checking of the synchronization permissions from the first electronic device to the second electronic device according to the policy data comprises: determining whether the synchronization range of the first electronic device includes the second electronic device according to the policy data; if the synchronization range of the first electronic device includes the second electronic device, determining whether the application program corresponding to the business data has synchronization permissions according to the application type corresponding to the business data; if the application program corresponding to the business data has synchronization permissions, the synchronization permissions from the first electronic device to the second electronic device are checked successfully; if the synchronization range of the first electronic device does not include the second electronic device or the application program corresponding to the business data does not have synchronization permissions, the synchronization permissions from the first electronic device to the second electronic device are checked unsuccessfully.

6. The data synchronization method of claim 4, wherein, The determining of whether the synchronization range of the first electronic device includes the second electronic device according to the policy data comprises: determining whether the remote device label of the first policy sub-data in the policy data includes the local device label of the second policy sub-data in the policy data; if the remote device label of the first policy sub-data includes the local device label of the second policy sub-data, it is determined that the synchronization range of the first electronic device includes the second electronic device; If the remote device label of the first policy sub-data does not include the local device label of the second policy sub-data, it is determined that the synchronization range of the first electronic device does not include the second electronic device.

7. The data synchronization method of claim 3, wherein, The step of checking the synchronization permission from the second electronic device to the first electronic device according to the policy data comprises: determining whether the synchronization range of the second electronic device includes the first electronic device according to the policy data; if the synchronization range of the second electronic device includes the first electronic device, the checking of the synchronization permission from the second electronic device to the first electronic device is successful; if the synchronization range of the second electronic device does not include the first electronic device, the checking of the synchronization permission from the second electronic device to the first electronic device is failed.

8. The data synchronization method of claim 3, wherein, The step of checking the synchronization permission from the second electronic device to the first electronic device according to the policy data comprises: determining whether the synchronization range of the second electronic device includes the first electronic device according to the policy data; if the synchronization range of the second electronic device includes the first electronic device, determining whether the application program corresponding to the service data has the synchronization permission according to the application type corresponding to the service data; if the application program corresponding to the service data has the synchronization permission, the checking of the synchronization permission from the second electronic device to the first electronic device is successful; if the synchronization range of the second electronic device does not include the first electronic device or the application program corresponding to the service data does not have the synchronization permission, the checking of the synchronization permission from the second electronic device to the first electronic device is failed.

9. The data synchronization method of claim 7, wherein, The step of determining whether the synchronization range of the second electronic device includes the first electronic device according to the policy data comprises: determining whether the remote device label of the second policy sub-data in the policy data includes the local device label of the first policy sub-data in the policy data; if the remote device label of the second policy sub-data in the policy data includes the local device label of the first policy sub-data in the policy data, it is determined that the synchronization range of the second electronic device includes the first electronic device; if the remote device label of the second policy sub-data in the policy data does not include the local device label of the first policy sub-data in the policy data, it is determined that the synchronization range of the second electronic device does not include the first electronic device.

10. The data synchronization method of any one of claims 1 to 9, wherein, The step of synchronizing the service data between the first electronic device and the second electronic device if the checking of the synchronization permission between the first electronic device and the second electronic device is successful comprises: if the checking of the synchronization permission from the first electronic device to the second electronic device is successful, synchronizing the service data to the second electronic device; and / or if the checking of the synchronization permission from the second electronic device to the first electronic device is successful, receiving the service data from the second electronic device.

11. The data synchronization method of any one of claims 1 to 9, wherein, The step of synchronizing the service data between the first electronic device and the second electronic device if the checking of the synchronization permission between the first electronic device and the second electronic device is successful comprises: if the checking of the synchronization permission from the first electronic device to the second electronic device is successful, synchronizing the service data to the second electronic device; and / or if the checking of the synchronization permission from the second electronic device to the first electronic device is successful, receiving the service data from the second electronic device. If the synchronization permission check from the first electronic device to the second electronic device succeeds and the synchronization permission check from the second electronic device to the first electronic device succeeds, the service data is synchronized to the second electronic device.

12. The data synchronization method of any one of claims 1 to 9, wherein, The synchronization of the service data between the first electronic device and the second electronic device if the synchronization permission check of the first electronic device and the second electronic device succeeds comprises: If the synchronization permission check from the first electronic device to the second electronic device succeeds and the synchronization permission check from the second electronic device to the first electronic device succeeds, the service data is received from the second electronic device.

13. The data synchronization method of any one of claims 1 to 9, wherein, The synchronization priority of the policy data is higher than the synchronization priority of the service data.

14. An electronic device, comprising: The electronic device comprises a processor and a memory; the memory is configured to store instructions; and the processor is configured to invoke the instructions in the memory, so that the electronic device performs the data synchronization method according to any one of claims 1 to 13.

15. A computer-readable storage medium, characterized in that, The computer readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor to implement the data synchronization method according to any one of claims 1 to 13.

Citation Information

Patent Citations

  • Service equipment switching method and device

    CN110099430A