WO2021063189A1 - Method and system for information synchronization between multiple devices, and electronic device - Google Patents

Method and system for information synchronization between multiple devices, and electronic device Download PDF

Info

Publication number
WO2021063189A1
WO2021063189A1 PCT/CN2020/116005 CN2020116005W WO2021063189A1 WO 2021063189 A1 WO2021063189 A1 WO 2021063189A1 CN 2020116005 W CN2020116005 W CN 2020116005W WO 2021063189 A1 WO2021063189 A1 WO 2021063189A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
type
master
information list
class
Prior art date
Application number
PCT/CN2020/116005
Other languages
French (fr)
Chinese (zh)
Inventor
易立
伍晓晖
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021063189A1 publication Critical patent/WO2021063189A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/2823Reporting information sensed by appliance or service execution status of appliance services in a home automation network
    • H04L12/2827Reporting to a device within the home network; wherein the reception of the information reported automatically triggers the execution of a home appliance functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks

Definitions

  • This application relates to the field of communication technology, and in particular to a method, system and electronic device for information synchronization between multiple devices.
  • the wake-up words of these multiple electronic devices are the same (for example, " ⁇ "). Then, after the user speaks the wake-up word, multiple devices that detect the wake-up word need to interact with each other's device information (such as device type, whether to connect a headset, etc.), and then, each device can pass through the received device information according to the received device information.
  • the preset wake-up decision algorithm determines which device is awakened this time in response to the wake-up word input by the user.
  • the present application provides a method, system and electronic device for information synchronization between multiple devices, which can reduce the time consumption in the process of multi-device collaborative work, reduce the power consumption of the electronic device, and improve the user experience in the multi-device collaborative scenario.
  • this application provides an information synchronization system between multiple devices.
  • the system may include a first type of device (also called a type A device) and a second type of device (also called a type B device) ;
  • the first type of equipment is one or more devices powered by an external power supply, the first type of equipment may include the first device, the first device is the main device in the system;
  • the second type of equipment is one or more battery-powered A device, the second type of device may include a second device and a third device, and both the second device and the third device are slave devices in the system;
  • the above-mentioned first device is used to: receive the device information of the third device sent by the third device (that is, the slave device), and the device information can reflect the latest device status of the third device; further, according to the received third device Update the device information list with the device information of the device information list, the device information of the first type of device and the device information of the second type of device are recorded in the device information list; the above-mentioned second device is used to: start the preset first timer; When the timer expires, the device information of the second device is sent to the first device (that is, the master device), and the updated device information list is obtained from the first device.
  • the first device can update the device information list according to the device information reported by each slave device, and each slave device (for example, the second device) can obtain the latest device information list in the first device when reporting device information to the first device .
  • each slave device can learn the latest device status of each device in the system according to the acquired device information list. Therefore, when multiple devices need to complete a collaborative work task, each device participating in the collaborative work can quickly query the device status of other devices according to the latest device information list, and then quickly complete the collaborative task according to the device status of other devices. Reduce the time-consuming and power consumption when multiple devices work together.
  • the above-mentioned second device is also used to: receive a first message sent by the first device, and the first message is used to indicate that the main device in the system is the first device; that is, when the first device is the first device After a device determines that it is a master device, it can send a first message to a slave device such as a second device to inform the slave device that the current master device is the first device.
  • a slave device such as a second device to inform the slave device that the current master device is the first device.
  • the preset field in the first message may include the identification of the first device.
  • the second device may determine the first device as the master device.
  • the network access time of the first device and the network access time of the devices in the system are recorded in the above device information list; at this time, the second device is also used for: when the first device is the first device with the earliest network access time In the case of one type of device, the first device can be determined as the master device.
  • the timing duration of the foregoing first timer is the same as the heartbeat period of the second device. That is, the period for the second device to send a heartbeat message to the PUSH message server is the same as the period for the second device to send device information to the first device. In this way, each time the second device is awakened and sends a heartbeat message to the PUSH message server, it can also send its own latest device information to the first device at the same time, thereby reducing the number of additional wake-ups of the second device and reducing the second device’s Power consumption.
  • the above-mentioned first-type device may further include a fourth device; the above-mentioned second device is also used to: receive a main device update message sent by the fourth device, indicating that the main device at this time may have been Replace with the fourth device; in response to the message, the second device can disconnect the network connection with the first device and establish a network connection with the fourth device.
  • the above-mentioned second device is also used to: when the network connection between the second device and the first device times out, indicating that the main device may have been replaced or offline at this time, and the second device may
  • the new master device is determined among the first type devices except the first device.
  • the above-mentioned first device is also used to: receive the second device device information sent by the second device; update the above-mentioned device information list according to the received device information of the second device; similar to the second device Yes, the third device is also used to: start a preset second timer; when the second timer expires, send the device information of the third device to the first device, and obtain the updated device from the first device
  • the information list that is, the slave device can obtain the latest device information list in the first device when reporting device information to the first device.
  • the above-mentioned first device is further configured to: when the first device joins the above-mentioned system, it can determine whether the first device is the master device according to the master device decision algorithm.
  • the first device determines that it is the master device, the first device is also used to: when a new device joins, a device exits, or a master device update message is received, the master device in the above system Changes may occur, therefore, the first device can re-determine whether the first device is the master device at this time.
  • the above-mentioned first type device further includes a fifth device, and the fifth device is a slave device; wherein, the fifth device is used to: start a preset third timer; when the third timer exceeds From time to time, the device information of the fifth device is sent to the first device, and the updated device information list is obtained from the first device. That is, when the device of the first type is a slave device, the slave device can also obtain the latest device information list in the master device when reporting device information to the master device.
  • the above-mentioned fifth device is further used for: when the number of times that the fifth device fails to send the device information of the fifth device to the first device exceeds a preset value, the first device may no longer be a system at this time Therefore, the fifth device can re-determine the main device in the system; or, when a new device joins, device exits, or main device update message is received, the first device may no longer be in the system at this time. The main device, therefore, the fifth device can re-determine the main device in the system.
  • the above system also includes a third type of device (ie, type C device), and the master device of the third type of device is the first device; wherein, the third type of device is used to: Send the device information of the third type of device to the first device periodically; the first device is also used to: update the device information list according to the device information of the third type of device.
  • a third type of device ie, type C device
  • the master device of the third type of device is the first device
  • the third type of device is used to: Send the device information of the third type of device to the first device periodically
  • the first device is also used to: update the device information list according to the device information of the third type of device.
  • the above system further includes a third type of device, and the main control device of the third type of device is the second device; wherein, the third type of device is used to: Send the device information of the third-type device; the second device is also used to: when the above-mentioned first timer expires, send the device information of the third-type device to the first device, so that the first device is based on the device information of the third-type device
  • the information updates the device information list. That is to say, when the above-mentioned first timer expires, the second device can send its own device information to the first device (master device) together with the device information of the third type of device, avoiding waking up the second device multiple times to increase the number of times. 2. Power consumption of the device.
  • the foregoing system further includes a third type of device, and the main control device of the third type of device is a server; wherein, the third type of device is used to: send a third type of device to the server according to a preset period.
  • Device information of the device of the third type; the first device is also used to: obtain the device information of the device of the third type from the server; update the device information list according to the device information of the device of the third type.
  • the embodiments of the present application provide an information synchronization system between multiple devices.
  • the system includes a first device, a second device, and a third device; the first device, the second device, and the third device are all used Battery-powered type 1 equipment (ie, type B equipment); the first equipment, the second equipment, and the third equipment form a ring network, where the first equipment is the previous node of the second equipment, and the second equipment is the first equipment The previous node of the three devices;
  • the second device is used to: receive the device information list sent by the first device, in which device information of each device in the system is recorded; update the device information list according to the device information of the second device; send the update to the third device After the device information list.
  • each type B device when there is no above-mentioned type A device in the system, each type B device only needs to be awakened by the type B device of the previous node in a cycle to obtain the latest device information list. In this way, the number of wake-ups for type B devices will be greatly reduced, and the power consumption of type B devices will be reduced accordingly.
  • the above-mentioned second device sending the updated device information list to the third device includes: when the first timer expires, the second device sends the updated device information list to the third device.
  • the above-mentioned second device is also used to: receive a message that the fourth device joins the system; if the fourth device is a device of the first type, re-determine the second device according to a preset networking algorithm The position in the ring network, that is, the previous node and the next node of the second device in the ring network. If the fourth device is not a first type device (a type B device) but a type A device, the second device can start working according to the system described in the first aspect.
  • the above-mentioned second device cannot send data to the first device; at the same time, the second device cannot receive data sent by the third device.
  • the above system also includes a second type of device (ie, type C device) controlled by the main control device, and the main control device is the second device; wherein, the second type of device is used for: Send the device information of the second type of device to the second device in a preset period; the second device is further configured to: update the device information list according to the device information of the second type of device.
  • a second type of device ie, type C device
  • the above system further includes a second type of device controlled by the main control device, and the main control device is a server; wherein, the second type of device is used to: Send the device information of the second type of device; the second device is also used to: when the second device is woken up, obtain the device information of the second type of device from the server; update the device information list according to the device information of the second type of device.
  • the second device ie, the type B device
  • the second device can be prevented from interacting with the server after being awakened in the standby state, and the additional power consumption of the type B device due to querying the device information of the type C device can be reduced.
  • the foregoing device information may include one or more of: device name, device type, device model, network access time of the device, IP address, MAC address, service provided by the device, or custom business information.
  • the service provided by the device may be a voice service, an audio playback service, a video playback service, a gateway service, etc.; for another example, the customized service information may include the latest wake-up time and the latest wake-up location of the device.
  • an embodiment of the present application provides an information synchronization method between multiple devices, including: after the first device joins the information synchronization system, determining whether the first device is the master device in the information synchronization system, and the first device It is the first type of equipment (ie, Class A equipment) that uses external power supply; if the first equipment is the main equipment, then:
  • the first device receives the device information of the second device sent by the second device, and the second device is a battery-powered second type device (ie, type B device) in the information synchronization system; the first device is based on the device information of the second device Update the device information list.
  • the device information of the first type of device and the device information of the second type of device are recorded in the device information list; when the first device receives the device information of the third device sent by the third device, the device information is sent to the third device.
  • the device sends the updated device information list, and the third device is the second type device in the information synchronization system.
  • determining whether the first device is the master device in the information synchronization system includes: after the first device joins the information synchronization system, determining according to the master device decision algorithm Whether the first device is the master device in the information synchronization system.
  • the above method further includes: when the first device receives a new device joining, device exit, or master device update message, re-determining whether the first device is The main device.
  • the method further includes: the first device determines the master device in the information synchronization system; when the preset first timer When the timeout expires, the first device sends the device information of the first device to the determined main device, and obtains the updated device information list from the main device.
  • an embodiment of the present application provides a method for information synchronization between multiple devices, including: after the first device joins the information synchronization system, determining whether the information synchronization system includes the first type of equipment powered by an external power supply (That is, type A equipment), the first device is a second type of battery-powered equipment (ie, type B equipment); if the above-mentioned information synchronization system includes the first type of equipment, then:
  • the first device determines in the first type of device that the master device in the information synchronization system is the second device; the first device starts the preset first timer; when the first timer expires, the first device reports to the second device Send the device information of the first device, and obtain the updated device information list from the second device.
  • the device information list records the device information of the first type of device and the device information of the second type of device.
  • the first device determines in the first type device that the master device in the information synchronization system is the second device, including: the first device receives the first message sent by the second device, and the first device receives the first message sent by the second device.
  • the message is used to indicate that the master device in the information synchronization system is the second device; the first device determines the second device as the master device in response to the first message; or, if the first device finds the network access time in the device information list
  • the earliest device of the first type is the second device, and the first device determines the second device as the master device.
  • the timing duration of the foregoing first timer is the same as the heartbeat period of the first device.
  • the above method further includes: the first device receives a master device update message sent by the third device, the third device is a first type device; in response to the message, the first device sends the third device Determine as the new master device, and establish a network connection with the third device.
  • the above method further includes: when the network connection between the first device and the second device times out, the first device determines a new master among the first type devices except the second device. equipment.
  • the above-mentioned method further includes: the first device and other second-type devices form a ring network, wherein the first device is in the ring network The previous node in the device is the fourth device, and the next node of the first device in the ring network is the fifth device; the first device receives the device information list sent by the fourth device, and the device information list records the information synchronization The device information of each device in the system; the first device updates the device information list according to the device information of the first device; the first device sends the updated device information list to the fifth device.
  • the first device sends the updated device information list to the fifth device, including: when a preset second timer expires, the first device sends the updated device information to the fifth device List.
  • the method further includes: the first device receives a message that the sixth device joins the information synchronization system; if the sixth device is a second-type device, the first device re-determines that it is on the ring network The previous node and the next node of the first device in the middle, that is, the position of a device in the ring network.
  • the present application provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein the processor is coupled with the touch screen and the memory, and the above one or more A computer program is stored in the memory, and when the electronic device is running, the processor executes one or more computer programs stored in the memory, so that the electronic device executes the information between multiple devices described in any one of the above Synchronization method.
  • the present application provides a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the electronic device to execute the information between multiple devices as described in any one of the first aspect Synchronization method.
  • the present application provides a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute the method for information synchronization between multiple devices as described in any one of the first aspect.
  • the information synchronization method described in the third aspect and the fourth aspect provided above, the electronic device described in the fifth aspect, the computer storage medium described in the sixth aspect, and the computer program product described in the seventh aspect Both are applied to the information synchronization system provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the information synchronization provided above, which will not be repeated here.
  • FIG. 1 is a schematic diagram 1 of the architecture of an information synchronization system between multiple devices provided by an embodiment of this application;
  • FIG. 2 is a first structural diagram of an electronic device provided by an embodiment of this application.
  • FIG. 3 is a schematic diagram 2 of the architecture of an information synchronization system between multiple devices provided by an embodiment of the application;
  • FIG. 4 is a first schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application;
  • FIG. 5 is a second schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application;
  • FIG. 6 is the third structural diagram of an information synchronization system between multiple devices according to an embodiment of the application.
  • FIG. 7 is a third schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application.
  • FIG. 8 is a fourth schematic structural diagram of an information synchronization system between multiple devices provided by an embodiment of this application.
  • FIG. 9 is a schematic structural diagram 5 of an information synchronization system between multiple devices provided by an embodiment of this application.
  • FIG. 10 is a sixth structural diagram of an information synchronization system between multiple devices provided by an embodiment of this application.
  • FIG. 11 is a schematic diagram 7 of the architecture of an information synchronization system between multiple devices according to an embodiment of the application;
  • FIG. 12 is an eighth schematic diagram of the architecture of an information synchronization system between multiple devices according to an embodiment of this application.
  • FIG. 13 is a fourth schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application.
  • FIG. 14 is a fifth schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application.
  • FIG. 15 is a sixth flowchart of a method for information synchronization between multiple devices according to an embodiment of this application.
  • FIG. 16 is a second structural diagram of an electronic device provided by an embodiment of this application.
  • the method for information synchronization between multiple devices can be applied to a device group 200 shown in FIG. 1, and each electronic device 100 in the device group 200 can communicate with each other.
  • the device group 200 may also be referred to as an information synchronization system.
  • the electronic devices 100 may communicate with each other through a local area network (LAN) or a wide area network (WAN).
  • LAN local area network
  • WAN wide area network
  • the user can log in to the application server using the same user account through a mobile phone, a tablet computer, a smart speaker, a smart watch, and a laptop computer.
  • the mobile phone, tablet computer, smart speaker, and notebook computer form the device group 200, and each electronic device 100 in the device group 200 can communicate with each other through an application server.
  • the electronic devices 100 may also form the device group 200 through short-distance communication connections such as Wi-Fi connections or Bluetooth connections.
  • Wi-Fi connections For example, users can add mobile phones, tablets, smart speakers, and laptops to the Wi-Fi network named "1234".
  • Each electronic device 100 in the Wi-Fi network forms a local area network, and all the devices in the local area network form a device group 200.
  • the electronic devices 100 in the device group 200 can also be interconnected through a switching device (for example, a USB data cable or a Dock device), so as to realize the communication function between the electronic devices 100 in the device group 200.
  • a switching device for example, a USB data cable or a Dock device.
  • each electronic device 100 in the device group 200 may be classified in advance.
  • the electronic device 100 that is connected to an external power source and has a certain computing capability may be referred to as a class A device.
  • Class A devices may include TVs, routers, desktop computers, speakers, and so on. This type of equipment can use an external power supply to obtain power through plugs, data cables, etc. during work. Therefore, Class A equipment can always be in a standby state after being connected to an external power supply. Users generally do not make special requirements for the power consumption of Class A equipment.
  • the electronic device 100 that uses a battery and has a certain computing capability may be referred to as a type B device.
  • Class B devices can include mobile phones, tablets, laptops, and so on. This type of equipment needs to use a battery to power the equipment itself when it is working.
  • the mobile phone can enter the standby state after the screen is off.
  • the mobile phone needs to interact with other electronic devices, it needs to wake up the mobile phone's processor (such as CPU) and related communication modules (such as Wi-Fi chip).
  • the processor or communication module wakes up more frequently, it will increase the power consumption of the mobile phone and shorten the standby time. Therefore, when users use Class B equipment, they generally hope that the power consumption of Class B equipment is as small as possible.
  • the electronic device 100 with weak computing capability may be referred to as a Class C device.
  • Class C devices may include air conditioners, refrigerators, smart light bulbs, wearable devices (such as smart watches, smart bracelets, smart glasses, etc.). Due to the weak computing power of Class C devices, such devices are generally used as controlled devices to be bound to corresponding main control devices such as Class A devices, Class B devices, or servers. The user can control the corresponding Class C device through the main control device. The power consumption of the Class C device due to device interaction is generally small when it is working.
  • the above-mentioned type A equipment can also be referred to as the first type equipment, the B type equipment is referred to as the second type equipment, and the C equipment is referred to as the third type equipment; or, the B type equipment is referred to as the first type equipment.
  • the first type of equipment, the C equipment is called the second type of equipment, that is, the A equipment, the B equipment, and the C equipment are three types of electronic equipment.
  • a corresponding flag bit can be set in the configuration file of the electronic device 100 in advance to indicate the device type of the electronic device 100.
  • the flag bit can be referred to as a device tag.
  • the electronic device 100 can learn its own device type by reading its own device tag in the working process.
  • the electronic device 100 may also receive device tags sent by other devices, so as to learn the device types of other devices.
  • the device type of the electronic device 100 may also be dynamically changed. For example, when a mobile phone uses a battery to power itself, its device tag can be set as a Class B device. If it is detected that the mobile phone is connected to an external power source through the charger, the mobile phone can set its label as a Class A device. If it is detected that the battery level of the mobile phone is lower than the threshold or the mobile phone enters the low battery protection mode, the mobile phone can set its label as a Class C device.
  • the corresponding firmware or patch update file may be obtained from the server, and the update file may also include the device type newly set for the electronic device 100. In this way, when the electronic device 100 obtains the update file for device update, it can update its own device label according to the newly set device type in the update file.
  • each electronic device 100 in the device group 200 may store a device information list.
  • the device information list includes device information of each electronic device 100.
  • the device information may include the device name, device type, device model, IP (internet protocol) address, MAC (media access control) address, services provided by the device, customized business information, etc.
  • the device information list stored in the electronic device A is shown in Table 1.
  • the electronic device A can query the specific name, type, service provided, and recent information of an electronic device in the device group 200.
  • Device status such as wake-up time.
  • each electronic device can learn the device status of each electronic device 100 in the device group 200 through the device information list stored by itself.
  • each electronic device 100 in the device group 200 may periodically update its stored device information list.
  • each electronic device 100 in the device group 200 may periodically send a multicast containing its own device information to other electronic devices. After each electronic device receives the device information sent by other electronic devices, it can update the device status of the corresponding electronic device in its stored device information list. In this way, each electronic device can learn the latest device status of each electronic device 100 in the device group 200 through the device information list stored in itself.
  • the electronic devices participating in the collaborative work can quickly query the device status of other electronic devices according to the recently updated device information list, and then according to the multiple electronic devices participating in the collaborative work.
  • the equipment status of the electronic equipment quickly completes this collaborative task.
  • speaker 1 detects that the user utters the wake-up word and can find out from Table 1 that mobile phone 1 also provides voice functions, and the last wake-up time of mobile phone 1 has been More than 24 hours.
  • the mobile phone 1 detects that the user utters the wake-up word, it can be queried from Table 1 that the speaker 1 also provides a voice function, and the last wake-up time of the speaker 1 is 13:05:47.
  • speaker 1 can determine that speaker 1 (ie itself) responds to the user's wake-up word this time according to the latest wake-up time of mobile phone 1.
  • the mobile phone 1 can also determine according to the recent wake-up time of the speaker 1 that the mobile phone 1 does not need to answer the wake-up word spoken by the user this time.
  • the speaker 1 can turn on the corresponding voice function to answer the wake-up word "Xiaoyi Xiaoyi" spoken by the user, and the speaker 1 and the mobile phone 1 also end this collaborative work task.
  • each electronic device 100 of the device group 200 stores the latest device status of other electronic devices, when multiple electronic devices need to complete a collaborative work task, each electronic device participating in the collaborative work can be based on The latest device information list can quickly query the device status of other electronic devices, and then quickly complete the collaborative task according to the device status of other electronic devices, which reduces the time consumption of multiple devices working together.
  • each electronic device can quickly query the device status of other electronic devices through the above device information list, the number of data interactions between electronic devices is reduced when multiple devices work together.
  • the number of times that Class B devices are awakened from standby or performing data interactions is also reduced, thereby reducing the power consumption of Class B devices and extending the standby time of Class B devices.
  • the electronic device 100 in the above device group 200 may specifically be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, Personal digital assistants (personal digital assistants, PDAs), wearable electronic devices, in-vehicle devices, virtual reality devices, etc., are not limited in the embodiments of the present application.
  • UMPC ultra-mobile personal computer
  • PDAs personal digital assistants
  • wearable electronic devices in-vehicle devices, virtual reality devices, etc.
  • FIG. 2 shows a schematic structural diagram of the mobile phone.
  • the mobile phone 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, and mobile
  • the communication module 150 the wireless communication module 160, the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, the sensor module 180, the camera 193, the display screen 194 and so on.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the mobile phone.
  • the mobile phone may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components.
  • the illustrated components can be implemented in hardware, software, or a combination of software and hardware.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • modem processor modem processor
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that the processor 110 has just used or used cyclically. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous transmitter receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the charging management module 140 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 140 may receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive the wireless charging input through the wireless charging coil of the mobile phone. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
  • the power management module 141 is used to connect 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 charge management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be provided in the processor 110.
  • the power management module 141 and the charging management module 140 may also be provided in the same device.
  • the wireless communication function of the mobile phone can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the mobile phone can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G, etc., which are applied to mobile phones.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the wireless communication module 160 can provide applications on mobile phones including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), and global navigation satellite systems ( Global navigation satellite system, GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite systems
  • FM frequency modulation
  • NFC near field communication
  • IR infrared technology
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the mobile phone is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the mobile phone can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (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 technology, etc.
  • the GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite-based augmentation systems
  • the mobile phone realizes the display function through GPU, display screen 194, and application processor.
  • the GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the mobile phone may include one or N display screens 194, and N is a positive integer greater than one.
  • the mobile phone can realize the shooting function through ISP, camera 193, video codec, GPU, display 194 and application processor.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the mobile phone may include one or N cameras 193, and N is a positive integer greater than one.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the mobile phone selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
  • Video codecs are used to compress or decompress digital video.
  • the phone can support one or more video codecs.
  • video codecs In this way, mobile phones can play or record videos in a variety of encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
  • MPEG moving picture experts group
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the mobile phone.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the processor 110 executes various functional applications and data processing of the mobile phone by running instructions stored in the internal memory 121.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as audio data, phone book, etc.) created during the use of the mobile phone.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • UFS universal flash storage
  • the mobile phone can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal.
  • the audio module 170 can also be used to encode and decode audio signals.
  • the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
  • the speaker 170A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the mobile phone can listen to music through the speaker 170A, or listen to a hands-free call.
  • the receiver 170B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the voice can be heard by bringing the receiver 170B close to the human ear.
  • the microphone 170C also called “microphone”, “microphone”, is used to convert sound signals into electrical signals.
  • the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C.
  • the mobile phone can be equipped with at least one microphone 170C.
  • the mobile phone can be equipped with two microphones 170C, in addition to collecting sound signals, it can also achieve a noise reduction function.
  • the mobile phone can also be equipped with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
  • the earphone interface 170D is used to connect wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA, CTIA
  • the sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
  • the above-mentioned mobile phone may also include one or more devices such as buttons, motors, indicators, and SIM card interfaces, which are not limited in the embodiment of the present application.
  • the electronic device may determine that its device type is specifically the above-mentioned type A device, type B device or type C device according to the device tag stored in itself, and further, The electronic device can enter different working modes to start working. For example, if the electronic device is a class A device, the electronic device can automatically enter the preset working mode A; if the electronic device is a class B device, the electronic device can automatically enter the preset working mode B; if the electronic device is C equipment, the electronic equipment can automatically enter the preset working mode C.
  • the above-mentioned working modes are electronic devices A general term for a series of working steps and working mechanisms during work. Electronic equipment may not need to perform specific steps to enter a certain working mode during actual operation.
  • the preset working state variable can be set to 01 when the electronic device starts working, which is used to indicate that the current working mode of the electronic device is working mode A.
  • the step in which the electronic device sets the above-mentioned working state variable to 01 can be regarded as a step in which the electronic device enters the working mode A.
  • the first message is sent to each electronic device in the Wi-Fi network.
  • the first message includes the network access time of the electronic device 1 and the device information.
  • the network access time of electronic device 1 refers to the time when electronic device 1 accesses the aforementioned Wi-Fi network.
  • the device information of electronic device 1 may include the device name, device type, device model, IP address, MAC address, The status of the device such as the services provided by the device and the customized business information.
  • each electronic device in the Wi-Fi network After each electronic device in the Wi-Fi network receives the first message sent by the newly added electronic device 1, it can send a second message to the electronic device 1 in response to the first message.
  • the second message includes the network access time and device information of the electronic device that sent the second message.
  • the electronic device 1 joins the Wi-Fi network, it can receive the second message from each electronic device that has joined the Wi-Fi network.
  • the electronic device 1 may form the device information list shown in Table 2.
  • the electronic device 1 can query the recent specific device status of other electronic devices in the Wi-Fi network through the device information list.
  • the device information list shown in Table 2 may also include the network access time and device information of the electronic device 1, which is not limited in the embodiment of the present application.
  • the electronic device 1 can determine which working mode it enters to start working according to its own device type. For example, if the device label in the electronic device 1 indicates that the electronic device 1 is a class A device (such as a speaker, smart TV, etc.), the electronic device 1 can enter the preset working mode A; if the device label in the electronic device 1 indicates electronic Device 1 is a Class B device (such as a mobile phone, a tablet computer, etc.), then the electronic device 1 can enter the preset working mode B; if the device label in the electronic device 1 indicates that the electronic device 1 is a Class C device (such as a wearable device, Smart bulb, etc.), the electronic device 1 can enter the preset working mode C.
  • a class A device such as a speaker, smart TV, etc.
  • the electronic device 1 can enter the preset working mode A
  • the electronic Device label in the electronic device 1 indicates electronic Device 1 is a Class B device (such as a mobile phone, a tablet computer, etc.)
  • the electronic device 1 can enter the preset working
  • the above-mentioned working mode B may also include working mode B1 and working mode B2. That is to say, when the electronic device 1 is a type B device, the electronic device 1 can choose one of the two working mechanisms of the working mode B1 and the working mode B2. For example, after the electronic device 1 determines that it is a Class B device, it can query whether there is a Class A device in the current Wi-Fi network through the above-mentioned device information list. If there is a class A device, the electronic device 1 can enter the working mode B1; if there is no class A device, the electronic device 1 can enter the working mode B2.
  • a class A device working in working mode A is mainly used to receive device information periodically sent by other devices in the Wi-Fi network, and then update the device information of the corresponding device in the device information list, so that the device information stored in the class A device The information of each device in the list is in the latest state.
  • other devices in the Wi-Fi network can also obtain the latest device information list from Class A devices, so that each device in the Wi-Fi network can learn the latest device status of other devices.
  • a class A device working in working mode A can wait for the class B device to actively report its device information, and when it reports the device information, it will issue the latest device information list to the class B device, thereby reducing the class B device’s slave status. The number of times that the standby state is awakened, to avoid the extra power consumption of Class B devices.
  • the electronic device 1 after the electronic device 1 enters the working mode A, it can determine whether the electronic device 1 is currently the master device according to a preset master decision algorithm (ie, S401). If there is no Class A device in the Wi-Fi network before the electronic device 1 joins the Wi-Fi network, the electronic device 1 can determine itself as the master device after entering the working mode A. If there are one or more Class A devices in the Wi-Fi network before the electronic device 1 joins the Wi-Fi network, the electronic device 1 can negotiate with the one or more Class A devices after entering the working mode A The main device in the current Wi-Fi network.
  • a preset master decision algorithm ie, S401
  • the foregoing main device decision-making algorithm may be: the Class A device with the earliest network access time is the main device. Then, after the electronic device 1 enters the working mode A, it can determine whether it is the earliest type A device connected to the network according to the network access time of each type A device recorded in Table 2 and its own network access time. If the electronic device 1 is the earliest type A device connected to the network, then the electronic device 1 can enter the master device working mode as the master device; if the electronic device 1 is not the earliest type A device connected to the network, the electronic device 1 can enter the slave device (slave) Slave working mode.
  • the aforementioned master device decision-making algorithm may also be: selecting a specific type of device as the master device.
  • the priority order between different types of devices in Class A devices can be preset. For example, the priority of the TV is greater than the priority of the router, and the priority of the router is greater than the priority of the smart speaker. Then, after the electronic device 1 enters the working mode A, it can determine whether it is the class A device with the highest priority according to the device type of each class A device recorded in Table 2 and its own device type.
  • the electronic device 1 can enter the master working mode as the master device; if the electronic device 1 is not the class A device with the highest priority, then the electronic device 1 can enter the slave device as a slave device. Device working mode.
  • main device decision algorithm may also be a decision algorithm such as a raft election algorithm.
  • One or more main devices may be set in the Wi-Fi network, and the embodiment of the present application does not impose any limitation on this.
  • the Class A device 1 in the Wi-Fi network is the only master device (master), and the master device is used to maintain the device information of all electronic devices in the Wi-Fi network.
  • Other devices in the Wi-Fi network for example, Class A device 2, Class A device 3, Class B device 1, Class B device 2, and Class C device 1 can be used as slave devices to establish with this master device Connect, and each slave device reports its own device information to the master device.
  • each slave device can also obtain the latest device information list from the master device.
  • the Wi-Fi network includes Class A device 1, Class A device 2 and Class A device 3.
  • Class A device 1, Class A device 2 and Class A device 3 are all Master (master).
  • the class A device 1 can establish a connection with the class B device 1 and the class B device 2 respectively, so as to obtain the device information of the class B device 1 and the class B device 2.
  • the type B device 1 and the type B device 2 are slaves of the type A device 1.
  • the Class A device 2 can establish a connection with the Class C device 1 and the Class B device 3, respectively, so as to obtain the device information of the Class C device 1 and the Class B device 3.
  • the C-type device 1 and the B-type device 3 are slaves of the A-type device 1.
  • class A device 1, the class A device 2, and the class A device 3 as the master device can be connected to each other.
  • Class A devices 1 to A device 3 can synchronize the received device information reported by each electronic device with each other, so that each main device can obtain the latest device information of all electronic devices in the Wi-Fi network. Form the latest equipment information list.
  • the electronic device 1 when the electronic device 1 enters the main device working mode, the electronic device 1 can send a message indicating the main device to other electronic devices in the Wi-Fi network through DNS multicast (ie S402) ,
  • the field used to indicate the master device in the message may include the identification of the electronic device 1.
  • other electronic devices After receiving the message, other electronic devices can determine that the main device in the current Wi-Fi network is electronic device 1.
  • the electronic device 2 can be in the stored device information list Mark the electronic device 1 as the main device. Subsequently, the electronic device 2 can be used as a slave device to establish a connection with the electronic device 1, and periodically report its own device information to the electronic device 1 (ie, the master device).
  • the electronic device 1 can update the device information of the corresponding device in its device information list after receiving device information (ie S403) from other electronic devices (ie slave devices) in the master device working mode.
  • the device information list stored in the electronic device 1 is kept in the latest state.
  • the electronic device 1 receives the device information sent from the slave device, it can also send the latest device information list to the slave device (ie S404).
  • the slave device receives the device information list sent by the master device, it can store the stored device information list.
  • the device information list of is deleted, so that the device information list stored in each slave device is synchronized with the device information list stored in the electronic device 1, and they are all in the latest state.
  • the electronic device 1 can start the preset timer T1 (ie S405).
  • the electronic device 1 can act as a slave device to send its latest device information to the current master device (ie S406).
  • the master device can update the device information of the corresponding electronic device 1 in its device information list.
  • the master device can send the latest device information list to the electronic device 1 (ie S407), so that the electronic device 1 can learn the latest device status of other electronic devices in the Wi-Fi network through the device information list.
  • the electronic device 1 when the electronic device 1 serves as a slave device to send device information to the master device, if it fails to send device information to the master device multiple times in succession, it means that the master device may have been replaced or offline at this time, then the electronic device Device 1 can re-determine the main device in the current Wi-Fi network and send its own device information to the new main device.
  • the electronic device 1 after the electronic device 1 enters the slave device working mode, if it receives device information from other slave devices, it means that the slave device may incorrectly determine the electronic device 1 as the master device, then the electronic device 1 can send the current master device identification to the slave device to inform the slave device of the current correct master device.
  • the electronic device 1 can re-determine the current The master device in the Wi-Fi network determines that the electronic device 1 needs to enter the master device working mode or the slave device working mode at this time.
  • the electronic device 1 when the electronic device 1 is the master device, if it receives a message that the electronic device 2 exits the Wi-Fi network, the electronic device 1 can determine that the new master device is the electronic device at this time according to the preset master device decision algorithm 3. Then, the electronic device 1 can enter the above-mentioned slave device working mode and disconnect the established connection with other electronic devices.
  • the connection can be a network connection at the L3 layer.
  • the electronic device 1 can send a message to other Class A devices to notify the other Class A devices that the new master device is the electronic device 3. At this time, the electronic device 1 may not send a message to the Class B device to notify the new master device.
  • the electronic device 1 When the class B device actively sends its own device information to the electronic device 1, the electronic device 1 can notify the class B device of the new master device, so as to reduce the power consumption of the class B device being actively awakened by the class A device.
  • the electronic device 1 after the electronic device 1 enters the working mode A, it can query whether there is a class A device that has an earlier network access time (that is, S1301). If there is no Class A device earlier than its own network access time, the electronic device 1 can enter the master working mode; if there is a Class A device earlier than its own network access time, then the electronic device 1 can enter the slave device (slave) working mode.
  • the electronic device 1 can be used as the master device to send DNS broadcasts to other electronic devices in the Wi-Fi network through DNS multicast (ie mDNS) to inform other electronic devices.
  • DNS multicast ie mDNS
  • the main device of the device is updated to electronic device 1.
  • the electronic device 1 can wait for other electronic devices in the Wi-Fi network to establish an L3 network connection with itself (ie S1302). After the electronic device 1 monitors the connection request from the slave device, it can establish an L3 layer network connection with the corresponding slave device.
  • the electronic device 1 After the electronic device 1 receives the device information sent from the device through the established network connection, it can update the device information of the corresponding device in its device information list (ie S1303), so that the device information list is in the latest state. In addition, the electronic device 1 may save the updated device information list in a preset home network device information database.
  • the electronic device 1 can re-determine itself Whether it is still the main device in the current Wi-Fi network (ie S1305). For example, if the electronic device 1 determines that there are other Class A devices whose access time is earlier than its own network access time, then the electronic device 1 can determine the Class A device with the earliest access time as the latest master device in the Wi-Fi network (i.e. S1306 ). Then, the electronic device 1 can send a message to other Class A devices, thereby notifying the other Class A devices of the new master device (ie S1307). In addition, the electronic device 1 can disconnect the network connection established with the slave device and enter the slave working mode.
  • the electronic device 1 can establish an L3 network connection with the determined master device (ie S1308). Furthermore, the electronic device 1 can start a timer (for example, the timer T1). When the timer T1 expires, the electronic device 1 can act as a slave device to send its latest device information to the current master device (ie S1309). If sending device information to the main device for multiple times (for example, N0 times) times out, it means that the main device may have been replaced or offline at this time. Then, the electronic device 1 can re-determine the main device (ie, the main device in the current Wi-Fi network). S1310).
  • a timer for example, the timer T1
  • the electronic device 1 can act as a slave device to send its latest device information to the current master device (ie S1309). If sending device information to the main device for multiple times (for example, N0 times) times out, it means that the main device may have been replaced or offline at this time. Then, the electronic device 1 can re-determine the main
  • the electronic device 1 can re-determine the current The main device in the Wi-Fi network. If the main device in the current Wi-Fi network changes, the electronic device 1 can disconnect the network connection with the old main device and establish a network connection with the new main device (ie S1312).
  • a Class B device working in the working mode B1 can periodically send its own device information to the main device in the Class A device, and at the same time obtain the latest device information list from the main device, so as to be based on each device in the device information list.
  • the device information in the Wi-Fi network completes the collaborative work task with other devices in the Wi-Fi network.
  • the electronic device 1 can determine the main device in the current Wi-Fi network and establish a connection with the main device (ie S501).
  • the electronic device 1 can query whether there is a Class A device marked as the main device in the device information list stored in itself. If a Class A device marked as the main device is queried, the electronic device 1 can establish a connection with the main device.
  • the connection can be a network connection at the L3 layer.
  • the network connection of the L3 layer can specifically be a TCP (transmission control protocol) connection or a UDP (user datagram protocol, user datagram protocol)-based network connection, such as UDP-based CoAP (constrained application protocol, restricted Application protocol) connection, the embodiment of this application does not impose any restriction on this.
  • the electronic device 1 can establish a connection with the updated master device.
  • the electronic device 1 may also determine any type A device in the Wi-Fi network as the master device.
  • the Class A device can notify the Class B device at this time A new master device to reduce the power consumption of Class B devices being actively awakened by Class A devices.
  • the electronic device 1 can start the preset timer T2 (ie S502).
  • the electronic device 1 can act as a slave device to send its own latest device information to the determined master device (ie S503).
  • the master device can update the device information of the corresponding electronic device 1 in its device information list.
  • the master device can send the latest device information list to the electronic device 1 (ie S504), so that the electronic device 1 can learn the latest device status of each electronic device in the Wi-Fi network through the device information list.
  • a shorter timing duration of the timer T2 can be set; for a type B device with a slower update of device information, a longer timing duration of the timer T2 can be set. In this way, it is possible to reduce the number of wake-ups of the type B equipment as much as possible while ensuring that the device information of the type B equipment is updated in time, thereby reducing the power consumption of the type B equipment.
  • the timing duration of the timer T2 can be set to be synchronized with the period of the heartbeat message sent by the Class B device.
  • each time a Class B device is awakened and sends a heartbeat message to the PUSH message server it can also send its own latest device information to the master device, thereby reducing the number of additional wake-ups of Class B devices and reducing the power consumption of Class B devices .
  • the timer for the type B device to send a heartbeat message to the PUSH message server and the timer for the type B device to send its own latest device information to the master device may be one.
  • Class B devices rarely receive messages from other devices to wake up Class B devices, and in working mode B1, Class B devices will actively report device information to the master device and synchronize periodically.
  • Device information list which makes the number of times that Class B devices are awakened relatively stable, so that the power consumption of Class B devices is more stable and controllable, and will not increase with the increase in the number of devices in the Wi-Fi network.
  • a Class B device fails to send device information to the main device multiple times in working mode B1, it means that the main device may have been replaced or offline at this time. Then, the electronic device 1 can re-determine the current Wi-Fi network The master device, and send its own device information to the new master device. If there is no Class A device in the current Wi-Fi network, the electronic device 1 can enter the working mode B2.
  • the electronic device 1 can determine a master device from the Class A devices of the Wi-Fi network, and establish an L3 with the master device. Layer network connection (ie S1401).
  • the electronic device 1 can disconnect the network connection with the current master device and establish an L3 network connection with the new master device (ie S1402).
  • the electronic device 1 can start a preset timer (for example, timer T2).
  • timer T2 expires, the electronic device 1 can act as a slave device to send its latest device information to the determined master device (ie S1403).
  • the electronic device 1 can synchronize the latest device information list from the home network device information database of the master device (S1404).
  • the electronic device 1 can re-determine the current Wi-Fi network in the Class A device The main device (that is, back to S1401), establish a network connection with the new main device. If there is no Class A device in the current Wi-Fi network, the electronic device 1 can enter the working mode B2.
  • Class B devices 1 to B devices 3 form a ring network, and each Class B device can control one or more Class C devices.
  • the Class B equipment on each node in the ring network can periodically receive the updated device information list sent by the Class B equipment of the previous node, and the Class B equipment of each node can periodically receive the Class B equipment of the next node. Send the updated device information list.
  • class B device 1 can generate device information list 1 based on the device information of class B device 1 and the device information reported by class C device 1, and send device information list 1 to class B device when the preset timer T3 expires 2.
  • the class B device 2 can add its own device information to the device information list 1 to form the device information list 2.
  • the class B device 2 can send the device information list 2 to the class B device 3.
  • the class B device 3 can add its own device information and the device information reported by the class C device 2 to the device information list 2 to form the device information list 3.
  • the class B device 3 can send the device information list 3 to the class B device 1.
  • the Class B device 1 to the Class B device 3 can circulate the above method to periodically update the device information list stored in themselves, so as to learn the latest device status of each device in the Wi-Fi network.
  • each type B device only needs to be awakened by the type B device of the previous node in one cycle to obtain the latest device information list. In this way, the number of wake-ups for type B devices will be greatly reduced, and the power consumption of type B devices will be reduced accordingly.
  • the timing duration of the timer T3, the timer T4, and the timer T5 may be the same or different.
  • only one timer T0 may be set in one node of the above-mentioned ring network.
  • the timer T0 can be set in the Class B device 1.
  • the class B device 1 can send the latest device information list to the class B device 2.
  • class B device 2 After class B device 2 receives the device information list sent by class B device 1, it can update the device information list and send the updated device information list to the next node (ie, class B device 3).
  • the class B device 3 can update the device information list, and send the updated device information list to the next node (ie, the class B device 1).
  • Class B device 1 to Class B device 3 can periodically update the device information list stored by themselves through the above-mentioned method, so as to learn the latest device status of each device in the Wi-Fi network.
  • the electronic device 1 can join the above-mentioned ring network as a new node according to the preset networking algorithm (i.e., S701).
  • the electronic device 1 can be plugged into the above-mentioned ring network as a Class B device 4.
  • the original connection between the class B device 3 and the class B device 1 can be disconnected, and the newly added electronic device 1 can establish a connection with the class B device 3 and the class B device 1 respectively.
  • Class B device 3 is the previous node of electronic device 1
  • class B device 1 is the next node of electronic device 1.
  • the electronic device 1 after the electronic device 1 joins the above-mentioned ring network, it can receive the device information list sent by the previous node (ie, the type B device 3) (ie, S702). Furthermore, the electronic device 1 can start a preset timer T6 (ie S703). When the timer T6 expires, the electronic device 1 can update the above-mentioned device information list and send the latest device information list to the next node: Class B device 1 (ie S704).
  • the electronic device 1 can receive the device information list sent by the previous node (ie, the type B device 3) (ie, S702). Furthermore, the electronic device 1 can start a preset timer T6 (ie S703). When the timer T6 expires, the electronic device 1 can update the above-mentioned device information list and send the latest device information list to the next node: Class B device 1 (ie S704).
  • the electronic device 1 if the electronic device 1 fails to send the device information list to the next node multiple times in succession, it means that the next node of the electronic device 1 may be offline, and then the electronic device 1 can continue to the next node (I.e. Class B device 2) Send a list of device information.
  • the next node I.e. Class B device 2
  • the electronic device 1 can determine whether the new device is Class A according to the device information sent by the new device equipment. If the newly added device is not a Class A device, the electronic device 1 can re-determine its position in the ring network according to the preset networking algorithm, that is, determine the previous position of the electronic device 1 in the ring network after the new device is added. Which type B device the node and the next node are specifically. Furthermore, the electronic device 1 can periodically receive the device information list sent by the previous node according to the above method, and periodically send the latest device information list to the next node. Correspondingly, if the newly added device this time is a class A device, the electronic device 1 can switch from the working mode B2 to the above-mentioned working mode B1.
  • the electronic device 1 can join the aforementioned ring network as a new node according to a preset networking algorithm (ie S1501). Furthermore, after the electronic device 1 receives the device information list (ie S1502) sent by the previous node, the device information list may also be called home device information data, it can update the device information list (ie S1503) and start the preset timing Device (e.g. timer T6). When the timer T6 expires, the electronic device 1 can send the latest device information list to the next node (ie S1504). If the network connection between the electronic device 1 and the next node times out, the electronic device 1 may try to establish a network connection with the next node of the next node (ie S1505).
  • a preset networking algorithm ie S1501
  • the electronic device 1 can query whether the new device is a class A device. If the new device is not a Class A device, the electronic device 1 can determine whether it is the previous node of the new device according to a preset networking algorithm (ie S1507). If it is the previous node, the electronic device 1 can disconnect the network connection between the electronic device 1 and the next node in the original ring network, and establish a network connection with the new device (ie S1508); otherwise, the electronic device 1 can continue Keep network connection with the previous node. Correspondingly, if the new device is a class A device, the electronic device 1 can enter the above-mentioned B1 working mode.
  • Class C devices are generally bound to the corresponding master control device as a controlled device.
  • the main control device of the C-type device may be the above-mentioned Class A device or the B-type device, and the main control device of the C-type device may also be a server.
  • the main control device of a wearable device is generally a class B device such as a mobile phone
  • the main control device of a smart light bulb can be a class A device such as a router
  • the main control device of a smart meter can be a server of a power company.
  • the electronic device 1 when the electronic device 1 enters working mode C, it can periodically report its own device information to the corresponding master control device without obtaining and saving the current device information list.
  • Class A devices When there are Class A devices in the Wi-Fi network, there are one or more master devices in the Wi-Fi network.
  • the Class A device 1 can be used as the master device to enter the master in the above working mode A.
  • Device working mode Class A device 2 can be used as a slave device to enter the working mode of the slave device in the above working mode A.
  • the type B device 1 and the type B device 2 in the Wi-Fi network can also be used as slave devices to enter the above-mentioned working mode B1.
  • the class B device 1 is the main control device of the class C device 1
  • the class B device 2 is the main control device of the class C device 2
  • the main control device of the class C device 3 is the server.
  • the class C device 1 can report its own device information to the class B device 1 according to cycle 1.
  • the class B device 1 can report the device information of the class C device 1 to the main device when reporting the device information of the class B device 1 to the main device (ie, the class A device 1).
  • the class C device 2 can report its own device information to the class B device 2 according to cycle 2.
  • the class B device 2 may report the device information of the class C device 2 to the main device when reporting the device information of the class B device 2 to the main device.
  • the class C device 3 can periodically report its own device information to the server, and the main device (ie, the class A device 1) can periodically obtain the device information of the class C device 3 from the server.
  • the main device ie, the Class A device 1
  • the main device can periodically obtain the device information of all devices in the Wi-Fi network and form the latest device information list.
  • other devices in the Wi-Fi network report their own device information to the main device, they can also obtain the latest device information list from the main device.
  • all devices in the Wi-Fi network can save a list of the latest device information, and each device can learn the latest device status of other devices according to the device information list, so as to quickly participate in the subsequent and complete the multi-device information Of collaborative work tasks.
  • Class B devices 1 to B devices 3 can form a ring network.
  • Class B equipment 1 to Class B equipment 3 can all enter the above-mentioned working mode B2.
  • the class B device 1 is the main control device of the class C device 1
  • the class B device 2 is the main control device of the class C device 2
  • the main control device of the class C device 3 is the server.
  • the class C device 1 can report its own device information to the class B device 1 according to cycle 1.
  • the class B device 1 can add its own device information and the device information of the class C device 1 to the device information list when sending the device information list to the next node (ie, the class B device 2) according to the above-mentioned working mode B2.
  • the class C device 2 can report its own device information to the class B device 2 according to cycle 2.
  • the class B device 2 can add its own device information and the device information of the class C device 2 to the device information list when sending the device information list to the next node (ie, the class B device 3) according to the above-mentioned working mode B2.
  • the class C device 3 can periodically report its own device information to the server.
  • a certain class B device in the ring network can obtain the device information of the class C device 3 from the server, and update the device information of the class C device 3 In the device information list.
  • the electronic device 1 enters the working mode A, the working mode B or the working mode C when it joins the above-mentioned Wi-Fi network as an example. It is understandable that each electronic device in the Wi-Fi network can enter the working mode corresponding to its own device type and start working according to the above method.
  • the Wi-Fi network includes 3 class A devices (namely, TV 1001, speaker 1002, and router 1003), and 2 class B devices (namely Mobile phone 1004 and tablet PC 1005) and 3 Class C devices (that is, wearable device 1006, smart light bulb 1007, and smart air conditioner 1008).
  • 3 class A devices namely, TV 1001, speaker 1002, and router 1003
  • 2 class B devices namely Mobile phone 1004 and tablet PC 1005
  • 3 Class C devices that is, wearable device 1006, smart light bulb 1007, and smart air conditioner 1008.
  • the TV 1001 can be used as the main device in the Wi-Fi network to enter the main device working mode.
  • Other Class A devices in the Wi-Fi network can be used as slave devices of the TV 1001 to enter the slave device working mode, and Class B devices in the Wi-Fi network can also be used as slave devices of the TV 1001 to enter the working mode B1.
  • the speaker 1002 and the router 1003 can actively report their device information to the TV 1001 every 30s in a period of 30s, and synchronize the latest device information list from the TV 1001.
  • the mobile phone 1004 and the tablet computer 1005 can actively report their device information to the TV 1001 every time a heartbeat message is sent to the PUSH server, and synchronize the latest device information list from the TV 1001.
  • the main control device of the wearable device 1006 in Class C devices is a mobile phone 1004, the main control device of the smart light bulb 1007 is the TV 1001, and the main control device of the smart air conditioner 1008 is the server 1009.
  • the wearable device 1006 may periodically report its own device information to the mobile phone 1004, and the mobile phone 1004 may report the device information of the wearable device 1006 when reporting its own device information to the TV 1001.
  • the smart bulb 1007 can periodically report its own device information to the TV 1001.
  • the smart air conditioner 1008 can periodically report its own device information to the server 1009.
  • the TV 1001 can take 30s as a period, and actively obtain the device information of the smart air conditioner 1008 from the server 1009 every 30s.
  • the TV 1001 can obtain the latest device information of each electronic device in the Wi-Fi network, and form the latest device information list.
  • the TV 1001 can synchronize the latest device information list to other electronic devices in the Wi-Fi network, so that each electronic device in the Wi-Fi network can learn the latest device status of other electronic devices according to the device information list.
  • the schematic diagram of the architecture of the above Wi-Fi network may be as shown in FIG. 11, and the Wi-Fi network includes 3 class B devices (ie, mobile phone 1101, mobile phone 1102, and tablet computer 1103) and 3 class C devices ( That is, the wearable device 1104, the smart bulb 1105, and the smart air conditioner 1106).
  • 3 class B devices ie, mobile phone 1101, mobile phone 1102, and tablet computer 1103
  • 3 class C devices That is, the wearable device 1104, the smart bulb 1105, and the smart air conditioner 1106).
  • the above-mentioned Wi-Fi network does not include Class A devices, then the mobile phone 1101, the mobile phone 1102, and the tablet computer 1103 can enter the above-mentioned working mode B2 to form a ring network.
  • the mobile phone 1101 is the main control device of the wearable device 1104
  • the mobile phone 1102 is the main control device of the smart light bulb 1105
  • the main control device of the smart air conditioner 1106 is the server 1107.
  • the wearable device 1104 may periodically report its own device information to the mobile phone 1101.
  • the mobile phone 1101 can carry its own device information and the device information of the wearable device 1104 in the device information list when sending the device information list to the next node (ie, the mobile phone 1102) according to the above-mentioned working mode B2.
  • the smart bulb 1105 can report its device information to the mobile phone 1102 periodically.
  • the mobile phone 1102 can carry its own device information and the device information of the smart bulb 1105 in the device information list when sending the device information list to the next node (ie, the tablet 1103) according to the above-mentioned working mode B2.
  • the smart air conditioner 1106 may periodically report its own device information to the server 1107.
  • the mobile phone 1102 in the Wi-Fi network can actively obtain the device information of the smart air conditioner 1106 from the server 1107 when sending a heartbeat message to the PUSH server, and update the device information of the smart air conditioner 1106 in the device information list.
  • the B-type devices in the ring network can obtain the latest device information list through regular synchronization, so that the latest device status of each electronic device in the Wi-Fi network can be obtained according to the device information list.
  • the electronic devices participating in the collaborative work can quickly query the device status of other electronic devices based on the recently updated device information list, and then based on the number of electronic devices participating in the collaborative work. The device status of each electronic device quickly completes this collaborative task.
  • the TV 1001, speaker 1002, mobile phone 1004, and tablet computer 1005 in the Wi-Fi network can all detect this Wake word.
  • the TV 1001 , Speaker 1002, mobile phone 1004, and tablet computer 1005 can query the latest awakening time of each electronic device in the Wi-Fi network that supports the voice wake-up function in the device information list stored by itself, and then determine the specific electronic device that responded to the user this time. equipment.
  • speaker 1002 determines that it is the most recently awakened electronic device among TV 1001, speaker 1002, mobile phone 1004, and tablet 1005, and can turn on the corresponding voice function to answer the user’s comment.
  • the awakening word "Xiaoyi Xiaoyi" came out.
  • the TV 1001, the mobile phone 1004, and the tablet computer 1005 do not need to respond to the wake-up words spoken by the user, nor do they need to interact with the speaker 1002 for data.
  • each electronic device in the Wi-Fi network stores the latest device status of other electronic devices, when multiple electronic devices need to complete a collaborative work task, each electronic device participating in the collaborative work can The device status of other electronic devices can be quickly queried according to the latest device information list, and then the collaborative task can be quickly completed according to the device status of other electronic devices, which reduces the time consumption of multiple devices working together.
  • each electronic device can quickly query the device status of other electronic devices through the above device information list, the number of data interactions between electronic devices is reduced when multiple devices work together.
  • the number of times that Class B devices are awakened from standby or performing data interactions is also reduced, thereby reducing the power consumption of Class B devices and extending the standby time of Class B devices.
  • an embodiment of the present application discloses an electronic device, and the electronic device may specifically be a type A device, a type B device, or a type C device in the foregoing embodiment.
  • the electronic device includes: a communication module 1601; one or more processors 1602; one or more memories 1603; one or more application programs (not shown); and one or more computer programs 1604, as described above Each device may be connected through one or more communication buses 1605.
  • the one or more computer programs 1604 are stored in the aforementioned memory 1603 and configured to be executed by the one or more processors 1602, and the one or more computer programs 1604 include instructions, and the aforementioned instructions can be used to execute the aforementioned Each step in the embodiment should be implemented.
  • the above-mentioned processor 1602 may specifically be the processor 110 shown in FIG. 2
  • the above-mentioned memory 1603 may specifically be the internal memory 121 shown in FIG. 2
  • the above-mentioned communication module 1601 may specifically be the mobile communication module shown in FIG. 2 150 or wireless communication module 160.
  • the electronic device may also include a display screen, a touch sensor, and other devices, which are not limited in the embodiment of the present application.
  • the functional units in the various embodiments of the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage
  • the medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application relates to the technical field of communications. Provided are a method and system for information synchronization between multiple devices, and an electronic device. The power consumption of the electronic device can be reduced and the user experience in multidevice collaboration scenarios can be improved. The system comprises a first type device and second type devices. The first type device comprises a first device, and the first device is a master device. The second type devices comprise a second device and a third device, and both the second device and the third device are slave devices. The first device is configured to: receive device information of the third device sent by the third device; and update a device information list according to the received device information of the third device, the device information list recording device information of the first type device and device information of the second type devices. The second device is configured to: start a preset first timer; and when the first timer expires, send the device information of the second device to the first device, and obtain the updated device information list from the first device.

