Device Collaboration Method
The device collaboration method improves efficiency by transmitting only changed data objects between devices via different sessions, addressing the complexity and inefficiency of current methods.
Patent Information
- Application Number
- JP2024556280
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-03-24
- Filing Date
- 2023-03-22
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2043-03-22
AI Technical Summary
Current device collaboration methods face challenges in efficiently transmitting data between devices, leading to increased complexity and reduced collaboration efficiency.
A device collaboration method that involves establishing a collaboration connection between electronic devices, where one device sends instance attributes to another via different sessions, allowing only changed data objects to be transmitted, thereby reducing data transfer and improving efficiency.
This method reduces the amount of data transmitted between devices, enhances collaboration efficiency, and avoids delays caused by excessive data transfer, ensuring consistent collaboration data across devices.
Smart Images

Figure 2025514609000001_ABST
Abstract
Description
[Technical field]
[0001] This application claims priority to Chinese Patent Application No. 202210297167.3, entitled "DEVICE COLLABORATION METHOD," filed with the State Intellectual Property Office of the People's Republic of China on March 24, 2022, the entire contents of which are incorporated herein by reference.
[0002] The present application relates to the field of electronic device technology, and in particular to a device collaboration method. [Background technology]
[0003] With the development of electronic devices, multi-device interconnection scenarios are becoming more and more prevalent in daily life, and the requirements for cross-device access and multi-device collaboration are becoming stronger and stronger.
[0004] Currently, resource sharing can be implemented between devices during multi-device collaboration. However, when data collaboration is performed between devices, data transmission links and interfaces need to be established between the devices, which makes the operation complicated. Therefore, how to improve device collaboration efficiency is an urgent problem to be solved. Summary of the Invention
[0005] The present application provides a device collaboration method for reducing the amount of data transmitted between collaborating devices and improving the collaboration efficiency of the collaborating devices. [Means for solving the problem]
[0006] According to a first aspect, the present application provides a device collaboration method, including a first electronic device establishing a collaboration connection to a second electronic device. The first electronic device obtains a first instance attribute of a first data object and a second instance attribute of a second data object. The first electronic device transmits the first instance attribute to the second electronic device via a first session and transmits the second instance attribute to the second electronic device via a second session, the first instance attribute being used by the second electronic device to generate the first data object, and the second instance attribute being used by the second electronic device to generate the second data object. A session identifier of the first session is the first session identifier. A session identifier of the second session is the second session identifier. Before the first electronic device obtains the first instance attribute of the first data object and the second instance attribute of the second data object, the first electronic device further generates the first data object and the second data object. According to the device collaboration method provided in the first aspect, a first electronic device transmits different types of data objects to a second electronic device through different sessions. Data objects that are the same on the first electronic device and the second electronic device are associated with the same session identifier. In other words, both a first instance on the first electronic device and a first instance on the second electronic device are associated with a first session identifier, and both a second instance on the first electronic device and a second instance on the second electronic device are associated with a second session identifier. In this way, the first electronic device can monitor attribute changes of the different types of data objects and transmit only the data objects whose attributes have changed to the second electronic device. This can reduce the amount of data transmitted between the collaborating devices, improve the collaboration efficiency of the collaborating devices, and avoid device collaboration delays caused by excessively large amounts of transmitted data.
[0007] Referring to the first aspect, in a possible implementation, the method further includes the first electronic device acquiring a third instance attribute of the first data object. The first electronic device transmits the third instance attribute to the second electronic device through the first session, and the first instance attribute and the third instance attribute are jointly used by the second electronic device to generate the first data object. In this way, if the first data object includes two types of instances, the first electronic device transmits both the first instance and the third instance to the second electronic device through the first session. In other words, data objects that are the same on the first electronic device and the second electronic device are associated with the same session identifier, and different types of instances included in the same type of data object are not distinguished. When an attribute of the first data object on the first electronic device changes, the first electronic device transmits the changed first data object to the second electronic device.
[0008] Referring to the first aspect, in a possible implementation, the method further includes the first electronic device obtaining a third instance attribute of the first data object. The first electronic device transmits the third instance attribute to the second electronic device through a third session, and the first instance attribute and the third instance attribute are jointly used by the second electronic device to generate the first data object. In this way, when the first data object includes two types of instances, the first electronic device transmits the first instance and the third instance to the second electronic device separately through different sessions. In other words, the instances that are the same on the first electronic device and the second electronic device are associated with the same session identifier, and the different types of instances included in the same type of data object are distinguished. When the attribute of the first instance on the first electronic device changes, the first electronic device transmits only the changed attribute of the first instance to the second electronic device, and does not need to transmit the third instance attribute. This reduces the amount of data transmitted between collaboration devices and improves collaboration efficiency.
[0009] Referring to the first aspect, in a possible implementation, after the first electronic device transmits the first instance attribute to the second electronic device through the first session, the method further includes: the electronic device detects that the first instance attribute has changed, and transmits the changed first instance attribute to the second electronic device through the first session, and the changed first instance attribute is used by the second electronic device to update the first data object. In this way, the first electronic device transmits only the changed instance attribute to the second electronic device, and does not need to transmit the unchanged instance attribute. In this case, the amount of data transmitted between the collaboration devices is reduced, and collaboration efficiency is improved.
[0010] With reference to the first aspect, in a possible implementation, the first electronic device establishing a collaboration connection to the second electronic device specifically includes the first electronic device sending a collaboration message to the second electronic device, the collaboration message including an instance identifier of the first instance and a session identifier of the first session, and the session identifier of the first session is associated with the first instance. In this way, the first electronic device associates the first instance with the session identifier of the first session, so that after receiving the session identifier of the first session, the second electronic device associates the first instance on the second electronic device with the session identifier of the first session. In this way, the same session identifier is associated with two instances that are the same on the first electronic device and the second electronic device. This ensures the consistency of attributes of the two instances that are the same on the first electronic device and the second electronic device, and ensures the consistency of collaboration data.
[0011] Referring to the first aspect, in a possible implementation, the method further includes the first electronic device establishing a collaboration connection to a third electronic device, the first electronic device sending the first instance attribute to the third electronic device via the fourth session and the second instance attribute to the third electronic device via the fifth session, the first instance attribute being used by the third electronic device to generate the first data object, and the second instance attribute being used by the third electronic device to generate the second data object.
[0012] The session identifier of the fourth session is the fourth session identifier, and the session identifier of the fifth session is the fifth session identifier. Sending the first instance attribute by the first electronic device to the third electronic device over the fourth session and sending the second instance attribute by the third electronic device over the fifth session may be understood as associating, by the first electronic device, the first instance on the first electronic device with the fourth session identifier, and associating, by the first electronic device, the second instance on the first electronic device with the fifth session identifier. The first electronic device sends the first instance identifier and the fourth session identifier to the third electronic device, and the first electronic device sends the second instance identifier and the fifth session identifier to the third electronic device. The third electronic device associates the first instance on the third electronic device with the fourth session identifier. The third electronic device associates the second instance on the third electronic device with the fifth session identifier. In other words, both the first instance on the first electronic device and the first instance on the third electronic device are associated with a fourth session identifier, and both the second instance on the first electronic device and the second instance on the third electronic device are associated with a fifth session identifier.
[0013] In this way, three electronic devices can simultaneously establish collaboration connections and the attributes of the same instance on multiple devices are also the same, which ensures the consistency of the collaboration data.
[0014] With reference to the first aspect, in a possible implementation, the method further includes the first electronic device establishing a collaboration connection to a third electronic device. The first electronic device generates a third data object. The first electronic device obtains a fourth instance attribute of the third data object. The first electronic device transmits the fourth instance attribute to the third electronic device via a sixth session, and the fourth instance attribute is used by the third electronic device to generate the third data object.
[0015] The session identifier of the sixth session is the sixth session identifier. The sending of the fourth instance attribute by the first electronic device to the third electronic device through the sixth session may be understood as the first electronic device associating the fourth instance on the first electronic device with the sixth session identifier. The first electronic device then sends the identifier of the fourth instance and the sixth session identifier to the third electronic device. The third electronic device associates the fourth instance on the third electronic device with the sixth session identifier. In other words, both the fourth instance on the first electronic device and the fourth instance on the third electronic device are associated with the sixth session identifier.
[0016] In this way, when the first electronic device establishes collaboration connections to multiple different electronic devices, the first electronic device can simultaneously transmit different collaboration data to the multiple different electronic devices, thereby improving the versatility of device collaboration capabilities.
[0017] Referring to the first aspect, in a possible implementation, the first electronic device acquiring the first instance attribute of the first data object and the second instance attribute of the second data object specifically includes the first electronic device acquiring the first instance attribute of the first data object and the second instance attribute of the second data object through data interception. In this way, through data interception, it can be monitored whether the first instance attribute and the second instance attribute have changed, and updates to the changed first instance attribute and / or second instance attribute can be performed in a timely manner. This ensures data consistency between the collaboration devices.
[0018] With reference to the first aspect, in a possible implementation, a first data object is associated with a first session, and a second data object is associated with a second session. The first data object includes at least one of a text data object, a picture data object, an audio data object, and a video data object. The second data object includes at least one of a text data object, a picture data object, an audio data object, and a video data object. The first data object is different from the second data object.
[0019] According to a second aspect, the present application provides a collaboration method. The method includes: a second electronic device establishes a collaboration connection to a first electronic device; the second electronic device receives a first instance attribute of a first data object sent by the first electronic device via a first session; the second electronic device receives a second instance attribute of a second data object sent by the first electronic device via a second session; the second electronic device generates a first data object based on the first instance attribute; the second electronic device generates a second data object based on the second instance attribute; a session identifier of the first session is the first session identifier; the session identifier of the second session is the second session identifier; before the first electronic device obtains the first instance attribute of the first data object and the second instance attribute of the second data object, the first electronic device further generates the first data object and the second data object. According to the device collaboration method provided in the second aspect, the second electronic device receives different types of data objects transmitted by the second electronic device through different sessions. The data objects that are the same on the second electronic device and the first electronic device are associated with the same session identifier. In other words, both the first instance on the first electronic device and the first instance on the second electronic device are associated with the first session identifier, and both the second instance on the first electronic device and the second instance on the second electronic device are associated with the second session identifier. In this way, the first electronic device can monitor attribute changes of the different types of data objects and transmit only the data objects whose attributes have changed to the second electronic device. This can reduce the amount of data transmitted between the collaborating devices, improve the collaboration efficiency of the collaborating devices, and avoid device collaboration delays caused by excessively large amounts of transmitted data.
[0020] Referring to the second aspect, in a possible implementation, the method further includes the second electronic device receiving a third instance attribute of the first data object transmitted by the first electronic device through the first session. The second electronic device generates the first data object based on both the first instance attribute and the third instance attribute. In this way, if the first data object includes two types of instances, the second electronic device receives both the first instance and the third instance transmitted by the first electronic device through the first session. In other words, data objects that are the same on the first electronic device and the second electronic device are associated with the same session identifier, and different types of instances included in the same type of data object are not distinguished. When an attribute of the first data object on the first electronic device changes, the first electronic device transmits the changed first data object to the second electronic device.
[0021] Referring to the second aspect, in a possible implementation, the method further includes the second electronic device receiving a third instance attribute of the first data object sent by the first electronic device through the third session. The second electronic device generates the first data object based on both the first instance attribute and the third instance attribute. In this way, when the first data object includes two types of instances, the second electronic device separately receives the first instance and the third instance sent by the second electronic device through different sessions. In other words, two instances that are the same on the first electronic device and the second electronic device are associated with the same session identifier, and different types of instances included in the same type of data object are not distinguished. When an attribute of the first instance on the first electronic device changes, the first electronic device only sends the changed attribute of the first instance to the second electronic device, and does not need to send the third instance attribute. This reduces the amount of data transmitted between collaboration devices and improves collaboration efficiency.
[0022] In relation to the second aspect, in a possible implementation, after the second electronic device receives the first instance attribute of the first data object transmitted by the first electronic device through the first session, the method further includes the second electronic device receiving the changed first instance attribute of the first data object transmitted by the first electronic device through the first session. The second electronic device generates the first data object based on the changed first instance attribute. In this way, the first electronic device transmits only the changed instance attribute to the second electronic device, and does not need to transmit the unchanged instance attribute. In this case, the amount of data transmitted between collaboration devices is reduced, and collaboration efficiency is improved.
[0023] With reference to the second aspect, in a possible implementation, the second electronic device establishing a collaboration connection with the first electronic device specifically includes the second electronic device receiving a collaboration message sent by the first electronic device, the collaboration message including an instance identifier of the first instance attribute and a session identifier of the first session, and the session identifier of the first session is associated with the first instance attribute. In this way, the first electronic device associates the first instance with the session identifier of the first session, so that after receiving the session identifier of the first session, the second electronic device associates the first instance on the second electronic device with the session identifier of the first session. In this way, the same session identifier is associated with two instances that are the same on the first electronic device and the second electronic device. This ensures the consistency of the attributes of the two instances that are the same on the first electronic device and the second electronic device, and ensures the consistency of the collaboration data.
[0024] With reference to the second aspect, in a possible implementation, a first data object is associated with a first session and a second data object is associated with a second session, and the first data object is different from the second data object.
[0025] With reference to the second aspect, in a possible implementation, the first data object includes at least one of a text data object, an image data object, an audio data object, and a video data object.
[0026] According to a third aspect, the present application provides an electronic device. The electronic device is a first electronic device. The first electronic device includes one or more functional units. The one or more functional units are used by the first electronic device to perform a device collaboration method provided in any possible implementation of any one of the previous aspects.
[0027] According to a fourth aspect, the present application provides an electronic device. The electronic device is a second electronic device. The second electronic device includes one or more functional units. The one or more functional units are used by the second electronic device to perform a device collaboration method provided in any possible implementation of any one of the previous aspects.
[0028] According to a fifth aspect, the present application provides an electronic device. The electronic device is a first electronic device. The first electronic device includes one or more processors and one or more memories. The one or more memories are coupled to the one or more processors. The one or more memories are configured to store computer program code. The computer program code includes computer instructions. When the computer instructions are invoked by the one or more processors, the first electronic device is enabled to execute a device collaboration method provided in any possible implementation form of any one of the preceding aspects.
[0029] According to a sixth aspect, the present application provides an electronic device. The electronic device is a second electronic device. The second electronic device includes one or more processors and one or more memories. The one or more memories are coupled to the one or more processors. The one or more memories are configured to store computer program code. The computer program code includes computer instructions. When the computer instructions are invoked by the one or more processors, the second electronic device is enabled to execute a device collaboration method provided in any possible implementation form of any one of the aforementioned aspects.
[0030] According to a seventh aspect, the present application provides a computer-readable storage medium configured to store computer instructions that, when executed on a first electronic device, enable the first electronic device to perform a device collaboration method provided in any possible implementation of any one of the preceding aspects.
[0031] According to an eighth aspect, the present application provides a computer-readable storage medium configured to store computer instructions that, when executed on a second electronic device, enable the second electronic device to perform a device collaboration method provided in any possible implementation of any one of the preceding aspects.
[0032] According to a ninth aspect, the present application provides a computer program product, which when executed on a first electronic device enables the first electronic device to perform a device collaboration method provided in any possible implementation of any one of the preceding aspects.
[0033] According to a tenth aspect, the present application provides a computer program product, which when executed on a second electronic device enables the second electronic device to perform a device collaboration method provided in any possible implementation of any one of the preceding aspects.
[0034] For the beneficial effects of the second to tenth aspects, please refer to the relevant description of the beneficial effects in the first aspect. Details will not be described again in this specification in the embodiments of the present application. [Brief description of the drawings]
[0035] [Figure 1] FIG. 2 is a diagram of a partial process of an RPC mechanism according to an embodiment of the present application. [Diagram 2] FIG. 4 is an architecture diagram of a system 400 according to an embodiment of the present application. [Diagram 3] FIG. 1 is a diagram of a structure of an electronic device 100 according to an embodiment of the present application. [Figure 4] FIG. 1 is a block diagram of the software architecture of an electronic device 100 according to an embodiment of the present application. [Diagram 5]FIG. 2 is a diagram of functional modules of a JS programming framework according to an embodiment of the present application. [Figure 6] 1 is a diagram of a collaboration interaction between electronic device 100 and electronic device 200 according to an embodiment of the present application. [Figure 7] FIG. 13 is an example UI diagram in which any two instances of two collaboration devices in a group are associated with the same session ID. [Figure 8] FIG. 13 is an example UI diagram in which any two instances of two collaboration devices in a group are associated with the same session ID. [Figure 9] FIG. 13 is an example UI diagram in which any two instances of two collaboration devices in a group are associated with the same session ID. [Figure 10] 1 is an example of a UI diagram in which any two instances of multiple collaboration devices in a group are associated with the same session ID. [Figure 11] 1 is an example of a UI diagram in which any two instances of multiple collaboration devices in a group are associated with the same session ID. [Figure 12] 1 is an example of a UI diagram in which any two instances of multiple collaboration devices in a group are associated with the same session ID. [Figure 13] FIG. 2 is a diagram illustrating an implementation of data synchronization between collaboration devices according to one embodiment of the present application. [Figure 14] 1 is a schematic flowchart of a device collaboration method according to an embodiment of the present application; [Figure 15A] 1 is a group of UI diagrams according to one embodiment of the present application. [Figure 15B] 1 is a group of UI diagrams according to one embodiment of the present application. [Figure 15C] 1 is a group of UI diagrams according to one embodiment of the present application. [Figure 15D]1 is a group of UI diagrams according to one embodiment of the present application. [Figure 15E] 1 is a group of UI diagrams according to one embodiment of the present application. [Figure 15F] 1 is a group of UI diagrams according to one embodiment of the present application. [Figure 15G] 1 is a group of UI diagrams according to one embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0036] The technical solutions according to the embodiments of the present application are described below clearly and completely with reference to the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means "or". For example, A / B may represent A or B. In this specification, "and / or" simply describes the association relationship between related objects and represents that three relationships may exist. For example, A and / or B may represent the following three cases: only A exists, both A and B exist, and only B exists. In addition, in the description of the embodiments of the present application, "multiple" means two or more.
[0037] The terms "first" and "second" referred to below are used merely for descriptive purposes and should not be understood as an implicit or implied indication of the number or relative importance of the technical features indicated. Thus, features qualified by "first" and "second" may explicitly or implicitly include one or more of those features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0038] The term "user interface (UI)" in the following embodiments of this application refers to a medium interface for interaction and information exchange between a user and an application or an operating system, and implements the conversion between the internal form of information and the form acceptable to the user. A user interface is usually in the form of a graphical user interface (GUI), a user interface related to computer operation and in the form of graphics. A user interface can be visual interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, or widgets displayed on the display of an electronic device.
[0039] Currently, links and interfaces for data transfer can be established between electronic devices by using a remote procedure call (RPC) mechanism to perform data collaboration.
[0040] FIG. 1 is an exemplary diagram of the partial processes of an RPC mechanism.
[0041] The RPC mechanism mainly includes the following steps:
[0042] 1. The serving end defines and implements an AIDL interface for invoking remote messages.
[0043] 2. The serving end exposes the AIDL interface to the client end by using the server.
[0044] 3. A persistent connection is established between the client end and the serving end.
[0045] 4. The client end binds to the client end, invokes the AIDL interface of the client end, and invokes messages on the client end.
[0046] From the above steps, it can be seen that during a specific implementation of an existing RPC mechanism, a client end needs to be bound to a serving end and a persistent connection needs to be maintained between the client end and the serving end, which increases the internal resource consumption of the client end. A developer also needs to implement internal code implementation forms, such as creating a communication interface of the serving end, binding the client end and the serving end (i.e., establishing a communication connection between the client end and the serving end), and maintaining a persistent connection between the client end and the serving end, which increases the burden on the developer.
[0047] Therefore, an embodiment of the present application provides a device collaboration method. The method includes: By using the programming framework provided in this embodiment of the present application, the electronic device 100 can redefine the data object according to the getter / setter method through data interception to obtain the distributed data object. The electronic device 100 can detect whether the attribute value of the distributed data object has changed, and then the electronic device 100 sends the distributed data to the electronic device 200. In addition, two instances or data objects that are the same on the electronic device 100 and the electronic device 200 are associated with the same session identifier (session ID), so that the data of the two instances that are the same on the electronic device 100 and the electronic device 200 are the same. In this way, automatic synchronization of the distributed data object on the electronic device is implemented.
[0048] In some embodiments, electronic device 100 may be referred to as a first electronic device, and electronic device 200 may be referred to as a second electronic device.
[0049] According to the method provided in this embodiment of the present application, by using the programming framework provided in this embodiment of the present application, there is no need to distinguish between the client end and the serving end, and there is no need to maintain a persistent connection between electronic devices. In this case, the development efficiency of application developers is improved. Furthermore, distributed data objects are created through data interception. The electronic device 100 can monitor the instance attribute values of the distributed data objects and send only the changed instance attribute values to the electronic device 200. In this way, the amount of data transmitted is reduced and the device collaboration efficiency is improved. In addition, in this embodiment of the present application, resource sharing between multiple electronic devices can be implemented.
[0050] For example, if it is inconvenient for a user to use a mobile phone for navigation while cycling, the mobile phone cannot process navigation information. When the mobile phone and the smart watch are in the same distributed network, the mobile phone can seamlessly switch the map information for navigation on the mobile phone to the smart watch with one tap, and then the smart watch continues to display the navigation information. In this way, the user can see the navigation information while cycling.
[0051] In another example, when a mobile phone and a TV are in the same distributed network, the mobile phone can seamlessly switch the video being watched on the mobile phone to the TV with one tap, and the TV then continues to provide video playback services so that the user can enjoy the big screen experience.
[0052] As another example, in an office scenario, during a meeting, a staff member can operate an office computer to display a presentation file. The office computer can establish a collaboration connection to another person's office device, so that the presentation file on the office computer can be displayed on the other person's office device. In this way, office efficiency is improved.
[0053] The following describes the system architecture provided in one embodiment of the present application.
[0054] Please refer to Figure 2. Figure 2 is an architecture diagram of a system 400 according to one embodiment of the present application.
[0055] System 400 may include a plurality of electronic devices. The plurality of electronic devices may be of various types. The specific type of the plurality of electronic devices is not particularly limited in this embodiment of the present application. For example, the plurality of electronic devices may include mobile phones, tablet computers, desktop computers, laptop computers, handheld computers, notebook computers, smart screens, wearable devices, augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, telematics, smart headsets, and game consoles, and may further include internet of things (IOT) devices, or smart home devices such as smart water heaters, smart lamps, or smart air conditioners. This is not limited thereto. The plurality of electronic devices in system 400 may further include non-portable terminal devices, such as laptop computers with touch-sensitive surfaces or touch panels, or desktop computers with touch-sensitive surfaces or touch panels.
[0056] Different software operating systems (OS) may be configured for the multiple electronic devices, including but not limited to Harmony, Android, iOS, Windows, Linux, etc. Harmony is the Huawei HarmonyOS.
[0057] Multiple electronic devices may all be configured with the same software operating system, for example, all configured with Harmony.
[0058] Multiple electronic devices can establish a collaboration connection in any one of the following ways:
[0059] Method 1: Multiple electronic devices can be connected to the same network. For example, multiple electronic devices can be connected to the same local area network to establish a collaboration connection.
[0060] Method 2: The same system account is used to log in to multiple electronic devices to establish a collaboration connection. For example, the system account used to log in to multiple electronic devices may be "HW1234".
[0061] Scheme 3: The system accounts used to log in to multiple electronic devices may all belong to the same account group. For example, the system accounts used to log in to multiple electronic devices include “HW001”, “HW002”, and “HW003”. The system accounts “HW001”, “HW002”, and “HW003” belong to the account group “Huawei Home”.
[0062] Method 4: Multiple electronic devices can establish a collaboration connection through methods such as Near Field Communication (NFC), Bluetooth (BT), wireless local area network (WLAN) such as wireless fidelity point to point (Wi-Fi P2P), or infrared (IR) technology.
[0063] Method 5: Multiple electronic devices may establish a temporary account group by scanning the same two-dimensional barcode to establish a collaborative connection for communication.
[0064] In addition to the above five ways, the electronic device 100 may further establish a collaboration connection in another way, which is not limited in this embodiment of the present application.
[0065] In addition, multiple electronic devices can also be connected to and communicate with each other according to any number of combinations of the above-mentioned manners, which is not limited in this embodiment of the present application.
[0066] In another embodiment, the system 400 may include only two electronic devices, for example, the electronic device 100 and the electronic device 200, and the electronic device 100 establishes a collaboration connection to the electronic device 100. In the following embodiments of the present application, an example in which the system 400 includes two electronic devices is used for explanation. The electronic device 100 is a mobile phone, and the electronic device 200 is a watch.
[0067] One or more applications are installed on the electronic device 100, and one or more applications are also installed on the electronic device 200. After the electronic device 100 establishes a collaboration connection to the electronic device 200, the electronic device 100 creates a distributed data object of the application 1 by using the JS programming framework provided in this embodiment of the present application. Then, the electronic device 100 sends the distributed data object to the electronic device 200, and the electronic device 200 can output the distributed data object. When it is inconvenient for a user to use a mobile phone for navigation while cycling, and the mobile phone and the smart watch are in the same distributed network, the mobile phone can seamlessly switch the map information for navigation on the mobile phone to the smart watch with one tap, and then the smart watch displays the navigation information. In this way, the user can see the navigation information while cycling.
[0068] When electronic device 100 establishes a collaboration connection to electronic device 200, the JS programming framework creates a session ID and associates the session ID with the locally created instance 1 of application 1. Electronic device 200 then obtains the session ID and associates the session ID with instance 1 of application 1 on electronic device 200. In this manner, after the distributed data object on electronic device 100 changes (e.g., the distributed data object is updated), the distributed data object on electronic device 100 also changes accordingly.
[0069] It should be noted that a data object can be understood as memory data (also referred to as service data) generated during the execution of an application, and an instance can be understood as a specification of a particular type of data object. A data object includes one or more types of data objects, and each type of data object can include one or more types of instances. The types of data objects include, but are not limited to, audio data objects, text data objects, image data objects, video data objects, and the like. For example, when a navigation application on the electronic device 100 is started and executed, the electronic device 100 can announce route information for navigation on an application navigation while displaying the route information for navigation on the navigation application. In this case, the route information displayed by the electronic device 100 for navigation on the navigation application may be referred to as a picture data object, and the route information for navigation on the navigation application announced by the electronic device 100 is referred to as an audio data object. For example, a data object may be a text data object in the navigation information, and the text data object in the navigation information may further include multiple different types of instances. The multiple different types of instances may be a time instance, a remaining distance instance, a duration instance, and the like.
[0070] In some embodiments, for one type of data object, the data object includes multiple instances of different types, which may be collectively referred to as the same instance in the electronic device, or the types of instances may not be distinguished, and each type of data object includes only one instance.
[0071] A specific implementation of creating distributed data objects through the JS programming framework will be described in detail in the following embodiments, and the details will not be described in this embodiment of the present application.
[0072] FIG. 3 is a diagram showing the structure of the electronic device 100. As shown in FIG.
[0073] 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 headset jack 170D, a sensor module 180, buttons 190, a motor 191, indicators 192, a camera 193, a display 194, a subscriber identity module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, an optical 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, and the like.
[0074] It may be understood that the structure shown in this embodiment of the application does not constitute a particular limitation on the electronic device 100. In some other embodiments of the application, the electronic device 100 may include more or fewer components than those shown in the figures, or some components may be combined, or some components may be divided, or a different component arrangement may be used. The components shown in the figures may be implemented by hardware, software, or a combination of software and hardware.
[0075] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be separate components or may be integrated into one or more processors.
[0076] The controller can generate operation control signals based on the instruction operation codes and the time series signals to control instruction fetching and instruction execution.
[0077] A memory may also be located within the processor 110 and configured to store instructions and data. In some embodiments, the memory within the processor 110 is a cache memory. The memory may store instructions or data that have been used or are used periodically by the processor 110. When the processor 110 needs to use the instructions or data again, the processor can retrieve the instructions or data directly from the memory. This avoids repeated accesses, reduces the latency of the processor 110, and improves system efficiency.
[0078] In some embodiments, the processor 110 may include one or more interfaces, which 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, a universal serial bus (USB) interface, etc.
[0079] 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 groups of I2C buses. The processor 110 may be separately coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through the I2C bus interface to implement the touch function of the electronic device 100.
[0080] The I2S interface may be configured to perform audio communication. In some embodiments, the processor 110 may include multiple groups of I2S buses. The processor 110 may be coupled to the audio module 170 via the I2S bus to implement communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may send an audio signal via the I2S interface to the wireless communication module 160 to implement a function of answering a call via a Bluetooth headset.
[0081] The PCM interface may also be used for audio communication, analog signal sampling, quantization, and encoding. In some embodiments, audio module 170 may be coupled to wireless communication module 160 through a PCM bus interface. In some embodiments, audio module 170 may also send audio signals to wireless communication module 160 via the PCM interface to implement the functionality of answering a call via a Bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
[0082] The UART interface is a universal serial data bus and is configured to perform asynchronous communication. The bus may be a bidirectional communication bus. The bus converts data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is generally configured to connect the processor 110 to the wireless communication module 160. For example, the processor 110 communicates with a Bluetooth module in the wireless communication module 160 via the UART interface to implement a Bluetooth function. In some embodiments, the audio module 170 can send an audio signal to the wireless communication module 160 via the UART interface to implement a function of playing music via a Bluetooth headset.
[0083] MIPI may be configured to connect the processor 110 to peripheral components such as a display 194 or a camera 193. MIPI includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 communicates with the camera 193 via the CSI to implement a photographing function of the electronic device 100. The processor 110 communicates with the display 194 via the DSI interface to realize a display function of the electronic device 100.
[0084] The GPIO interface may be configured by using software. The GPIO interface may be configured as a control signal or a data signal. In some embodiments, the GPIO interface may be configured to connect the processor 110 to the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface may be further configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0085] The USB interface 130 is an interface that complies with the USB standard specification, and may specifically be a mini USB interface, a micro USB interface, a USB type-C interface, etc. The USB interface 130 may be configured to connect to a charger to charge the electronic device 100, or may be configured to transmit data between the electronic device 100 and a peripheral device, or may be configured to connect to a headset to play audio through the headset. The interface may further be configured to connect to another electronic device, such as an AR device.
[0086] It may be understood that the interface connection relationships between modules shown in this embodiment of the present invention are merely examples for illustrative purposes and do not constitute limitations on the structure of the electronic device 100. In some other embodiments of the present application, the electronic device 100 may alternatively use a different interface connection scheme than the aforementioned embodiment or may use a combination of multiple interface connection schemes.
[0087] The charging management module 140 is configured to receive a charging input from a charger. The charger may be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 may receive the charging input of the wired charger via the USB interface 130. In some embodiments of wireless charging, the charging management module 140 may receive the wireless charging input via a wireless charging coil of the electronic device 100. The charging management module 140 provides power to the electronic device via the power management module 141 while charging the battery 142.
[0088] The power management module 141 is configured to connect to 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 and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, etc. The power management module 141 may be further configured to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage or impedance). In some other embodiments, the power management module 141 may alternatively be located within the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 may alternatively be located within the same device.
[0089] The wireless communication functions of the electronic device 100 may be implemented by using antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, a modem processor, a baseband processor, and the like.
[0090] Antenna 1 and Antenna 2 are configured to transmit and receive electromagnetic signals. Each antenna in electronic device 100 may be configured to cover one or more communication bands. Different antennas may be multiplexed to improve antenna utilization. For example, Antenna 1 may be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas may be used in combination with a tuning switch.
[0091] The mobile communication module 150 can provide a solution applied to the electronic device 100 for wireless communication including 2G, 3G, 4G, 5G, etc. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 may receive electromagnetic waves via the antenna 1, perform processing such as filtering or amplification on the received electromagnetic waves, and send the electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can further amplify the modulated signal by the modem processor and convert the signal to electromagnetic waves for emission via the antenna 1. In some embodiments, at least some functional modules in the mobile communication module 150 can be located 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 can be located in the same device.
[0092] The modem processor may include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the low-frequency baseband signal obtained through demodulation to the baseband processor for processing. The low-frequency baseband signal is processed by the baseband processor and then transmitted to the application processor. The application processor outputs an audio signal by an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video using the display 194. In some embodiments, the modem processor may be an independent component. In some other embodiments, the modem processor may be independent from the processor 110, and the modem processor and the mobile communication module 150 or another functional module may be located in the same device.
[0093] The wireless communication module 160 can be applied to the electronic device 100 to provide wireless communication solutions including wireless local area network (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC) technology, infrared (IR) technology, etc. The wireless communication module 160 can be one or more components integrating at least one communication processor module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs demodulation and filtering processing on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 may further receive signals transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves for radiation via the antenna 2.
[0094] In some embodiments, in the electronic device 100, the antenna 1 and the mobile communication module 150 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, such that the electronic device 100 can communicate with a network and another device by using a wireless communication technology. The wireless communication technology may include technologies such as 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), BT, GNSS, WLAN, NFC, FM, and / or IR. GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a BeiDou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).
[0095] The electronic device 100 can implement display functions via a GPU, a display 194, an application processor, etc. The GPU is a microprocessor for image processing and is connected to the display 194 and the application processor. The GPU is configured to perform mathematical and geometric calculations and render images. The processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0096] The display 194 is configured to display images, videos, etc. The display 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 mini-LED, a micro-LED, a micro-OLED, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0097] The electronic device 100 may implement image capture functionality through an ISP, a camera 193, a video codec, a GPU, a display 194, an application processor, and the like.
[0098] The ISP is configured to process data fed back by the camera 193. For example, during shooting, the shutter is pressed and light is sent through the lens to the camera's photosensitive elements. The light signal is converted into an electrical signal, which in turn sends the electrical signal to the ISP for processing to convert the electrical signal into a visible image. The ISP can further perform algorithmic optimization on noise and brightness of the image. The ISP can further optimize parameters such as exposure and color temperature for the shooting scenario. In some embodiments, the ISP can be located within the camera 193.
[0099] The camera 193 is configured to capture still images or videos. An optical image of an object is generated through a lens and projected onto a photosensitive element. The photosensitive element may be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then sent to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format, such as RGB or YUV. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0100] The digital signal processor is configured to process digital signals and can process other digital signals in addition to the digital image signal, for example, when the electronic device 100 selects a frequency, the digital signal processor is configured to perform a Fourier transform on the frequency energy.
[0101] A video codec is configured to compress or decompress digital video. Electronic device 100 may support one or more types of video codecs. In this manner, electronic device 100 may play or record video in multiple coding formats, e.g., moving picture experts group (MPEG)-1, MPEG-2, MPEG-3, and MPEG-4.
[0102] The NPU is a neural-network (NN) computing processor. The NPU can quickly process input information by referring to the structure of a biological neural network, such as the transmission mode between human brain neurons, and can continuously perform self-learning. Through the NPU, intelligent cognition of the electronic device 100, such as applications such as image recognition, face recognition, voice recognition, and text understanding, can be realized.
[0103] The internal memory 121 may be one or more random access memories (RAMs) and one or more non-volatile memories (NVMs).
[0104] Random access memory may include static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, such as the fifth generation DDR SDRAM, commonly referred to as DDR5 SDRAM), etc. Non-volatile memory may include magnetic disk storage devices and flash memory.
[0105] Based on the operating principle, flash memory can be classified into NOR flash, NAND flash, 3D NAND flash, etc.; based on the amount of potential levels of the cell, it can be classified into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; or based on the storage specifications, flash memory can be classified into universal flash storage (UFS), embedded multi-media card (eMMC), etc.
[0106] The random access memory may be directly read and written to using the processor 110. The random access memory may be configured to store executable programs (e.g., machine instructions) within an operating system or another executing program, and may be further configured to store user data, application data, and the like.
[0107] The non-volatile memory may also store executable programs, user and application data, and the like, which may be pre-loaded into the random access memory so that the processor 110 can read and write them directly.
[0108] The external memory interface 120 may be configured to connect to an external non-volatile memory to expand the storage capabilities of the electronic device 100. The external non-volatile memory communicates with the processor 110 via the external memory interface 120 to implement data storage functions. The external non-volatile memory stores files such as music and videos.
[0109] The electronic device 100 can implement audio functions, such as music playback and recording, via an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, and an application processor.
[0110] Audio module 170 is configured to convert digital audio information to analog audio signals for output, and also to convert analog audio input to digital audio signals. Audio module 170 may be further configured to encode and decode audio signals. In some embodiments, audio module 170 may be located within processor 110, or some functional modules within audio module 170 are located within processor 110.
[0111] The speaker 170A, also referred to as a "loudspeaker," is configured to convert audio electrical signals into voice signals. The electronic device 100 can be used to listen to music in a hands-free mode or to answer phone calls via the speaker 170A.
[0112] Receiver 170B, also referred to as an "earpiece," is configured to convert electrical audio signals into speech signals such that when answering a call or receiving voice information via electronic device 100, receiver 170B can be held close to a person's ear to hear the sound.
[0113] The microphone 170C, also referred to as a "mike" or "mic", is configured to convert audio signals into electrical signals. When making a phone call or sending a voice message, a user can make a sound near the microphone 170C through the user's mouth to input an audio signal into the microphone 170C. At least one microphone 170C can be disposed in the electronic device 100. In some other embodiments, two microphones 170C may be disposed in the electronic device 100 to collect audio signals and implement noise cancellation functions. In some other embodiments, three, four, or more microphones 170C can alternatively be disposed in the electronic device 100 to collect audio signals, implement noise cancellation, identify sound sources, implement directional recording functions, and the like.
[0114] The headset jack 170D is configured to connect to a wired headset and may be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0115] The pressure sensor 180A is configured to sense a pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display 194. There are multiple types of pressure sensor 180A, such as a resistive pressure sensor, an inductive pressure sensor, and a capacitive pressure sensor. The capacitive pressure sensor can include at least two parallel plates made of a conductive material. When a force is applied to the pressure sensor 180A, a capacitance between the electrodes changes. The electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is performed on the display 194, the electronic device 100 detects the intensity of the touch operation via the pressure sensor 180A. The electronic device 100 can also calculate the touch position based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations performed at the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than a first pressure threshold is performed on an SMS message application icon, an instruction to view the SMS message is executed. When a touch is performed over the SMS message application icon with a touch strength equal to or greater than a first pressure threshold, instructions are executed to compose an SMS message.
[0116] The gyro sensor 180B may be configured to determine the movement attitude of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (axes x, y, and z) may be determined by using the gyro sensor 180B. The gyro sensor 180B may be configured to implement image stabilization during shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle at which the electronic device 100 jitters, and based on the angle, calculates the distance that the lens module needs to compensate, and the lens cancels the jitter of the electronic device 100 through the reverse movement to implement image stabilization. The gyro sensor 180B may also be used in navigation scenarios and physical game scenarios.
[0117] The air pressure sensor 180C is configured to measure air pressure. In some embodiments, the electronic device 100 calculates an altitude based on the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0118] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 may use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, if the electronic device 100 is a clamshell phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Furthermore, functions such as auto-unlock on opening are set based on the detected opening and closing state of the flip cover or clamshell.
[0119] The acceleration sensor 180E can detect acceleration in various directions (usually on three axes) of the electronic device 100. When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor 180E may be further configured to identify the orientation of the electronic device, which is used in applications such as switching between landscape and portrait modes or a pedometer.
[0120] The distance sensor 180F is configured to measure distance. The electronic device 100 can measure distance by infrared or laser. In some embodiments, in a shooting scenario, the electronic device 100 can measure distance via the distance sensor 180F to implement fast focusing.
[0121] The optical proximity sensor 180G may include, for example, a light emitting diode (LED) and a photodetector, for example, a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 uses the light emitting diode to emit infrared light. The electronic device 100 detects the infrared light reflected from a nearby object through the photodiode. If sufficient reflected light is detected, it can be determined that an object is present in the vicinity of the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object in the vicinity of the electronic device 100. By using the optical proximity sensor 180G, the electronic device 100 can detect that a user is holding the electronic device 100 close to the ear for a call and automatically turn off the screen to save power. The optical proximity sensor 180G can also be used in flip cover mode or pocket mode to automatically unlock or lock the screen.
[0122] The ambient light sensor 180L is configured to sense the brightness of the ambient light. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the sensed ambient light brightness. The ambient light sensor 180L may also be configured to automatically adjust the white balance during shooting. The ambient light sensor 180L may also cooperate with the optical proximity sensor 180G to detect whether the electronic device 100 is in a pocket to avoid accidental touches.
[0123] The fingerprint sensor 180H is configured to collect a fingerprint. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint-based unlocking, application lock access, fingerprint-based photographing, fingerprint-based phone answering, and the like.
[0124] The temperature sensor 180J detects the temperature. In some embodiments, the electronic device 100 executes a temperature handling policy based on the temperature detected by the temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor near the temperature sensor 180J to reduce power consumption and implement thermal protection. In some other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from abnormally shutting down due to low temperature. In some other embodiments, when the temperature is below yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0125] The touch sensor 180K is also referred to as a "touch component." The touch sensor 180K may be disposed on the display 194, and the touch sensor 180K and the display 194 constitute a touch screen referred to as a "touch screen." The touch sensor 180K is configured to detect a touch operation performed on or near the touch sensor. The touch sensor can forward the detected touch operation to an application processor to determine a type of touch event. A visual output associated with the touch operation may be provided via the display 194. In some other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a location different from the location of the display 194.
[0126] The bone conduction sensor 180M can acquire a vibration signal. In some embodiments, the bone conduction sensor 180M can acquire a vibration signal of the vibrating bone of the human vocal cord part. The bone conduction sensor 180M may be in contact with a body pulse to receive a blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may be disposed in a headset to acquire a bone conduction headset. The audio module 170 can acquire a voice signal by analyzing based on the vibration signal of the vibrating bone of the vocal cord part acquired by the bone conduction sensor 180M to implement a voice function. The application processor can analyze heart rate information based on the blood pressure pulsation signal acquired by the bone conduction sensor 180M to implement a heart rate detection function.
[0127] The buttons 190 include a power button, a volume button, etc. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive button inputs and generate button signal inputs related to user settings and function control of the electronic device 100.
[0128] The motor 191 can generate vibration prompts. The motor 191 may be configured to provide incoming vibration prompts and touch vibration feedback. For example, touch operations performed in different applications (e.g., taking pictures and playing audio) may correspond to different vibration feedback effects. For touch operations performed in different regions of the display 194, the motor 191 may also correspond to different vibration feedback effects. Different application scenarios (e.g., time remind, information reception, alarm clock, and games) may correspond to different vibration feedback effects. The touch vibration feedback effects may be further customized.
[0129] The indicator 192 may be an indicator light and may be configured to indicate charging status and power changes, or may be configured to indicate messages, missed calls, notifications, and the like.
[0130] The SIM card interface 195 is configured to connect to a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to implement contact with or separation 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 one. The SIM card interface 195 can support a nano-SIM card, a micro-SIM card, a SIM card, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The multiple cards can be of the same type or different types. Different types of SIM cards are compatible in the SIM card interface 195. The SIM card interface 195 is also compatible with an external storage card. The electronic device 100 interacts with a network through the SIM card to implement functions such as calling and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card may be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0131] The software system of the electronic device 100 may use a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In this embodiment of the present invention, the Android system of the layered architecture is used as an example to explain the software structure of the electronic device 100.
[0132] FIG. 4 is a block diagram of the software architecture of electronic device 100 according to one embodiment of the present invention.
[0133] The software is divided into some layers based on a layered architecture, and the layers implement their respective functions. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers from top to bottom: application layer, application framework layer, Android runtime and system libraries, and kernel layer.
[0134] The application layer may include various application packages.
[0135] As shown in FIG. 4, the application package may include applications such as Camera, Gallery, Calendar, Call, Map, Navigation, WLAN, Bluetooth, Music, Videos, and Messages.
[0136] The application framework layer provides an application programming interface (API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0137] As shown in FIG. 4, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a JS programming framework, and the like.
[0138] A window manager is configured to manage window programs. A window manager can get the size of the display, determine if there is a status bar, perform screen locking, take screenshots, etc.
[0139] Content providers are configured to store and retrieve data and make the data accessible to applications. Data can include video, images, audio, calls made and received, browsing history and bookmarks, address books, and the like.
[0140] The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be configured to build applications. A display interface can include one or more views. For example, a display interface that includes an SMS message notification icon can include a view that displays text and a view that displays a picture.
[0141] The telephone manager is configured to provide communication functions of the electronic device 100, such as managing the call status (including answering, rejecting, etc.).
[0142] The resource manager provides various resources such as localized strings, icons, images, layout files, video files, etc. to the application.
[0143] The JS programming framework can be used to redefine the JS data object transferred by the application according to the getter / setter methods through JS data interception to obtain a JS wrapper object, and then wrap the JS wrapper object into a JS distributed data object to obtain the JS distributed data object.
[0144] The JS programming framework is further used to call the distributed in-memory database in the system library and store the retrieved JS distributed data objects in the distributed in-memory database.
[0145] When electronic device 100 establishes a collaboration connection to electronic device 200, the JS programming framework creates a session ID and associates the session ID with instance 1 of the distributed data object.
[0146] Then, when electronic device 100 sends a collaboration message to electronic device 200, the collaboration message carries the session ID.
[0147] After receiving the reconciliation message, the electronic device 200 obtains the session ID carried in the reconciliation message through analysis, and based on the session ID, the electronic device 100 stores the session ID. Then, the electronic device 100 sends the instance 1 of the distributed data object to the electronic device 200, and the electronic device 200 generates the distributed data object based on the instance 1 after receiving the instance 1. Furthermore, the electronic device 200 associates the local instance 1 with the session ID. The instance 1 on the electronic device 100 and the instance 1 on the electronic device 200 are associated with the same session ID. In this way, after the attribute value of the instance 1 of the electronic device 100 is changed (e.g., added, deleted, queried, or modified), the attribute value of the instance 1 on the electronic device 200 is also changed accordingly.
[0148] The Android Runtime includes the kernel library and the virtual machine, and is responsible for the scheduling and management of the Android system.
[0149] The kernel library includes two parts: the functions that need to be called in the java language and the Android kernel library.
[0150] The application layer and the application framework layer run on a virtual machine. The virtual machine executes the java files of the application layer and the application framework layer as binary files. The virtual machine is configured to implement functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0151] The system library may include multiple functional modules, such as a surface manager, a Media Library, a three-dimensional graphics processing library (eg, OpenGL ES), a 2D graphics engine (eg, SGL), and a distributed in-memory database.
[0152] The surface manager is configured to manage the display subsystem and provide blending of 2D and 3D layers for multiple applications.
[0153] The media library supports playback and recording of multiple commonly used audio and video formats, as well as still image files. The media library can support multiple audio and video encoding formats, for example, MPEG-4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0154] The 3D graphics processing library is configured to implement 3D graphics drawing, image rendering, compositing, layer processing, and the like.
[0155] The 2D graphics engine is a drawing engine for 2D drawing.
[0156] A distributed in-memory database provides the ability to manage distributed databases, synchronize distributed databases across electronic devices, and access (add, delete, modify, and query) distributed data objects.
[0157] The kernel layer is a layer between the hardware and the software, and includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
[0158] The following describes an example of the software and hardware working process of the electronic device 100 with reference to a shooting scenario.
[0159] When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including information such as touch coordinates and timestamp of the touch operation). The original input event is stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer and identifies a control corresponding to the input event. An example is used in which the touch operation is a tap operation and the control corresponding to the tap operation is a control of a camera application icon. The camera application calls an interface of the application framework layer to enable the camera application, then enables a camera driver by calling the kernel layer, and captures a still image or video by using the camera 193.
[0160] The following describes the functional modules of the JS programming framework provided in this application.
[0161] FIG. 5 is an exemplary diagram of functional modules of a JS programming framework according to an embodiment of the present application.
[0162] The functional module diagram of the JS programming framework in FIG. 5 is a diagram of the functional modules on the collaboration initiation device side.
[0163] As shown in FIG. 5, the JS programming framework includes a distributed data object creation module 401, a distributed data object synchronization module 402, and a distributed data object monitoring module 403.
[0164] It should be noted that multiple functional modules may exist independently to implement preset functions, or any two or more functional modules may be combined to implement preset functions of the two or more functional modules, which is not limited in this embodiment of the present application.
[0165] In some embodiments, the distributed data object creation module 401 is configured to receive a data object generated by application 1, redefine the data object transferred by the application through data interception by getter / setter methods to obtain a wrapper object, and wrap the wrapper object into a distributed data object.
[0166] Data interception is to perform additional operations when the access or modification operation is intercepted by using a pre-configured code function during the access or modification of a specific instance attribute of a data object. For example, after the distributed data object creation module 401 obtains the data object 1, the distributed data object creation module 401 calls a getter method to obtain the attribute value of the instance 1 of the data object 1. The distributed data object creation module 401 calls a setter method to add data listening and data interception to the attribute value of the instance 1. In this way, when the attribute value of the instance 1 changes, the distributed data object creation module 401 can detect the change in the attribute value of the instance 1 and then update the attribute value of the instance 1 in a timely manner.
[0167] The distributed data object creation module 401 sends the distributed data object to the application 1. After the application 1 obtains the distributed data object, the application 1 can perform an operation on the distributed data object (e.g., perform a value update operation on the distributed data object).
[0168] The data object may be a JS (java script) data object. The distributed data object creation module 401 can redefine the JS data object through JS data interception according to a getter method or a setter method to obtain a final JS wrapper object, and then wrap the JS wrapper object into a distributed data object to obtain a JS distributed data object. In the following embodiments of the present application, an example in which the data object is a JS data object is used for description. The JS distributed data object may also be referred to as a distributed data object in the following embodiments of the present application.
[0169] In some embodiments, the distributed data object creation module 401 is further configured to generate a session ID and associate the session ID with the instance corresponding to the distributed data object.
[0170] In some embodiments, the distributed data object creation module 401 invokes a cross-device communication module (not shown in FIG. 5 ) to send the session ID to the peer device (or the device accepting the collaboration). After receiving the session ID, the peer device associates the session ID with instance 1 of application 1. In this way, after instance 1 on the local device (or collaboration initiating device) and instance 1 on the peer device are associated with the same session ID, the attribute value of instance 1 on electronic device 100 changes, and the attribute value of instance 1 on electronic device 200 changes, data synchronization between different devices is implemented.
[0171] After the distributed data object creation module 401 obtains the distributed data object, the distributed data object creation module 401 sends the distributed data object to the distributed data object synchronization module 402 and the distributed data object monitoring module 403 separately.
[0172] The distributed data object synchronization module 402 is configured to store the distributed data objects in a distributed in-memory database in a key-value format.
[0173] [Table 1]
[0174] Table 1 illustrates an exemplary storage form of distributed data objects in a distributed database. For example, distributed data object 1 includes field 1 and field 2. Field 1 is stored in a distributed content database named kv store1, and the attribute value of field 1 stored in kv store1 is key1. Field 2 is stored in a distributed content database named kv store1, and the attribute value of field 2 stored in kv store1 is key2. Distributed data object 2 includes field 3 and field 4. Field 3 is stored in a distributed content database named kv store2, and the attribute value of field 3 stored in kv store2 is key3. Field 4 is stored in a distributed content database named kv store2, and the attribute value of field 4 stored in kv store2 is key4. Distributed data object n includes field 5 and field 6. Field 5 is stored in a distributed content database named kv store n, and the attribute value of field 5 stored in kv store n is key5. Field 6 is stored in a distributed content database named kv store n, and the attribute value of field 6 stored in kv store n is key6.
[0175] The distributed data object monitoring module 403 is configured to monitor whether an attribute value of a distributed data object has changed. If the attribute value has changed, the distributed data object monitoring module 403 sends the changed distributed data object to the distributed data object synchronization module 402.
[0176] The distributed data object synchronization module 402 is further configured to receive the changed distributed data object sent by the distributed data object monitoring module 403 and store the changed distributed data object in a key-value format in the distributed in-memory database.
[0177] In some embodiments, the distributed data object synchronization module 402 can simultaneously store the changed and pre-change distributed data objects in a distributed in-memory database, or the distributed data object synchronization module 402 can replace the pre-change distributed data object with the changed distributed data object. Based on this, the distributed data object synchronization module 402 stores only the changed distributed data object and does not store the pre-change distributed data object.
[0178] FIG. 6 is an exemplary interaction diagram of collaboration between electronic device 100 and electronic device 200.
[0179] Electronic device 100 includes an application 601, a JS programming framework 602, a communication module 603, and a distributed in-memory database 604. Electronic device 200 includes an application 605, a JS programming framework 606, a communication module 607, and a distributed in-memory database 608.
[0180] It should be noted that application 601 and application 605 may be the same application, e.g., both are the same map application. Application 601 and application 605 may alternatively be different applications of the same type. For example, both application 601 and application 605 may be applications that provide navigation services, but application 601 and application 605 are not applications developed by the same developer. In the following embodiments of the present application, an example in which application 601 and application 605 are the same application (e.g., both are application 1) is used for explanation.
[0181] For example, this embodiment of the present application is described by using an example in which electronic device 100 is a collaboration initiating device and electronic device 200 is a collaboration accepting device.
[0182] The steps of collaboration interaction between electronic device 100 and electronic device 200 are as follows.
[0183] 1. When electronic device 100 initiates a collaboration with electronic device 200, an application 601 in the electronic device creates a data object and sends the data object to the JS programming framework 602.
[0184] In some embodiments, step 1 may alternatively be performed after electronic device 100 receives a message sent by electronic device 200 indicating an agreement to establish a collaboration connection, i.e., step 1 may occur after step 4.
[0185] 2. When the electronic device 100 initiates a collaboration with the electronic device 200, the JS programming framework 602 in the electronic device 100 is configured to generate a distributed data object and a session ID associated with an instance corresponding to the distributed data object and send the session ID to the communication module 603 in the electronic device 100.
[0186] 3. After the communication module 603 receives the session ID, the communication module 603 sends a collaboration message to the electronic device 200 (e.g., the communication module 607 in the electronic device 200), which is used to request establishing a collaboration connection to the electronic device 200.
[0187] In some embodiments, the collaboration message further carries a session ID.
[0188] In some embodiments, the collaboration message may not carry the session ID, and the communication module 603 in the electronic device 100 separately transmits the session ID to the electronic device 200, for example, to the communication module 607 in the electronic device 200.
[0189] The step of the communication module 603 separately transmitting the session ID to the communication module 607 may be performed after the electronic device 100 receives the message transmitted by the electronic device 200 indicating an agreement to establish the collaboration connection. For example, after step 4 and before step 8, the communication module 603 may separately transmit the session ID to the communication module 607.
[0190] In some embodiments, the electronic device 100 may perform the step of transmitting the session ID to the communication module 607 only once. For example, the electronic device 100 transmits the session ID to the communication module 607 only once.
[0191] In some embodiments, the electronic device 100 may periodically perform the step of transmitting the session ID to the communication module 607, such that the electronic device 100 periodically transmits the session ID to the electronic device 200. In this way, a case where the electronic device 200 does not receive the session ID can be avoided because the electronic device 100 transmits the session ID only once.
[0192] 4. After the communication module 607 receives the collaboration message sent by the electronic device 100, the electronic device 200 decides to establish a collaboration connection to the electronic device 100. In this case, the electronic device 200 can send a message to the electronic device 100 (e.g., the communication module 603 on the electronic device 100) indicating an agreement to establish the collaboration connection.
[0193] 5. After the communication module 603 receives the message sent by the electronic device 200 indicating an agreement to establish a collaboration connection, the communication module 603 sends a collaboration start command to the JS programming framework 602, which instructs the JS programming framework 602 to wrap the data object into a distributed data object through data interception and send the distributed data object to the electronic device 200, such that the electronic device 100 starts a collaboration with the electronic device 200.
[0194] 6. After the JS programming framework 602 in the electronic device 100 receives the collaboration start command, the JS programming framework 602 is configured to wrap the data object into a distributed data object through data interception and store the distributed data object and the session ID in the distributed in-memory database 604.
[0195] After the distributed in-memory database 604 receives the distributed data object and the session ID, the distributed in-memory database 604 stores the distributed data object in the distributed in-memory database 604 in a key-value format. In some embodiments, the distributed in-memory database 604 further needs to associate the session ID with the instance of the distributed data object. For how to associate the session ID with the instance of the distributed data object, please refer to the related description of step 9. The details are not described herein in this embodiment of the present application.
[0196] In some embodiments, step 6 may be performed at any time after step 1 starts and before step 5 starts. The JS programming framework 602 wraps the data object generated by the application 601 into a distributed data object in advance. This can avoid the case where the JS programming framework starts to wrap the data object generated by the application into a distributed data object after receiving a collaboration start command. Based on this, the method provided in the embodiment of the present application can avoid collaboration delay.
[0197] 7. After the distributed in-memory database 604 retrieves the distributed data object, the distributed in-memory database 604 sends the distributed data object to the communication module 603 .
[0198] In some embodiments, step 7 may be performed at a time after the JS programming framework 602 obtains the distributed data object. This can avoid the case where the JS programming framework 602 starts to send the distributed data object to the communication module 603 only after receiving a collaboration start command. On this basis, the method provided in the embodiment of the present application can avoid collaboration delay.
[0199] 8. The communication module 603 transmits the distributed data to the communication module 607 on the electronic device 200.
[0200] The distributed data includes the types of data objects and the attribute values of instances of the data objects.
[0201] In some embodiments, step 8 may be performed immediately after step 4. The electronic device 100 prepares the distributed data object in advance and immediately transmits the distributed data object to the communication module 607 on the electronic device 200 after receiving a message indicating an agreement to establish a collaboration connection. In this way, the collaboration delay time can be reduced.
[0202] 9. After receiving the session ID, the communication module 607 sends the distribution data and the session ID to the JS programming framework 606 on the electronic device 200.
[0203] In some embodiments, the communications module 607 may send the distribution data and the session ID separately to the JS programming framework 606 .
[0204] In some embodiments, the communications module 607 may send the distribution data and the session ID to the JS programming framework 606 simultaneously.
[0205] In some embodiments, the communications module 607 may send the session ID to the JS programming framework 606 after step 4 and before step 9.
[0206] After receiving the distributed data, the JS programming framework 606 generates a distributed data object based on the attribute values of the data object instance.
[0207] After receiving the distributed data and the session ID, the JS programming framework 606 associates the instance of the data object with the session ID. Different instances are associated with different session IDs, so that the session ID associated with any two instances that are the same on the electronic device 100 and the electronic device 200 is the same. The data of two instances that are the same on the electronic device 100 and the electronic device 200 is consistent. In this way, after the data object of the instance 1 on the electronic device 100 changes, the instance 1 on the electronic device 200 also changes. Data synchronization is implemented when the electronic device 100 cooperates with the electronic device 200.
[0208] 10. The JS programming framework 606 sends the distributed data objects to a distributed in-memory database 608.
[0209] After the distributed in-memory database 608 receives the distributed data object, the distributed in-memory database 608 stores the distributed data object in the distributed in-memory database 608 in a key-value format.
[0210] Specifically, FIGS. 7-9 are example UI diagrams in which any two instances of a group of two collaboration devices are associated with the same session ID.
[0211] It should be noted that there may be more than one type of data object in the distributed data transmitted by electronic device 100 to electronic device 200 .
[0212] In some embodiments, data objects of the same type may also include instances of one type or multiple different types.
[0213] The electronic device 100 establishes a collaboration connection to the electronic device 200. The electronic device 100 creates a distributed data object based on the JS programming framework provided in this embodiment of the present application by using the data object generated by the application 1. There may be one or more data types of the distributed data object.
[0214] For example, as shown in FIG. 7, when a distributed data object (data object 1) has one data type, there is one instance of data object 1. Or, data object 1 has multiple instances, but the types of different instances are not distinguished. In this case, there is also one instance of a distributed data object with multiple instances of different types. The electronic device 100 creates a session ID-1 by using the JS programming framework, and associates the session ID-1 with the instance 1. Then, the electronic device 100 sends the attribute value of the instance 1, the type of the data object, and the session ID-1 to the electronic device 200. After receiving the instance 1 and the type of the data object, the electronic device 200 generates a data object 1 based on the instance 1 and the type of the data object, and associates the instance 1 on the electronic device 200 with the session ID-1. In this way, when a distributed data object has one data type, the instance 1 on the electronic device 100 and the instance 2 on the electronic device 200 are associated with the same session ID (session ID-1). In this manner, after a data object of instance 1 on electronic device 100 changes, the data object of instance 2 on electronic device 200 also changes. Data synchronization is implemented when electronic device 100 cooperates with electronic device 200.
[0215] For example, as shown in Fig. 8, when a distributed data object (data object 1) has one data type and the data object 1 has multiple instances, it is necessary to distinguish the instances of the distributed data object having multiple instances of different types. In addition, the electronic device 100 creates multiple different session IDs by using the JS programming framework, and sends the multiple different session IDs, attribute values of the different instances, and types of the data object to the electronic device 200. After receiving the multiple different session IDs, attribute values of the different instances, and types of the data object, the electronic device 200 generates a data object 1 based on the attribute values of the different instances and the types of the data object, and associates the same instance as the instance on the electronic device 100 with the same session ID.
[0216] For example, as shown in FIG. 8, data object 1 has n instance types. Electronic device 100 creates n different session IDs by using the JS programming framework, and associates instance 1 with session ID-1, instance 2 with session ID-2, and instance n with session ID-n. Then, electronic device 100 transmits the multiple different session IDs, attribute values of the different instances, and types of data objects to electronic device 200. Electronic device 100 generates data object 1 based on the attribute values of instance 1, instance 2, and instance n. Then, electronic device 200 associates instance 1 with session ID-1, instance 2 with session ID-2, and instance n with session ID-n. In this way, when the same data object has n instance types, the same instances on electronic device 100 and electronic device 200 are associated with the same session ID.
[0217] In this manner, after an attribute value of any instance on electronic device 100 changes, the attribute value of the instance associated with the same session ID on electronic device 200 also changes. For example, after an attribute value on instance 1 of electronic device 100 changes, the attribute value of instance 1 on electronic device 200 also changes. Data synchronization is implemented when electronic device 100 cooperates with electronic device 200.
[0218] For example, as shown in Fig. 9, when a data object has multiple data types (two or more), each type of data object has multiple instances. The electronic device 100 creates multiple different session IDs by using the JS programming framework, and sends the multiple different session IDs, attribute values of the different instances, and types of the data object to the electronic device 200. After receiving the multiple different session IDs, attribute values of the different instances, and types of the data object, the electronic device 200 generates a data object 1 based on the attribute values of the different instances and the types of the data object, and associates the same instance as the instance on the electronic device 100 with the same session ID.
[0219] For example, as shown in FIG. 9, there are n types of instances of data object 1. The electronic device 100 creates n different session IDs by using the JS programming framework, and associates instance 1 with session ID-1, instance 2 with session ID-2, and instance n with session ID-n. Then, the electronic device 100 transmits the multiple different session IDs, attribute values of the different instances, and types of data objects to the electronic device 200. The electronic device 200 generates data object 1 based on the attribute values of instance 1, instance 2, and instance n. Then, the electronic device 200 associates instance 1 with session ID-1, instance 2 with session ID-2, and instance n with session ID-n. In this way, when the same data object has n instance types, the same instances on the electronic device 100 and the electronic device 200 are associated with the same session ID.
[0220] There are m types of instances of the data object 2. The electronic device 100 creates m different session IDs by using a JS programming framework, and associates instance n+1 with session ID-n+1, instance n+2 with session ID-n+2, and instance n+m with session ID-n+m. Then, the electronic device 100 transmits the multiple different session IDs, attribute values of the different instances, and types of the data object to the electronic device 200. The electronic device 200 generates the data object 2 based on the attribute values of instance n+1, instance n+2, and instance n+m. Then, the electronic device (200) associates instance n+1 with session n+1, instance n+2 with session ID-n+2, and instance n+m with session ID-n+m.
[0221] In this way, when a data object has multiple data types, the same instance on electronic device 100 and electronic device 200 is associated with the same session ID. Data synchronization is implemented when electronic device 100 cooperates with electronic device 200.
[0222] 7 to 9 are exemplary UI diagrams in which any two instances of two collaboration devices in a group are associated with the same session ID. In another embodiment, multiple devices (more than two devices) can establish a collaboration connection simultaneously. When multiple devices establish a collaboration connection simultaneously, any two instances of the multiple devices can be associated with the same session ID to implement data synchronization.
[0223] 10 to 12 are examples of UI diagrams in which any two instances of multiple collaboration devices in a group are associated with the same session ID.
[0224] In an embodiment of the present application, the principle of implementing data synchronization by associating instances with the same session ID when three devices (e.g., electronic device 100, electronic device 200, and electronic device 300) establish a collaboration connection simultaneously is described.
[0225] In some embodiments, the electronic device 300 may be referred to as a third electronic device.
[0226] For example, as shown in FIG. 10, electronic device 100 is a collaboration initiating device, and electronic device 200 and electronic device 300 are collaboration accepting devices.
[0227] If the data object (data object 1) has one data type and the data object also has one instance type, the electronic device 100 creates a session ID-1 by using the JS programming framework and associates the session ID-1 with the instance 1. Then, the electronic device 100 sends the attribute values of the instance 1 and the session ID-1 to the electronic device 200 and the electronic device 300 separately.
[0228] After receiving the attribute values of instance 1 and session ID-1, electronic device 200 generates data object 1 based on the attribute values of instance 1 and associates instance 1 with session ID-1. In this way, instance 1 on electronic device 100 and instance 1 on electronic device 200 are associated with the same session ID (session ID-1).
[0229] Similarly, after receiving the attribute values of instance 1 and session ID-1, electronic device 300 generates data object 1 based on the attribute values of instance 1 and associates instance 1 with session ID-1. In this way, instance 1 on electronic device 300 and instance 1 on electronic device 100 are associated with the same session ID (session ID-1).
[0230] Instance 1 on electronic device 100, instance 1 on electronic device 200, and instance 1 on electronic device 300 are associated with the same session ID.
[0231] In this manner, after a data object of an instance of electronic device 100 changes, the data objects of the instances associated with the same session ID on electronic device 200 and electronic device 300 also change. For example, after a data object of instance 1 on electronic device 100 changes, the data object of instance 1 on electronic device 200 and the data object of instance 1 on electronic device 300 also change. Data synchronization is implemented when electronic device 100 cooperates with electronic device 200 and electronic device 300.
[0232] For example, as shown in FIG. 11, electronic device 100 is a collaboration initiating device, and electronic device 200 and electronic device 300 are collaboration accepting devices.
[0233] The data object 1 has multiple instances. The instances of distributed data objects with different types of instances need to be distinguished. In addition, the electronic device 100 creates multiple different session IDs by using a JS programming framework, and sends the multiple different session IDs and attribute values of the different instances to the electronic device 200 and the electronic device 300. After receiving the multiple different session IDs and attribute values of the different instances, the electronic device 200 generates the data object 1 based on the attribute values of the different instances, and associates the same instance on the electronic device 200 with the same session ID. After receiving the multiple different session IDs and attribute values of the different instances, the electronic device 300 generates the data object 1 based on the attribute values of the different instances, and associates the same instance on the electronic device 300 with the same session ID.
[0234] For example, as shown in Fig. 11, there are n types of instances of data object 1. The electronic device 100 creates n different session IDs by using a JS programming framework, and associates instance 1 with session ID-1, instance 2 with session ID-2, and instance n with session ID-n. Then, the electronic device 100 transmits the multiple different session IDs and attribute values of the different instances to the electronic device 200 and the electronic device 300. The electronic device 200 generates data object 1 based on the attribute values of instance 1, instance 2, and instance n. Then, the electronic device (200) associates instance 1 with session ID-1, instance 2 with session ID-2, and instance n with session ID-n.
[0235] Similarly, the electronic device 300 generates a data object 1 based on the attribute values of instance 1, instance 2, and instance n. Then, the electronic device (300) associates instance 1 with session ID-1, instance 2 with session ID-2, and instance n with session ID-n.
[0236] In this way, when the same data object has n instance types, the same instance on electronic device 100, electronic device 200, and electronic device 300 are associated with the same session ID. In this way, after a data object of any instance of electronic device 100 changes, the data object of the instances associated with the same session ID on electronic device 200 and electronic device 300 also changes. For example, after a data object of instance 1 on electronic device 100 changes, the data object of instance 1 on electronic device 200 and the data object of instance 1 on electronic device 300 also change. Data synchronization is implemented when electronic device 100 cooperates with electronic device 200 and electronic device 300.
[0237] It should be noted that the embodiments of the present application are not limited to two or three devices establishing a collaboration connection simultaneously, but more devices may establish a collaboration connection simultaneously, and the number of devices establishing a collaboration connection simultaneously is not limited in the embodiments of the present application.
[0238] In some embodiments, when electronic device 100 establishes collaboration connections to multiple other devices, electronic device 100 can send different types of data objects to the different collaboration devices.
[0239] For example, as shown in FIG. 12, electronic device 100 is a collaboration initiating device, and electronic device 200 and electronic device 300 are collaboration accepting devices.
[0240] The data object 1 has multiple instances. The instances of distributed data objects with different types of instances need to be distinguished. In addition, the electronic device 100 creates multiple different session IDs by using the JS programming framework, and sends the multiple different session IDs and attribute values of the different instances to the electronic device 200. After receiving the multiple different session IDs and attribute values of the different instances, the electronic device 200 generates the data object 1 based on the attribute values of the different instances, and associates the same instances on the electronic device 200 with the same session ID. After receiving the multiple different session IDs and attribute values of the different instances, the electronic device 300 generates the data object 1 based on the attribute values of the different instances, and associates the same instances on the electronic device 300 with the same session ID.
[0241] For example, as shown in FIG. 12, the electronic device 100 cooperates with the electronic device 300 based on a data object 1. There are n types of instances of the data object 1. The electronic device 100 creates n different session IDs by using a JS programming framework, and associates the instance 1 with the session ID-1, the instance 2 with the session ID-2, and the instance n with the session ID-n. Then, the electronic device 100 transmits the multiple different session IDs and the attribute values of the different instances to the electronic device 300. The electronic device 300 generates a data object 1 based on the attribute values of the instance 1, the attribute values of the instance 2, and the attribute values of the instance n. Then, the electronic device (300) associates the instance 1 with the session ID-1, the instance 2 with the session ID-2, and the instance n with the session ID-n.
[0242] For example, as shown in FIG. 12, the electronic device 100 cooperates with the electronic device 200 based on the data object 2. There are m types of instances of the data object 2. The electronic device 100 creates m different session IDs by using the JS programming framework, and associates the instance n+1 with the session ID-n+1, the instance n+2 with the session ID-n+2, and the instance n+m with the session ID-n+m. Then, the electronic device 100 transmits the multiple different session IDs and the attribute values of the different instances to the electronic device 200. The electronic device 200 generates the data object 2 based on the attribute value of the instance n+1, the attribute value of the instance n+2, and the attribute value of the instance n+m. Then, the electronic device (200) associates the instance n+1 with the session ID-n+1, the instance n+2 with the session ID-n+2, and the instance n+m with the session ID-n+m.
[0243] 11. The distributed in-memory database 608 sends the distributed data object to the application 605 on the electronic device 200.
[0244] After the application 605 receives the distributed data object, the application 605 outputs the distributed data object and the electronic device 200 initiates a collaboration with the electronic device 100 .
[0245] In some embodiments, when there are multiple (e.g., three) devices that establish collaboration connections at the same time, for example, when the electronic device 100 establishes a collaboration connection to the electronic device 200, the electronic device 100 further establishes a collaboration connection to the electronic device 300, and how the electronic device 300 performs collaboration interaction with the electronic device 100, please refer to how the electronic device 200 performs collaboration interaction with the electronic device 100 shown in FIG. 6. The principle is similar. Details are not described herein in the embodiments of the present application.
[0246] After the application on electronic device 300 obtains the distributed data object sent by electronic device 100, electronic device 300 can output the distributed data object, and electronic device 300 begins to collaborate with electronic device 100. Electronic device 100, electronic device 200, and electronic device 300 simultaneously establish a collaboration connection.
[0247] It should be noted that the session identifiers, e.g., session ID-1, session ID-2, ..., session ID-n, session ID-n+1, session ID-n+2, ..., and session ID-n+m, are different from each other, and the session identifiers are only used to indicate that different instances are associated with different session identifiers. In another embodiment, the session identifiers may be in other representation formats. This is not limited in the embodiment of the present application.
[0248] It should be noted that some of steps 1 to 10 may be deleted or replaced. Alternatively, some of steps 1 to 10 may be executed before or after another step. The execution sequence of steps 1 to 10 shown in FIG. 6 is merely an exemplary diagram for explaining the collaboration between the electronic device 100 and the electronic device 200, and should not be construed as a limitation.
[0249] The above embodiment describes a process for implementing collaboration between devices. After the devices establish a collaboration connection, the data object on the application 1 may change (for example, the attribute value of the instance in the data object is updated). In this case, the attribute value of the corresponding instance on the electronic device 200 may also change to implement data synchronization between the collaboration devices. The following describes a specific implementation form for implementing data synchronization between the collaboration devices.
[0250] FIG. 13 is a diagram of implementing data synchronization between collaboration devices.
[0251] Data synchronization between collaboration devices mainly includes the following steps:
[0252] 1. The application 601 sends a mutated data object to the JS programming framework 602.
[0253] Compared with the data object before the change, the type of the changed data object does not change, but the attribute value of the instance of the data object changes. For example, for data object 1, the attribute value of instance 1 of the data object before the change is a first value, and the attribute value of instance 1 of the changed data object is a second value.
[0254] 2. The JS programming framework 602 wraps the mutated data object into a mutated distributed data object through data interception and stores the mutated distributed data object in a key-value format in the distributed in-memory database 604.
[0255] 3. The distributed in-memory database 604 sends the changed distributed data object and a session identifier corresponding to the changed distributed data object to the communication module 603.
[0256] 4. The communication module 603 sends the changed distributed data and a session identifier corresponding to the changed distributed data object to the communication module 607.
[0257] The changed distributed data includes changed attribute values of instances and types of data objects.
[0258] The distributed in-memory database 604 listens to instance attributes of the distributed data object and monitors whether the instance attributes of the distributed data object have changed, and if the instance attributes of the distributed data object have changed, the distributed in-memory database 604 sends the changed distributed data object and a session identifier corresponding to the changed distributed data object to the communication module 603.
[0259] The distributed in-memory database 604 sends the changed distributed data object to the communication module 603, which in turn sends the changed distributed data object to the electronic device 200. The electronic device 200 then updates the distributed data object.
[0260] The distributed in-memory database 604 sends a session identifier corresponding to the changed distributed data object to the communication module 603, which in turn sends the session identifier corresponding to the changed distributed data object to the electronic device 200. The electronic device 200 then determines an instance identifier associated with the received session identifier on the electronic device 200 based on the received session identifier and replaces the attribute value of the instance corresponding to the instance identifier with the changed attribute value. The electronic device 200 generates the changed distributed data object based on the changed attribute value of the instance.
[0261] In some embodiments, step 3 above may be replaced with the following steps:
[0262] The distributed in-memory database 604 sends the changed distributed data object and the instance identifier to the communication module 603 .
[0263] In some embodiments, step 4 above may be replaced with the following steps:
[0264] The communication module 603 transmits the changed distribution data and the instance identifier to the communication module 607 .
[0265] The communication module 603 transmits the instance identifier to the electronic device 200. The electronic device 200 can also determine an instance on the electronic device 200 based on the instance identifier and replace the attribute value of the instance with the modified attribute value. The electronic device 200 generates a changed distributed data object based on the modified attribute value of the instance.
[0266] 5. After receiving the mutated distributed data, the communication module 607 sends the mutated distributed data and the session identifier to the JS programming framework 606 on the electronic device 200.
[0267] In some embodiments, the communications module 607 may send the mutated distributed data and the session identifier (session ID) separately to the JS programming framework 606 .
[0268] In some embodiments, the communications module 607 may send the distribution data and the session ID to the JS programming framework 606 simultaneously.
[0269] After JS programming framework 606 receives the mutated distributed data, JS programming framework 606 generates the mutated distributed data object based on the instance's changed attribute values.
[0270] Specifically, after the JS programming framework 606 receives the mutated distributed data object and the session ID, the JS programming framework 606 determines an instance identifier associated with the received session ID and replaces the attribute value of the instance corresponding to the instance identifier with the modified attribute value. The JS programming framework 606 generates a mutated distributed data object based on the modified attribute value of the instance.
[0271] 6. The JS programming framework 606 sends the mutated distributed data objects to the distributed in-memory database 608.
[0272] After the distributed in-memory database 608 receives the changed distributed data object, the distributed in-memory database 608 stores the changed distributed data object locally in a key-value format.
[0273] 7. The distributed in-memory database 608 sends the changed distributed data objects to the application 605.
[0274] After application 605 receives the mutated distributed data object, application 605 can output the mutated distributed data object.
[0275] In this way, after a data object on electronic device 100 changes, the data object on electronic device 200 changes accordingly. In this way, data synchronization between devices is implemented.
[0276] FIG. 14 is an exemplary schematic flowchart of a device collaboration method according to an embodiment of the present application.
[0277] S1401. The electronic device 100 establishes a collaboration connection to the electronic device 200.
[0278] Electronic device 100 is a collaboration initiating device, and electronic device 200 is a collaboration accepting device.
[0279] Electronic device 100 can establish a collaboration connection to electronic device 200 in any one of the following ways:
[0280] Method 1: The electronic device 100 and the electronic device 200 are connected to the same network. For example, the electronic device 100 and the electronic device 200 may be connected to the same local area network to establish a collaboration connection.
[0281] Method 2: To establish a collaboration connection, the same system account is used to log in to electronic device 100 and electronic device 200. For example, the system account used to log in to multiple electronic devices may be “HW1234.”
[0282] Scheme 3: The system accounts used to log in to the electronic device 100 and the electronic device 200 may both belong to the same account group. For example, the system accounts used to log in to the electronic device 100 and the electronic device 200 include "HW001" and "HW002". The system accounts "HW001" and "HW002" belong to the account group "Huawei Home".
[0283] Method 4: The electronic device 100 may establish a collaboration connection to the electronic device 200 by methods such as Near Field Communication (NFC), Bluetooth (BT), wireless local area network (WLAN) such as wireless fidelity point to point (Wi-Fi P2P), or infrared (IR) technology.
[0284] Method 5: The electronic device 100 and the electronic device 200 may establish a temporary account group by scanning the same two-dimensional barcode to establish a collaboration connection for communication.
[0285] In addition to the above five manners, the electronic device 100 may alternatively establish a collaboration connection to the electronic device 200 in another manner, which is not limited in the embodiment of the present application.
[0286] In addition, the electronic device 100 and the electronic device 200 may alternatively be connected to and communicate with each other according to any number of combinations of the above-mentioned manners, which is not limited in the embodiments of the present application.
[0287] 1402. The electronic device 100 obtains a data object 1, where the data object 1 includes an instance 1, and the attribute value of the instance 1 is a first value.
[0288] In some embodiments, data object 1 may be referred to as the first data object, instance 1 may be referred to as the first instance, and the first value of an attribute value of instance 1 may be referred to as the first instance attribute.
[0289] The electronic device 100 starts application 1 and obtains data object 1 of instance 1, where data object 1 includes instance 1, and the attribute value of instance 1 is a first value.
[0290] It can be seen from the above embodiment that the application 1 may have multiple types of data objects, and each type of data object may have multiple instance types, which is not limited in the embodiment of the present application.
[0291] The electronic device 100 creates a distributed data object through data interception. The electronic device 100 can monitor the instance attribute values of the distributed data object and send only the changed instance attribute values to the electronic device 200. In this way, the amount of data transmitted is reduced and device collaboration efficiency is improved.
[0292] For example, data object 1 includes instance 1 and instance 2, and electronic device 100 can monitor attribute values of instance 1 and instance 2. If electronic device 100 detects that the attribute value of instance 2 has changed and the attribute value of instance 1 has not changed, electronic device 100 can send only the changed attribute value of instance 2 to electronic device 200, and does not need to send the attribute value of instance 1 to electronic device 100. In this way, the amount of data transmitted between collaborating devices is reduced, and device collaboration efficiency is improved.
[0293] In some embodiments, instance 2 may be referred to as a third instance, and the attribute values of instance 2 may be referred to as third instance attributes.
[0294] In some embodiments, the electronic device 100 obtains data object 1 and data object 2. Data object 1 includes instance 1 and instance 2, and data object 2 includes instance 3 and instance 4. The electronic device 100 can monitor changes in the instance attribute values of data object 1 and the instance attribute values of data object 2. If the electronic device 100 detects that the attribute value of instance 3 has changed and the attribute value of instance 1 has not changed, the electronic device 100 can send only data object 2 (instance 3 and instance 4) to the electronic device 200, and does not need to send data object 1 and data object 2 to the electronic device 200. Only the changed data objects (instance 3 and instance 4) are sent to the electronic device 200. In this way, the amount of data sent between the collaboration devices can be reduced compared to the manner in which the electronic device 100 sends all data objects to the electronic device 200.
[0295] In some embodiments, data object 2 may be referred to as a second data object, instance 3 may be referred to as a second instance, and attribute values of instance 3 may be referred to as second instance attributes.
[0296] 1403. The electronic device 100 wraps data object 1 into distributed data object 1 through data interception and learns that the attribute value of the obtained instance 1 is the first value.
[0297] Through data interception, the electronic device 100 obtains the attribute value of the instance 1. In this way, through data interception, it can monitor whether the attribute value of the instance 1 has changed, and can perform updates to the changed attribute value of the instance 1 in a timely manner, thereby ensuring the consistency of data between the collaboration devices.
[0298] In some embodiments, the electronic device 100 obtains the attribute value of the instance 2 through data interception. In this way, through data interception, it can monitor whether the attribute value of the instance 2 has changed, and can perform updates to the changed attribute value of the instance 2 in a timely manner. This ensures the consistency of data between the collaboration devices.
[0299] For example, the following shows a specific implementation of an interface for creating a distributed data object: var obj = distributed({ title:'Title', desc:'Description' })
[0300] It should be noted that in another embodiment, the name of the interface for creating a distributed data object may vary, but the principle is similar, which is not limited in this embodiment of the present application.
[0301] After the electronic device 100 wraps the data object 1 into a distributed data object 1 through data interception, the electronic device 100 further needs to store the distributed data object 1 in a distributed database in a key-value format. For details, please refer to the related description in Table 1. The details will not be described again in this embodiment of the present application.
[0302] After the electronic device 100 creates the distributed data object 1, the electronic device 100 can further access the distributed data object.
[0303] For example, the following illustrates a specific implementation of an interface for accessing distributed data objects: console.info(obj.title)
[0304] It should be noted that in another embodiment, the name of the interface for accessing the distributed data object may be changed, but the principle is similar, which is not limited in this embodiment of the present application.
[0305] 1404. The electronic device 100 sends the attribute value of instance 1 to the electronic device 200.
[0306] In some embodiments, the electronic device 100 further obtains an instance 3 of the data object 2 , and the electronic device 100 sends attribute values of the instance 3 to the electronic device 200 .
[0307] In some embodiments, transmitting the attribute value of instance 1 by electronic device 100 to electronic device 200 may also be referred to as transmitting the attribute value of instance 1 by electronic device 100 to electronic device 200 via a first session. The session identifier of the first session is the first session identifier. Instance 1 is associated with the session identifier of the first session.
[0308] In some embodiments, the electronic device 100 establishes a collaboration connection to the electronic device 200, and the electronic device 100 sends a collaboration message to the electronic device 200. The collaboration message includes an instance identifier of the instance 1 and a session identifier of the first session. The session identifier of the first session is associated with the instance 1. In this way, the electronic device 100 associates the instance 1 with the session identifier of the first session, so that after receiving the session identifier of the first session, the electronic device 200 associates the instance 1 on the electronic device 200 with the session identifier of the first session. In this way, the same session identifier is associated with two instances that are the same on the electronic device 100 and the electronic device 200. This ensures the consistency of the attributes of the two instances that are the same on the electronic device 100 and the electronic device 200, and ensures the consistency of the collaboration data.
[0309] In some embodiments, transmitting the attribute value of instance 3 by electronic device 100 to electronic device 200 may also be referred to as transmitting the attribute value of instance 3 by electronic device 100 to electronic device 200 via a second session. The session identifier of the second session is the second session identifier. Instance 3 is associated with the session identifier of the second session.
[0310] Electronic device 100 sends different types of instances to electronic device 200 through different sessions. The same instances on electronic device 100 and electronic device 200 are associated with the same session identifier. In other words, both instance 1 on electronic device 100 and instance 1 on electronic device 200 are associated with a first session identifier, and both instance 3 on electronic device 100 and instance 3 on electronic device 200 are associated with a second session identifier.
[0311] In some embodiments, the electronic device 100 further obtains an instance 2 of the data object 1, and the electronic device 100 transmits an attribute value of the instance 2 to the electronic device 200 through the first session. The electronic device 200 generates a distributed data object 1 based on the attribute value of the instance 1 and the attribute value of the instance 2. In this way, if the data object 1 includes two types of instances, the electronic device 100 transmits both the instance 1 and the instance 2 to the electronic device 200 through the first session. In other words, data objects that are the same on the electronic device 100 and the electronic device 200 are associated with the same session identifier, and different types of instances included in the same type of data object are not distinguished. When an attribute of the data object 1 on the electronic device 100 changes, the electronic device 100 transmits the changed data object 1 to the electronic device 200.
[0312] In some embodiments, the electronic device 100 further obtains an instance 2 of the data object 1, and the electronic device 100 transmits the attribute value of the instance 2 to the electronic device 200 through a third session. The electronic device 200 generates a distributed data object 1 based on the attribute value of the instance 1 and the attribute value of the instance 2. In this way, when the data object 1 includes two types of instances, the electronic device 100 transmits the instance 1 and the instance 2 separately to the electronic device 200 through different sessions. In other words, the two instances that are the same on the electronic device 100 and the electronic device 200 are associated with the same session identifier, and the different types of instances included in the same type of data object are distinguished. When the attribute of the instance 1 on the electronic device 100 changes, the electronic device 100 transmits only the changed attribute of the instance 1 to the electronic device 200, and does not need to transmit the attribute value of the instance 2. This reduces the amount of data transmitted between the collaboration devices and improves collaboration efficiency.
[0313] In some embodiments, a first electronic device establishes a collaboration connection to a second electronic device and a third electronic device, the first electronic device sends a first instance attribute to the third electronic device over a fourth session and sends a second instance attribute to the third electronic device over a fifth session, the first instance attribute being used by the third electronic device to generate a first data object and the second instance attribute being used by the third electronic device to generate a second data object.
[0314] The session identifier of the fourth session is a fourth session identifier, and the session identifier of the fifth session is a fifth session identifier. The fourth session identifier may be session ID-1 shown in Fig. 11, and the fifth session identifier may be session ID-n shown in Fig. 11. For details, please refer to the related description of Fig. 11.
[0315] The sending of the first instance attribute to the third electronic device over the fourth session and the sending of the second instance attribute to the third electronic device over the fifth session may be understood as the first electronic device associating the first instance on the first electronic device with the fourth session identifier and the first electronic device associating the second instance on the first electronic device with the fifth session identifier. The first electronic device sends the first instance identifier and the fourth session identifier to the third electronic device, and the first electronic device sends the second instance identifier and the fifth session identifier to the third electronic device. The third electronic device associates the first instance on the third electronic device with the fourth session identifier. The third electronic device associates the second instance on the third electronic device with the fifth session identifier. In other words, both the first instance on the first electronic device and the first instance on the third electronic device are associated with a fourth session identifier, and both the second instance on the first electronic device and the second instance on the third electronic device are associated with a fifth session identifier.
[0316] In this way, three electronic devices can simultaneously establish collaboration connections and the attributes of the same instance on multiple devices are also the same, which ensures the consistency of the collaboration data.
[0317] In some embodiments, the first electronic device establishes a collaboration connection to the second electronic device and the third electronic device. The first electronic device generates a third data object. The first electronic device obtains a fourth instance attribute of the third data object. The first electronic device sends the fourth instance attribute to the third electronic device over a sixth session, where the fourth instance attribute is used by the third electronic device to generate the third data object.
[0318] The session identifier of the sixth session is a sixth session identifier. The sixth session identifier may be any one of session ID-n+1, session ID-n+2, ..., and session ID-n+m shown in Fig. 12. The fourth instance attribute may be any one of instance n+1, instance n+2, ..., and instance n+m shown in Fig. 12. For details, please refer to the related description of Fig. 12.
[0319] The sending of the fourth instance attribute by the first electronic device to the third electronic device through the sixth session may be understood as the first electronic device associating the fourth instance on the first electronic device with the sixth session identifier. The first electronic device then sends the identifier of the fourth instance and the sixth session identifier to the third electronic device. The third electronic device associates the fourth instance on the third electronic device with the sixth session identifier. In other words, both the fourth instance on the first electronic device and the fourth instance on the third electronic device are associated with the sixth session identifier.
[0320] In this way, when the first electronic device establishes collaboration connections to multiple different electronic devices, the first electronic device can simultaneously transmit different collaboration data to the multiple different electronic devices, thereby improving the versatility of device collaboration capabilities.
[0321] 1405. The electronic device 200 generates distributed data object 1 based on the attribute values of instance 1 and outputs distributed data object 1.
[0322] After receiving the attribute values of instance 1, the electronic device 100 generates a distributed data object 1 based on the attribute values of instance 1, and outputs the distributed data object 1.
[0323] After the electronic device 200 generates the distributed data object 1, the electronic device 200 further needs to store the distributed data object 1 in a distributed database in a key-value format. For details, please refer to the relevant description in Table 1. The details will not be described again in this embodiment of the present application.
[0324] After the electronic device 100 performs data collaboration with the electronic device 200, the electronic device 100 can further monitor the status of the data collaboration with the electronic device 200, and the electronic device 200 can also monitor the status of the data collaboration with the electronic device 100.
[0325] The data collaboration states include data collaboration successful and data collaboration failed. Data collaboration may fail because electronic device 100 is disconnected from electronic device 200, or data collaboration fails because the format of the distributed data object stored on electronic device 100 is different from the format of the distributed data object stored on electronic device 200.
[0326] For example, the following shows a specific implementation of an interface for monitoring data coordination failures: obj.on('sync-failer',(changedKeys:Array[string])=>{})
[0327] It should be noted that in another embodiment, the name of the interface for monitoring data collaboration failures may be changed, but the principle is similar, which is not limited in this embodiment of the present application.
[0328] 1406. The electronic device 100 associates instance 1 on the electronic device 100 and instance 1 on the electronic device 200 with the same session identifier (session identifier 1).
[0329] In some embodiments, session identifier 1 may also be referred to as the first session identifier, where the first session identifier is the session identifier of the first session.
[0330] In this way, the two instances that are the same on electronic device 100 and electronic device 200 are bound to the same session identifier, and the data of the two instances that are the same on electronic device 100 and electronic device 200 is consistent.
[0331] After the data of instance 1 on electronic device 100 changes, the data of instance 1 on electronic device 200 changes correspondingly.
[0332] For a specific implementation of how the electronic device 100 and the electronic device 200 associate two identical instances with the same session ID, please refer to the specific descriptions in Figures 7 to 12. The details will not be described again in this embodiment of the present application.
[0333] For example, the following shows a specific implementation of an interface for initiating a collaboration: session ID = genSession ID (); j.setSessionID(sessionID)
[0334] A particular implementation of an interface for transmitting a session identifier by electronic device 100 to electronic device 200 is shown.
[0335] For example, the following shows a specific implementation of an interface for accepting collaboration: j.setSessionID(sessionID)
[0336] Electronic device 200 parses and obtains the session identifier sent by electronic device 200 and associates instance 1 on electronic device 200 with the same session identifier (session identifier 1) associated with instance 1 on electronic device 100, so that the data of the two instances that are the same on electronic device 100 and electronic device 200 match.
[0337] It should be noted that in another embodiment, the names of the interfaces for initiating collaboration and for accepting collaboration may vary, but the principle is similar, which is not limited in this embodiment of the present application.
[0338] 1407. The electronic device 100 detects that the attribute value of instance 1 has changed from a first value to a second value.
[0339] In some embodiments, the second value of instance 1 may also be referred to as the first instance attribute that changed.
[0340] For example, the following shows a specific implementation of an interface for monitoring data object changes: obj.on('change',(changedKeys:Array[string])=>{})
[0341] It should be noted that in another embodiment, the name of the interface for monitoring changes in a data object may be changed, but the principle is similar, which is not limited in this embodiment of the present application.
[0342] 1408. The electronic device 100 updates the distributed data object 1 and learns that the attribute value of the retrieved instance 1 is the second value.
[0343] The type of the updated distributed data object 1 remains unchanged; only the attribute values of the instances on the updated distributed data object 1 change.
[0344] For example, data object 1 may be audio navigation information, and a first value of the attribute value of instance 1 may be the audio content "The remaining distance is 5 kilometers." A second value of the attribute value of instance 1 may be the audio content "The remaining distance is 3 kilometers."
[0345] After the electronic device 100 updates the distributed data object 1, the electronic device 100 further needs to store the updated distributed data object 1 in the distributed database in a key-value format. For details, please refer to the related description in Table 1. The details will not be described again in this embodiment of the present application.
[0346] In some embodiments, electronic device 100 may store both distributed data object 1 and the updated distributed data object 1 in the distributed database, or electronic device 100 may store only the updated distributed data object 1 and delete distributed data object 1.
[0347] 1409. The electronic device 100 sends the attribute values of instance 1 and session identifier 1 to the electronic device 200.
[0348] In some embodiments, the electronic device 100 transmitting the attribute value of instance 1 and the session identifier 1 to the electronic device 200 may also be referred to as the electronic device 100 transmitting the modified attribute value of instance 1 to the second electronic device 200 through the first session. In this way, the first electronic device transmits only the modified instance attributes to the second electronic device, and does not need to transmit the unmodified instance attributes. In this case, the amount of data transmitted between the collaboration devices is reduced, and collaboration efficiency is improved.
[0349] The electronic device 100 transmits the attribute value (second value) of the instance 1 to the electronic device 200, and as a result, the electronic device 200 updates the distributed data object 1 based on the attribute value (second value) of the instance 1.
[0350] Electronic device 100 sends session identifier 1 to electronic device 200, which then determines an instance identifier (identifier of instance 1) on electronic device 200 and associated with session identifier 1 based on the received session identifier 1, changes an attribute value of instance 1 on electronic device 200 from a first value to a second value, and updates distributed data object 1 based on the attribute value of instance 1.
[0351] 1410. The electronic device 200 modifies the attribute value of instance 1 from a first value to a second value, updates distributed data object 1 based on the attribute value of instance 1, and outputs the updated distributed data object 1.
[0352] The electronic device 200 modifies the attribute value of the instance 1 from a first value to a second value, updates the distributed data object 1 based on the attribute value of the instance 1, and outputs the updated distributed data object 1.
[0353] The electronic device 200 further needs to store the updated distributed data object 1 in the distributed database in a key-value format. For details, please refer to the relevant description in Table 1. The details will not be described again in this embodiment of the present application.
[0354] In some embodiments, electronic device 200 may store both distributed data object 1 and the updated distributed data object 1 in the distributed database, or electronic device 200 may store only the updated distributed data object 1 and delete distributed data object 1.
[0355] For example, the following shows a specific implementation of an interface for updating a distributed data object: Obj.title = "New Title"
[0356] It should be noted that in another embodiment, the name of the interface for updating the distributed data object may vary, but the principle is similar, which is not limited in this embodiment of the present application.
[0357] The following describes, by using examples, application scenarios provided by the device collaboration method provided in the embodiments of the present application.
[0358] For example, the electronic device 100 is a mobile phone and the electronic device 200 is a smart watch. When it is inconvenient for the user to use the mobile phone for navigation while cycling, the mobile phone cannot process navigation information. When the mobile phone and the smart watch are in the same distributed network, the mobile phone can seamlessly switch the map information for navigation on the mobile phone to the smart watch with one tap, and then the smart watch continues to display the navigation information. In this way, the user can see the navigation information while cycling.
[0359] For example, as shown in FIG. 15A, the electronic device 100 may display a home screen interface 1301. The interface 1301 displays a page on which application icons are located, and the page includes a plurality of application icons (e.g., a weather application icon, a stocks application icon, a calculator application icon, a settings application icon, an email application icon, a music application icon, a video application icon, a browser application icon, and a map application icon 1302). A page indicator is further displayed below the plurality of application icons to indicate a positional relationship between the currently displayed page and another page. Below the page indicator are a plurality of tray icons (e.g., a dial application icon, an SMS message application icon, a contacts application icon, and a camera application icon), which remain displayed during page switching.
[0360] The electronic device 100 may receive an input action (e.g., a single tap) performed by a user on the map application icon 1302. In response to the input action, the electronic device 100 may respond to the input action, and the electronic device 100 may display the map application interface 1303 shown in FIG.
[0361] 15B, the electronic device 100 displays a map application interface 1303. The map application interface 1303 includes a map 1304 and a search box. The map 1304 displays map information of the surrounding environment of the user's current location. The search box can be used to receive a destination name entered by the user.
[0362] 15C , the electronic device 100 may receive a destination name (e.g., “Tian'an Cloud Park”) entered by a user into a destination search box. In response to the input action, the electronic device 100 may display a window 1305. The window 1305 may include a distance between a current geographic location of the electronic device 100 and the destination (e.g., 5.2 km), destination address information (e.g., “Campus 163, Banxuegang Avenue, Longgang District, Shenzhen, Guangdong”), and a “Navigation” control 1306.
[0363] The electronic device 100 can receive a user input operation (e.g., a single tap) on the navigation control 1306. In response to the input operation, the electronic device 100 can enable navigation, obtain information from a map server about a route from the current location of the electronic device 100 to the destination, and display the interface 1307 shown in FIG. 15D in full screen.
[0364] 15D, the interface 1307 may include a map, a location marker 1308, a driving route 1309 from the current location of the electronic device 100 to a destination, a "More" control 1310, and an "Exit" control 1311. The location marker 1308 may indicate the current location of the electronic device 100 on a map. The "More" control 1310 may be configured to trigger the display of more other functional controls. The "Exit" control 1311 may be configured to trigger the electronic device 100 to end navigation.
[0365] As shown in FIGS. 15D and 15E, after the electronic device 100 establishes a collaboration connection to the electronic device 200, the electronic device 100 transmits navigation information to the electronic device 200, and the electronic device 200 displays the navigation information.
[0366] In some embodiments, as shown in Figures 15F and 15G, after the electronic device 100 establishes a collaboration connection to the electronic device 200, the electronic device 100 can send navigation information and audio information to the electronic device 200. The electronic device 200 displays the navigation information and plays the audio information by using an audio output device. The information can be "Turn into Bell Road in 500 meters, the journey from the destination is 4.5 km and takes 17 minutes."
[0367] The implementations of the present application may be randomly combined to achieve different technical effects.
[0368] All or part of the above-mentioned embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When software is used to implement the embodiments, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the procedures or functions according to the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (e.g., coaxial cable, optical fiber, or digital subscriber line) or wireless (e.g., infrared, radio, or microwave) manner. The computer-readable storage medium may be any available medium accessible by a computer, or a data storage device, such as a server or data center that integrates one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk drive, or a magnetic tape), an optical medium (e.g., a DVD), a semiconductor medium (e.g., a solid-state disk (SSD)), or the like.
[0369] Those skilled in the art may understand that all or part of the steps of the method in the embodiment may be implemented by a computer program that instructs relevant hardware. The program may be stored in a computer-readable storage medium. When the program is executed, the steps of the method in the embodiment may be executed. The storage medium may include any medium that can store program code, such as a ROM, a random access memory RAM, a magnetic disk, or a compact disk. [Explanation of symbols]
[0370] 1 Antenna 2 Antennas 100 Electronic Devices 200 Electronic Devices 300 Electronic Devices 400 Systems 110 Processor 120 External Memory Interface 121 Internal Memory 130 USB interface 140 Charging Management Module 141 Power Management Module 142 Battery 150 Mobile Communication Module 160 Wireless Communication Module 170 Audio Module 170A Speaker 170B Receiver 170C Microphone 170D Headset Jack 180 Sensor Module 180A PRESSURE SENSOR 180B Gyro sensor 180C Barometric Pressure Sensor 180D Magnetic Sensor 180E Acceleration Sensor 180F Distance Sensor 180G Optical Proximity Sensor 180H Fingerprint Sensor 180J Temperature Sensor 180K touch sensor 180L Ambient Light Sensor 180M Bone Conduction Sensor 190 Button 191 Motor 192 Indicator 193 Camera 194 Display 195 SIM card interface 401 Distributed Data Object Creation Module 402 Distributed Data Object Synchronization Module 403 Distributed Data Object Monitoring Module 601 Applications 602 JS Programming Frameworks 603 Communication Module 604 Distributed In-Memory Database 605 Applications 606 JS Programming Framework 607 Communication Module 608 Distributed In-Memory Database 1301 Interface 1302 Map Application Icon 1303 Map Application Interface 1304 Map 1305 Window 1306 Navigation Control 1307 Interface 1308 Position Marker 1309 Travel route 1310 Other 1311 Exit
Claims
1. 1. A device collaboration method, comprising: establishing, by the first electronic device, a collaboration connection to a second electronic device; obtaining, by the first electronic device, a first instance attribute of a first data object and a second instance attribute of a second data object; sending, by the first electronic device, the first instance attribute to the second electronic device over a first session and the second instance attribute to the second electronic device over a second session, wherein the first instance attribute is used by the second electronic device to generate the first data object and the second instance attribute is used by the second electronic device to generate the second data object; A method comprising:
2. The method comprises: obtaining, by the first electronic device, a third instance attribute of the first data object; transmitting, by the first electronic device, the third instance attribute to the second electronic device over the first session, wherein the first instance attribute and the third instance attribute are jointly used by the second electronic device to generate the first data object; The method of claim 1, further comprising:
3. The method comprises: obtaining, by the first electronic device, a third instance attribute of the first data object; transmitting, by the first electronic device, the third instance attribute to the second electronic device over a third session, wherein the first instance attribute and the third instance attribute are jointly used by the second electronic device to generate the first data object; The method of claim 1, further comprising:
4. After the step of transmitting, by the first electronic device, the first instance attribute to the second electronic device over a first session, the method further comprises: detecting, by the electronic device, that the first instance attribute has changed and transmitting the changed first instance attribute to the second electronic device over the first session, wherein the changed first instance attribute is used by the second electronic device to update the first data object.
4. The method of claim 1, further comprising:
5. Establishing a collaboration connection by a first electronic device to a second electronic device includes: sending, by the first electronic device, a collaboration message to the second electronic device, the collaboration message including an instance identifier of a first instance and a session identifier of the first session, the session identifier of the first session being associated with the first instance; 5. The method according to claim 1 , comprising in particular:
6. The method comprises: establishing, by the first electronic device, a collaboration connection to a third electronic device; sending, by the first electronic device, the first instance attribute to the third electronic device over a fourth session and the second instance attribute to the third electronic device over a fifth session, wherein the first instance attribute is used by the third electronic device to generate the first data object and the second instance attribute is used by the third electronic device to generate the second data object; 6. The method of claim 1, further comprising:
7. The method comprises: establishing, by the first electronic device, a collaboration connection to a third electronic device; generating, by the first electronic device, a third data object; obtaining, by the first electronic device, a fourth instance attribute of the third data object; sending, by the first electronic device, the fourth instance attribute to the third electronic device over a sixth session, the fourth instance attribute being used by the third electronic device to generate the third data object; 6. The method of claim 1, further comprising:
8. The step of obtaining, by the first electronic device, a first instance attribute of a first data object and a second instance attribute of a second data object, further comprises: obtaining, by the first electronic device through data interception, the first instance attribute of the first data object and the second instance attribute of the second data object. The method according to any one of claims 1 to 7, comprising in particular
9. 9. The method of claim 1, wherein the first data object is associated with the first session and the second data object is associated with the second session, and the first data object is different from the second data object.
10. The method of claim 1 , wherein the first data object comprises at least one of a text data object, a picture data object, an audio data object, and a video data object.
11. 11. An electronic device, the electronic device being a first electronic device, the first electronic device comprising one or more functional units, the one or more functional units being configured to perform the method of any one of claims 1 to 10.
12. 11. An electronic device, wherein the electronic device is a first electronic device, the first electronic device comprising one or more processors and one or more memories, the one or more memories coupled to the one or more processors, the one or more memories configured to store computer program code, the computer program code comprising computer instructions, and the one or more processors invoke the computer instructions to enable the first electronic device to perform the method of any one of claims 1 to 10.
13. 11. A computer-readable storage medium configured to store computer instructions, which when executed on a first electronic device, enable the first electronic device to perform the method of any one of claims 1 to 10.
14. 11. A computer program product, which when executed on a first electronic device, enables the first electronic device to perform the method of any one of claims 1 to 10.
Citation Information
Patent Citations
Media transfer for group communication sessions in wireless communication systems
JP2012533221A
Service Updates during Real-Time Communication and Experience Sharing Sessions
JP2016502781A
Establishing a wireless display session between a computing device and a vehicle head unit
JP2016503601A
Wireless media sharing from multiple sources to a single sink
JP2017505005A
Generating Challenges Using Location-Based Gameplay Companion Applications
JP2019524180A