A master device switching method and apparatus, electronic device, and storage medium
By establishing a mapping relationship between the master control device and preset identifiers and sub-device metadata in the smart home system, the problem of manual configuration when switching master control devices is solved, enabling fast and seamless switching and improving the user experience.
Patent Information
- Application Number
- CN202411873103.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-12-18
AI Technical Summary
In smart home systems, switching master control devices requires manual reconfiguration of information, resulting in a poor user experience.
By establishing a mapping relationship between the first master control device and a preset identifier, and a mapping relationship between the preset identifier and the metadata of the sub-device, the first master control device can be replaced with the second master control device, thus achieving the switching of the sub-device without manual reconfiguration.
It enables rapid switching of the master control device, improves the user experience, and simplifies the configuration process.
Smart Images

Figure CN119882395B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart home technology, and in particular to a method, apparatus, electronic device, and storage medium for switching master control devices. Background Technology
[0002] In a smart home system, the master control device is responsible for managing and coordinating the entire smart home network. It typically serves as the primary interface for user interaction with the system, receiving user commands and controlling other smart devices. When the master control device (such as a smart speaker or control panel) malfunctions, or when user needs or scenarios change, it's necessary to switch from the current master control device to another. However, currently, switching master control devices usually requires manually reconfiguring various settings, resulting in a poor user experience. Summary of the Invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a method, apparatus, electronic device and storage medium for switching master control devices to overcome the above problems or at least partially solve the above problems.
[0004] To address the aforementioned problems, this invention discloses a method for switching master control devices, the method comprising:
[0005] Obtain metadata of the first master control device, the metadata including information of the first master control device and information of the sub-devices controlled by the first master control device;
[0006] Obtain the address identifier of the first master control device and the address identifier of the second master control device;
[0007] Establish a first mapping relationship between the address identifier of the first master control device and a preset identifier, a second mapping relationship between the preset identifier and the metadata of the first master control device, and a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device;
[0008] According to the third mapping relationship, the address identifier of the first master control device in the first mapping relationship is replaced with the address identifier of the second master control device, so that when the second master control device receives an instruction, it responds to the instruction according to the first mapping relationship and the second mapping relationship.
[0009] Optionally, the method further includes:
[0010] Obtain the status information of the first master control device;
[0011] The status information of the first master control device is synchronized to the second master control device.
[0012] Optionally, the method further includes:
[0013] Intercept commands targeting the first master control device;
[0014] The instructions are translated to the second master control device.
[0015] Optionally, establishing a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device includes:
[0016] Obtain the metadata of the second master control device;
[0017] Based on the metadata of the second master control device and the information of the first master control device, determine whether the second master control device and the first master control device are of the same type;
[0018] If the second master control device is of the same type as the first master control device, then a third mapping relationship is established between the address identifier of the first master control device and the address identifier of the second master control device.
[0019] Optionally, the method further includes:
[0020] Verify whether the second master control device can control the sub-device.
[0021] Optionally, translating the instructions to the second master control device includes:
[0022] Obtain the decryption key of the first master control device and the encryption key of the second master control device;
[0023] The instruction is decrypted using the decryption key;
[0024] The instructions are encrypted using the encryption key.
[0025] Send the encrypted command to the second master control device.
[0026] Optionally, the address identifier is a MAC address.
[0027] Accordingly, embodiments of the present invention disclose a device for switching master control devices, the device comprising:
[0028] The metadata acquisition module is used to acquire the metadata of the first master control device, the metadata including information of the first master control device and information of the sub-devices controlled by the first master control device;
[0029] The address identifier acquisition module is used to acquire the address identifier of the first master control device and the address identifier of the second master control device;
[0030] The mapping relationship establishment module is used to establish a first mapping relationship between the address identifier of the first master control device and a preset identifier, a second mapping relationship between the preset identifier and the metadata of the first master control device, and a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device.
[0031] The mapping relationship update module is used to replace the address identifier of the first master control device in the first mapping relationship with the address identifier of the second master control device according to the third mapping relationship, so that the second master control device can respond to the instruction according to the first mapping relationship and the second mapping relationship when it receives the instruction.
[0032] Optionally, the device further includes:
[0033] The status information acquisition module is used to acquire the status information of the first master control device;
[0034] The status information synchronization module is used to synchronize the status information of the first master control device to the second master control device.
[0035] Optionally, the device further includes:
[0036] The instruction interception module is used to intercept instructions targeting the first master control device;
[0037] The instruction translation module is used to translate the instructions to the second master control device.
[0038] Optionally, the mapping relationship establishment module includes:
[0039] The metadata acquisition submodule is used to acquire the metadata of the second master control device;
[0040] The judgment submodule is used to determine whether the second master control device and the first master control device are of the same type based on the metadata of the second master control device and the information of the first master control device;
[0041] A submodule is established to establish a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device if the second master control device is of the same type as the first master control device.
[0042] Optionally, the device further includes:
[0043] The verification module is used to verify whether the second master control device can control the sub-device.
[0044] Optionally, the instruction translation module includes:
[0045] The key acquisition submodule is used to acquire the decryption key of the first master control device and the encryption key of the second master control device;
[0046] A decryption submodule is used to decrypt the instruction based on the decryption key;
[0047] An encryption submodule is used to encrypt the instructions according to the encryption key;
[0048] The sending submodule is used to send the encrypted instructions to the second master control device.
[0049] Optionally, the address identifier is a MAC address.
[0050] Accordingly, this invention discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various steps of the above-described master control device switching method embodiment.
[0051] Accordingly, this invention discloses a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the various steps of the above-described master control device switching method embodiments.
[0052] The embodiments of the present invention have the following advantages:
[0053] An embodiment of the present invention discloses a method for switching master control devices. The method involves obtaining metadata of a first master control device, including information about the first master control device and information about sub-devices controlled by the first master control device; obtaining the address identifiers of the first and second master control devices; establishing a first mapping relationship between the address identifiers of the first master control device and a preset identifier, a second mapping relationship between the preset identifiers and the metadata of the first master control device, and a third mapping relationship between the address identifiers of the first and second master control devices; and replacing the address identifier of the first master control device in the first mapping relationship with the address identifier of the second master control device according to the third mapping relationship, so that the second master control device responds to an instruction upon receiving an instruction based on the first and second mapping relationships. By establishing the mapping relationship between the first master control device and the preset identifier, the mapping relationship between the preset identifier and the metadata of the sub-devices, and replacing the first master control device in the mapping relationship between the first master control device and the preset identifier with the second master control device, a rapid switch from the first master control device to the second master control device is achieved without the need for manual reconfiguration of the sub-devices, thus improving the user experience. Attached Figure Description
[0054] Figure 1This is a flowchart illustrating the steps of a method for switching master control devices according to an embodiment of the present invention;
[0055] Figure 2 This is a structural block diagram of a master control device switching device according to an embodiment of the present invention. Detailed Implementation
[0056] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0057] In a smart home system, the master control device is the device responsible for managing and coordinating the entire smart home network. It is usually the main interface for users to interact with the smart home system, and is responsible for receiving user commands and controlling other smart devices.
[0058] Here are some common types of master control devices: smart speakers, which receive voice commands via voice assistants to control smart home devices, play music, set reminders, etc.; smartphones / tablets, which control smart home devices through dedicated applications, set automation scenes, monitor home security, etc.; smart control panels, which provide a touchscreen interface for centralized control of lighting, temperature, security, entertainment systems, etc., supporting scene settings and automation; smartwatches, which remotely control smart home devices through watch apps, receive notifications, set reminders, etc.; and smart TVs, which control smart home devices through the TV interface, watch surveillance videos, set scenes, etc. These master control devices typically connect to the smart home system via wireless protocols such as Wi-Fi and Bluetooth, or Ethernet, and communicate and control through cloud services or local networks. Users can choose the appropriate master control device to manage and control their smart home system according to their needs and preferences.
[0059] If the main control device (such as a smart speaker or central control panel) malfunctions, it's necessary to switch to another main control device to ensure the smart home functions properly. Alternatively, users may prefer to use different devices to control the smart home system, such as switching from a phone to a tablet, or from a smart speaker to a smartwatch. In multi-user homes, different users may want to use different devices to control the smart home system. Furthermore, users may need to use different devices to control the smart home system in different life scenarios; for example, using a smart speaker in the living room and a phone in the bedroom. When users leave home, they may need to switch to a phone or other remote control device to manage the smart home system. However, currently, switching main control devices usually requires manually reconfiguring various information, resulting in a poor user experience.
[0060] One of the core concepts of this invention is that by establishing a mapping relationship between a first master control device and a preset identifier, a mapping relationship between the preset identifier and the metadata of the sub-device, and replacing the first master control device in the mapping relationship between the first master control device and the preset identifier with a second master control device, a quick switch from the first master control device to the second master control device is achieved without the need for manual reconfiguration of the sub-device, thus improving the user experience.
[0061] Reference Figure 1 The diagram illustrates a flowchart of a method for switching master control devices according to an embodiment of the present invention, which may specifically include the following steps:
[0062] Step 101: Obtain the metadata of the first master control device, which includes information about the first master control device and information about the sub-devices controlled by the first master control device.
[0063] Specifically, metadata of the first master control device can be extracted from the first master control device. The metadata of the first master control device includes information about the first master control device and information about the sub-devices controlled by the first master control device. The information about the first master control device and the sub-devices controlled by the first master control device may include information such as device model, device category, device mid (Manufacturer ID), associated sub-devices, device scheduled tasks, and scene tasks.
[0064] Step 102: Obtain the address identifier of the first master control device and the address identifier of the second master control device.
[0065] Specifically, the address identifiers of the first master control device and the second master control device are obtained. The address identifiers can be used to uniquely identify and manage the device.
[0066] Step 103: Establish a first mapping relationship between the address identifier of the first master control device and a preset identifier, a second mapping relationship between the preset identifier and the metadata of the first master control device, and a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device.
[0067] Specifically, a first mapping relationship is established between the address identifier of the first master control device and a preset identifier, where the preset identifier is a unique ID. Then, a second mapping relationship is established between the preset identifier and the metadata of the first master control device, and a third mapping relationship is established between the address identifier of the first master control device and the address identifier of the second master control device. Establishing these mapping relationships enables collaborative work, data sharing, or status synchronization between the devices.
[0068] Step 104: According to the third mapping relationship, replace the address identifier of the first master control device in the first mapping relationship with the address identifier of the second master control device, so that when the second master control device receives an instruction, it responds to the instruction according to the first mapping relationship and the second mapping relationship.
[0069] For example, according to the third mapping relationship, the address identifier of the first master control device in the first mapping relationship is replaced with the address identifier of the second master control device. That is, according to the mapping between the address identifiers of the first master control device and the second master control device, the mapping between the address identifier of the first master control device and the preset identifier is updated to the mapping between the address identifier of the second master control device and the preset identifier. Since there is a mapping relationship between the preset identifier and the metadata of the first master control device, there is also a mapping relationship between the address identifier of the second master control device and the metadata of the first master control device. The metadata of the first master control device includes the information of the first master control device and the information of the sub-devices controlled by the first master control device. Therefore, after the first mapping relationship is updated, the sub-devices controlled by the first master control device are directly switched to the second master control device and controlled by the second master control device. Therefore, when switching from the first master control device to the second master control device, it is not necessary to update the mapping relationship, but there is no need to reconfigure each device.
[0070] An embodiment of the present invention discloses a method for switching master control devices. The method involves obtaining metadata of a first master control device, including information about the first master control device and information about sub-devices controlled by the first master control device; obtaining the address identifiers of the first and second master control devices; establishing a first mapping relationship between the address identifiers of the first master control device and a preset identifier, a second mapping relationship between the preset identifiers and the metadata of the first master control device, and a third mapping relationship between the address identifiers of the first and second master control devices; and replacing the address identifier of the first master control device in the first mapping relationship with the address identifier of the second master control device according to the third mapping relationship, so that the second master control device responds to an instruction upon receiving an instruction based on the first and second mapping relationships. By establishing the mapping relationship between the first master control device and the preset identifier, the mapping relationship between the preset identifier and the metadata of the sub-devices, and replacing the first master control device in the mapping relationship between the first master control device and the preset identifier with the second master control device, a rapid switch from the first master control device to the second master control device is achieved without the need for manual reconfiguration of the sub-devices, thus improving the user experience.
[0071] In this embodiment of the invention, the method further includes:
[0072] Obtain the status information of the first master control device.
[0073] Specifically, acquiring the status information of the primary control device refers to key data such as the device's current operating status, configuration parameters, connection status, and working mode. This status information is crucial for the normal operation of the system, user interaction, and device management. Below are some common status information and their uses: Working status: whether the device is currently running, such as "running," "standby," or "stopped"; Mode status: the device's current working mode, such as "automatic mode," "manual mode," or "energy-saving mode"; Device connection status: a list of smart devices currently connected to the primary control device, such as smart bulbs, smart sockets, and smart door locks, and the status information of each connected device, such as "online," "offline," or "faulty"; User interaction status: records of the user's recent operations on the primary control device, such as power on / off operations and mode switching, the current user's permission status, such as "administrator" or "regular user," and user feedback on the primary control device's operations, such as "operation successful" or "operation failed."
[0074] The status information of the first master control device is synchronized to the second master control device.
[0075] Specifically, after obtaining the status information of the first master control device, the status information of the first master control device is synchronized to the second master control device. In this way, it can be ensured that the second master control device takes over the control of the first master control device and the sub-devices under the first master control device, thus maintaining the continuity and stability of the smart home system.
[0076] In this embodiment of the invention, the method further includes:
[0077] Intercept commands targeting the first master control device.
[0078] Specifically, users can send control commands through a smart home application on their smartphone or tablet. The application sends the commands to the first master control device via the network. When updating the mapping relationship, the application intercepts the commands sent to the first master control device during the process of sending commands to the first master control device via the network. These commands are used to enable the first master control device to control the corresponding sub-devices, not to control the first master control device itself. In addition to controlling the corresponding sub-devices, the first master control device can also have independent control functions.
[0079] The instructions are translated to the second master control device.
[0080] Specifically, after intercepting the instructions for the first master control device, the instructions are translated and sent directly to the second master control device, which then distributes them to the sub-devices.
[0081] When the command for controlling the sub-device has not reached the first master control device, it can be intercepted and translated directly to the second master control device, which will then send it to the sub-device. When the command has already reached the first master control device, it is not necessary to send the command to the second master control device; the status information of the first master control device can be synchronized to the second master control device.
[0082] In this embodiment of the invention, establishing a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device includes:
[0083] Obtain the metadata of the second master control device.
[0084] Specifically, the metadata of the second master control device is obtained. The metadata of the second master control device may include basic equipment information such as model, category, and MID.
[0085] Based on the metadata of the second master control device and the information of the first master control device, determine whether the second master control device and the first master control device are of the same type.
[0086] Specifically, based on the metadata of the second master control device and the information of the first master control device, it is determined whether the second master control device and the first master control device are of the same type. For example, consistency means that the communication protocols and function control protocols used by the first and second master control devices are the same, or in other words, they are interoperable and compatible. After switching master control devices, the device status data packets and control command data packets are consistent with the original master control device. In this case, the model, category, and MID may not be completely identical. However, in general, smart home devices mostly need to have consistent basic information to have consistent protocols for them to be interoperable.
[0087] If the second master control device is of the same type as the first master control device, then a third mapping relationship is established between the address identifier of the first master control device and the address identifier of the second master control device.
[0088] Specifically, if the second master control device is of the same type as the first master control device, that is, the second master control device and the first master control device have the same protocol and can communicate with each other, then it is determined that the second master control device and the first master control device can be mapped, and a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device is established.
[0089] The protocol consistency and interoperability between the second master control device and the first master control device are the basis for establishing the mapping relationship, ensuring the standardization of communication, data compatibility, consistency of control commands, system integration and scalability, security and reliability, and consistency of user experience between devices. Protocol consistency means that two master control devices use the same communication standards and data formats, ensuring they can understand and parse the information sent by each other. Standardized communication makes data exchange between devices more reliable and efficient, avoiding communication failures or data errors caused by protocol inconsistencies. Protocol consistency also ensures that two master control devices use the same data formats and encoding methods, enabling them to correctly parse and process the data sent by each other. Data compatibility is the foundation for data exchange and sharing between devices, ensuring data accuracy and consistency. Protocol consistency ensures that two master control devices use the same control command format and syntax, enabling them to correctly understand and execute each other's control commands. Command consistency is the foundation for collaborative control and linkage between devices, ensuring accurate execution and response of control commands. Protocol consistency simplifies the system integration process, enabling seamless connection and collaborative work between different devices and systems, enhancing system scalability, and making it easier to integrate new devices and functions into existing systems without complex protocol conversions and adaptations. Protocol consistency ensures that users receive a consistent operating experience when using different devices, simplifying user learning and usage costs, making interaction between devices more seamless and natural, and improving the smoothness and convenience of the user experience.
[0090] In this embodiment of the invention, the method further includes:
[0091] Verify whether the second master control device can control the sub-device.
[0092] Specifically, after replacing the address identifier of the first master control device in the first mapping relationship with the address identifier of the second master control device according to the third mapping relationship, and synchronizing the status information of the first master control device to the second master control device, that is, after switching from the first master control device to the second master control device, it is verified whether the second master control device can correctly control the sub-devices and ensure that the status and functions of all devices are normal. This can be confirmed by directly controlling the second master control device.
[0093] For example, it can be checked whether the second master control device can communicate with the sub-devices via the network, confirm that the second master control device can correctly identify and list all connected sub-devices, and ensure that the second master control device can obtain and display the current status of all sub-devices, thereby ensuring that the second master control device and the sub-devices are successfully connected; it can also be tested whether the second master control device can correctly control the on / off status of the sub-devices (such as the on / off of lights, appliances, etc.), whether it can correctly switch the working mode of the sub-devices (such as automatic mode, manual mode, energy-saving mode, etc.), and whether it can correctly adjust the operating parameters of the sub-devices (such as temperature, brightness, volume, etc.), thereby ensuring that the second master control device can perform basic control functions; it can also be verified whether the second master control device can update and display the current status of the sub-devices in real time (such as device online status, running status, etc.), test whether the second master control device can correctly receive and display the feedback information of the sub-devices (such as fault alarms, operation feedback, etc.), and verify whether the second master control device can correctly record and display the operation history and status changes of the sub-devices, thereby ensuring that the second master control device can correctly obtain and display the status and feedback information of the sub-devices.
[0094] In this embodiment of the invention, translating the instructions to the second master control device includes:
[0095] Obtain the decryption key of the first master control device and the encryption key of the second master control device;
[0096] The instruction is decrypted using the decryption key;
[0097] The instructions are encrypted using the encryption key.
[0098] Send the encrypted command to the second master control device.
[0099] Specifically, the decryption key of the first master control device and the encryption key of the second master control device are obtained. The intercepted instructions are decrypted according to the decryption key of the first master control device, and the decrypted instructions are encrypted according to the encryption key of the second master control device. The encrypted instructions are then sent to the second master control device.
[0100] Similarly, data packets sent by the sub-device to the first master control device will also be intercepted and translated to the second master control device. Specifically, the data packets will be decrypted according to the decryption key of the first master control device, and then the decrypted data packets will be encrypted according to the encryption key of the second master control device. The encrypted data packets will then be sent to the second master control device. The data packets sent by the sub-device to the first master control device can be the sub-device status reported by the sub-device to the first master control device.
[0101] In this embodiment of the invention, the address identifier is a MAC address.
[0102] Specifically, a MAC address (Media Access Control Address) is a unique identifier for network devices (such as computers, routers, smart home devices, etc.) used to identify and locate devices within a local area network (LAN). A MAC address consists of 48 binary digits, typically represented as 12 hexadecimal numbers, divided into 6 groups of 2 characters each, separated by colons or hyphens. For example: 00:1A:2B:3C:4D:5E.
[0103] Using MAC addresses as address identifiers offers uniqueness. MAC addresses are globally unique, assigned to device manufacturers by the IEEE, ensuring that each device's MAC address is unique worldwide. Within a local area network (LAN), the MAC address serves as a unique identifier, ensuring each device has a unique identity within the network. Typically, MAC addresses are hardware-based and cannot be changed, ensuring the stability and reliability of device identification and preventing identity confusion caused by software configuration errors or malicious tampering. Hardware-based MAC addresses remain unchanged throughout the device's lifespan, ensuring a stable identity within the network. MAC addresses are data link layer (Layer 2 of the OSI model) identifiers used for direct communication between devices. In a LAN, data packets use MAC addresses for source and destination address identification and transmission. Using MAC addresses as identifiers ensures the accuracy and reliability of communication between devices, avoiding communication failures due to address conflicts or errors. In smart home systems, using MAC addresses as the unique identifier for master devices offers numerous advantages, including uniqueness, hardware fixation, fundamental network communication infrastructure, network management, compatibility and standardization, simplicity, and efficiency. These advantages ensure a device's unique identity within the network, stable communication, efficient management, and secure control, thereby enhancing the overall performance and user experience of the smart home system.
[0104] Address identifiers can be physical addresses (such as MAC addresses) or logical addresses (such as IP addresses), depending on the device's communication protocol and network architecture. Below are some common address identifier types and their uses, including IP addresses (Internet Protocol addresses). IP address is a logical address used to uniquely identify a device in a network. It is typically composed of 4 bytes (32 bits) and represented in dotted decimal notation (e.g., 192.168.1.100). IP addresses are used to locate and route data packets in a network, ensuring communication between devices. The primary control device (such as a smartphone or smart control panel) can be uniquely identified by its IP address. Zigbee address: Zigbee is a low-power, short-range wireless communication protocol. Devices in a Zigbee network use a unique 64-bit address (IEEE address) and a 16-bit network address (short address). Zigbee addresses are used to uniquely identify devices in a Zigbee network, ensuring communication and data transmission between devices. The primary control device (such as a Zigbee gateway) can be uniquely identified by its Zigbee address. Device ID: A device ID is a unique identifier assigned to each device in a smart home system. It is usually automatically generated by the system or manually set by the user. Device IDs are used to uniquely identify devices in a smart home system, ensuring communication and data transmission between devices. The primary control device (such as a smart speaker) can be uniquely identified by its device ID.
[0105] Of course, the address identifier can be set according to actual needs in practical applications, and this embodiment of the invention does not limit this.
[0106] An embodiment of the present invention provides a method for switching master control devices. By updating the mapping relationship, it is possible to quickly switch between different master control devices without reconfiguring each device, which greatly improves the flexibility and maintainability of the system. At the same time, it enables various sub-devices under the old master control to operate normally without interruption under the new master control, which helps to improve the security of the smart home system because it can reduce the system interruption time caused by master control device failure.
[0107] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0108] Reference Figure 2The diagram illustrates a structural block diagram of a master control device switching apparatus according to an embodiment of the present invention, which may specifically include the following modules:
[0109] Metadata acquisition module 201 is used to acquire metadata of the first master control device, the metadata including information of the first master control device and information of the sub-devices controlled by the first master control device;
[0110] Address identifier acquisition module 202 is used to acquire the address identifier of the first master control device and the address identifier of the second master control device;
[0111] The mapping relationship establishment module 203 is used to establish a first mapping relationship between the address identifier of the first master control device and a preset identifier, a second mapping relationship between the preset identifier and the metadata of the first master control device, and a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device.
[0112] The mapping relationship update module 204 is used to replace the address identifier of the first master control device in the first mapping relationship with the address identifier of the second master control device according to the third mapping relationship, so that the second master control device can respond to the instruction according to the first mapping relationship and the second mapping relationship when it receives the instruction.
[0113] An embodiment of the present invention provides a device for switching master control devices. The device acquires metadata of a first master control device, including information about the first master control device and information about sub-devices controlled by the first master control device. It acquires the address identifiers of the first and second master control devices. It establishes a first mapping relationship between the address identifiers of the first master control device and a preset identifier, a second mapping relationship between the preset identifiers and the metadata of the first master control device, and a third mapping relationship between the address identifiers of the first and second master control devices. Based on the third mapping relationship, it replaces the address identifier of the first master control device in the first mapping relationship with the address identifier of the second master control device, so that the second master control device responds to an instruction received based on the first and second mapping relationships. By establishing the mapping relationship between the first master control device and the preset identifier, the mapping relationship between the preset identifier and the metadata of the sub-devices, and replacing the first master control device in the mapping relationship with the second master control device, a rapid switch from the first master control device to the second master control device is achieved without manual reconfiguration of the sub-devices, thus improving the user experience.
[0114] In this embodiment of the invention, the device further includes:
[0115] The status information acquisition module is used to acquire the status information of the first master control device;
[0116] The status information synchronization module is used to synchronize the status information of the first master control device to the second master control device.
[0117] In this embodiment of the invention, the device further includes:
[0118] The instruction interception module is used to intercept instructions targeting the first master control device;
[0119] The instruction translation module is used to translate the instructions to the second master control device.
[0120] In this embodiment of the invention, the mapping relationship establishment module includes:
[0121] The metadata acquisition submodule is used to acquire the metadata of the second master control device;
[0122] The judgment submodule is used to determine whether the second master control device and the first master control device are of the same type based on the metadata of the second master control device and the information of the first master control device;
[0123] A submodule is established to establish a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device if the second master control device is of the same type as the first master control device.
[0124] In this embodiment of the invention, the device further includes:
[0125] The verification module is used to verify whether the second master control device can control the sub-device.
[0126] In this embodiment of the invention, the instruction translation module includes:
[0127] The key acquisition submodule is used to acquire the decryption key of the first master control device and the encryption key of the second master control device;
[0128] A decryption submodule is used to decrypt the instruction based on the decryption key;
[0129] An encryption submodule is used to encrypt the instructions according to the encryption key;
[0130] The sending submodule is used to send the encrypted instructions to the second master control device.
[0131] In this embodiment of the invention, the address identifier is a MAC address.
[0132] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0133] This invention also provides an electronic device, comprising:
[0134] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described method embodiment for switching the master control device and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0135] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described method embodiment for switching the master control device and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0136] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0137] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0138] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0139] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0141] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0142] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0143] The present invention has provided a detailed description of a method, apparatus, electronic device, and storage medium for switching master control devices. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for switching master control devices, characterized in that, The method includes: Obtain metadata of the first master control device, the metadata including information of the first master control device and information of the sub-devices controlled by the first master control device; Obtain the address identifier of the first master control device and the address identifier of the second master control device; Establish a first mapping relationship between the address identifier of the first master control device and a preset identifier, a second mapping relationship between the preset identifier and the metadata of the first master control device, and a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device; According to the third mapping relationship, the address identifier of the first master control device in the first mapping relationship is replaced with the address identifier of the second master control device, so that when the second master control device receives an instruction, it responds to the instruction according to the first mapping relationship and the second mapping relationship.
2. The method according to claim 1, characterized in that, The method further includes: Obtain the status information of the first master control device; The status information of the first master control device is synchronized to the second master control device.
3. The method according to claim 1, characterized in that, The method further includes: Intercept commands targeting the first master control device; The instructions are translated to the second master control device.
4. The method according to claim 1, characterized in that, The establishment of the third mapping relationship between the address identifiers of the first master control device and the address identifiers of the second master control device includes: Obtain the metadata of the second master control device; Based on the metadata of the second master control device and the information of the first master control device, determine whether the second master control device and the first master control device are of the same type; If the second master control device is of the same type as the first master control device, then a third mapping relationship is established between the address identifier of the first master control device and the address identifier of the second master control device.
5. The method according to claim 1, characterized in that, The method further includes: Verify whether the second master control device can control the sub-device.
6. The method according to claim 3, characterized in that, The step of translating the instructions to the second master control device includes: Obtain the decryption key of the first master control device and the encryption key of the second master control device; The instruction is decrypted using the decryption key; The instructions are encrypted using the encryption key. Send the encrypted command to the second master control device.
7. The method according to claim 1, characterized in that, The address identifier is a MAC address.
8. A device for switching master control equipment, characterized in that, The device includes: The metadata acquisition module is used to acquire the metadata of the first master control device, the metadata including information of the first master control device and information of the sub-devices controlled by the first master control device; The address identifier acquisition module is used to acquire the address identifier of the first master control device and the address identifier of the second master control device; The mapping relationship establishment module is used to establish a first mapping relationship between the address identifier of the first master control device and a preset identifier, a second mapping relationship between the preset identifier and the metadata of the first master control device, and a third mapping relationship between the address identifier of the first master control device and the address identifier of the second master control device. The mapping relationship update module is used to replace the address identifier of the first master control device in the first mapping relationship with the address identifier of the second master control device according to the third mapping relationship, so that the second master control device can respond to the instruction according to the first mapping relationship and the second mapping relationship when it receives the instruction.
9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the master device switching method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the master control device switching method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Unique identities of endpoints across layer 3 networks
CN112703717A
Network distribution method, device and system of intelligent equipment, equipment and storage medium
CN114244643A