Description

一种多设备之间的信息同步方法、系统及电子设备Information synchronization method, system and electronic equipment between multiple devices
本申请要求于2019年9月30日提交国家知识产权局、申请号为201910944497.5、发明名称为“一种多设备之间的信息同步方法、系统及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office on September 30, 2019, the application number is 201910944497.5, and the invention title is "a method, system and electronic device for information synchronization between multiple devices". The entire content is incorporated into this application by reference.
技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种多设备之间的信息同步方法、系统及电子设备。This application relates to the field of communication technology, and in particular to a method, system and electronic device for information synchronization between multiple devices.
背景技术Background technique
随着智能家居技术的发展,一个用户或家庭中往往具备多个能够互相通信的电子设备。各类电子设备一般具有各自的设备特点,例如,手机的便携性更好,电视屏幕的显示效果更好,而音箱的音质效果更好。为了充分发挥不同电子设备的设备特点,需要多个电子设备之间协同工作完成的功能也越来越多。With the development of smart home technology, a user or family often has multiple electronic devices that can communicate with each other. Various electronic devices generally have their own device characteristics. For example, mobile phones have better portability, TV screens have better display effects, and speakers have better sound quality. In order to give full play to the device characteristics of different electronic devices, more and more functions need to be completed by multiple electronic devices working together.
例如,用户家中可能存在多个支持语音唤醒的电子设备,且这多个电子设备的唤醒词相同(例如“小艺小艺”)。那么,用户说出唤醒词后,检测到该唤醒词的多个设备需要互相交互各自的设备信息(例如设备类型、是否连接耳机等),进而,各个设备之间可根据接收到的设备信息通过预设的唤醒决策算法确定出本次由哪个设备响应用户输入的唤醒词被唤醒。For example, there may be multiple electronic devices that support voice wake-up in the user's home, and the wake-up words of these multiple electronic devices are the same (for example, "小艺小艺"). Then, after the user speaks the wake-up word, multiple devices that detect the wake-up word need to interact with each other's device information (such as device type, whether to connect a headset, etc.), and then, each device can pass through the received device information according to the received device information. The preset wake-up decision algorithm determines which device is awakened this time in response to the wake-up word input by the user.
可以看出,当多个电子设备之间进行协同工作时,彼此需要先交互各自的设备信息,才能进一步根据各个设备的设备信息确定具体的协同步骤或协同结果。显然,设备之间的多次交互不仅会导致整个设备协同工作的响应耗时增加,还会增加电子设备的功耗。It can be seen that when multiple electronic devices work in coordination, they need to interact with each other's respective device information before they can further determine specific coordination steps or coordination results based on the device information of each device. Obviously, multiple interactions between devices will not only increase the time-consuming response of the entire device's collaborative work, but also increase the power consumption of the electronic device.
发明内容Summary of the invention
本申请提供一种多设备之间的信息同步方法、系统及电子设备,可降低多设备协同工作过程中的耗时,并降低电子设备的功耗,提高多设备协同场景下用户的使用体验。The present application provides a method, system and electronic device for information synchronization between multiple devices, which can reduce the time consumption in the process of multi-device collaborative work, reduce the power consumption of the electronic device, and improve the user experience in the multi-device collaborative scenario.
为达到上述目的,本申请采用如下技术方案:In order to achieve the above objectives, this application adopts the following technical solutions:
第一方面,本申请提供一种多设备之间的信息同步系统,该系统中可包括第一类型设备(也可称为A类设备)和第二类型设备(也可称为B类设备);第一类型设备为使用外接电源供电的一个或多个设备,第一类型设备中可包括第一设备,第一设备为系统中的主设备;第二类型设备为使用电池供电的一个或多个设备,第二类型设备中可包括第二设备和第三设备,第二设备和第三设备均为系统中的从设备;In the first aspect, this application provides an information synchronization system between multiple devices. The system may include a first type of device (also called a type A device) and a second type of device (also called a type B device) ; The first type of equipment is one or more devices powered by an external power supply, the first type of equipment may include the first device, the first device is the main device in the system; the second type of equipment is one or more battery-powered A device, the second type of device may include a second device and a third device, and both the second device and the third device are slave devices in the system;
其中,上述第一设备用于:接收第三设备(即从设备)发送的第三设备的设备信息,该设备信息可反映出第三设备最新的设备状态;进而,根据接收到的第三设备的设备信息更新设备信息列表,该设备信息列表中记录有第一类型设备的设备信息和第 二类型设备的设备信息;上述第二设备用于:启动预设的第一定时器;当第一定时器超时时,向第一设备(即主设备)发送第二设备的设备信息,并从第一设备中获取更新后的该设备信息列表。Wherein, the above-mentioned first device is used to: receive the device information of the third device sent by the third device (that is, the slave device), and the device information can reflect the latest device status of the third device; further, according to the received third device Update the device information list with the device information of the device information list, the device information of the first type of device and the device information of the second type of device are recorded in the device information list; the above-mentioned second device is used to: start the preset first timer; When the timer expires, the device information of the second device is sent to the first device (that is, the master device), and the updated device information list is obtained from the first device.
也就是说,第一设备可根据各个从设备上报的设备信息更新设备信息列表,各个从设备(例如第二设备)在向第一设备上报设备信息时可获取第一设备中最新的设备信息列表。这样,每个从设备根据获取到的设备信息列表可以获知系统中各个设备最新的设备状态。因此,当多个设备需要完成一次协同工作任务时,参与协同工作的各个设备可以根据最新的设备信息列表快速查询到其他设备的设备状态,进而根据其他设备的设备状态快速完成本次协同任务,降低了多个设备协同工作时的耗时和功耗。In other words, the first device can update the device information list according to the device information reported by each slave device, and each slave device (for example, the second device) can obtain the latest device information list in the first device when reporting device information to the first device . In this way, each slave device can learn the latest device status of each device in the system according to the acquired device information list. Therefore, when multiple devices need to complete a collaborative work task, each device participating in the collaborative work can quickly query the device status of other devices according to the latest device information list, and then quickly complete the collaborative task according to the device status of other devices. Reduce the time-consuming and power consumption when multiple devices work together.
在一种可能的实现方式中,上述第二设备还用于:接收第一设备发送的第一消息,第一消息用于指示该系统中的主设备为第一设备;也就是说,当第一设备确定自身为主设备后,可向第二设备等从设备发送第一消息,以告知从设备当前的主设备为第一设备。例如,该第一消息中的预设字段可以包括第一设备的标识。那么,响应于第一消息,第二设备可将第一设备确定为主设备。In a possible implementation manner, the above-mentioned second device is also used to: receive a first message sent by the first device, and the first message is used to indicate that the main device in the system is the first device; that is, when the first device is the first device After a device determines that it is a master device, it can send a first message to a slave device such as a second device to inform the slave device that the current master device is the first device. For example, the preset field in the first message may include the identification of the first device. Then, in response to the first message, the second device may determine the first device as the master device.
在一种可能的实现方式中,上述设备信息列表中记录有第一设备的入网时间以及系统中设备的入网时间;此时,第二设备还用于:当第一设备为入网时间最早的第一类型设备时,可将第一设备确定为主设备。In a possible implementation manner, the network access time of the first device and the network access time of the devices in the system are recorded in the above device information list; at this time, the second device is also used for: when the first device is the first device with the earliest network access time In the case of one type of device, the first device can be determined as the master device.
示例性的,上述第一定时器的定时时长与第二设备的心跳周期相同。也就是说,第二设备向PUSH消息服务器发送心跳报文的周期,与第二设备向第一设备发送设备信息的周期相同。这样,第二设备每次被唤醒向PUSH消息服务器发送心跳报文的同时,可同时向第一设备发送自身最新的设备信息,从而减少了额外唤醒第二设备的次数,降低了第二设备的功耗。Exemplarily, the timing duration of the foregoing first timer is the same as the heartbeat period of the second device. That is, the period for the second device to send a heartbeat message to the PUSH message server is the same as the period for the second device to send device information to the first device. In this way, each time the second device is awakened and sends a heartbeat message to the PUSH message server, it can also send its own latest device information to the first device at the same time, thereby reducing the number of additional wake-ups of the second device and reducing the second device’s Power consumption.
在一种可能的实现方式中,上述第一类型设备中还可以包括第四设备;上述第二设备还用于:接收第四设备发送的主设备更新的消息,说明此时的主设备可能已经更换为第四设备;响应于该消息,第二设备可与第一设备断开该网络连接,并与第四设备建立网络连接。In a possible implementation manner, the above-mentioned first-type device may further include a fourth device; the above-mentioned second device is also used to: receive a main device update message sent by the fourth device, indicating that the main device at this time may have been Replace with the fourth device; in response to the message, the second device can disconnect the network connection with the first device and establish a network connection with the fourth device.
在一种可能的实现方式中,上述第二设备还用于:当第二设备与第一设备之间的网络连接超时时,说明此时的主设备可能已经更换或下线,第二设备可在除第一设备之外的第一类型设备中确定新的主设备。In a possible implementation manner, the above-mentioned second device is also used to: when the network connection between the second device and the first device times out, indicating that the main device may have been replaced or offline at this time, and the second device may The new master device is determined among the first type devices except the first device.
在一种可能的实现方式中,上述第一设备还用于:接收第二设备发送的第二设备设备信息;根据接收到的第二设备的设备信息更新上述设备信息列表;与第二设备类似的,第三设备还用于:启动预设的第二定时器;当第二定时器超时时,向第一设备发送第三设备的设备信息,并从第一设备中获取更新后的该设备信息列表,即从设备在向第一设备上报设备信息时可获取第一设备中最新的设备信息列表。In a possible implementation manner, the above-mentioned first device is also used to: receive the second device device information sent by the second device; update the above-mentioned device information list according to the received device information of the second device; similar to the second device Yes, the third device is also used to: start a preset second timer; when the second timer expires, send the device information of the third device to the first device, and obtain the updated device from the first device The information list, that is, the slave device can obtain the latest device information list in the first device when reporting device information to the first device.
在一种可能的实现方式中,上述第一设备还用于:当第一设备加入上述系统时,可根据主设备决策算法确定第一设备是否为主设备。In a possible implementation manner, the above-mentioned first device is further configured to: when the first device joins the above-mentioned system, it can determine whether the first device is the master device according to the master device decision algorithm.
在一种可能的实现方式中,当第一设备确定自身为主设备之后,第一设备还用于:当接收到新设备加入、设备退出或主设备更新的消息时,上述系统中的主设备可能会发生改变,因此,第一设备可重新确定第一设备此时是否为主设备。In a possible implementation manner, after the first device determines that it is the master device, the first device is also used to: when a new device joins, a device exits, or a master device update message is received, the master device in the above system Changes may occur, therefore, the first device can re-determine whether the first device is the master device at this time.
在一种可能的实现方式中,上述第一类型设备还包括第五设备,第五设备为从设备;其中,第五设备用于:启动预设的第三定时器;当第三定时器超时时,向第一设备发送第五设备的设备信息,并从第一设备中获取更新后的设备信息列表。也就是说,当第一类型设备为从设备时,该从设备也可在向主设备上报设备信息时获取主设备中最新的设备信息列表。In a possible implementation manner, the above-mentioned first type device further includes a fifth device, and the fifth device is a slave device; wherein, the fifth device is used to: start a preset third timer; when the third timer exceeds From time to time, the device information of the fifth device is sent to the first device, and the updated device information list is obtained from the first device. That is, when the device of the first type is a slave device, the slave device can also obtain the latest device information list in the master device when reporting device information to the master device.
在一种可能的实现方式中,上述第五设备还用于:当第五设备向第一设备发送第五设备的设备信息失败的次数超过预设值时,此时第一设备可能已经不是系统中的主设备,因此,第五设备可重新确定该系统中的主设备;或者,当接收到新设备加入、设备退出或主设备更新的消息时,此时第一设备可能已经不是系统中的主设备,因此,第五设备可重新确定该系统中的主设备。In a possible implementation manner, the above-mentioned fifth device is further used for: when the number of times that the fifth device fails to send the device information of the fifth device to the first device exceeds a preset value, the first device may no longer be a system at this time Therefore, the fifth device can re-determine the main device in the system; or, when a new device joins, device exits, or main device update message is received, the first device may no longer be in the system at this time. The main device, therefore, the fifth device can re-determine the main device in the system.
在一种可能的实现方式中,上述系统中还包括第三类型设备(即C类设备),第三类型设备的主控设备为第一设备;其中,第三类型设备用于:按照预设的周期向第一设备发送第三类型设备的设备信息;第一设备还用于:根据第三类型设备的设备信息更新该设备信息列表。In a possible implementation, the above system also includes a third type of device (ie, type C device), and the master device of the third type of device is the first device; wherein, the third type of device is used to: Send the device information of the third type of device to the first device periodically; the first device is also used to: update the device information list according to the device information of the third type of device.
在一种可能的实现方式中,上述系统中还包括第三类型设备,第三类型设备的主控设备为第二设备;其中,第三类型设备用于:按照预设的周期向第二设备发送第三类型设备的设备信息;第二设备还用于:当上述第一定时器超时时,向第一设备发送第三类型设备的设备信息,以使得第一设备根据第三类型设备的设备信息更新该设备信息列表。也就是说,当上述第一定时器超时时,第二设备可一并向第一设备(主设备)发送自身的设备信息可第三类型设备的设备信息,避免多次唤醒第二设备增加第二设备的功耗。In a possible implementation manner, the above system further includes a third type of device, and the main control device of the third type of device is the second device; wherein, the third type of device is used to: Send the device information of the third-type device; the second device is also used to: when the above-mentioned first timer expires, send the device information of the third-type device to the first device, so that the first device is based on the device information of the third-type device The information updates the device information list. That is to say, when the above-mentioned first timer expires, the second device can send its own device information to the first device (master device) together with the device information of the third type of device, avoiding waking up the second device multiple times to increase the number of times. 2. Power consumption of the device.
在一种可能的实现方式中,上述系统中还包括第三类型设备,第三类型设备的主控设备为服务器;其中,第三类型设备用于:按照预设的周期向该服务器发送第三类型设备的设备信息;第一设备还用于:从该服务器获取第三类型设备的设备信息;根据第三类型设备的设备信息更新该设备信息列表。In a possible implementation manner, the foregoing system further includes a third type of device, and the main control device of the third type of device is a server; wherein, the third type of device is used to: send a third type of device to the server according to a preset period. Device information of the device of the third type; the first device is also used to: obtain the device information of the device of the third type from the server; update the device information list according to the device information of the device of the third type.
第二方面,本申请的实施例提供一种多设备之间的信息同步系统,该系统包括第一设备、第二设备以及第三设备;第一设备、第二设备以及第三设备均为使用电池供电的第一类型设备(即B类设备);第一设备、第二设备以及第三设备组成一个环形网网络,其中,第一设备为第二设备的上一节点,第二设备为第三设备的上一节点;In the second aspect, the embodiments of the present application provide an information synchronization system between multiple devices. The system includes a first device, a second device, and a third device; the first device, the second device, and the third device are all used Battery-powered type 1 equipment (ie, type B equipment); the first equipment, the second equipment, and the third equipment form a ring network, where the first equipment is the previous node of the second equipment, and the second equipment is the first equipment The previous node of the three devices;
第二设备用于:接收第一设备发送的设备信息列表,该设备信息列表中记录有系统中各个设备的设备信息;根据第二设备的设备信息更新该设备信息列表;向第三设备发送更新后的设备信息列表。The second device is used to: receive the device information list sent by the first device, in which device information of each device in the system is recorded; update the device information list according to the device information of the second device; send the update to the third device After the device information list.
也就是说,当系统中没有上述A类设备时,每个B类设备在一个周期内只需被上一个节点的B类设备唤醒,以获取最新的设备信息列表。这样,B类设备的唤醒次数将大大降低,使得B类设备的功耗也相应降低。That is to say, when there is no above-mentioned type A device in the system, each type B device only needs to be awakened by the type B device of the previous node in a cycle to obtain the latest device information list. In this way, the number of wake-ups for type B devices will be greatly reduced, and the power consumption of type B devices will be reduced accordingly.
在一种可能的实现方式中,上述第二设备向第三设备发送更新后的设备信息列表,包括:当第一定时器超时时,第二设备向第三设备发送更新后的设备信息列表。In a possible implementation manner, the above-mentioned second device sending the updated device information list to the third device includes: when the first timer expires, the second device sends the updated device information list to the third device.
在一种可能的实现方式中,上述第二设备还用于:接收第四设备加入该系统的消息;若第四设备为第一类型设备,则按照预设的组网算法重新确定第二设备在该环形 网络中的位置,即第二设备在环形网络中的上一节点和下一节点。若第四设备不是第一类型设备(B类设备)而是A类设备,则第二设备可按照上述第一方面中所述的系统开始工作。In a possible implementation manner, the above-mentioned second device is also used to: receive a message that the fourth device joins the system; if the fourth device is a device of the first type, re-determine the second device according to a preset networking algorithm The position in the ring network, that is, the previous node and the next node of the second device in the ring network. If the fourth device is not a first type device (a type B device) but a type A device, the second device can start working according to the system described in the first aspect.
在一种可能的实现方式中,上述第二设备无法向第一设备发送数据;同时,第二设备也无法接收第三设备发送的数据。In a possible implementation manner, the above-mentioned second device cannot send data to the first device; at the same time, the second device cannot receive data sent by the third device.
在一种可能的实现方式中,上述系统中还包括受控于主控设备的第二类型设备(即C类设备),该主控设备为第二设备;其中,第二类型设备用于:按照预设的周期向第二设备发送第二类型设备的设备信息;第二设备还用于:根据第二类型设备的设备信息更新该设备信息列表。In a possible implementation manner, the above system also includes a second type of device (ie, type C device) controlled by the main control device, and the main control device is the second device; wherein, the second type of device is used for: Send the device information of the second type of device to the second device in a preset period; the second device is further configured to: update the device information list according to the device information of the second type of device.
在一种可能的实现方式中,上述系统中还包括受控于主控设备的第二类型设备,该主控设备为服务器;其中,第二类型设备用于:按照预设的周期向该服务器发送第二类型设备的设备信息;第二设备还用于:当第二设备被唤醒时,从服务器获取第二类型设备的设备信息;根据第二类型设备的设备信息更新该设备信息列表。这样,可避免第二设备(即B类设备)在待机状态下被唤醒后与服务器交互,降低B类设备因查询C类设备的设备信息而额外产生的功耗。In a possible implementation manner, the above system further includes a second type of device controlled by the main control device, and the main control device is a server; wherein, the second type of device is used to: Send the device information of the second type of device; the second device is also used to: when the second device is woken up, obtain the device information of the second type of device from the server; update the device information list according to the device information of the second type of device. In this way, the second device (ie, the type B device) can be prevented from interacting with the server after being awakened in the standby state, and the additional power consumption of the type B device due to querying the device information of the type C device can be reduced.
示例性的,上述设备信息可以包括:设备名称、设备类型、设备型号、设备入网时间、IP地址、MAC地址、设备提供的服务或自定义的业务信息中的一项或多项。例如,设备提供的服务可以为语音服务、音频播放服务、视频播放服务、网关服务等;又例如,自定义的业务信息可以包括设备最近的唤醒时间、最近的唤醒地点等。Exemplarily, the foregoing device information may include one or more of: device name, device type, device model, network access time of the device, IP address, MAC address, service provided by the device, or custom business information. For example, the service provided by the device may be a voice service, an audio playback service, a video playback service, a gateway service, etc.; for another example, the customized service information may include the latest wake-up time and the latest wake-up location of the device.
第三方面,本申请的实施例提供一种多设备之间的信息同步方法,包括:第一设备加入信息同步系统后,确定第一设备是否为该信息同步系统中的主设备,第一设备为使用外接电源供电的第一类型设备(即A类设备);若第一设备为主设备,则:In a third aspect, an embodiment of the present application provides an information synchronization method between multiple devices, including: after the first device joins the information synchronization system, determining whether the first device is the master device in the information synchronization system, and the first device It is the first type of equipment (ie, Class A equipment) that uses external power supply; if the first equipment is the main equipment, then:
第一设备接收第二设备发送的第二设备的设备信息,第二设备为该信息同步系统中使用电池供电的第二类型设备(即B类设备);第一设备根据第二设备的设备信息更新设备信息列表,该设备信息列表中记录有第一类型设备的设备信息和第二类型设备的设备信息;当第一设备接收到第三设备发送的第三设备的设备信息时,向第三设备发送更新后的该设备信息列表,第三设备为该信息同步系统中的第二类型设备。The first device receives the device information of the second device sent by the second device, and the second device is a battery-powered second type device (ie, type B device) in the information synchronization system; the first device is based on the device information of the second device Update the device information list. The device information of the first type of device and the device information of the second type of device are recorded in the device information list; when the first device receives the device information of the third device sent by the third device, the device information is sent to the third device. The device sends the updated device information list, and the third device is the second type device in the information synchronization system.
在一种可能的实现方式中,第一设备加入信息同步系统后,确定第一设备是否为该信息同步系统中的主设备,包括:第一设备加入信息同步系统后,根据主设备决策算法确定第一设备是否为该信息同步系统中的主设备。In a possible implementation manner, after the first device joins the information synchronization system, determining whether the first device is the master device in the information synchronization system includes: after the first device joins the information synchronization system, determining according to the master device decision algorithm Whether the first device is the master device in the information synchronization system.
在一种可能的实现方式中,若第一设备为主设备,则上述方法还包括:当第一设备接收到新设备加入、设备退出或主设备更新的消息时,重新确定第一设备是否为主设备。In a possible implementation manner, if the first device is the master device, the above method further includes: when the first device receives a new device joining, device exit, or master device update message, re-determining whether the first device is The main device.
在一种可能的实现方式中,若第一设备为该信息同步系统中的从设备,则该方法还包括:第一设备确定该信息同步系统中的主设备;当预设的第一定时器超时时,第一设备向确定出的主设备发送第一设备的设备信息,并从主设备中获取更新后的该设备信息列表。In a possible implementation, if the first device is a slave device in the information synchronization system, the method further includes: the first device determines the master device in the information synchronization system; when the preset first timer When the timeout expires, the first device sends the device information of the first device to the determined main device, and obtains the updated device information list from the main device.
第四方面,本申请的实施例提供一种多设备之间的信息同步方法,包括:第一设备加入信息同步系统后,确定该信息同步系统中是否包含使用外接电源供电的第一类 型设备(即A类设备),第一设备为使用电池供电的第二类型设备(即B类设备);若上述信息同步系统中包含第一类型设备,则:In a fourth aspect, an embodiment of the present application provides a method for information synchronization between multiple devices, including: after the first device joins the information synchronization system, determining whether the information synchronization system includes the first type of equipment powered by an external power supply ( That is, type A equipment), the first device is a second type of battery-powered equipment (ie, type B equipment); if the above-mentioned information synchronization system includes the first type of equipment, then:
第一设备在第一类型设备中确定该信息同步系统中的主设备为第二设备;第一设备启动预设的第一定时器;当第一定时器超时时,第一设备向第二设备发送第一设备的设备信息,并从第二设备中获取更新后的该设备信息列表,该设备信息列表中记录有第一类型设备的设备信息和第二类型设备的设备信息。The first device determines in the first type of device that the master device in the information synchronization system is the second device; the first device starts the preset first timer; when the first timer expires, the first device reports to the second device Send the device information of the first device, and obtain the updated device information list from the second device. The device information list records the device information of the first type of device and the device information of the second type of device.
在一种可能的实现方式中,第一设备在第一类型设备中确定该信息同步系统中的主设备为第二设备,包括:第一设备接收到第二设备发送的第一消息,第一消息用于指示该信息同步系统中的主设备为第二设备;第一设备响应于第一消息将第二设备确定为主设备;或者,若第一设备在该设备信息列表中查询到入网时间最早的第一类型设备为第二设备,则第一设备将第二设备确定为主设备。In a possible implementation manner, the first device determines in the first type device that the master device in the information synchronization system is the second device, including: the first device receives the first message sent by the second device, and the first device receives the first message sent by the second device. The message is used to indicate that the master device in the information synchronization system is the second device; the first device determines the second device as the master device in response to the first message; or, if the first device finds the network access time in the device information list The earliest device of the first type is the second device, and the first device determines the second device as the master device.
在一种可能的实现方式中,上述第一定时器的定时时长与该第一设备的心跳周期相同。In a possible implementation manner, the timing duration of the foregoing first timer is the same as the heartbeat period of the first device.
在一种可能的实现方式中,上述方法还包括:第一设备接收第三设备发送的主设备更新的消息,第三设备为第一类型设备;响应于该消息,第一设备将第三设备确定为新的主设备,并与第三设备建立网络连接。In a possible implementation manner, the above method further includes: the first device receives a master device update message sent by the third device, the third device is a first type device; in response to the message, the first device sends the third device Determine as the new master device, and establish a network connection with the third device.
在一种可能的实现方式中,上述方法还包括:当第一设备与第二设备之间的网络连接超时时,第一设备在除第二设备之外的第一类型设备中确定新的主设备。In a possible implementation manner, the above method further includes: when the network connection between the first device and the second device times out, the first device determines a new master among the first type devices except the second device. equipment.
在一种可能的实现方式中,若上述信息同步系统中不包含第一类型设备,则上述方法还包括:第一设备与其他第二类型设备组成环形网络,其中,第一设备在该环形网络中的上一节点为第四设备,第一设备在该环形网络中的下一节点为第五设备;第一设备接收第四设备发送的设备信息列表,该设备信息列表中记录有该信息同步系统中各个设备的设备信息;第一设备根据第一设备的设备信息更新该设备信息列表;第一设备向第五设备发送更新后的设备信息列表。In a possible implementation manner, if the above-mentioned information synchronization system does not include the first-type device, the above-mentioned method further includes: the first device and other second-type devices form a ring network, wherein the first device is in the ring network The previous node in the device is the fourth device, and the next node of the first device in the ring network is the fifth device; the first device receives the device information list sent by the fourth device, and the device information list records the information synchronization The device information of each device in the system; the first device updates the device information list according to the device information of the first device; the first device sends the updated device information list to the fifth device.
在一种可能的实现方式中,第一设备向第五设备发送更新后的设备信息列表,包括:当预设的第二定时器超时时,第一设备向第五设备发送更新后的设备信息列表。In a possible implementation manner, the first device sends the updated device information list to the fifth device, including: when a preset second timer expires, the first device sends the updated device information to the fifth device List.
在一种可能的实现方式中,该方法还包括:第一设备接收到第六设备加入该信息同步系统的消息;若第六设备为第二类型设备,则第一设备重新确定在该环形网络中第一设备的上一节点和下一节点,即一设备在环形网络中的位置。In a possible implementation, the method further includes: the first device receives a message that the sixth device joins the information synchronization system; if the sixth device is a second-type device, the first device re-determines that it is on the ring network The previous node and the next node of the first device in the middle, that is, the position of a device in the ring network.
第五方面,本申请提供一种电子设备,包括:一个或多个处理器、一个或多个存储器、以及一个或多个计算机程序;其中,处理器与触摸屏以及存储器均耦合,上述一个或多个计算机程序被存储在存储器中,当电子设备运行时,该处理器执行该存储器存储的一个或多个计算机程序,以使电子设备执行上述任一项所述的一种多设备之间的信息同步方法。In a fifth aspect, the present application provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein the processor is coupled with the touch screen and the memory, and the above one or more A computer program is stored in the memory, and when the electronic device is running, the processor executes one or more computer programs stored in the memory, so that the electronic device executes the information between multiple devices described in any one of the above Synchronization method.
第六方面,本申请提供一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如第一方面中任一项所述的一种多设备之间的信息同步方法。In a sixth aspect, the present application provides a computer storage medium, including computer instructions, which when the computer instructions run on an electronic device, cause the electronic device to execute the information between multiple devices as described in any one of the first aspect Synchronization method.
第七方面,本申请提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行如第一方面中任一项所述的一种多设备之间的信息同步方法。In a seventh aspect, the present application provides a computer program product, which when the computer program product runs on an electronic device, causes the electronic device to execute the method for information synchronization between multiple devices as described in any one of the first aspect.
可以理解地,上述提供的第三方面和第四方面所述的信息同步方法,第五方面所述的电子设备,第六方面所述的计算机存储介质,以及第七方面所述的计算机程序产品均应用于上文所提供的信息同步系统,因此,其所能达到的有益效果可参考上文所提供的信息同步中的有益效果,此处不再赘述。Understandably, the information synchronization method described in the third aspect and the fourth aspect provided above, the electronic device described in the fifth aspect, the computer storage medium described in the sixth aspect, and the computer program product described in the seventh aspect Both are applied to the information synchronization system provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the information synchronization provided above, which will not be repeated here.
附图说明Description of the drawings
图1为本申请实施例提供的一种多设备之间的信息同步系统的架构示意图一;FIG. 1 is a schematic diagram 1 of the architecture of an information synchronization system between multiple devices provided by an embodiment of this application;
图2为本申请实施例提供的一种电子设备的结构示意图一;FIG. 2 is a first structural diagram of an electronic device provided by an embodiment of this application;
图3为本申请实施例提供的一种多设备之间的信息同步系统的架构示意图二;3 is a schematic diagram 2 of the architecture of an information synchronization system between multiple devices provided by an embodiment of the application;
图4为本申请实施例提供的一种多设备之间的信息同步方法的流程示意图一;FIG. 4 is a first schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application;
图5为本申请实施例提供的一种多设备之间的信息同步方法的流程示意图二;FIG. 5 is a second schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application;
图6为本申请实施例提供的一种多设备之间的信息同步系统的架构示意图三;FIG. 6 is the third structural diagram of an information synchronization system between multiple devices according to an embodiment of the application;
图7为本申请实施例提供的一种多设备之间的信息同步方法的流程示意图三;FIG. 7 is a third schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application;
图8为本申请实施例提供的一种多设备之间的信息同步系统的架构示意图四;FIG. 8 is a fourth schematic structural diagram of an information synchronization system between multiple devices provided by an embodiment of this application;
图9为本申请实施例提供的一种多设备之间的信息同步系统的架构示意图五;FIG. 9 is a schematic structural diagram 5 of an information synchronization system between multiple devices provided by an embodiment of this application;
图10为本申请实施例提供的一种多设备之间的信息同步系统的架构示意图六;FIG. 10 is a sixth structural diagram of an information synchronization system between multiple devices provided by an embodiment of this application;
图11为本申请实施例提供的一种多设备之间的信息同步系统的架构示意图七;11 is a schematic diagram 7 of the architecture of an information synchronization system between multiple devices according to an embodiment of the application;
图12为本申请实施例提供的一种多设备之间的信息同步系统的架构示意图八;FIG. 12 is an eighth schematic diagram of the architecture of an information synchronization system between multiple devices according to an embodiment of this application;
图13为本申请实施例提供的一种多设备之间的信息同步方法的流程示意图四;FIG. 13 is a fourth schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application;
图14为本申请实施例提供的一种多设备之间的信息同步方法的流程示意图五;FIG. 14 is a fifth schematic flowchart of a method for information synchronization between multiple devices according to an embodiment of this application;
图15为本申请实施例提供的一种多设备之间的信息同步方法的流程示意图六;FIG. 15 is a sixth flowchart of a method for information synchronization between multiple devices according to an embodiment of this application;
图16为本申请实施例提供的一种电子设备的结构示意图二。FIG. 16 is a second structural diagram of an electronic device provided by an embodiment of this application.
具体实施方式Detailed ways
下面将结合附图对本实施例的实施方式进行详细描述。The implementation of this embodiment will be described in detail below in conjunction with the accompanying drawings.
本申请实施例提供的一种多设备之间的信息同步方法,可应用于图1所示的一个设备组200中,该设备组200内的各个电子设备100之间均可以互相通信。设备组200也可称为信息同步系统。例如,电子设备100之间可以通过局域网(local area network,LAN)或广域网(wide area network,WAN)进行通信。The method for information synchronization between multiple devices provided by the embodiment of the present application can be applied to a device group 200 shown in FIG. 1, and each electronic device 100 in the device group 200 can communicate with each other. The device group 200 may also be referred to as an information synchronization system. For example, the electronic devices 100 may communicate with each other through a local area network (LAN) or a wide area network (WAN).
示例性的,用户可通过手机、平板电脑、智能音箱、智能手表以及笔记本电脑使用同一用户账号登录应用服务器。此时,该手机、平板电脑、智能音箱以及笔记本电脑组成了设备组200,设备组200内的各个电子设备100之间均可以通过应用服务器互相通信。Exemplarily, the user can log in to the application server using the same user account through a mobile phone, a tablet computer, a smart speaker, a smart watch, and a laptop computer. At this time, the mobile phone, tablet computer, smart speaker, and notebook computer form the device group 200, and each electronic device 100 in the device group 200 can communicate with each other through an application server.
又例如,电子设备100之间也可以通过Wi-Fi连接或蓝牙连接等短距离通信连接组成设备组200。例如,用户可将手机、平板电脑、智能音箱以及笔记本电脑均加入名称为“1234”的Wi-Fi网络。该Wi-Fi网络内的各个电子设备100形成了一个局域网,该局域网内的所有设备组成了设备组200。For another example, the electronic devices 100 may also form the device group 200 through short-distance communication connections such as Wi-Fi connections or Bluetooth connections. For example, users can add mobile phones, tablets, smart speakers, and laptops to the Wi-Fi network named "1234". Each electronic device 100 in the Wi-Fi network forms a local area network, and all the devices in the local area network form a device group 200.
当然,设备组200内的各电子设备100之间还可以通过转接设备(例如,USB数据线或Dock设备)互联,从而实现设备组200内各个电子设备100之间的通信功能,本申请实施例对此不作任何限制。Of course, the electronic devices 100 in the device group 200 can also be interconnected through a switching device (for example, a USB data cable or a Dock device), so as to realize the communication function between the electronic devices 100 in the device group 200. The implementation of this application The example does not make any restrictions on this.
在本申请实施例中,可预先对设备组200中的各个电子设备100进行分类。In the embodiment of the present application, each electronic device 100 in the device group 200 may be classified in advance.
示例性的,可将连接有外接电源且具有一定计算能力的电子设备100称为A类设备。例如,A类设备可以包括电视、路由器、台式计算机、音箱等。这类设备在工作时可通过插头、数据线等使用外接电源获取电能,因此,A类设备接入外接电源后可一直处于待机状态,用户对A类设备的功耗一般不做特殊要求。Exemplarily, the electronic device 100 that is connected to an external power source and has a certain computing capability may be referred to as a class A device. For example, Class A devices may include TVs, routers, desktop computers, speakers, and so on. This type of equipment can use an external power supply to obtain power through plugs, data cables, etc. during work. Therefore, Class A equipment can always be in a standby state after being connected to an external power supply. Users generally do not make special requirements for the power consumption of Class A equipment.
示例性的,可将使用电池且具有一定计算能力的电子设备100称为B类设备。例如,B类设备可以包括手机、平板电脑、笔记本电脑等。这类设备在工作时需要使用电池向设备自身供电。以手机为B类设备举例,手机息屏后可进入待机状态,当手机需要与其他电子设备交互时,需要先唤醒手机的处理器(例如CPU)及相关通信模块(例如Wi-Fi芯片)。当处理器或通信模块的唤醒次数较多时,会增加手机的功耗从而缩短待机时间。因此,用户在使用B类设备时一般希望B类设备的功耗越小越好。Exemplarily, the electronic device 100 that uses a battery and has a certain computing capability may be referred to as a type B device. For example, Class B devices can include mobile phones, tablets, laptops, and so on. This type of equipment needs to use a battery to power the equipment itself when it is working. Taking a mobile phone as an example of a Class B device, the mobile phone can enter the standby state after the screen is off. When the mobile phone needs to interact with other electronic devices, it needs to wake up the mobile phone's processor (such as CPU) and related communication modules (such as Wi-Fi chip). When the processor or communication module wakes up more frequently, it will increase the power consumption of the mobile phone and shorten the standby time. Therefore, when users use Class B equipment, they generally hope that the power consumption of Class B equipment is as small as possible.
示例性的,可将计算能力较弱的电子设备100称为C类设备。例如,C类设备可以包括空调、冰箱、智能灯泡、可穿戴设备(例如智能手表、智能手环、智能眼镜等)等。由于C类设备的计算能力较弱,这类设备一般作为被控设备与对应的A类设备、B类设备或服务器等主控设备绑定。用户可通过主控设备控制对应的C类设备,C类设备在工作时因为设备交互产生的功耗一般较小。Exemplarily, the electronic device 100 with weak computing capability may be referred to as a Class C device. For example, Class C devices may include air conditioners, refrigerators, smart light bulbs, wearable devices (such as smart watches, smart bracelets, smart glasses, etc.). Due to the weak computing power of Class C devices, such devices are generally used as controlled devices to be bound to corresponding main control devices such as Class A devices, Class B devices, or servers. The user can control the corresponding Class C device through the main control device. The power consumption of the Class C device due to device interaction is generally small when it is working.
需要说明的是,也可将上述A类设备称为第一类型设备,将B类设备称为第二类型设备,将C类设备称为第三类型设备;或者,将B类设备称为第一类型设备,将C类设备称为第二类型设备,即A类设备、B类设备以及C类设备分别为三种类型的电子设备。It should be noted that the above-mentioned type A equipment can also be referred to as the first type equipment, the B type equipment is referred to as the second type equipment, and the C equipment is referred to as the third type equipment; or, the B type equipment is referred to as the first type equipment. The first type of equipment, the C equipment is called the second type of equipment, that is, the A equipment, the B equipment, and the C equipment are three types of electronic equipment.
在每个电子设备100出厂前,可预先在电子设备100的配置文件中设置对应的标志位用于指示电子设备100自身的设备类型,后续实施例中可将该标志位称为设备标签。例如,当该设备标签为00时,说明电子设备100为A类设备;当该设备标签为01时,说明电子设备100为B类设备;当设备标签为11时,说明电子设备100为C类设备。这样,电子设备100在工作过程中通过读取自身的设备标签可以获知自身的设备类型。并且,电子设备100也可以接收其他设备发来的设备标签,从而获知其他设备的设备类型。Before each electronic device 100 leaves the factory, a corresponding flag bit can be set in the configuration file of the electronic device 100 in advance to indicate the device type of the electronic device 100. In subsequent embodiments, the flag bit can be referred to as a device tag. For example, when the device label is 00, it means that the electronic device 100 is a class A device; when the device label is 01, it means that the electronic device 100 is a class B device; when the device label is 11, it means that the electronic device 100 is class C equipment. In this way, the electronic device 100 can learn its own device type by reading its own device tag in the working process. In addition, the electronic device 100 may also receive device tags sent by other devices, so as to learn the device types of other devices.
或者,电子设备100的设备类型也可以是动态变化的。例如,当手机使用电池向自身供电时,可将其设备标签设置为B类设备。如果检测到手机通过充电器与外接电源连接,则手机可将其标签设置为A类设备。如果检测到手机的电量低于阈值或手机进入低电量保护模式,则手机可将其标签设置为C类设备。又例如,当电子设备100需要更新时可以从服务器获取对应的固件或补丁等更新文件,该更新文件中还可以包括为电子设备100最新设置的设备类型。这样,电子设备100获取到更新文件进行设备更新时,可根据更新文件中最新设置的设备类型更新自身的设备标签。Alternatively, the device type of the electronic device 100 may also be dynamically changed. For example, when a mobile phone uses a battery to power itself, its device tag can be set as a Class B device. If it is detected that the mobile phone is connected to an external power source through the charger, the mobile phone can set its label as a Class A device. If it is detected that the battery level of the mobile phone is lower than the threshold or the mobile phone enters the low battery protection mode, the mobile phone can set its label as a Class C device. For another example, when the electronic device 100 needs to be updated, the corresponding firmware or patch update file may be obtained from the server, and the update file may also include the device type newly set for the electronic device 100. In this way, when the electronic device 100 obtains the update file for device update, it can update its own device label according to the newly set device type in the update file.
在本申请实施例中,设备组200中的每个电子设备100中可存储一份设备信息列表。该设备信息列表中包括各个电子设备100的设备信息。例如,该设备信息可以包括设备名称、设备类型、设备型号、IP(internet protocol,互联网协议)地址、MAC(media access control,媒体访问控制)地址、设备提供的服务、自定义的业务信息等。示例性的,电子设备A中存储的设备信息列表如表1所示,电子设备A通过该设备信 息列表可查询到设备组200中某一电子设备的具体名称、类型、提供的服务以及最近的唤醒时间等设备状态。也就是说,每个电子设备通过自身存储的设备信息列表可以获知设备组200中各个电子设备100的设备状态。In the embodiment of the present application, each electronic device 100 in the device group 200 may store a device information list. The device information list includes device information of each electronic device 100. For example, the device information may include the device name, device type, device model, IP (internet protocol) address, MAC (media access control) address, services provided by the device, customized business information, etc. Exemplarily, the device information list stored in the electronic device A is shown in Table 1. Through the device information list, the electronic device A can query the specific name, type, service provided, and recent information of an electronic device in the device group 200. Device status such as wake-up time. In other words, each electronic device can learn the device status of each electronic device 100 in the device group 200 through the device information list stored by itself.
表1Table 1
Figure PCTCN2020116005-appb-000001
Figure PCTCN2020116005-appb-000001
另外,设备组200中的每个电子设备100可定期更新各自存储的设备信息列表。例如,设备组200中的每个电子设备100可周期性的向其他电子设备发送包含自身设备信息的组播。每个电子设备接收到其他电子设备发来的设备信息后,可在自身存储的设备信息列表中更新对应电子设备的设备状态。这样,每个电子设备通过自身存储的设备信息列表可以获知设备组200中各个电子设备100最新的设备状态。In addition, each electronic device 100 in the device group 200 may periodically update its stored device information list. For example, each electronic device 100 in the device group 200 may periodically send a multicast containing its own device information to other electronic devices. After each electronic device receives the device information sent by other electronic devices, it can update the device status of the corresponding electronic device in its stored device information list. In this way, each electronic device can learn the latest device status of each electronic device 100 in the device group 200 through the device information list stored in itself.
那么,当设备组200内需要多个电子设备100进行协同工作时,参与协同工作的电子设备可根据最近更新的设备信息列表快速查询到其他电子设备的设备状态,进而根据参与协同工作的多个电子设备的设备状态快速完成本次协同任务。Then, when multiple electronic devices 100 in the device group 200 need to work collaboratively, the electronic devices participating in the collaborative work can quickly query the device status of other electronic devices according to the recently updated device information list, and then according to the multiple electronic devices participating in the collaborative work. The equipment status of the electronic equipment quickly completes this collaborative task.
例如,当用户说出“小艺小艺”的唤醒词后,音箱1检测到用户说出该唤醒词后可通过表1查询到手机1也提供语音功能,且手机1最近一次的唤醒时间已超过24小时。同样,手机1检测到用户说出该唤醒词后可通过表1查询到音箱1也提供语音功能,且音箱1最近一次的唤醒时间为13:05:47。如果预设的唤醒策略为最近一次被唤醒的电子设备优先响应用户的唤醒词,则音箱1根据手机1的最近唤醒时间可确定本次由音箱1(即自身)应答用户说出的唤醒词,同时手机1也可根据音箱1的最近唤醒时间确定手机1无需应答用户本次说出的唤醒词。进而,音箱1可打开相应的语音功能应答用户说出的“小艺小艺”这一唤醒词,音箱1和手机1也结束了本次的协同工作任务。For example, when the user utters the wake-up word of "Xiaoyi Xiaoyi", speaker 1 detects that the user utters the wake-up word and can find out from Table 1 that mobile phone 1 also provides voice functions, and the last wake-up time of mobile phone 1 has been More than 24 hours. Similarly, after the mobile phone 1 detects that the user utters the wake-up word, it can be queried from Table 1 that the speaker 1 also provides a voice function, and the last wake-up time of the speaker 1 is 13:05:47. If the preset wake-up strategy is that the most recently awakened electronic device responds to the user's wake-up word first, then speaker 1 can determine that speaker 1 (ie itself) responds to the user's wake-up word this time according to the latest wake-up time of mobile phone 1. At the same time, the mobile phone 1 can also determine according to the recent wake-up time of the speaker 1 that the mobile phone 1 does not need to answer the wake-up word spoken by the user this time. Furthermore, the speaker 1 can turn on the corresponding voice function to answer the wake-up word "Xiaoyi Xiaoyi" spoken by the user, and the speaker 1 and the mobile phone 1 also end this collaborative work task.
可以看出,由于设备组200的每个电子设备100中均存储有其他电子设备最新的设备状态,因此,当多个电子设备需要完成一次协同工作任务时,参与协同工作的各个电子设备可以根据最新的设备信息列表快速查询到其他电子设备的设备状态,进而根据其他电子设备的设备状态快速完成本次协同任务,降低了多个设备协同工作时的耗时。It can be seen that since each electronic device 100 of the device group 200 stores the latest device status of other electronic devices, when multiple electronic devices need to complete a collaborative work task, each electronic device participating in the collaborative work can be based on The latest device information list can quickly query the device status of other electronic devices, and then quickly complete the collaborative task according to the device status of other electronic devices, which reduces the time consumption of multiple devices working together.
同时,由于每个电子设备通过上述设备信息列表可以快速查询到其他电子设备的设备状态,因此,在多设备协同工作时电子设备之间进行数据交互的次数减少,对于上述B类设备而言,B类设备从待机状态被唤醒或进行数据交互的次数也相应减少,从而可降低B类设备的功耗,延长B类设备的待机时间。At the same time, since each electronic device can quickly query the device status of other electronic devices through the above device information list, the number of data interactions between electronic devices is reduced when multiple devices work together. For the above-mentioned Class B devices, The number of times that Class B devices are awakened from standby or performing data interactions is also reduced, thereby reducing the power consumption of Class B devices and extending the standby time of Class B devices.
其中,上述设备组200中电子设备更新上述设备信息列表的方法,以及设备组200中A类设备、B类设备以及C类设备的具体工作模式将在后续实施例中详细阐述,故此处不予赘述。Wherein, the method for updating the above device information list by the electronic device in the device group 200, and the specific working modes of the A device, the B device, and the C device in the device group 200 will be described in detail in the subsequent embodiments, so it will not be described here. Go into details.
示例性的,上述设备组200中的电子设备100具体可以是手机、平板电脑、桌面型、膝上型、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、手持计算机、上网本、个人数字助理(personal digital assistant,PDA)、可穿戴电子设备、车载设备、虚拟现实设备等,本申请实施例对此不做任何限制。Exemplarily, the electronic device 100 in the above device group 200 may specifically be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, Personal digital assistants (personal digital assistants, PDAs), wearable electronic devices, in-vehicle devices, virtual reality devices, etc., are not limited in the embodiments of the present application.
以手机为上述电子设备100举例,图2示出了手机的结构示意图。Taking a mobile phone as an example of the above-mentioned electronic device 100, FIG. 2 shows a schematic structural diagram of the mobile phone.
手机可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,摄像头193以及显示屏194等。The mobile phone 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, and mobile The communication module 150, the wireless communication module 160, the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, the sensor module 180, the camera 193, the display screen 194 and so on.
可以理解的是,本申请实施例示意的结构并不构成对手机的具体限定。在本申请另一些实施例中,手机可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the mobile phone. In other embodiments of the present application, the mobile phone may include more or fewer components than those shown in the figure, or combine certain components, or split certain components, or arrange different components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。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), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait. Among them, the different processing units may be independent devices or integrated in one or more processors.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that the processor 110 has just used or used cyclically. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过手机的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is used to receive charging input from the charger. Among them, the charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive the charging input of the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 may receive the wireless charging input through the wireless charging coil of the mobile phone. While the charging management module 140 charges the battery 142, it can also supply power to the electronic device through the power management module 141.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used to connect 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 charge management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
手机的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the mobile phone can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。手机中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna can be used in combination with a tuning switch.
移动通信模块150可以提供应用在手机上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G, etc., which are applied to mobile phones. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
无线通信模块160可以提供应用在手机上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on mobile phones including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), and global navigation satellite systems ( Global navigation satellite system, GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive the signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
在一些实施例中,手机的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得手机可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(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,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the mobile phone is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the mobile phone can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), broadband Code division multiple access (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 technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite-based augmentation systems (SBAS).
手机通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The mobile phone realizes the display function through GPU, display screen 194, and application processor. The GPU is an image processing microprocessor, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,手机可以包括1个或N个显示屏194,N为大于1的正整数。The display screen 194 is used to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can use liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). AMOLED, flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc. In some embodiments, the mobile phone may include one or N display screens 194, and N is a positive integer greater than one.
手机可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The mobile phone can realize the shooting function through ISP, camera 193, video codec, GPU, display 194 and application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye. ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193.
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,手机可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and is projected to the 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, and then transfers the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other formats of image signals. In some embodiments, the mobile phone may include one or N cameras 193, and N is a positive integer greater than one.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当手机在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the mobile phone selects the frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。手机可以支持一种或多种视频编解码器。这样,手机可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The phone can support one or more video codecs. In this way, mobile phones can play or record videos in a variety of encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the mobile phone. The external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save music, video and other files in an external memory card.
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行手机的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存 储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions. The processor 110 executes various functional applications and data processing of the mobile phone by running instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. Among them, the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function. The data storage area can store data (such as audio data, phone book, etc.) created during the use of the mobile phone. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
手机可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The mobile phone can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. For example, music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。The audio module 170 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be provided in the processor 110, or part of the functional modules of the audio module 170 may be provided in the processor 110.
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。手机可以通过扬声器170A收听音乐,或收听免提通话。The speaker 170A, also called "speaker", is used to convert audio electrical signals into sound signals. The mobile phone can listen to music through the speaker 170A, or listen to a hands-free call.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。当手机接听电话或语音信息时,可以通过将受话器170B靠近人耳接听语音。The receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the mobile phone answers a call or voice message, the voice can be heard by bringing the receiver 170B close to the human ear.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风170C发声,将声音信号输入到麦克风170C。手机可以设置至少一个麦克风170C。在另一些实施例中,手机可以设置两个麦克风170C,除了采集声音信号,还可以实现降噪功能。在另一些实施例中,手机还可以设置三个,四个或更多麦克风170C,实现采集声音信号,降噪,还可以识别声音来源,实现定向录音功能等。The microphone 170C, also called "microphone", "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by approaching the microphone 170C through the human mouth, and input the sound signal into the microphone 170C. The mobile phone can be equipped with at least one microphone 170C. In other embodiments, the mobile phone can be equipped with two microphones 170C, in addition to collecting sound signals, it can also achieve a noise reduction function. In other embodiments, the mobile phone can also be equipped with three, four or more microphones 170C to collect sound signals, reduce noise, identify sound sources, and realize directional recording functions.
耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The earphone interface 170D is used to connect wired earphones. The earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, and a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
当然,上述手机还可以包括按键、马达、指示器以及SIM卡接口等一项或多项器件,本申请实施例对此不做任何限制。Of course, the above-mentioned mobile phone may also include one or more devices such as buttons, motors, indicators, and SIM card interfaces, which are not limited in the embodiment of the present application.
以下将结合附图详细阐述本申请实施例提供的一种多设备之间的信息同步方法。In the following, a method for information synchronization between multiple devices provided by an embodiment of the present application will be described in detail with reference to the accompanying drawings.
示例性的,当用户将某一电子设备添加至上述设备组200时,该电子设备可根据自身存储的设备标签确定其设备类型具体为上述A类设备、B类设备或C类设备,进而,电子设备可进入不同的工作模式开始工作。例如,如果电子设备为A类设备,则该电子设备可自动进入预设的工作模式A;如果电子设备为B类设备,则该电子设备可自动进入预设的工作模式B;如果电子设备为C类设备,则该电子设备可自动进入预设的工作模式C。Exemplarily, when a user adds an electronic device to the above-mentioned device group 200, the electronic device may determine that its device type is specifically the above-mentioned type A device, type B device or type C device according to the device tag stored in itself, and further, The electronic device can enter different working modes to start working. For example, if the electronic device is a class A device, the electronic device can automatically enter the preset working mode A; if the electronic device is a class B device, the electronic device can automatically enter the preset working mode B; if the electronic device is C equipment, the electronic equipment can automatically enter the preset working mode C.
需要说明的是,上述工作模式(例如,上述工作模式A、工作模式B、工作模式C以及后续实施例中的工作模式B1、工作模式B2、主设备工作模式或从设备工作模式)是电子设备工作时的一系列工作步骤和工作机制的总称,电子设备在实际运行过程中可以不需要执行进入某一工作模式的具体步骤。又或者,以电子设备为A类设备举例,电子设备开始工作时可将预先设置的工作状态的变量设置为01,用于指示电子 设备当前的工作模式为工作模式A。此时,电子设备将上述工作状态的变量设置为01的步骤可认为是电子设备进入工作模式A的步骤。It should be noted that the above-mentioned working modes (for example, working mode A, working mode B, working mode C above and working mode B1, working mode B2, master working mode or slave working mode in the subsequent embodiments) are electronic devices A general term for a series of working steps and working mechanisms during work. Electronic equipment may not need to perform specific steps to enter a certain working mode during actual operation. Or, taking the electronic device as an example of a class A device, the preset working state variable can be set to 01 when the electronic device starts working, which is used to indicate that the current working mode of the electronic device is working mode A. At this time, the step in which the electronic device sets the above-mentioned working state variable to 01 can be regarded as a step in which the electronic device enters the working mode A.
以用户家中Wi-Fi网络内的各个电子设备组成上述设备组200举例,如图3所示,电子设备1加入该Wi-Fi网络后,可通过DNS(domain name system,域名系统)组播的方式向Wi-Fi网络中的各个电子设备发送第一消息。第一消息中包括电子设备1的入网时间以及设备信息。其中,电子设备1的入网时间是指电子设备1接入上述Wi-Fi网络的时间,电子设备1的设备信息可以包括电子设备1的设备名称、设备类型、设备型号、IP地址、MAC地址、设备提供的服务、自定义的业务信息等设备状态。Taking each electronic device in the Wi-Fi network of a user’s home to form the above device group 200 as an example, as shown in Figure 3, after the electronic device 1 joins the Wi-Fi network, it can be multicast through DNS (domain name system, domain name system) The first message is sent to each electronic device in the Wi-Fi network. The first message includes the network access time of the electronic device 1 and the device information. Wherein, the network access time of electronic device 1 refers to the time when electronic device 1 accesses the aforementioned Wi-Fi network. The device information of electronic device 1 may include the device name, device type, device model, IP address, MAC address, The status of the device such as the services provided by the device and the customized business information.
Wi-Fi网络中的每个电子设备接收到新加入的电子设备1发来的第一消息后,可响应该第一消息向电子设备1发送第二消息。第二消息中包括发送该第二消息的电子设备的入网时间以及设备信息。这样,电子设备1加入该Wi-Fi网络后可接收到已加入该Wi-Fi网络的每个电子设备发来的第二消息。示例性的,电子设备1接收到Wi-Fi网络中已加入该Wi-Fi网络的每个电子设备发来的第二消息后,可形成如表2所示的设备信息列表。电子设备1通过该设备信息列表可以查询到Wi-Fi网络中其他电子设备最近的具体设备状态。当然,表2所示的设备信息列表中也可以包括电子设备1的入网时间以及设备信息,本申请实施例对此不做任何限制。After each electronic device in the Wi-Fi network receives the first message sent by the newly added electronic device 1, it can send a second message to the electronic device 1 in response to the first message. The second message includes the network access time and device information of the electronic device that sent the second message. In this way, after the electronic device 1 joins the Wi-Fi network, it can receive the second message from each electronic device that has joined the Wi-Fi network. Exemplarily, after the electronic device 1 receives the second message from each electronic device in the Wi-Fi network that has joined the Wi-Fi network, it may form the device information list shown in Table 2. The electronic device 1 can query the recent specific device status of other electronic devices in the Wi-Fi network through the device information list. Of course, the device information list shown in Table 2 may also include the network access time and device information of the electronic device 1, which is not limited in the embodiment of the present application.
表2Table 2
Figure PCTCN2020116005-appb-000002
Figure PCTCN2020116005-appb-000002
电子设备1根据Wi-Fi网络中各个电子设备发来的第二消息生成上述设备信息列表后,电子设备1可根据自身的设备类型确定进入哪一种工作模式开始工作。例如,如果电子设备1中的设备标签指示电子设备1为A类设备(例如音箱、智能电视等),则电子设备1可进入预设的工作模式A;如果电子设备1中的设备标签指示电子设备1为B类设备(例如手机、平板电脑等),则电子设备1可进入预设的工作模式B;如果电子设备1中的设备标签指示电子设备1为C类设备(例如可穿戴设备、智能灯泡等),则电子设备1可进入预设的工作模式C。After the electronic device 1 generates the above-mentioned device information list according to the second message sent by each electronic device in the Wi-Fi network, the electronic device 1 can determine which working mode it enters to start working according to its own device type. For example, if the device label in the electronic device 1 indicates that the electronic device 1 is a class A device (such as a speaker, smart TV, etc.), the electronic device 1 can enter the preset working mode A; if the device label in the electronic device 1 indicates electronic Device 1 is a Class B device (such as a mobile phone, a tablet computer, etc.), then the electronic device 1 can enter the preset working mode B; if the device label in the electronic device 1 indicates that the electronic device 1 is a Class C device (such as a wearable device, Smart bulb, etc.), the electronic device 1 can enter the preset working mode C.
另外,上述工作模式B还可以包括工作模式B1和工作模式B2。也就是说,当电子设备1为B类设备时,电子设备1可在工作模式B1和工作模式B2这两种工作机制中选择一种。例如,当电子设备1确定自身为B类设备后,可以通过上述设备信息列表查询当前的Wi-Fi网络中是否存在A类设备。如果存在A类设备,则电子设备1可进入工作模式B1;如果不存在A类设备,则电子设备1可进入工作模式B2。In addition, the above-mentioned working mode B may also include working mode B1 and working mode B2. That is to say, when the electronic device 1 is a type B device, the electronic device 1 can choose one of the two working mechanisms of the working mode B1 and the working mode B2. For example, after the electronic device 1 determines that it is a Class B device, it can query whether there is a Class A device in the current Wi-Fi network through the above-mentioned device information list. If there is a class A device, the electronic device 1 can enter the working mode B1; if there is no class A device, the electronic device 1 can enter the working mode B2.
下面具体介绍A类设备的工作模式A:The following specifically introduces the working mode A of Class A equipment:
一般,工作在工作模式A下的A类设备主要用于接收Wi-Fi网络中其他设备定期 发送的设备信息,进而更新设备信息列表中对应设备的设备信息,使得A类设备中存储的设备信息列表中的各个设备信息处于最新的状态。另外,Wi-Fi网络中的其他设备还可以从A类设备中获取最新的设备信息列表,使得Wi-Fi网络中的每个设备均可获知其他设备最新的设备状态。Generally, a class A device working in working mode A is mainly used to receive device information periodically sent by other devices in the Wi-Fi network, and then update the device information of the corresponding device in the device information list, so that the device information stored in the class A device The information of each device in the list is in the latest state. In addition, other devices in the Wi-Fi network can also obtain the latest device information list from Class A devices, so that each device in the Wi-Fi network can learn the latest device status of other devices.
示例性的,在工作模式A下工作的A类设备可以等待B类设备主动上报其设备信息,并在其上报设备信息时向B类设备下发最新的设备信息列表,从而降低B类设备从待机状态被唤醒的次数,避免B类设备产生额外的功耗开销。Exemplarily, a class A device working in working mode A can wait for the class B device to actively report its device information, and when it reports the device information, it will issue the latest device information list to the class B device, thereby reducing the class B device’s slave status. The number of times that the standby state is awakened, to avoid the extra power consumption of Class B devices.
如图4所示,电子设备1进入工作模式A后,可根据预设的主设备(master)决策算法确定电子设备1当前是否为主设备(即S401)。如果在电子设备1加入Wi-Fi网络前,Wi-Fi网络内没有A类设备,则电子设备1进入工作模式A后可将自身确定为主设备。如果在电子设备1加入Wi-Fi网络前,Wi-Fi网络内有一个或多个A类设备,则电子设备1进入工作模式A后可与这一个或多个A类设备进行协商,以确定当前Wi-Fi网络内的主设备。As shown in FIG. 4, after the electronic device 1 enters the working mode A, it can determine whether the electronic device 1 is currently the master device according to a preset master decision algorithm (ie, S401). If there is no Class A device in the Wi-Fi network before the electronic device 1 joins the Wi-Fi network, the electronic device 1 can determine itself as the master device after entering the working mode A. If there are one or more Class A devices in the Wi-Fi network before the electronic device 1 joins the Wi-Fi network, the electronic device 1 can negotiate with the one or more Class A devices after entering the working mode A The main device in the current Wi-Fi network.
例如,上述主设备决策算法可以为:入网时间最早的A类设备为主设备。那么,电子设备1进入工作模式A后,可根据表2中记录的各个A类设备的入网时间以及自己的入网时间确定自己是否为入网最早的A类设备。如果电子设备1为入网最早的A类设备,则电子设备1可作为主设备进入主设备工作模式;如果电子设备1不是入网最早的A类设备,则电子设备1可作为从设备(slave)进入从设备工作模式。For example, the foregoing main device decision-making algorithm may be: the Class A device with the earliest network access time is the main device. Then, after the electronic device 1 enters the working mode A, it can determine whether it is the earliest type A device connected to the network according to the network access time of each type A device recorded in Table 2 and its own network access time. If the electronic device 1 is the earliest type A device connected to the network, then the electronic device 1 can enter the master device working mode as the master device; if the electronic device 1 is not the earliest type A device connected to the network, the electronic device 1 can enter the slave device (slave) Slave working mode.
又例如,上述主设备决策算法还可以为:将特定类型的设备优选为主设备。示例性的,可预先设置A类设备中不同类型设备之间的优先级顺序,例如,电视的优先级大于路由器的优先级,路由器的优先级大于智能音箱的优先级。那么,电子设备1进入工作模式A后,可根据表2中记录的各个A类设备的设备类型以及自身的设备类型确定自己是否为优先级最高的A类设备。如果电子设备1为优先级最高的A类设备,则电子设备1可作为主设备进入主设备工作模式;如果电子设备1不是优先级最高的A类设备,则电子设备1可作为从设备进入从设备工作模式。For another example, the aforementioned master device decision-making algorithm may also be: selecting a specific type of device as the master device. Exemplarily, the priority order between different types of devices in Class A devices can be preset. For example, the priority of the TV is greater than the priority of the router, and the priority of the router is greater than the priority of the smart speaker. Then, after the electronic device 1 enters the working mode A, it can determine whether it is the class A device with the highest priority according to the device type of each class A device recorded in Table 2 and its own device type. If the electronic device 1 is a class A device with the highest priority, then the electronic device 1 can enter the master working mode as the master device; if the electronic device 1 is not the class A device with the highest priority, then the electronic device 1 can enter the slave device as a slave device. Device working mode.
当然,上述主设备决策算法还可以为raft选举算法等决策算法,Wi-Fi网络中可以设置一个或多个主设备,本申请实施例对此不做任何限制。Of course, the above-mentioned main device decision algorithm may also be a decision algorithm such as a raft election algorithm. One or more main devices may be set in the Wi-Fi network, and the embodiment of the present application does not impose any limitation on this.
如图12中的(a)所示,Wi-Fi网络中A类设备1为唯一的主设备(master),该主设备用于维护Wi-Fi网络中所有电子设备的设备信息。Wi-Fi网络中的其他设备(例如,A类设备2、A类设备3、B类设备1、B类设备2以及C类设备1)均可作为从设备(slave)与这一个主设备建立连接,并由各个从设备向主设备上报自身的设备信息。并且,各个从设备也可从主设备中获取最新的设备信息列表。As shown in (a) of FIG. 12, the Class A device 1 in the Wi-Fi network is the only master device (master), and the master device is used to maintain the device information of all electronic devices in the Wi-Fi network. Other devices in the Wi-Fi network (for example, Class A device 2, Class A device 3, Class B device 1, Class B device 2, and Class C device 1) can be used as slave devices to establish with this master device Connect, and each slave device reports its own device information to the master device. In addition, each slave device can also obtain the latest device information list from the master device.
如图12中的(b)所示,Wi-Fi网络中包括A类设备1、A类设备2和A类设备3,其中,A类设备1、A类设备2和A类设备3均为主设备(master)。那么,A类设备1可分别与B类设备1和B类设备2建立连接,从而获取B类设备1和B类设备2的设备信息。此时,B类设备1和B类设备2为A类设备1的从设备(slave)。A类设备2可分别与C类设备1和B类设备3建立连接,从而获取C类设备1和B类设备3的设备信息。此时,C类设备1和B类设备3为A类设备1的从设备(slave)。As shown in Figure 12(b), the Wi-Fi network includes Class A device 1, Class A device 2 and Class A device 3. Among them, Class A device 1, Class A device 2 and Class A device 3 are all Master (master). Then, the class A device 1 can establish a connection with the class B device 1 and the class B device 2 respectively, so as to obtain the device information of the class B device 1 and the class B device 2. At this time, the type B device 1 and the type B device 2 are slaves of the type A device 1. The Class A device 2 can establish a connection with the Class C device 1 and the Class B device 3, respectively, so as to obtain the device information of the Class C device 1 and the Class B device 3. At this time, the C-type device 1 and the B-type device 3 are slaves of the A-type device 1.
并且,作为主设备的A类设备1、A类设备2以及A类设备3之间可互相连接。 这样,A类设备1至A类设备3之间可互相同步接收到的各个电子设备上报的设备信息,使得每个主设备中均可获取到Wi-Fi网络中所有电子设备最新的设备信息,形成最新的设备信息列表。In addition, the class A device 1, the class A device 2, and the class A device 3 as the master device can be connected to each other. In this way, Class A devices 1 to A device 3 can synchronize the received device information reported by each electronic device with each other, so that each main device can obtain the latest device information of all electronic devices in the Wi-Fi network. Form the latest equipment information list.
仍如图4所示,当电子设备1进入主设备工作模式后,电子设备1可通过DNS组播的方式向Wi-Fi网络中的其他电子设备发送用于指示主设备的消息(即S402),该消息中用于指示主设备的字段可以包含电子设备1的标识。其他电子设备接收到该消息后,可确定当前Wi-Fi网络中的主设备为电子设备1。As still shown in FIG. 4, when the electronic device 1 enters the main device working mode, the electronic device 1 can send a message indicating the main device to other electronic devices in the Wi-Fi network through DNS multicast (ie S402) , The field used to indicate the master device in the message may include the identification of the electronic device 1. After receiving the message, other electronic devices can determine that the main device in the current Wi-Fi network is electronic device 1.
例如,电子设备2接收到电子设备1发来的更新消息后,由于电子设备2中也存储有与上述表1或表2类似的设备信息列表,因此电子设备2可在存储的设备信息列表中将电子设备1标记为主设备。后续,电子设备2可作为从设备与电子设备1建立连接,并定期向电子设备1(即主设备)上报自己的设备信息。For example, after the electronic device 2 receives the update message from the electronic device 1, since the electronic device 2 also stores a device information list similar to the above-mentioned Table 1 or Table 2, the electronic device 2 can be in the stored device information list Mark the electronic device 1 as the main device. Subsequently, the electronic device 2 can be used as a slave device to establish a connection with the electronic device 1, and periodically report its own device information to the electronic device 1 (ie, the master device).
仍如图4所示,电子设备1在主设备工作模式下接收到其他电子设备(即从设备)发来的设备信息(即S403)后,可更新其设备信息列表中对应设备的设备信息,使得电子设备1中存储的设备信息列表处于最新的状态。并且,电子设备1接收到从设备发来的设备信息后,还可以将最新的设备信息列表发送给从设备(即S404),从设备接收到主设备发来的设备信息列表后可将已存储的设备信息列表删除,使得各个从设备中存储的设备信息列表与电子设备1中存储的设备信息列表同步,均处于最新的状态。As still shown in FIG. 4, the electronic device 1 can update the device information of the corresponding device in its device information list after receiving device information (ie S403) from other electronic devices (ie slave devices) in the master device working mode. The device information list stored in the electronic device 1 is kept in the latest state. In addition, after the electronic device 1 receives the device information sent from the slave device, it can also send the latest device information list to the slave device (ie S404). After the slave device receives the device information list sent by the master device, it can store the stored device information list. The device information list of is deleted, so that the device information list stored in each slave device is synchronized with the device information list stored in the electronic device 1, and they are all in the latest state.
仍如图4所示,如果电子设备1进入从设备工作模式,则电子设备1可启动预设的定时器T1(即S405)。当定时器T1超时时,电子设备1可作为从设备向当前的主设备发送自身最新的设备信息(即S406)。这样,主设备可更新其设备信息列表中对应的电子设备1的设备信息。并且,主设备可将最新的设备信息列表发送给电子设备1(即S407),使得电子设备1通过该设备信息列表可获知Wi-Fi网络内其他电子设备最新的设备状态。As still shown in FIG. 4, if the electronic device 1 enters the slave device working mode, the electronic device 1 can start the preset timer T1 (ie S405). When the timer T1 expires, the electronic device 1 can act as a slave device to send its latest device information to the current master device (ie S406). In this way, the master device can update the device information of the corresponding electronic device 1 in its device information list. In addition, the master device can send the latest device information list to the electronic device 1 (ie S407), so that the electronic device 1 can learn the latest device status of other electronic devices in the Wi-Fi network through the device information list.
在一些实施例中,当电子设备1作为从设备向主设备发送设备信息时,如果连续多次向主设备发送设备信息失败,则说明此时的主设备可能已经更换或下线,那么,电子设备1可重新确定当前Wi-Fi网络中的主设备,并向新的主设备发送自己的设备信息。In some embodiments, when the electronic device 1 serves as a slave device to send device information to the master device, if it fails to send device information to the master device multiple times in succession, it means that the master device may have been replaced or offline at this time, then the electronic device Device 1 can re-determine the main device in the current Wi-Fi network and send its own device information to the new main device.
在一些实施例中,当电子设备1进入从设备工作模式后,如果接收到其他从设备发来的设备信息,则说明该从设备可能将电子设备1错误的确定为主设备,那么,电子设备1可向该从设备发送当前主设备的标识,以告知该从设备当前正确的主设备。In some embodiments, after the electronic device 1 enters the slave device working mode, if it receives device information from other slave devices, it means that the slave device may incorrectly determine the electronic device 1 as the master device, then the electronic device 1 can send the current master device identification to the slave device to inform the slave device of the current correct master device.
另外,无论电子设备1进入主设备工作模式或从设备工作模式,如果电子设备1接收到Wi-Fi网络内有新设备加入、设备退出或主设备更新的消息,则电子设备1可重新确定当前Wi-Fi网络中的主设备,从而确定电子设备1此时需要进入主设备工作模式或从设备工作模式。In addition, regardless of whether the electronic device 1 enters the master device working mode or the slave device working mode, if the electronic device 1 receives a message that a new device joins, the device exits, or the master device is updated in the Wi-Fi network, the electronic device 1 can re-determine the current The master device in the Wi-Fi network determines that the electronic device 1 needs to enter the master device working mode or the slave device working mode at this time.
示例性的,当电子设备1为主设备时,如果接收到电子设备2退出Wi-Fi网络的消息,则电子设备1可根据预设的主设备决策算法确定此时新的主设备为电子设备3。那么,电子设备1可进入上述从设备工作模式,并断开与其他电子设备已建立的连接。例如,该连接可以是L3层的网络连接。并且,电子设备1可向其他A类设备发送消 息,以通知其他A类设备新的主设备为电子设备3。此时,电子设备1可以不向B类设备发送消息通知新的主设备。当B类设备主动向电子设备1发送自身的设备信息时,电子设备1可向B类设备通知新的主设备,以降低B类设备被A类设备主动唤醒而产生的功耗。Exemplarily, when the electronic device 1 is the master device, if it receives a message that the electronic device 2 exits the Wi-Fi network, the electronic device 1 can determine that the new master device is the electronic device at this time according to the preset master device decision algorithm 3. Then, the electronic device 1 can enter the above-mentioned slave device working mode and disconnect the established connection with other electronic devices. For example, the connection can be a network connection at the L3 layer. In addition, the electronic device 1 can send a message to other Class A devices to notify the other Class A devices that the new master device is the electronic device 3. At this time, the electronic device 1 may not send a message to the Class B device to notify the new master device. When the class B device actively sends its own device information to the electronic device 1, the electronic device 1 can notify the class B device of the new master device, so as to reduce the power consumption of the class B device being actively awakened by the class A device.
在一种具体的实现方式中,如图13所示,电子设备1进入工作模式A后,可查询是否有比自身的入网时间更早的A类设备(即S1301)。如果没有比自身的入网时间更早的A类设备,则电子设备1可进入主设备(master)工作模式;如果有比自身的入网时间更早的A类设备,则电子设备1可进入从设备(slave)工作模式。In a specific implementation manner, as shown in FIG. 13, after the electronic device 1 enters the working mode A, it can query whether there is a class A device that has an earlier network access time (that is, S1301). If there is no Class A device earlier than its own network access time, the electronic device 1 can enter the master working mode; if there is a Class A device earlier than its own network access time, then the electronic device 1 can enter the slave device (slave) working mode.
仍如图13所示,电子设备1进入master工作模式后,电子设备1可作为主设备通过DNS组播(即mDNS)的方式向Wi-Fi网络中的其他电子设备发送DNS广播以告知其他电子设备主设备更新为电子设备1。同时,电子设备1可等待Wi-Fi网络中的其他电子设备与自身建立L3层的网络连接(即S1302)。当电子设备1监听到从设备的连接请求后,可与对应的从设备建立L3层的网络连接。当电子设备1通过已建立的网络连接接收到从设备发来的设备信息后,可更新其设备信息列表中对应设备的设备信息(即S1303),使得设备信息列表处于最新的状态。并且,电子设备1可将更新后的设备信息列表保存在预设的家庭网络设备信息数据库中。As shown in Figure 13, after the electronic device 1 enters the master working mode, the electronic device 1 can be used as the master device to send DNS broadcasts to other electronic devices in the Wi-Fi network through DNS multicast (ie mDNS) to inform other electronic devices. The main device of the device is updated to electronic device 1. At the same time, the electronic device 1 can wait for other electronic devices in the Wi-Fi network to establish an L3 network connection with itself (ie S1302). After the electronic device 1 monitors the connection request from the slave device, it can establish an L3 layer network connection with the corresponding slave device. After the electronic device 1 receives the device information sent from the device through the established network connection, it can update the device information of the corresponding device in its device information list (ie S1303), so that the device information list is in the latest state. In addition, the electronic device 1 may save the updated device information list in a preset home network device information database.
另外,电子设备1进入master工作模式后,如果接收到其他设备发来的DNS组播,或接收到有从设备与自身断开网络连接的消息(即S1304),则电子设备1可重新确定自身是否仍然是当前Wi-Fi网络中的主设备(即S1305)。例如,如果电子设备1确定出有其他A类设备的入网时间早于自身的入网时间,则电子设备1可将入网时间最早的A类设备确定为Wi-Fi网络中最新的主设备(即S1306)。那么,电子设备1可向其他A类设备发送消息,从而向其他A类设备通知新的主设备(即S1307)。并且,电子设备1可断开与从设备建立的网络连接,进入slave工作模式。In addition, after the electronic device 1 enters the master working mode, if it receives DNS multicast from other devices, or receives a message that the slave device disconnects from the network (ie S1304), the electronic device 1 can re-determine itself Whether it is still the main device in the current Wi-Fi network (ie S1305). For example, if the electronic device 1 determines that there are other Class A devices whose access time is earlier than its own network access time, then the electronic device 1 can determine the Class A device with the earliest access time as the latest master device in the Wi-Fi network (i.e. S1306 ). Then, the electronic device 1 can send a message to other Class A devices, thereby notifying the other Class A devices of the new master device (ie S1307). In addition, the electronic device 1 can disconnect the network connection established with the slave device and enter the slave working mode.
仍如图13所示,电子设备1进入slave工作模式后,电子设备1可与确定出的主设备建立L3层的网络连接(即S1308)。进而,电子设备1可启动定时器(例如定时器T1)。当定时器T1超时时,电子设备1可作为从设备向当前的主设备发送自身最新的设备信息(即S1309)。如果连续多次(例如N0次)向主设备发送设备信息超时,则说明此时的主设备可能已经更换或下线,那么,电子设备1可重新确定当前Wi-Fi网络中的主设备(即S1310)。As shown in FIG. 13, after the electronic device 1 enters the slave working mode, the electronic device 1 can establish an L3 network connection with the determined master device (ie S1308). Furthermore, the electronic device 1 can start a timer (for example, the timer T1). When the timer T1 expires, the electronic device 1 can act as a slave device to send its latest device information to the current master device (ie S1309). If sending device information to the main device for multiple times (for example, N0 times) times out, it means that the main device may have been replaced or offline at this time. Then, the electronic device 1 can re-determine the main device (ie, the main device in the current Wi-Fi network). S1310).
另外,电子设备1进入slave工作模式后,如果接收到其他设备发来的DNS组播,或接收到有从设备与自身断开网络连接的消息(即S1311),则电子设备1可重新确定当前Wi-Fi网络中的主设备。如果当前Wi-Fi网络中的主设备发生变化,则电子设备1可与旧的主设备断开网络连接,并与新的主设备建立网络连接(即S1312)。In addition, after the electronic device 1 enters the slave working mode, if it receives DNS multicast from other devices, or receives a message that the slave device disconnects from the network (ie S1311), the electronic device 1 can re-determine the current The main device in the Wi-Fi network. If the main device in the current Wi-Fi network changes, the electronic device 1 can disconnect the network connection with the old main device and establish a network connection with the new main device (ie S1312).
下面具体介绍B类设备的工作模式B1:The following specifically introduces the working mode B1 of Class B equipment:
示例性的,工作在工作模式B1下的B类设备可定期向A类设备中的主设备发送自身的设备信息,同时从主设备中获取最新的设备信息列表,以便根据设备信息列表中各个设备的设备信息与Wi-Fi网络中的其他设备完成协同工作任务。Exemplarily, a Class B device working in the working mode B1 can periodically send its own device information to the main device in the Class A device, and at the same time obtain the latest device information list from the main device, so as to be based on each device in the device information list. The device information in the Wi-Fi network completes the collaborative work task with other devices in the Wi-Fi network.
示例性的,如图5所示,电子设备1进入工作模式B1后,电子设备1可确定当前Wi-Fi网络中的主设备,并与主设备建立连接(即S501)。Exemplarily, as shown in FIG. 5, after the electronic device 1 enters the working mode B1, the electronic device 1 can determine the main device in the current Wi-Fi network and establish a connection with the main device (ie S501).
例如,电子设备1可在自身存储的设备信息列表中查询是否有标记为主设备的A类设备。如果查询到标记为主设备的A类设备,则电子设备1可与该主设备建立连接。例如,该连接可以是L3层的网络连接。其中,L3层的网络连接具体可以是TCP(transmission control protocol,传输控制协议)连接或基于UDP(user datagram protocol,用户数据报协议)的网络连接,例如基于UDP的CoAP(constrained application protocol,受限应用程序协议)连接,本申请实施例对此不做任何限制。For example, the electronic device 1 can query whether there is a Class A device marked as the main device in the device information list stored in itself. If a Class A device marked as the main device is queried, the electronic device 1 can establish a connection with the main device. For example, the connection can be a network connection at the L3 layer. Among them, the network connection of the L3 layer can specifically be a TCP (transmission control protocol) connection or a UDP (user datagram protocol, user datagram protocol)-based network connection, such as UDP-based CoAP (constrained application protocol, restricted Application protocol) connection, the embodiment of this application does not impose any restriction on this.
又例如,如果电子设备1接收到其他设备发送的主设备的更新消息,则电子设备1可与更新后的主设备建立连接。又例如,电子设备1还可以将Wi-Fi网络中任意的一个A类设备确定为主设备。当电子设备1主动向确定出的主设备发送自身的设备信息时,如果接收电子设备1发送的设备信息的A类设备不是真正的主设备,则该A类设备此时可向B类设备通知新的主设备,以降低B类设备被A类设备主动唤醒而产生的功耗。For another example, if the electronic device 1 receives an update message of the master device sent by other devices, the electronic device 1 can establish a connection with the updated master device. For another example, the electronic device 1 may also determine any type A device in the Wi-Fi network as the master device. When the electronic device 1 actively sends its own device information to the determined main device, if the Class A device that receives the device information sent by the electronic device 1 is not the real main device, the Class A device can notify the Class B device at this time A new master device to reduce the power consumption of Class B devices being actively awakened by Class A devices.
仍如图5所示,确定出当前Wi-Fi网络中的主设备后,电子设备1可启动预设的定时器T2(即S502)。当定时器T2超时时,电子设备1可作为从设备向确定出的主设备发送自身最新的设备信息(即S503)。这样,主设备可更新其设备信息列表中对应的电子设备1的设备信息。并且,主设备可将最新的设备信息列表发送给电子设备1(即S504),使得电子设备1通过该设备信息列表可获知Wi-Fi网络内各个电子设备最新的设备状态。Still as shown in FIG. 5, after determining the main device in the current Wi-Fi network, the electronic device 1 can start the preset timer T2 (ie S502). When the timer T2 expires, the electronic device 1 can act as a slave device to send its own latest device information to the determined master device (ie S503). In this way, the master device can update the device information of the corresponding electronic device 1 in its device information list. In addition, the master device can send the latest device information list to the electronic device 1 (ie S504), so that the electronic device 1 can learn the latest device status of each electronic device in the Wi-Fi network through the device information list.
示例性的,对于设备信息更新较快的B类设备,可设置较短的定时器T2的定时时长;对于设备信息更新较慢的B类设备,可设置较长的定时器T2的定时时长。这样可以在保证B类设备的设备信息及时更新的同时尽可能的减少B类设备的唤醒次数,从而降低B类设备的功耗。Exemplarily, for a type B device with a faster update of device information, a shorter timing duration of the timer T2 can be set; for a type B device with a slower update of device information, a longer timing duration of the timer T2 can be set. In this way, it is possible to reduce the number of wake-ups of the type B equipment as much as possible while ensuring that the device information of the type B equipment is updated in time, thereby reducing the power consumption of the type B equipment.
又或者,由于B类设备(例如手机、平板电脑)会定期向PUSH消息服务器发送心跳报文。那么,可设置定时器T2的定时时长与B类设备发送心跳报文的周期同步。这样,B类设备每次被唤醒向PUSH消息服务器发送心跳报文的同时,可向主设备发送自身最新的设备信息,从而减少了额外唤醒B类设备的次数,降低了B类设备的功耗。其中,B类设备向PUSH消息服务器发送心跳报文的定时器与B类设备向主设备发送自身最新的设备信息的定时器可以是一个。Or, because Class B devices (such as mobile phones, tablet computers) regularly send heartbeat messages to the PUSH message server. Then, the timing duration of the timer T2 can be set to be synchronized with the period of the heartbeat message sent by the Class B device. In this way, each time a Class B device is awakened and sends a heartbeat message to the PUSH message server, it can also send its own latest device information to the master device, thereby reducing the number of additional wake-ups of Class B devices and reducing the power consumption of Class B devices . Among them, the timer for the type B device to send a heartbeat message to the PUSH message server and the timer for the type B device to send its own latest device information to the master device may be one.
可以看出,B类设备在工作模式B1下很少会接收到其他设备发来的消息唤醒B类设备,并且,B类设备在工作模式B1下会主动的定期向主设备上报设备信息并同步设备信息列表,这使得B类设备被唤醒的次数相对稳定,从而使得B类设备的功耗较为稳定可控,不会随着Wi-Fi网络中设备数量的增加而增加。It can be seen that in working mode B1, Class B devices rarely receive messages from other devices to wake up Class B devices, and in working mode B1, Class B devices will actively report device information to the master device and synchronize periodically. Device information list, which makes the number of times that Class B devices are awakened relatively stable, so that the power consumption of Class B devices is more stable and controllable, and will not increase with the increase in the number of devices in the Wi-Fi network.
另外,B类设备在工作模式B1下如果连续多次向主设备发送设备信息失败,说明此时的主设备可能已经更换或下线,那么,电子设备1可重新确定当前Wi-Fi网络中的主设备,并向新的主设备发送自己的设备信息。如果当前Wi-Fi网络中没有A类设备,则电子设备1可进入工作模式B2。In addition, if a Class B device fails to send device information to the main device multiple times in working mode B1, it means that the main device may have been replaced or offline at this time. Then, the electronic device 1 can re-determine the current Wi-Fi network The master device, and send its own device information to the new master device. If there is no Class A device in the current Wi-Fi network, the electronic device 1 can enter the working mode B2.
在一种具体的实现方式中,如图14所示,电子设备1进入工作模式B1后,电子设备1可从Wi-Fi网络的A类设备中确定一个的主设备,并与主设备建立L3层网络连接(即S1401)。当然,如果电子设备1接收到主设备更新的消息,则电子设备1 可断开与当前主设备的网络连接,并与新的主设备建立L3层网络连接(即S1402)。确定主设备后,电子设备1可启动预设的定时器(例如定时器T2)。当定时器T2超时时,电子设备1可作为从设备向确定出的主设备发送自身最新的设备信息(即S1403)。同时,电子设备1可从主设备的家庭网络设备信息数据库中同步最新的设备信息列表(S1404)。In a specific implementation, as shown in FIG. 14, after the electronic device 1 enters the working mode B1, the electronic device 1 can determine a master device from the Class A devices of the Wi-Fi network, and establish an L3 with the master device. Layer network connection (ie S1401). Of course, if the electronic device 1 receives the update message of the master device, the electronic device 1 can disconnect the network connection with the current master device and establish an L3 network connection with the new master device (ie S1402). After determining the master device, the electronic device 1 can start a preset timer (for example, timer T2). When the timer T2 expires, the electronic device 1 can act as a slave device to send its latest device information to the determined master device (ie S1403). At the same time, the electronic device 1 can synchronize the latest device information list from the home network device information database of the master device (S1404).
如果电子设备1与主设备之间的网络连接超时(即S1405),说明此时的主设备可能已经更换或下线,那么,电子设备1可在A类设备中重新确定当前Wi-Fi网络中的主设备(即回到S1401),与新的主设备建立网络连接。如果当前Wi-Fi网络中没有A类设备,则电子设备1可进入工作模式B2。If the network connection between the electronic device 1 and the main device times out (ie S1405), it means that the main device may have been replaced or offline at this time. Then, the electronic device 1 can re-determine the current Wi-Fi network in the Class A device The main device (that is, back to S1401), establish a network connection with the new main device. If there is no Class A device in the current Wi-Fi network, the electronic device 1 can enter the working mode B2.
下面具体介绍B类设备的工作模式B2:The following specifically introduces the working mode B2 of Class B equipment:
由于在工作模式B2中不存在A类设备,因此,在工作模式B2中不存在主设备。进入工作模式B2的多个B类设备可按照预设的组网算法组成一个环形网络。Since there is no class A device in the working mode B2, there is no master device in the working mode B2. Multiple Class B devices entering working mode B2 can form a ring network according to a preset networking algorithm.
如图6所示,B类设备1至B类设备3组成了一个环形网络,每个B类设备可以控制一个或多个C类设备。环形网络中每个节点上的B类设备可定期接收到上一节点的B类设备发送的更新后的设备信息列表,并且,每个节点的B类设备可定期向下一节点的B类设备发送更新后的设备信息列表。As shown in Figure 6, Class B devices 1 to B devices 3 form a ring network, and each Class B device can control one or more Class C devices. The Class B equipment on each node in the ring network can periodically receive the updated device information list sent by the Class B equipment of the previous node, and the Class B equipment of each node can periodically receive the Class B equipment of the next node. Send the updated device information list.
例如,B类设备1可根据B类设备1的设备信息以及C类设备1上报的设备信息生成设备信息列表1,并在预设的定时器T3超时时将设备信息列表1发送给B类设备2。B类设备2接收到设备信息列表1后,可将自身的设备信息添加到设备信息列表1中形成设备信息列表2。当预设的定时器T4超时时,B类设备2可将设备信息列表2发送给B类设备3。B类设备3接收到设备信息列表2后,可将自身的设备信息以及C类设备2上报的设备信息添加到设备信息列表2中形成设备信息列表3。同样,当预设的定时器T5超时时,B类设备3可将设备信息列表3发送给B类设备1。这样,B类设备1至B类设备3可循环上述方法可定期更新自身存储的设备信息列表,从而获知Wi-Fi网络中各个设备最新的设备状态。For example, class B device 1 can generate device information list 1 based on the device information of class B device 1 and the device information reported by class C device 1, and send device information list 1 to class B device when the preset timer T3 expires 2. After receiving the device information list 1, the class B device 2 can add its own device information to the device information list 1 to form the device information list 2. When the preset timer T4 expires, the class B device 2 can send the device information list 2 to the class B device 3. After receiving the device information list 2, the class B device 3 can add its own device information and the device information reported by the class C device 2 to the device information list 2 to form the device information list 3. Similarly, when the preset timer T5 expires, the class B device 3 can send the device information list 3 to the class B device 1. In this way, the Class B device 1 to the Class B device 3 can circulate the above method to periodically update the device information list stored in themselves, so as to learn the latest device status of each device in the Wi-Fi network.
可以看出,在工作模式B2下,每个B类设备在一个周期内只需被上一个节点的B类设备唤醒,以获取最新的设备信息列表。这样,B类设备的唤醒次数将大大降低,使得B类设备的功耗也相应降低。It can be seen that in working mode B2, each type B device only needs to be awakened by the type B device of the previous node in one cycle to obtain the latest device information list. In this way, the number of wake-ups for type B devices will be greatly reduced, and the power consumption of type B devices will be reduced accordingly.
在一些实施例中,上述定时器T3、定时器T4以及定时器T5的定时时长可以相同也可以不同。In some embodiments, the timing duration of the timer T3, the timer T4, and the timer T5 may be the same or different.
在另一些实施例中,也可以仅在上述环形网络的一个节点中设置一个定时器T0。例如,可在B类设备1中设置定时器T0。当定时器T0超时时,B类设备1可将最新的设备信息列表发送给B类设备2。B类设备2接收到B类设备1发来的设备信息列表后,可更新该设备信息列表,并将更新后的设备信息列表发送给下一节点(即B类设备3)。同样,B类设备3接收到B类设备2发来的设备信息列表后,可更新该设备信息列表,并将更新后的设备信息列表发送给下一节点(即B类设备1)。后续,B类设备1至B类设备3可循环上述方法定期更新自身存储的设备信息列表,从而获知Wi-Fi网络中各个设备最新的设备状态。In other embodiments, only one timer T0 may be set in one node of the above-mentioned ring network. For example, the timer T0 can be set in the Class B device 1. When the timer T0 expires, the class B device 1 can send the latest device information list to the class B device 2. After class B device 2 receives the device information list sent by class B device 1, it can update the device information list and send the updated device information list to the next node (ie, class B device 3). Similarly, after receiving the device information list sent by the B device 2, the class B device 3 can update the device information list, and send the updated device information list to the next node (ie, the class B device 1). Subsequent, Class B device 1 to Class B device 3 can periodically update the device information list stored by themselves through the above-mentioned method, so as to learn the latest device status of each device in the Wi-Fi network.
示例性的,如图7所示,电子设备1进入工作模式B2后,电子设备1可按照预 设的组网算法加入上述环形网络中成为新的节点(即S701)。例如,电子设备1可作为B类设备4插入上述环形网络。此时,B类设备3与B类设备1之间原有的连接可以断开,新加入的电子设备1可分别与B类设备3和B类设备1建立连接。B类设备3为电子设备1的上一节点,B类设备1为电子设备1的下一节点。Exemplarily, as shown in FIG. 7, after the electronic device 1 enters the working mode B2, the electronic device 1 can join the above-mentioned ring network as a new node according to the preset networking algorithm (i.e., S701). For example, the electronic device 1 can be plugged into the above-mentioned ring network as a Class B device 4. At this time, the original connection between the class B device 3 and the class B device 1 can be disconnected, and the newly added electronic device 1 can establish a connection with the class B device 3 and the class B device 1 respectively. Class B device 3 is the previous node of electronic device 1, and class B device 1 is the next node of electronic device 1.
仍如图7所示,电子设备1加入上述环形网络后,可接收上一节点(即B类设备3)发来的设备信息列表(即S702)。进而,电子设备1可启动预设的定时器T6(即S703)。当定时器T6超时时,电子设备1可更新上述设备信息列表并将最新的设备信息列表发送给下一节点:B类设备1(即S704)。As still shown in FIG. 7, after the electronic device 1 joins the above-mentioned ring network, it can receive the device information list sent by the previous node (ie, the type B device 3) (ie, S702). Furthermore, the electronic device 1 can start a preset timer T6 (ie S703). When the timer T6 expires, the electronic device 1 can update the above-mentioned device information list and send the latest device information list to the next node: Class B device 1 (ie S704).
在一些实施例中,如果电子设备1向下一节点连续多次发送设备信息列表时均失败,说明电子设备1的下一节点可能已经下线,那么,电子设备1可继续向再下一个节点(即B类设备2)发送设备信息列表。In some embodiments, if the electronic device 1 fails to send the device information list to the next node multiple times in succession, it means that the next node of the electronic device 1 may be offline, and then the electronic device 1 can continue to the next node (I.e. Class B device 2) Send a list of device information.
在一些实施例中,电子设备1进入工作模式B2后如果接收到Wi-Fi网络内有新设备加入的消息,则电子设备1可根据新设备发来的设备信息确定该新设备是否为A类设备。如果本次新加入的设备不是A类设备,则电子设备1可按照预设的组网算法重新确定自己在环形网络中的位置,即确定新设备加入后电子设备1在环形网络中的上一节点和下一节点具体为哪个B类设备。进而,电子设备1可按照上述方法定期接收上一节点发来的设备信息列表,并定期向下一节点发送最新的设备信息列表。相应的,如果本次新加入的设备是A类设备,则电子设备1可从工作模式B2切换至上述工作模式B1。In some embodiments, after the electronic device 1 enters the working mode B2, if it receives a message that a new device joins in the Wi-Fi network, the electronic device 1 can determine whether the new device is Class A according to the device information sent by the new device equipment. If the newly added device is not a Class A device, the electronic device 1 can re-determine its position in the ring network according to the preset networking algorithm, that is, determine the previous position of the electronic device 1 in the ring network after the new device is added. Which type B device the node and the next node are specifically. Furthermore, the electronic device 1 can periodically receive the device information list sent by the previous node according to the above method, and periodically send the latest device information list to the next node. Correspondingly, if the newly added device this time is a class A device, the electronic device 1 can switch from the working mode B2 to the above-mentioned working mode B1.
在一种具体的实现方式中,如图15所示,电子设备1进入工作模式B2后,电子设备1可按照预设的组网算法加入上述环形网络中成为新的节点(即S1501)。进而,电子设备1接收到上一节点发来的设备信息列表(即S1502),设备信息列表也可称为家庭设备信息数据后,可更新该设备信息列表(即S1503)并启动预设的定时器(例如定时器T6)。当定时器T6超时时,电子设备1可将最新的设备信息列表发送给下一节点(即S1504)。如果电子设备1与下一节点之间的网络连接超时,电子设备1可尝试与下一节点的下一个节点建立网络连接(即S1505)。In a specific implementation, as shown in FIG. 15, after the electronic device 1 enters the working mode B2, the electronic device 1 can join the aforementioned ring network as a new node according to a preset networking algorithm (ie S1501). Furthermore, after the electronic device 1 receives the device information list (ie S1502) sent by the previous node, the device information list may also be called home device information data, it can update the device information list (ie S1503) and start the preset timing Device (e.g. timer T6). When the timer T6 expires, the electronic device 1 can send the latest device information list to the next node (ie S1504). If the network connection between the electronic device 1 and the next node times out, the electronic device 1 may try to establish a network connection with the next node of the next node (ie S1505).
另外,电子设备1进入工作模式B2后,如果接收到Wi-Fi网络内新设备的入网消息(即S1506),则电子设备1可查询该新设备是否为A类设备。如果新设备不是A类设备,则电子设备1可根据预设的组网算法确定自己是否为新设备的上一个节点(即S1507)。如果是上一个节点,则电子设备1可断开与原本环形网络中电子设备1与下一节点之间的网络连接,并与新设备建立网络连接(即S1508);否则,电子设备1可继续与上一节点保持网络连接。相应的,如果新设备为A类设备,则电子设备1可进入上述B1工作模式。In addition, after the electronic device 1 enters the working mode B2, if it receives a network access message of a new device in the Wi-Fi network (ie S1506), the electronic device 1 can query whether the new device is a class A device. If the new device is not a Class A device, the electronic device 1 can determine whether it is the previous node of the new device according to a preset networking algorithm (ie S1507). If it is the previous node, the electronic device 1 can disconnect the network connection between the electronic device 1 and the next node in the original ring network, and establish a network connection with the new device (ie S1508); otherwise, the electronic device 1 can continue Keep network connection with the previous node. Correspondingly, if the new device is a class A device, the electronic device 1 can enter the above-mentioned B1 working mode.
下面具体介绍C类设备的工作模式C:The following specifically introduces the working mode C of class C equipment:
C类设备一般作为被控设备与相应的主控设备绑定。例如,C类设备的主控设备可以为上述A类设备或B类设备,C类设备的主控设备也可以为服务器。例如,可穿戴带设备的主控设备一般为手机等B类设备,智能灯泡的主控设备可以为路由器等A类设备,智能电表的主控设备可以为电力公司的服务器。Class C devices are generally bound to the corresponding master control device as a controlled device. For example, the main control device of the C-type device may be the above-mentioned Class A device or the B-type device, and the main control device of the C-type device may also be a server. For example, the main control device of a wearable device is generally a class B device such as a mobile phone, the main control device of a smart light bulb can be a class A device such as a router, and the main control device of a smart meter can be a server of a power company.
由于C类设备的计算能力以及存储能力有限,因此,当电子设备1进入工作模式 C后,可周期性的向对应的主控设备上报自身的设备信息,无需获取并保存当前的设备信息列表。Due to the limited computing capabilities and storage capabilities of Class C devices, when the electronic device 1 enters working mode C, it can periodically report its own device information to the corresponding master control device without obtaining and saving the current device information list.
当Wi-Fi网络中存在A类设备时Wi-Fi网络中存在一个或多个主设备,示例性的,如图8所示,A类设备1可作为主设备进入上述工作模式A中的主设备工作模式,A类设备2可作为从设备进入上述工作模式A中的从设备工作模式。另外,Wi-Fi网络中的B类设备1和B类设备2也可作为从设备进入上述工作模式B1。When there are Class A devices in the Wi-Fi network, there are one or more master devices in the Wi-Fi network. Illustratively, as shown in FIG. 8, the Class A device 1 can be used as the master device to enter the master in the above working mode A. Device working mode, Class A device 2 can be used as a slave device to enter the working mode of the slave device in the above working mode A. In addition, the type B device 1 and the type B device 2 in the Wi-Fi network can also be used as slave devices to enter the above-mentioned working mode B1.
其中,B类设备1为C类设备1的主控设备,B类设备2为C类设备2的主控设备,C类设备3的主控设备为服务器。那么,C类设备1可按照周期1向B类设备1上报自身的设备信息。B类设备1可在向主设备(即A类设备1)上报B类设备1的设备信息时,一并向主设备上报C类设备1的设备信息。同样,C类设备2可按照周期2向B类设备2上报自身的设备信息。B类设备2可在向主设备上报B类设备2的设备信息时,一并向主设备上报C类设备2的设备信息。另外,C类设备3可周期性的向服务器上报自身的设备信息,主设备(即A类设备1)可定期从服务器中获取C类设备3的设备信息。Among them, the class B device 1 is the main control device of the class C device 1, the class B device 2 is the main control device of the class C device 2, and the main control device of the class C device 3 is the server. Then, the class C device 1 can report its own device information to the class B device 1 according to cycle 1. The class B device 1 can report the device information of the class C device 1 to the main device when reporting the device information of the class B device 1 to the main device (ie, the class A device 1). Similarly, the class C device 2 can report its own device information to the class B device 2 according to cycle 2. The class B device 2 may report the device information of the class C device 2 to the main device when reporting the device information of the class B device 2 to the main device. In addition, the class C device 3 can periodically report its own device information to the server, and the main device (ie, the class A device 1) can periodically obtain the device information of the class C device 3 from the server.
那么,主设备(即A类设备1)可以周期性地获取Wi-Fi网络内所有设备的设备信息,并形成最新的设备信息列表。Wi-Fi网络内的其他设备在向主设备上报自身的设备信息时,还可以从主设备获取到最新的设备信息列表。这样,Wi-Fi网络内的所有设备中均可保存一份最新的设备信息列表,每个设备根据该设备信息列表可获知其他设备最新的设备状态,以便后续快速的参与并完成多设备之间的协同工作任务。Then, the main device (ie, the Class A device 1) can periodically obtain the device information of all devices in the Wi-Fi network and form the latest device information list. When other devices in the Wi-Fi network report their own device information to the main device, they can also obtain the latest device information list from the main device. In this way, all devices in the Wi-Fi network can save a list of the latest device information, and each device can learn the latest device status of other devices according to the device information list, so as to quickly participate in the subsequent and complete the multi-device information Of collaborative work tasks.
当Wi-Fi网络中不存在A类设备时Wi-Fi网络中不存在主设备,示例性的,如图9所示,B类设备1至B类设备3可组成一个环形网络。B类设备1至B类设备3均可进入上述工作模式B2。其中,B类设备1为C类设备1的主控设备,B类设备2为C类设备2的主控设备,C类设备3的主控设备为服务器。When there is no Class A device in the Wi-Fi network, there is no main device in the Wi-Fi network. Illustratively, as shown in FIG. 9, Class B devices 1 to B devices 3 can form a ring network. Class B equipment 1 to Class B equipment 3 can all enter the above-mentioned working mode B2. Among them, the class B device 1 is the main control device of the class C device 1, the class B device 2 is the main control device of the class C device 2, and the main control device of the class C device 3 is the server.
那么,C类设备1可按照周期1向B类设备1上报自身的设备信息。B类设备1可按照上述工作模式B2在向下一个节点(即B类设备2)发送设备信息列表时,将自身的设备信息和C类设备1的设备信息添加在该设备信息列表中。同样,C类设备2可按照周期2向B类设备2上报自身的设备信息。B类设备2可按照上述工作模式B2在向下一个节点(即B类设备3)发送设备信息列表时,将自身的设备信息和C类设备2的设备信息添加在该设备信息列表中。另外,C类设备3可周期性的向服务器上报自身的设备信息,环形网络中的某个B类设备可从服务器中获取C类设备3的设备信息,并将C类设备3的设备信息更新在设备信息列表中。Then, the class C device 1 can report its own device information to the class B device 1 according to cycle 1. The class B device 1 can add its own device information and the device information of the class C device 1 to the device information list when sending the device information list to the next node (ie, the class B device 2) according to the above-mentioned working mode B2. Similarly, the class C device 2 can report its own device information to the class B device 2 according to cycle 2. The class B device 2 can add its own device information and the device information of the class C device 2 to the device information list when sending the device information list to the next node (ie, the class B device 3) according to the above-mentioned working mode B2. In addition, the class C device 3 can periodically report its own device information to the server. A certain class B device in the ring network can obtain the device information of the class C device 3 from the server, and update the device information of the class C device 3 In the device information list.
例如,可设置当环形网络中的某个B类设备被唤醒时,从服务器中获取C类设备3的设备信息,从而避免B类设备在待机状态下被唤醒后与服务器交互,降低B类设备因查询C类设备的设备信息而额外产生的功耗。For example, you can set to obtain the device information of the C-type device 3 from the server when a certain B-type device in the ring network is awakened, so as to prevent the B-type device from interacting with the server after being awakened in the standby state, and reduce the B-type device The additional power consumption caused by querying the device information of Class C devices.
可以看出,无论Wi-Fi网络中是否存在A类设备,Wi-Fi网络内的各类设备通过进入各自的工作模式A、工作模式B或工作模式C,均可定期获取到一份最新的设备信息列表。每个设备根据该设备信息列表可获知其他设备最新的设备状态,以便后续快速的参与并完成多设备之间的协同工作任务。It can be seen that regardless of whether there are Class A devices in the Wi-Fi network, all types of devices in the Wi-Fi network can obtain a copy of the latest Device information list. Each device can learn the latest device status of other devices according to the device information list, so that it can quickly participate in and complete the collaborative work tasks between multiple devices.
上述实施例中是以电子设备1加入上述Wi-Fi网络时进入工作模式A、工作模式 B或工作模式C举例说明的。可以理解的是,Wi-Fi网络中的每个电子设备均可按照上述方法进入与自身设备类型对应的工作模式中开始工作。In the above embodiment, the electronic device 1 enters the working mode A, the working mode B or the working mode C when it joins the above-mentioned Wi-Fi network as an example. It is understandable that each electronic device in the Wi-Fi network can enter the working mode corresponding to its own device type and start working according to the above method.
示例性的,上述Wi-Fi网络的架构示意图可以如图10所示,该Wi-Fi网络中包括3个A类设备(即电视1001、音箱1002以及路由器1003)、2个B类设备(即手机1004和平板电脑1005)以及3个C类设备(即可穿戴设备1006、智能灯泡1007以及智能空调1008)。Exemplarily, the schematic diagram of the above-mentioned Wi-Fi network architecture may be as shown in FIG. 10. The Wi-Fi network includes 3 class A devices (namely, TV 1001, speaker 1002, and router 1003), and 2 class B devices (namely Mobile phone 1004 and tablet PC 1005) and 3 Class C devices (that is, wearable device 1006, smart light bulb 1007, and smart air conditioner 1008).
其中,电视1001可作为Wi-Fi网络中的主设备进入主设备工作模式。Wi-Fi网络中的其他A类设备可作为电视1001的从设备进入从设备工作模式,Wi-Fi网络中的B类设备也可作为电视1001的从设备进入工作模式B1。Among them, the TV 1001 can be used as the main device in the Wi-Fi network to enter the main device working mode. Other Class A devices in the Wi-Fi network can be used as slave devices of the TV 1001 to enter the slave device working mode, and Class B devices in the Wi-Fi network can also be used as slave devices of the TV 1001 to enter the working mode B1.
例如,音箱1002和路由器1003可以以30s为周期,每隔30s主动向电视1001上报自身的设备信息,并从电视1001同步最新的设备信息列表。手机1004和平板电脑1005可在每次向PUSH服务器发送心跳报文时,主动向电视1001上报自身的设备信息,并从电视1001同步最新的设备信息列表。For example, the speaker 1002 and the router 1003 can actively report their device information to the TV 1001 every 30s in a period of 30s, and synchronize the latest device information list from the TV 1001. The mobile phone 1004 and the tablet computer 1005 can actively report their device information to the TV 1001 every time a heartbeat message is sent to the PUSH server, and synchronize the latest device information list from the TV 1001.
另外,C类设备中可穿戴设备1006的主控设备为手机1004,智能灯泡1007的主控设备为电视1001,智能空调1008的主控设备为服务器1009。示例性的,可穿戴设备1006可定期向手机1004上报自身的设备信息,手机1004可在向电视1001上报自身的设备信息时一并上报可穿戴设备1006的设备信息。智能灯泡1007可定期向电视1001上报自身的设备信息。智能空调1008可定期向服务器1009上报自身的设备信息。电视1001可以30s为周期,每隔30s主动从服务器1009中获取智能空调1008的设备信息。In addition, the main control device of the wearable device 1006 in Class C devices is a mobile phone 1004, the main control device of the smart light bulb 1007 is the TV 1001, and the main control device of the smart air conditioner 1008 is the server 1009. Exemplarily, the wearable device 1006 may periodically report its own device information to the mobile phone 1004, and the mobile phone 1004 may report the device information of the wearable device 1006 when reporting its own device information to the TV 1001. The smart bulb 1007 can periodically report its own device information to the TV 1001. The smart air conditioner 1008 can periodically report its own device information to the server 1009. The TV 1001 can take 30s as a period, and actively obtain the device information of the smart air conditioner 1008 from the server 1009 every 30s.
这样,电视1001可以获取到Wi-Fi网络中各个电子设备最新的设备信息,形成最新的设备信息列表。并且,电视1001可以将最新的设备信息列表同步给Wi-Fi网络中的其他电子设备,使得Wi-Fi网络中的每个电子设备均可根据该设备信息列表获知其他电子设备的最新设备状态。In this way, the TV 1001 can obtain the latest device information of each electronic device in the Wi-Fi network, and form the latest device information list. In addition, the TV 1001 can synchronize the latest device information list to other electronic devices in the Wi-Fi network, so that each electronic device in the Wi-Fi network can learn the latest device status of other electronic devices according to the device information list.
示例性的,上述Wi-Fi网络的架构示意图可以如图11所示,该Wi-Fi网络中包括3个B类设备(即手机1101、手机1102和平板电脑1103)和3个C类设备(即可穿戴设备1104、智能灯泡1105以及智能空调1106)。Exemplarily, the schematic diagram of the architecture of the above Wi-Fi network may be as shown in FIG. 11, and the Wi-Fi network includes 3 class B devices (ie, mobile phone 1101, mobile phone 1102, and tablet computer 1103) and 3 class C devices ( That is, the wearable device 1104, the smart bulb 1105, and the smart air conditioner 1106).
可以看出,上述Wi-Fi网络中不包括A类设备,那么,手机1101、手机1102和平板电脑1103可进入上述工作模式B2组成一个环形网络。其中,手机1101为可穿戴设备1104的主控设备,手机1102为智能灯泡1105的主控设备,智能空调1106的主控设备为服务器1107。It can be seen that the above-mentioned Wi-Fi network does not include Class A devices, then the mobile phone 1101, the mobile phone 1102, and the tablet computer 1103 can enter the above-mentioned working mode B2 to form a ring network. Among them, the mobile phone 1101 is the main control device of the wearable device 1104, the mobile phone 1102 is the main control device of the smart light bulb 1105, and the main control device of the smart air conditioner 1106 is the server 1107.
示例性的,穿戴设备1104可定期向手机1101上报自身的设备信息。手机1101可按照上述工作模式B2在向下一个节点(即手机1102)发送设备信息列表时,将自身的设备信息和穿戴设备1104的设备信息携带在该设备信息列表中。Exemplarily, the wearable device 1104 may periodically report its own device information to the mobile phone 1101. The mobile phone 1101 can carry its own device information and the device information of the wearable device 1104 in the device information list when sending the device information list to the next node (ie, the mobile phone 1102) according to the above-mentioned working mode B2.
同样,智能灯泡1105可定期向手机1102上报自身的设备信息。手机1102可按照上述工作模式B2在向下一个节点(即平板电脑1103)发送设备信息列表时,将自身的设备信息和智能灯泡1105的设备信息携带在该设备信息列表中。Similarly, the smart bulb 1105 can report its device information to the mobile phone 1102 periodically. The mobile phone 1102 can carry its own device information and the device information of the smart bulb 1105 in the device information list when sending the device information list to the next node (ie, the tablet 1103) according to the above-mentioned working mode B2.
另外,智能空调1106可周期性的向服务器1107上报自身的设备信息。Wi-Fi网络中的手机1102可在向PUSH服务器发送心跳报文时,主动从服务器1107中获取智 能空调1106的设备信息,并将智能空调1106的设备信息更新在设备信息列表中。In addition, the smart air conditioner 1106 may periodically report its own device information to the server 1107. The mobile phone 1102 in the Wi-Fi network can actively obtain the device information of the smart air conditioner 1106 from the server 1107 when sending a heartbeat message to the PUSH server, and update the device information of the smart air conditioner 1106 in the device information list.
这样,环形网络中的B类设备之间通过定期同步可获取到最新的设备信息列表,从而根据该设备信息列表获知Wi-Fi网络中各个电子设备的最新设备状态。In this way, the B-type devices in the ring network can obtain the latest device information list through regular synchronization, so that the latest device status of each electronic device in the Wi-Fi network can be obtained according to the device information list.
那么,当上述Wi-Fi网络内需要多个电子设备进行协同工作时,参与协同工作的电子设备可根据最近更新的设备信息列表快速查询到其他电子设备的设备状态,进而根据参与协同工作的多个电子设备的设备状态快速完成本次协同任务。Then, when multiple electronic devices are required to work collaboratively in the aforementioned Wi-Fi network, the electronic devices participating in the collaborative work can quickly query the device status of other electronic devices based on the recently updated device information list, and then based on the number of electronic devices participating in the collaborative work. The device status of each electronic device quickly completes this collaborative task.
以图10所示的Wi-Fi网络举例,当用户说出“小艺小艺”的唤醒词后,Wi-Fi网络中的电视1001、音箱1002、手机1004和平板电脑1005均可检测到该唤醒词。假设预设的唤醒策略为最近一次被唤醒的电子设备优先响应用户的唤醒词,那么,由于电视1001、音箱1002、手机1004和平板电脑1005中均存储有最新的设备信息列表,因此,电视1001、音箱1002、手机1004和平板电脑1005可在自身存储的设备信息列表中查询Wi-Fi网络内支持语音唤醒功能的各个电子设备最近一次被唤醒的时间,进而确定出本次响应用户的具体电子设备。Taking the Wi-Fi network shown in Figure 10 as an example, when the user utters the wake-up word of "Xiaoyi Xiaoyi", the TV 1001, speaker 1002, mobile phone 1004, and tablet computer 1005 in the Wi-Fi network can all detect this Wake word. Assuming that the preset wake-up strategy is that the most recently awakened electronic device responds to the user's wake-up word first, then, since the TV 1001, speaker 1002, mobile phone 1004, and tablet 1005 all store the latest device information list, the TV 1001 , Speaker 1002, mobile phone 1004, and tablet computer 1005 can query the latest awakening time of each electronic device in the Wi-Fi network that supports the voice wake-up function in the device information list stored by itself, and then determine the specific electronic device that responded to the user this time. equipment.
以最近一次被唤醒的电子设备为音箱1002举例,音箱1002确定出自己为电视1001、音箱1002、手机1004和平板电脑1005中最近一次被唤醒的电子设备后,可打开相应的语音功能应答用户说出的“小艺小艺”这一唤醒词。此时,电视1001、手机1004和平板电脑1005无需应答用户说出的唤醒词,也无需与音箱1002进行数据交互。Taking the last awakened electronic device as an example of speaker 1002, speaker 1002 determines that it is the most recently awakened electronic device among TV 1001, speaker 1002, mobile phone 1004, and tablet 1005, and can turn on the corresponding voice function to answer the user’s comment. The awakening word "Xiaoyi Xiaoyi" came out. At this time, the TV 1001, the mobile phone 1004, and the tablet computer 1005 do not need to respond to the wake-up words spoken by the user, nor do they need to interact with the speaker 1002 for data.
可以看出,由于Wi-Fi网络内的每个电子设备中均存储有其他电子设备最新的设备状态,因此,当多个电子设备需要完成一次协同工作任务时,参与协同工作的各个电子设备可以根据最新的设备信息列表快速查询到其他电子设备的设备状态,进而根据其他电子设备的设备状态快速完成本次协同任务,降低了多个设备协同工作时的耗时。It can be seen that since each electronic device in the Wi-Fi network stores the latest device status of other electronic devices, when multiple electronic devices need to complete a collaborative work task, each electronic device participating in the collaborative work can The device status of other electronic devices can be quickly queried according to the latest device information list, and then the collaborative task can be quickly completed according to the device status of other electronic devices, which reduces the time consumption of multiple devices working together.
同时,由于每个电子设备通过上述设备信息列表可以快速查询到其他电子设备的设备状态,因此,在多设备协同工作时电子设备之间进行数据交互的次数减少,对于上述B类设备而言,B类设备从待机状态被唤醒或进行数据交互的次数也相应减少,从而可降低B类设备的功耗,延长B类设备的待机时间。At the same time, since each electronic device can quickly query the device status of other electronic devices through the above device information list, the number of data interactions between electronic devices is reduced when multiple devices work together. For the above-mentioned Class B devices, The number of times that Class B devices are awakened from standby or performing data interactions is also reduced, thereby reducing the power consumption of Class B devices and extending the standby time of Class B devices.
如图16所示,本申请实施例公开了一种电子设备,该电子设备具体可以为上述实施例中的A类设备、B类设备或C类设备。As shown in FIG. 16, an embodiment of the present application discloses an electronic device, and the electronic device may specifically be a type A device, a type B device, or a type C device in the foregoing embodiment.
示例性的,该电子设备包括:通信模块1601;一个或多个处理器1602;一个或多个存储器1603;一个或多个应用程序(未示出);以及一个或多个计算机程序1604,上述各器件可以通过一个或多个通信总线1605连接。其中,该一个或多个计算机程序1604被存储在上述存储器1603中并被配置为被该一个或多个处理器1602执行,该一个或多个计算机程序1604包括指令,上述指令可以用于执行上述应实施例中的各个步骤。Exemplarily, the electronic device includes: a communication module 1601; one or more processors 1602; one or more memories 1603; one or more application programs (not shown); and one or more computer programs 1604, as described above Each device may be connected through one or more communication buses 1605. Wherein, the one or more computer programs 1604 are stored in the aforementioned memory 1603 and configured to be executed by the one or more processors 1602, and the one or more computer programs 1604 include instructions, and the aforementioned instructions can be used to execute the aforementioned Each step in the embodiment should be implemented.
示例性的,上述处理器1602具体可以为图2所示的处理器110,上述存储器1603具体可以为图2所示的内部存储器121,上述通信模块1601具体可以为图2所示的移动通信模块150或无线通信模块160。当然,电子设备中还可以包括显示屏、触摸传感器等器件,本申请实施例对此不做任何限制。Exemplarily, the above-mentioned processor 1602 may specifically be the processor 110 shown in FIG. 2, the above-mentioned memory 1603 may specifically be the internal memory 121 shown in FIG. 2, and the above-mentioned communication module 1601 may specifically be the mobile communication module shown in FIG. 2 150 or wireless communication module 160. Of course, the electronic device may also include a display screen, a touch sensor, and other devices, which are not limited in the embodiment of the present application.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的 方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiment, which is not repeated here.
在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。The functional units in the various embodiments of the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage The medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: flash memory, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.
以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of the present application shall be covered by this application. Within the protection scope of the application embodiments. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims (37)

  1. 一种多设备之间的信息同步系统,其特征在于,所述系统包括第一类型设备和第二类型设备;所述第一类型设备为使用外接电源供电的设备,所述第一类型设备包括第一设备,所述第一设备为主设备;所述第二类型设备为使用电池供电的设备,所述第二类型设备包括第二设备和第三设备,所述第二设备和所述第三设备均为从设备;其中,An information synchronization system between multiple devices, wherein the system includes a first type of equipment and a second type of equipment; the first type of equipment is a device that uses an external power supply, and the first type of equipment includes The first device, the first device is the main device; the second type device is a battery-powered device, the second type device includes a second device and a third device, the second device and the first device The three devices are all slave devices; among them,
    所述第一设备用于:接收所述第三设备发送的所述第三设备的设备信息;根据接收到的所述第三设备的设备信息更新设备信息列表,所述设备信息列表中记录有所述第一类型设备的设备信息和所述第二类型设备的设备信息;The first device is configured to: receive device information of the third device sent by the third device; update a device information list according to the received device information of the third device, and the device information list records The device information of the first type of device and the device information of the second type of device;
    所述第二设备用于:启动预设的第一定时器;当所述第一定时器超时时,向所述第一设备发送所述第二设备的设备信息,并从所述第一设备中获取更新后的所述设备信息列表。The second device is configured to: start a preset first timer; when the first timer expires, send the device information of the second device to the first device, and send the device information from the first device Obtain the updated device information list in.
  2. 根据权利要求1所述的系统,其特征在于,The system of claim 1, wherein:
    所述第二设备还用于:接收所述第一设备发送的第一消息,所述第一消息用于指示所述系统中的主设备为所述第一设备;响应于所述第一消息将所述第一设备确定为主设备。The second device is further configured to: receive a first message sent by the first device, where the first message is used to indicate that the main device in the system is the first device; and to respond to the first message The first device is determined as the master device.
  3. 根据权利要求1所述的系统,其特征在于,所述设备信息列表中记录有所述第一设备的入网时间;The system according to claim 1, wherein the network access time of the first device is recorded in the device information list;
    所述第二设备还用于:当所述第一设备为入网时间最早的第一类型设备时,将所述第一设备确定为主设备。The second device is further configured to determine the first device as the master device when the first device is the first type device with the earliest network access time.
  4. 根据权利要求1-3中任一项所述的系统,其特征在于,所述第一定时器的定时时长与所述第二设备的心跳周期相同。The system according to any one of claims 1 to 3, wherein the timing duration of the first timer is the same as the heartbeat period of the second device.
  5. 根据权利要求1-4中任一项所述的系统,其特征在于,所述第一类型设备还包括第四设备;The system according to any one of claims 1-4, wherein the first type device further comprises a fourth device;
    所述第二设备还用于:接收所述第四设备发送的主设备更新的消息;响应于所述消息,与所述第一设备断开网络连接,并与所述第四设备建立网络连接。The second device is further configured to: receive a master device update message sent by the fourth device; in response to the message, disconnect the network connection with the first device, and establish a network connection with the fourth device .
  6. 根据权利要求1-5中任一项所述的系统,其特征在于,The system according to any one of claims 1-5, wherein:
    所述第二设备还用于:当所述第二设备与所述第一设备之间的网络连接超时时,在除所述第一设备之外的第一类型设备中确定新的主设备。The second device is further configured to: when the network connection between the second device and the first device times out, determine a new master device among the devices of the first type other than the first device.
  7. 根据权利要求1-5中任一项所述的系统,其特征在于,The system according to any one of claims 1-5, wherein:
    所述第一设备还用于:接收所述第二设备发送的所述第二设备设备信息;根据接收到的所述第二设备的设备信息更新所述设备信息列表;The first device is further configured to: receive the second device device information sent by the second device; update the device information list according to the received device information of the second device;
    所述第三设备还用于:启动预设的第二定时器;当所述第二定时器超时时,向所述第一设备发送所述第三设备的设备信息,并从所述第一设备中获取更新后的所述设备信息列表。The third device is further configured to: start a preset second timer; when the second timer expires, send device information of the third device to the first device, and send the device information from the first device Obtain the updated device information list from the device.
  8. 根据权利要求1-7中任一项所述的系统,其特征在于,The system according to any one of claims 1-7, wherein:
    所述第一设备还用于:当所述第一设备加入所述系统时,根据主设备决策算法确定所述第一设备是否为主设备。The first device is further configured to: when the first device joins the system, determine whether the first device is the master device according to a master device decision algorithm.
  9. 根据权利要求1-8中任一项所述的系统,其特征在于,The system according to any one of claims 1-8, wherein:
    所述第一设备还用于:当接收到新设备加入、设备退出或主设备更新的消息时,重新确定所述第一设备是否为主设备。The first device is further configured to: when receiving a new device join, device exit, or master device update message, re-determine whether the first device is the master device.
  10. 根据权利要求1-9中任一项所述的系统,其特征在于,所述第一类型设备还包括第五设备,所述第五设备为从设备;其中,The system according to any one of claims 1-9, wherein the first type device further comprises a fifth device, and the fifth device is a slave device; wherein,
    所述第五设备用于:启动预设的第三定时器;当所述第三定时器超时时,向所述第一设备发送所述第五设备的设备信息,并从所述第一设备中获取更新后的所述设备信息列表。The fifth device is configured to: start a preset third timer; when the third timer expires, send device information of the fifth device to the first device, and send the device information from the first device Obtain the updated device information list in.
  11. 根据权利要求10所述的系统,其特征在于,The system of claim 10, wherein:
    所述第五设备还用于:当所述第五设备向所述第一设备发送所述第五设备的设备信息失败的次数超过预设值时,重新确定所述系统中的主设备;或者,当接收到新设备加入、设备退出或主设备更新的消息时,重新确定所述系统中的主设备。The fifth device is further configured to: when the number of times the fifth device fails to send the device information of the fifth device to the first device exceeds a preset value, re-determine the main device in the system; or , When a new device joins, a device exits, or a main device update message is received, the main device in the system is re-determined.
  12. 根据权利要求1-11中任一项所述的系统,其特征在于,所述系统中还包括第三类型设备,所述第三类型设备的主控设备为所述第一设备;其中,The system according to any one of claims 1-11, wherein the system further comprises a third-type device, and the main control device of the third-type device is the first device; wherein,
    所述第三类型设备用于:按照预设的周期向所述第一设备发送所述第三类型设备的设备信息;The third-type device is configured to: send the device information of the third-type device to the first device according to a preset cycle;
    所述第一设备还用于:根据所述第三类型设备的设备信息更新所述设备信息列表。The first device is further configured to: update the device information list according to the device information of the third type device.
  13. 根据权利要求1-11中任一项所述的系统,其特征在于,所述系统中还包括第三类型设备,所述第三类型设备的主控设备为所述第二设备;其中,The system according to any one of claims 1-11, wherein the system further comprises a third-type device, and the main control device of the third-type device is the second device; wherein,
    所述第三类型设备用于:按照预设的周期向所述第二设备发送所述第三类型设备的设备信息;The third type device is configured to: send the device information of the third type device to the second device according to a preset cycle;
    所述第二设备还用于:当所述第一定时器超时时,向所述第一设备发送所述第三类型设备的设备信息,以使得所述第一设备根据所述第三类型设备的设备信息更新所述设备信息列表。The second device is further configured to: when the first timer expires, send the device information of the third type device to the first device, so that the first device is The device information updates the device information list.
  14. 根据权利要求1-11中任一项所述的系统,其特征在于,所述系统中还包括第三类型设备,所述第三类型设备的主控设备为服务器;其中,The system according to any one of claims 1-11, wherein the system further comprises a third-type device, and the main control device of the third-type device is a server; wherein,
    所述第三类型设备用于:按照预设的周期向所述服务器发送所述第三类型设备的设备信息;The device of the third type is configured to send device information of the device of the third type to the server according to a preset period;
    所述第一设备还用于:从所述服务器获取所述第三类型设备的设备信息;根据所述第三类型设备的设备信息更新所述设备信息列表。The first device is further configured to: obtain device information of the third type device from the server; and update the device information list according to the device information of the third type device.
  15. 一种多设备之间的信息同步系统,其特征在于,所述系统包括第一设备、第二设备以及第三设备;所述第一设备、所述第二设备以及所述第三设备均为使用电池供电的第一类型设备;所述第一设备、所述第二设备以及所述第三设备组成一个环形网网络,其中,所述第一设备为所述第二设备的上一节点,所述第二设备为所述第三设备的上一节点;An information synchronization system between multiple devices, wherein the system includes a first device, a second device, and a third device; the first device, the second device, and the third device are all A first type of battery powered device; the first device, the second device, and the third device form a ring network, where the first device is the previous node of the second device, The second device is the previous node of the third device;
    所述第二设备用于:接收所述第一设备发送的设备信息列表,所述设备信息列表中记录有所述系统中各个设备的设备信息;根据所述第二设备的设备信息更新所述设备信息列表;向所述第三设备发送更新后的设备信息列表。The second device is configured to: receive a device information list sent by the first device, in which device information of each device in the system is recorded; and update the device information according to the device information of the second device. Device information list; sending the updated device information list to the third device.
  16. 根据权利要求15所述的系统,其特征在于,所述第二设备向所述第三设备发送更新后的设备信息列表,包括:The system according to claim 15, wherein the sending of the updated device information list by the second device to the third device comprises:
    当第一定时器超时时,所述第二设备向所述第三设备发送更新后的设备信息列表。When the first timer expires, the second device sends the updated device information list to the third device.
  17. 根据权利要求15或16所述的系统,其特征在于,The system according to claim 15 or 16, characterized in that:
    所述第二设备还用于:接收第四设备加入所述系统的消息;若所述第四设备为所述第一类型设备,则按照预设的组网算法重新确定所述第二设备在所述环形网络中的位置。The second device is further configured to: receive a message that a fourth device joins the system; if the fourth device is the first type device, re-determine that the second device is in the system according to a preset networking algorithm The location in the ring network.
  18. 根据权利要求15-17中任一项所述的系统,其特征在于,所述第二设备无法向所述第一设备发送数据;所述第二设备无法接收所述第三设备发送的数据。The system according to any one of claims 15-17, wherein the second device cannot send data to the first device; the second device cannot receive data sent by the third device.
  19. 根据权利要求15-18中任一项所述的系统,其特征在于,所述系统中还包括受控于主控设备的第二类型设备,所述主控设备为所述第二设备;其中,The system according to any one of claims 15-18, wherein the system further comprises a second type device controlled by a main control device, the main control device being the second device; wherein ,
    所述第二类型设备用于:按照预设的周期向所述第二设备发送所述第二类型设备的设备信息;The second type device is configured to: send the device information of the second type device to the second device according to a preset cycle;
    所述第二设备还用于:根据所述第二类型设备的设备信息更新所述设备信息列表。The second device is further configured to: update the device information list according to the device information of the second type device.
  20. 根据权利要求15-18中任一项所述的系统,其特征在于,所述系统中还包括受控于主控设备的第二类型设备,所述主控设备为服务器;其中,The system according to any one of claims 15-18, wherein the system further comprises a second type device controlled by a main control device, the main control device being a server; wherein,
    所述第二类型设备用于:按照预设的周期向所述服务器发送所述第二类型设备的设备信息;The second type device is configured to: send the device information of the second type device to the server according to a preset cycle;
    所述第二设备还用于:当所述第二设备被唤醒时,从所述服务器获取所述第二类型设备的设备信息;根据所述第二类型设备的设备信息更新所述设备信息列表。The second device is further configured to: when the second device is awakened, obtain the device information of the second type device from the server; update the device information list according to the device information of the second type device .
  21. 根据权利要求1-20中任一项所述的系统,其特征在于,所述设备信息包括:设备名称、设备类型、设备型号、设备入网时间、互联网协议IP地址、媒体访问控制MAC地址、设备提供的服务或自定义的业务信息中的一项或多项。The system according to any one of claims 1-20, wherein the device information includes: device name, device type, device model, network access time of the device, Internet Protocol IP address, media access control MAC address, device One or more of the provided services or customized business information.
  22. 一种多设备之间的信息同步方法,其特征在于,包括:A method for information synchronization between multiple devices, which is characterized in that it includes:
    第一设备加入信息同步系统后,确定所述第一设备是否为所述信息同步系统中的主设备,所述第一设备为使用外接电源供电的第一类型设备;After the first device joins the information synchronization system, determining whether the first device is the master device in the information synchronization system, and the first device is a first type device that uses an external power supply;
    若所述第一设备为主设备,则:If the first device is the master device, then:
    所述第一设备接收第二设备发送的所述第二设备的设备信息,所述第二设备为所述信息同步系统中使用电池供电的第二类型设备;Receiving, by the first device, device information of the second device sent by a second device, where the second device is a battery-powered second type device in the information synchronization system;
    所述第一设备根据所述第二设备的设备信息更新设备信息列表,所述设备信息列表中记录有所述第一类型设备的设备信息和所述第二类型设备的设备信息;The first device updates a device information list according to the device information of the second device, and the device information of the first type of device and the device information of the second type of device are recorded in the device information list;
    当所述第一设备接收到第三设备发送的所述第三设备的设备信息时,向所述第三设备发送更新后的所述设备信息列表,所述第三设备为所述信息同步系统中的所述第二类型设备。When the first device receives the device information of the third device sent by the third device, sends the updated device information list to the third device, and the third device is the information synchronization system The second type of equipment in.
  23. 根据权利要求22所述的方法,其特征在于,所述第一设备加入信息同步系统后,确定所述第一设备是否为所述信息同步系统中的主设备,包括:The method according to claim 22, wherein after the first device joins the information synchronization system, determining whether the first device is the master device in the information synchronization system comprises:
    所述第一设备加入信息同步系统后,根据主设备决策算法确定所述第一设备是否为所述信息同步系统中的主设备。After the first device joins the information synchronization system, it is determined whether the first device is the master device in the information synchronization system according to a master device decision algorithm.
  24. 根据权利要求22或23所述的方法,其特征在于,若所述第一设备为主设备,则所述方法还包括:The method according to claim 22 or 23, wherein if the first device is the master device, the method further comprises:
    当所述第一设备接收到新设备加入、设备退出或主设备更新的消息时,重新确定 所述第一设备是否为主设备。When the first device receives a message that a new device joins, a device exits, or a master device is updated, it determines whether the first device is a master device again.
  25. 根据权利要求22-24中任一项所述的方法,其特征在于,若所述第一设备为所述信息同步系统中的从设备,则所述方法还包括:The method according to any one of claims 22-24, wherein if the first device is a slave device in the information synchronization system, the method further comprises:
    所述第一设备确定所述信息同步系统中的主设备;The first device determines the master device in the information synchronization system;
    当预设的第一定时器超时时,所述第一设备向确定出的主设备发送所述第一设备的设备信息,并从主设备中获取更新后的所述设备信息列表。When the preset first timer expires, the first device sends the device information of the first device to the determined main device, and obtains the updated device information list from the main device.
  26. 一种多设备之间的信息同步方法,其特征在于,包括:A method for information synchronization between multiple devices, which is characterized in that it includes:
    第一设备加入信息同步系统后,确定所述信息同步系统中是否包含使用外接电源供电的第一类型设备,所述第一设备为使用电池供电的第二类型设备;After the first device joins the information synchronization system, determining whether the information synchronization system includes a first type device powered by an external power supply, and the first device is a second type device powered by a battery;
    若所述信息同步系统中包含第一类型设备,则:If the information synchronization system includes the first type of equipment, then:
    所述第一设备在所述第一类型设备中确定所述信息同步系统中的主设备为第二设备;Determining, by the first device, in the first type of device, that the master device in the information synchronization system is the second device;
    所述第一设备启动预设的第一定时器;The first device starts a preset first timer;
    当所述第一定时器超时时,所述第一设备向所述第二设备发送所述第一设备的设备信息,并从所述第二设备中获取更新后的所述设备信息列表,所述设备信息列表中记录有所述第一类型设备的设备信息和所述第二类型设备的设备信息。When the first timer expires, the first device sends the device information of the first device to the second device, and obtains the updated device information list from the second device, so The device information list of the device information records the device information of the first type device and the device information of the second type device.
  27. 根据权利要求26所述的方法,其特征在于,所述第一设备在所述第一类型设备中确定所述信息同步系统中的主设备为第二设备,包括:The method according to claim 26, wherein the determining by the first device in the first type of device that the master device in the information synchronization system is the second device comprises:
    所述第一设备接收到所述第二设备发送的第一消息,所述第一消息用于指示所述信息同步系统中的主设备为所述第二设备;所述第一设备响应于所述第一消息将所述第二设备确定为主设备;或者,The first device receives the first message sent by the second device, where the first message is used to indicate that the master device in the information synchronization system is the second device; the first device responds to the The first message determines the second device as the master device; or,
    若所述第一设备在所述设备信息列表中查询到入网时间最早的第一类型设备为所述第二设备,则所述第一设备将所述第二设备确定为主设备。If the first device inquires in the device information list that the device of the first type with the earliest network access time is the second device, the first device determines the second device as the master device.
  28. 根据权利要求26或27所述的方法,其特征在于,所述第一定时器的定时时长与所述第一设备的心跳周期相同。The method according to claim 26 or 27, wherein the timing duration of the first timer is the same as the heartbeat period of the first device.
  29. 根据权利要求26-28中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 26-28, wherein the method further comprises:
    所述第一设备接收第三设备发送的主设备更新的消息,所述第三设备为所述第一类型设备;Receiving, by the first device, a master device update message sent by a third device, and the third device is the first type device;
    响应于所述消息,所述第一设备将所述第三设备确定为新的主设备,并与所述第三设备建立网络连接。In response to the message, the first device determines the third device as a new master device, and establishes a network connection with the third device.
  30. 根据权利要求26-28中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 26-28, wherein the method further comprises:
    当所述第一设备与所述第二设备之间的网络连接超时时,所述第一设备在除所述第二设备之外的第一类型设备中确定新的主设备。When the network connection between the first device and the second device times out, the first device determines a new master device among the first type devices except the second device.
  31. 根据权利要求26-30中任一项所述的方法,其特征在于,若所述信息同步系统中不包含第一类型设备,则所述方法还包括:The method according to any one of claims 26-30, wherein if the information synchronization system does not include a first type device, the method further comprises:
    所述第一设备与其他第二类型设备组成环形网络,其中,所述第一设备在所述环形网络中的上一节点为第四设备,所述第一设备在所述环形网络中的下一节点为第五设备;The first device and other second type devices form a ring network, wherein the previous node of the first device in the ring network is the fourth device, and the first device is in the lower node of the ring network. One node is the fifth device;
    所述第一设备接收所述第四设备发送的设备信息列表,所述设备信息列表中记录 有所述信息同步系统中各个设备的设备信息;The first device receives the device information list sent by the fourth device, and the device information list records the device information of each device in the information synchronization system;
    所述第一设备根据所述第一设备的设备信息更新所述设备信息列表;The first device updates the device information list according to the device information of the first device;
    所述第一设备向所述第五设备发送更新后的设备信息列表。The first device sends the updated device information list to the fifth device.
  32. 根据权利要求31所述的方法,其特征在于,所述第一设备向所述第五设备发送更新后的设备信息列表,包括:The method according to claim 31, wherein the sending of the updated device information list by the first device to the fifth device comprises:
    当预设的第二定时器超时时,所述第一设备向所述第五设备发送更新后的设备信息列表。When the preset second timer expires, the first device sends the updated device information list to the fifth device.
  33. 根据权利要求31或32所述的方法,其特征在于,所述方法还包括:The method according to claim 31 or 32, wherein the method further comprises:
    所述第一设备接收到第六设备加入所述信息同步系统的消息;The first device receives a message that the sixth device joins the information synchronization system;
    若所述第六设备为所述第二类型设备,则所述第一设备重新确定在所述环形网络中所述第一设备的上一节点和下一节点。If the sixth device is the second type device, the first device re-determines the previous node and the next node of the first device in the ring network.
  34. 根据权利要求22-33中任一项所述的方法,其特征在于,所述设备信息包括:设备名称、设备类型、设备型号、设备入网时间、互联网协议IP地址、媒体访问控制MAC地址、设备提供的服务或自定义的业务信息中的一项或多项。The method according to any one of claims 22-33, wherein the device information includes: device name, device type, device model, network access time of the device, Internet Protocol IP address, media access control MAC address, device One or more of the provided services or customized business information.
  35. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises:
    一个或多个处理器;One or more processors;
    存储器;Memory
    通信模块;Communication module
    其中,所述存储器中存储有一个或多个计算机程序,所述一个或多个计算机程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行如权利要求22-25或权利要求26-34中任一项所述的一种多设备之间的信息同步方法。Wherein, one or more computer programs are stored in the memory, and the one or more computer programs include instructions, and when the instructions are executed by the electronic device, the electronic device executes as claimed in claim 22-25. Or a method for information synchronization between multiple devices as described in any one of claims 26-34.
  36. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求22-25或权利要求26-34中任一项所述的一种多设备之间的信息同步方法。A computer-readable storage medium having instructions stored in the computer-readable storage medium, characterized in that, when the instructions are executed on an electronic device, the electronic device is caused to execute as claimed in claim 22-25 or claim A method for information synchronization between multiple devices as described in any one of 26-34.
  37. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行如权利要求22-25或权利要求26-34中任一项所述的一种多设备之间的信息同步方法。A computer program product containing instructions, characterized in that, when the computer program product runs on an electronic device, the electronic device is caused to execute any one of claims 22-25 or 26-34. A method of information synchronization between multiple devices.
PCT/CN2020/116005 2019-09-30 2020-09-17 Method and system for information synchronization between multiple devices, and electronic device WO2021063189A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910944497.5A CN112584463B (en) 2019-09-30 2019-09-30 Information synchronization method and system among multiple devices and electronic device
CN201910944497.5 2019-09-30

Publications (1)

Publication Number Publication Date
WO2021063189A1 true WO2021063189A1 (en) 2021-04-08

Family

ID=75116669

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/116005 WO2021063189A1 (en) 2019-09-30 2020-09-17 Method and system for information synchronization between multiple devices, and electronic device

Country Status (2)

Country Link
CN (2) CN112584463B (en)
WO (1) WO2021063189A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115514734A (en) * 2022-10-03 2022-12-23 陈军 Method and system for sending message
CN115529579A (en) * 2022-04-12 2022-12-27 荣耀终端有限公司 Device discovery method and device

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113645714B (en) * 2021-05-11 2024-04-26 中国建设银行股份有限公司 Device connection method, device, system, device and storage medium
CN113453207B (en) * 2021-06-21 2024-03-22 青岛海尔科技有限公司 Identity type determining method and device, storage medium and electronic device
CN115065653A (en) * 2022-05-10 2022-09-16 北京达佳互联信息技术有限公司 Session processing method, device and communication system
CN117950343A (en) * 2022-10-28 2024-04-30 华为技术有限公司 Device control system, method, device, readable storage medium, and chip

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141360A (en) * 2007-09-14 2008-03-12 四川长虹电器股份有限公司 Equipment management and control method of family network
CN102646081A (en) * 2010-10-29 2012-08-22 惠普发展公司,有限责任合伙企业 System and method for inductively pairing devices to share data or resources
US20140025962A1 (en) * 2012-07-23 2014-01-23 Sony Corporation Information processing apparatus, information processing method, information processing system, and program
CN106797553A (en) * 2014-10-13 2017-05-31 三星电子株式会社 For being connected to the method for external equipment and realizing the electronic equipment of the method
CN108351851A (en) * 2015-09-11 2018-07-31 思睿逻辑国际半导体有限公司 More equipment of multiple equipment synchronize

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5434230B2 (en) * 2009-04-22 2014-03-05 ソニー株式会社 Wireless communication apparatus, wireless communication system, wireless communication method, and program
CN104837168B (en) * 2014-02-12 2019-02-26 华为技术有限公司 A kind of equipment switching method, equipment and system
US10075836B2 (en) * 2015-06-23 2018-09-11 Intel Corporation Group management of devices methods, apparatuses and systems
US10609118B2 (en) * 2017-03-14 2020-03-31 International Business Machines Corporation Adaptive communication control device
CN109842508B (en) * 2017-11-27 2022-04-05 华为技术有限公司 Multi-terminal cooperative work method, terminal equipment and multi-terminal cooperative system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101141360A (en) * 2007-09-14 2008-03-12 四川长虹电器股份有限公司 Equipment management and control method of family network
CN102646081A (en) * 2010-10-29 2012-08-22 惠普发展公司,有限责任合伙企业 System and method for inductively pairing devices to share data or resources
US20140025962A1 (en) * 2012-07-23 2014-01-23 Sony Corporation Information processing apparatus, information processing method, information processing system, and program
CN106797553A (en) * 2014-10-13 2017-05-31 三星电子株式会社 For being connected to the method for external equipment and realizing the electronic equipment of the method
CN108351851A (en) * 2015-09-11 2018-07-31 思睿逻辑国际半导体有限公司 More equipment of multiple equipment synchronize

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115529579A (en) * 2022-04-12 2022-12-27 荣耀终端有限公司 Device discovery method and device
CN115529579B (en) * 2022-04-12 2023-06-20 荣耀终端有限公司 Equipment discovery method and device
CN115514734A (en) * 2022-10-03 2022-12-23 陈军 Method and system for sending message

Also Published As

Publication number Publication date
CN114844737A (en) 2022-08-02
CN112584463A (en) 2021-03-30
CN112584463B (en) 2022-04-22

Similar Documents

Publication Publication Date Title
WO2021063189A1 (en) Method and system for information synchronization between multiple devices, and electronic device
WO2021004381A1 (en) Screencasting display method, and electronic apparatus
WO2021083280A1 (en) Cross-device content projection method and electronic device
WO2020098437A1 (en) Method for playing multimedia data and electronic device
WO2021115193A1 (en) Device networking method, electronic device, and system
WO2020133183A1 (en) Audio data synchronization method and device
WO2021185141A1 (en) Wi-fi aware link establishment method and system, electronic device, and storage medium
CN111369988A (en) Voice awakening method and electronic equipment
WO2021017909A1 (en) Method, electronic device and system for realizing functions through nfc tag
WO2021013196A1 (en) Simultaneous response method and device
WO2021104114A1 (en) Method for providing wireless fidelity (wifi) network access service, and electronic device
WO2022222754A1 (en) Wifi link sleeping and wake-up methods, electronic device, and system
WO2021143314A1 (en) Method for reducing power consumption of mobile terminal and mobile terminal
EP4311314A1 (en) Sleep scheduling method and device
WO2022048371A1 (en) Cross-device audio playing method, mobile terminal, electronic device and storage medium
WO2022228051A1 (en) Device networking method, electronic device, and storage medium
WO2022213689A1 (en) Method and device for voice communicaiton between audio devices
WO2021043277A1 (en) Method for configuring bluetooth connection parameter, and electronic device
WO2021043250A1 (en) Bluetooth communication method, and related device
US20230171691A1 (en) Data transmission method and apparatus, and storage medium
WO2023179731A1 (en) Sleep/wake-up method and electronic device
WO2022057416A1 (en) Location service method and related apparatus
WO2024051718A1 (en) Data synchronization method, and related apparatus and system
WO2023165513A1 (en) Communication method, electronic device, and apparatus
WO2023061217A1 (en) Data transmission method and apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20872314

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20872314

Country of ref document: EP

Kind code of ref document: A1