A communication method and device
By introducing communication methods and devices in the instant communication APP, multiple electronic devices are allowed to log in to the same main account and operate by displaying pages, the problem that the instant communication APP must connect to the server to send and receive messages from each other is solved, and communication between devices of different protocols is realized.
Patent Information
- Application Number
- CN202111486817.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-08-17
- Filing Date
- 2021-12-07
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2041-12-07
AI Technical Summary
In the prior art, instant communication APPs must connect to servers to send and receive messages from each other, and devices with different protocols have difficulty communicating.
Provide a communication method and device, allowing multiple electronic devices to log in to the same main account, respond to user operations by displaying pages, displaying sub-accounts and communication controls, users can choose a connection method or forwarding method, and control the target sub-account to communicate with other accounts through corresponding communication methods.
It solves the problem that instant messaging APPs must connect to servers to send and receive messages from each other, realizes communication between devices of different protocols, simplifies user operations, and unifies the way to connect different protocols.
Smart Images

Figure CN115714754B_ABST
Abstract
Description
[0001] This application claims the priority of a Chinese patent application with the application number 202110942784.X and the application title "A Communication Method and Device", which was filed with the National Intellectual Property Administration on August 17, 2021. The entire content of this Chinese patent application is incorporated herein by reference. Technical Field
[0002] The present invention relates to the field of communication technologies, and in particular, to a communication method and a device. Background Art
[0003] With the development of communication technologies, especially the popularization of instant messaging applications (APPs), users can log in to instant messaging APPs through electronic devices to conduct instant messaging with family members, friends, and professional partners.
[0004] Currently, when a first electronic device (communication message sending end) and a second electronic device (communication message receiving end) conduct instant messaging, they must be connected to a server to send and receive messages from each other. If the communication protocols of the first electronic device and the second electronic device are different, it takes a lot of time to establish a connection between the two different communication protocols, consuming a large amount of human and material resources. Summary of the Invention
[0005] The present invention provides a communication method and a device, which solve the technical problems in the prior art that instant messaging APPs must be connected to a server to send and receive messages from each other and it is very difficult to communicate with other devices with different protocols through the server.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, an embodiment of the present invention provides a communication method, which is applied to a communication system including multiple electronic devices; the same main account is logged in to all the multiple electronic devices; the communication method includes: in a display page showing the multiple electronic devices, in response to a trigger operation performed by a user on a target electronic device among the multiple electronic devices, showing multiple sub-accounts established in the main account; in response to a communication selection operation performed by the user on a target sub-account among the multiple sub-accounts, showing multiple communication controls corresponding to the communication selection operation; the communication selection operation includes: a connection method selection operation or a forwarding method selection operation; in response to a trigger operation performed by the user on a target communication control among the multiple communication controls, controlling the target sub-account in the target electronic device to communicate with other accounts through a communication method corresponding to the target communication control; the communication method of the other accounts is the same as that of the target sub-account.
[0008] In an implementable manner, when the communication selection operation is to select a connection method, the multiple communication controls include one or more of the following: Server Extensible Messaging and Presence Protocol (XMPP) protocol control, Message Queuing Telemetry Transport (MQTT) protocol control, MQTT protocol bridging control, personal hotspot Wi-Fi server control, local area network Wi-Fi server control, local area network Wi-Fi client control, Bluetooth wireless mesh network coordinator control, Bluetooth mesh network server control, Bluetooth mesh network client control, ZigBee network coordinator control, ZigBee network routing control, ZigBee network client control, Long Range Radio (LoRa) network gateway control, LoRa network client control; in response to a triggering operation performed by the user on the target communication control among the multiple communication controls, controlling the target sub-account in the target electronic device to communicate with other accounts through the communication method corresponding to the target communication control, including: in response to the triggering operation performed by the user on the target communication control, controlling the target sub-account in the target electronic device to establish a communication connection with other accounts through the communication method corresponding to the target communication control.
[0009] In an implementable manner, when the target communication control is a server XMPP protocol control or a server MQTT protocol control, it further includes: in response to the triggering operation performed by the user on the target communication control, controlling the target sub-account in each of the multiple electronic devices to establish a communication connection with other accounts through the communication method corresponding to the target communication control.
[0010] In an implementable manner, when the target communication control is any one of the MQTT protocol bridging control, personal hotspot Wi-Fi server control, local area network Wi-Fi server control, local area network Wi-Fi client control, Bluetooth mesh network coordinator control, Bluetooth mesh network server control, Bluetooth mesh network client control, ZigBee network coordinator control, ZigBee network routing control, ZigBee network client control, LoRa network gateway control, LoRa network client control, it further includes: in response to the triggering operation performed by the user on the target communication control, controlling the target sub-account in the other electronic devices except the target electronic device among the multiple electronic devices to stop establishing a communication connection with other accounts through the communication method corresponding to the target communication control; controlling the first account to establish a communication connection with other accounts through the first communication method; the first account is the target sub-account in the target electronic device; the first communication method is the communication method corresponding to the target communication control.
[0011] In an implementable manner, it further includes: displaying a parameter setting page in response to a triggering operation performed by the user on a target communication control; the parameter setting page is used to prompt the user to set communication parameters of a communication method corresponding to the target communication control.
[0012] In an implementable manner, when the communication selection operation is to select a forwarding method, the multiple communication controls include one or more of the following: a second account control, a serial port control, an I2C bus control, a controller area network CAN bus control, a universal serial USB bus control, a radio frequency transceiver module RF433 control, an MQTT client control, a private COPE client control, a hypertext transfer protocol HTTP client control, a transmission control protocol TCP / user datagram protocol UDP-client control, a Bluetooth low energy BLE Bluetooth-slave control, a local area network WIFI-client control, a Bluetooth mesh network-client control, a ZigBee network-client control, a LoRa network-client control; in response to a triggering operation performed by the user on the target communication control among the multiple communication controls, controlling the target sub-account in the target electronic device to communicate with other accounts through the communication method corresponding to the target communication control, including: in response to a triggering operation performed by the user on the target communication control, controlling the target sub-account in the target electronic device to forward the received communication message to the account or interface corresponding to the target communication control, and receiving the communication message sent by the account or interface corresponding to the target communication control.
[0013] In an implementable manner, when the target communication control is any one of a second account control, a serial port control, an I2C bus control, a CAN bus control, a USB bus control, an RF433 control, an MQTT client control, a COPE client control, an HTTP client control, a TCP / UDP-client control, a BLE Bluetooth-slave control, a local area network WIFI-client control, a Bluetooth mesh network-client control, a ZigBee network-client control, a LoRa network-client control, it further includes: in response to a triggering operation performed by the user on the second account control, controlling the second account to forward the received communication message through a second communication method, and receiving the communication message sent by a third account through the second communication method; the third account is an account other than the target sub-account among multiple electronic devices; the second communication method is a communication method established through an account or interface other than the account or interface corresponding to the target communication control.
[0014] In an implementable manner, when the target communication control is any one of a serial port control, an I2C bus control, a CAN bus control, a USB bus control, an RF433 control, an MQTT client control, a COPE client control, an HTTP client control, a TCP / UDP - client control, a BLE Bluetooth - slave control, a local area network WIFI - client control, a Bluetooth mesh network - client control, a ZigBee network - client control, and a LoRa network - client control, it further includes: in response to a trigger operation performed by the user on the target communication control, controlling other accounts in the target electronic device except the target sub - account to stop forwarding received communication messages through the communication method corresponding to the target communication control; and controlling the same target sub - account in different electronic devices among multiple electronic devices to select the same or different forwarding methods.
[0015] In an implementable manner, it further includes: in response to a trigger operation performed by the user on the whitelist setting control of the electronic device, controlling whether the messages of the sub - devices under the electronic device where the main account is located can be sent to other target sub - accounts through the sub - account after being forwarded in the communication method selected for binding, or whether the sub - account can send the messages received from other target sub - accounts to the sub - devices under the electronic device where the main account is located in the communication method selected for binding after receiving the messages.
[0016] In response to a trigger operation performed by the user on the whitelist setting control of the electronic device, controlling the main account to poll and manage the sub - devices under the electronic device where the main account is located at all times.
[0017] In an implementable manner, the communication protocol format between devices is: {"S":"1","D":"2","L":"3","R":"4","C":"5","N":6,"V":[7],"I":"8","M":"9","T":"20211110111110","P":"11","U":"12"}, and the data is a json - formatted string; "S" is the source sub - account that sends data, "D" is the destination sub - account that receives data, "L" is the address of the source sub - device under a certain electronic device where the main account is located, "R" is the address of the destination sub - device under a certain electronic device where the main account is located; "C" is a command, representing an operation, and the command types include: read, write, notify, request, and report; "N" is the number of a certain operation, which is different each time, and the value is an integer; "V" is the real data value of the data, and the value is a json array; "I" indicates the direction of data flow of the command and is used to determine what type of command it is; "M" is data required by the system internally and is irrelevant to the application; "T" is the time when the data is sent, "P" is the protocol type or version of the current protocol, and "U" is the ID of the main device of the data - sending party.
[0018] In an implementable manner, it further includes: in response to the user's triggering operation on the request and reporting binding control, and then in response to the user's triggering operation on the friend to be requested and reported, selecting the data of the request and reporting command and sending it to the target sub-account that needs to receive the command data; after the sub-account receives the data from the sub-device, according to command C in the data, selecting the target sub-account, and then sending the data to the target sub-account;
[0019] In response to the user's triggering operation on the local function selection control of the device, selecting one of the functions built into the device locally, so that the data from other target sub-accounts or from the sub-devices under the target sub-account is output to the selected function built into the device locally; after the local function is output with data, selecting a certain type of output function according to I, selecting a specific function according to command C, the internal process determines whether the data is the data of the current process according to N, and finally uses the data value V.
[0020] In a second aspect, the present invention provides a communication device, which is applied to a communication system including multiple electronic devices; the same main account is logged in to multiple electronic devices; the communication device includes: a display unit and a processing unit; the display unit is used to, in the display page of the multiple electronic devices, in response to the triggering operation performed by the user on the target electronic device among the multiple electronic devices, display multiple sub-accounts established in the main account; the display unit is further used to, in response to the communication selection operation performed by the user on the target sub-account among the multiple sub-accounts, display multiple communication controls corresponding to the communication selection operation; the communication selection operation includes: selecting a connection method operation or selecting a forwarding method operation; the processing unit is used to, in response to the triggering operation performed by the user on the target communication control among the multiple communication controls, control the target sub-account in the target electronic device to communicate with other accounts through the communication method corresponding to the target communication control; the communication method of the other accounts is the same as that of the target sub-account.
[0021] In an implementable manner, when the communication selection operation is to select a connection method, the multiple communication controls include one or more of the following: Server Extensible Messaging and Presence Protocol (XMPP) protocol control, Message Queuing Telemetry Transport (MQTT) protocol control, MQTT protocol bridging control, personal hotspot Wi-Fi server control, local area network Wi-Fi server control, local area network Wi-Fi client control, Bluetooth wireless mesh network coordinator control, Bluetooth mesh network server control, Bluetooth mesh network client control, ZigBee network coordinator control, ZigBee network routing control, ZigBee network client control, Long Range (LoRa) network gateway control, LoRa network client control; The processing unit is specifically configured to: in response to a triggering operation performed by the user on the target communication control, control the target sub-account in the target electronic device to establish a communication connection with other accounts through the communication method corresponding to the target communication control.
[0022] In an implementable manner, when the target communication control is the server XMPP protocol control or the server MQTT protocol control, the processing unit is further configured to, in response to a triggering operation performed by the user on the target communication control, control the target sub-account in each of the multiple electronic devices to establish a communication connection with other accounts through the communication method corresponding to the target communication control.
[0023] In an implementable manner, when the target communication control is any one of the MQTT protocol bridging control, personal hotspot Wi-Fi server control, local area network Wi-Fi server control, local area network Wi-Fi client control, Bluetooth mesh network coordinator control, Bluetooth mesh network server control, Bluetooth mesh network client control, ZigBee network coordinator control, ZigBee network routing control, ZigBee network client control, LoRa network gateway control, LoRa network client control, the processing unit is further configured to, in response to a triggering operation performed by the user on the target communication control, control the target sub-account in the other electronic devices except the target electronic device among the multiple electronic devices to stop establishing a communication connection with other accounts through the communication method corresponding to the target communication control; The processing unit is further configured to control the first account to establish a communication connection with other accounts through the first communication method; The first account is the target sub-account in the target electronic device; The first communication method is the communication method corresponding to the target communication control.
[0024] In an implementable manner, the processing unit is further configured to, in response to a triggering operation performed by the user on the target communication control, display a parameter setting page; The parameter setting page is used to prompt the user to set the communication parameters of the communication method corresponding to the target communication control.
[0025] In an implementable manner, when the communication selection operation is the selection forwarding mode, the multiple communication controls include one or more of the following: a second account control, a serial port control, an I2C bus control, a controller area network CAN bus control, a universal serial USB bus control, a radio frequency transceiver module RF433 control, an MQTT server control, a private COPE server control, a hypertext transfer protocol HTTP server control, a transmission control protocol TCP / user datagram protocol UDP server-client control, a Bluetooth low energy BLE Bluetooth-slave control, a local area network WIFI-client control, a Bluetooth mesh network-client control, a ZigBee network-client control, a LoRa network-client control; specifically, the processing unit is configured to: in response to a trigger operation performed by a user on a target communication control, control a target sub-account in the target electronic device to forward the received communication message to an account or interface corresponding to the target communication control, and receive a communication message sent by an account or interface corresponding to the target communication control.
[0026] In an implementable manner, when the target communication control is any one of a second account control, a serial port control, an I2C bus control, a CAN bus control, a USB bus control, an RF433 control, an MQTT client control, a COPE client control, an HTTP client control, a TCP / UDP-client control, a BLE Bluetooth-slave control, a local area network WIFI-client control, a Bluetooth mesh network-client control, a ZigBee network-client control, a LoRa network-client control, the processing unit is further configured to, in response to a trigger operation performed by the user on the second account control, control the second account to forward the received communication message through a second communication mode, and receive a communication message sent by a third account through the second communication mode; the third account is an account other than the target sub-account among the multiple electronic devices; the second communication mode is a communication mode established through an account or interface other than the account or interface corresponding to the target communication control.
[0027] In an implementable manner, when the target communication control is any one of a serial port control, an I2C bus control, a CAN bus control, a USB bus control, an RF433 control, an MQTT client control, a COPE client control, an HTTP client control, a TCP / UDP - client control, a BLE Bluetooth - slave control, a local area network WIFI - client control, a Bluetooth mesh network - client control, a ZigBee network - client control, and a LoRa network - client control, the processing unit is further configured to, in response to a triggering operation performed by the user on the target communication control, control other accounts in the target electronic device except the target sub - account to stop forwarding received communication messages through the communication method corresponding to the target communication control; and control the same target sub - accounts in different electronic devices among multiple electronic devices to select the same or different forwarding methods.
[0028] In an implementable manner, the processing unit is further configured to: in response to a triggering operation performed by the user on the white - list setting control of the electronic device, control whether the messages of the sub - devices under the electronic device where the main account is located can be sent to other target sub - accounts by the sub - account after being forwarded and bound to the selected communication method, or whether the sub - account can send the messages received from other target sub - accounts to the sub - devices under the electronic device where the main account is located under the communication method selected for forwarding and binding.
[0029] In response to a triggering operation performed by the user on the white - list setting control of the electronic device, control the main account to poll and manage the sub - devices under the electronic device where the main account is located at all times.
[0030] In an implementable manner, the communication protocol format between devices is: {"S":"1","D":"2","L":"3","R":"4","C":"5","N":6,"V":[7],"I":"8","M":"9","T":"20211110111110","P":"11","U":"12"}, and the data is a json - formatted string; "S" is the source sub - account sending the data, "D" is the destination sub - account receiving the data, "L" is the address of the source sub - device under a certain electronic device where the main account is located, "R" is the address of the destination sub - device under a certain electronic device where the main account is located; "C" is a command, representing an operation, and the command types include: read, write, notify, request, and report; "N" is the number of a certain operation, which is different each time, and the value is an integer; "V" is the real data value of the data, and the value is a json array; "I" indicates the direction of data flow of the command and is used to determine the type of the command; "M" is data required by the system internally and has nothing to do with the application; "T" is the time when the data is sent, "P" is the protocol type or version of the current protocol, and "U" is the ID of the main device of the data - sending party.
[0031] In an implementable manner, the processing unit is further configured to: in response to a user's triggering operation on the request and reporting binding control, and then in response to the user's triggering operation on the friend to be requested and reported, select the data of the request and reporting command and send it to the target sub-account that receives the command data; after the sub-account receives the data from the sub-device, select the target sub-account according to command C in the data, and then send the data to the target sub-account;
[0032] In response to a user's triggering operation on the local function selection control of the device, select one of the functions built into the device locally, so that the data from other target sub-accounts or from the sub-devices under the target sub-account is output to the locally built-in function of the device selected; after the local function outputs the data, select a certain type of output function according to I, select a specific function according to command C, the internal process determines whether the data is the data of the current process according to N, and finally uses the data value V.
[0033] In a third aspect, the present invention provides a communication device, including: a communication interface, a processor, a memory, and a bus; the memory is used to store computer execution instructions, and the processor is connected to the memory through the bus. When the communication device runs, the processor executes the computer execution instructions stored in the memory, so that the communication device executes the communication method provided in the first aspect as described above.
[0034] In a fourth aspect, the present invention provides a computer-readable storage medium, including instructions. When the instructions run on a computer, the computer is made to execute the communication method provided in the first aspect as described above.
[0035] In a fifth aspect, the present invention provides a computer program product, which when running on a computer, causes the computer to execute the communication method as described in the design manner of the first aspect.
[0036] It should be noted that the above computer instructions can be stored in whole or in part on the first computer-readable storage medium. Among them, the first computer-readable storage medium can be packaged together with the processor of the communication device, or can be packaged separately from the processor of the communication device, and the present invention does not make any limitation in this regard.
[0037] The descriptions of the second aspect, the third aspect, the fourth aspect, and the fifth aspect of the present invention can refer to the detailed description of the first aspect; and, for the beneficial effects of the descriptions of the second aspect, the third aspect, the fourth aspect, and the fifth aspect, reference can be made to the analysis of the beneficial effects of the first aspect, and details are not described herein again.
[0038] In the present invention, the name of the above communication device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of the present invention, they belong to the scope of the claims of the present invention and their equivalent technologies.
[0039] These and other aspects of the present invention will become more apparent from the following description.
[0040] As can be seen from the above, in the communication method provided by the present invention, any one of the multiple electronic devices logged in with the same main account can display multiple sub-accounts established in the main account in response to a trigger operation performed by a user on a target electronic device among the multiple electronic devices in a display page displaying multiple electronic devices. Subsequently, the electronic device can also display multiple communication controls corresponding to the communication selection operation in response to a communication selection operation performed by a user on a target sub-account among the multiple sub-accounts, and control the target sub-account in the target electronic device to communicate with other accounts (the communication methods of other accounts are the same as the communication methods of the target sub-account) or other networks through the communication method corresponding to the target communication control in response to a trigger operation performed by the user on a target communication control among the multiple communication controls.
[0041] Since the communication selection operation includes selecting a connection method operation or selecting a forwarding method operation, the electronic device can display multiple communication controls corresponding to the communication selection operation according to different communication selection operations, and after the user selects the target communication control, control the target sub-account in the target electronic device to communicate with other accounts or other networks through the communication method corresponding to the target communication control. In this way, the user can use different protocols for connection and forwarding methods under one sub-account according to needs, and connect two networks with different protocols. The method is simple, and the connection methods for all different protocols are the same and unified. As long as the connection method is the same, they can communicate with each other, which solves the problem in the prior art that instant messaging APPs must connect to the server to send and receive messages to each other. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 An architecture diagram of a communication system for a communication method provided by an embodiment of the present invention;
[0044] Figure 2One of the schematic flowcharts of the communication method provided by the embodiment of the present invention;
[0045] Figure 3 One of the interaction diagrams of the communication method provided by the embodiment of the present invention;
[0046] Figure 4 Two of the schematic flowcharts of the communication method provided by the embodiment of the present invention;
[0047] Figure 5 Three of the schematic flowcharts of the communication method provided by the embodiment of the present invention;
[0048] Figure 6 Four of the schematic flowcharts of the communication method provided by the embodiment of the present invention;
[0049] Figure 7 Five of the schematic flowcharts of the communication method provided by the embodiment of the present invention;
[0050] Figure 8 Six of the schematic flowcharts of the communication method provided by the embodiment of the present invention;
[0051] Figure 9 One of the schematic structural diagrams of the communication device provided by the embodiment of the present invention;
[0052] Figure 10 Two of the schematic structural diagrams of the communication device provided by the embodiment of the present invention. Detailed implementation manners
[0053] The embodiments of the present invention will be described below with reference to the accompanying drawings.
[0054] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0055] In order to clearly describe the technical solutions in the embodiments of the present invention, in the embodiments of the present invention, terms such as "first" and "second" are used to distinguish the same items or similar items with basically the same functions and roles. Those skilled in the art can understand that the terms "first" and "second" do not limit the quantity and execution order.
[0056] Figure 1 It is an architecture diagram of a communication system shown according to an exemplary embodiment. As Figure 1As shown below, the following communication method can be applied to this communication system. The communication system includes electronic device 01, server 02, and electronic device 03. Among them, electronic device 01 can communicate with electronic device 03 through server 02. Electronic device 01 and electronic device 03 can also communicate by logging in to the same main account.
[0057] In an implementable manner, server 02 can be a single server, a server cluster composed of multiple servers, or a cloud computing service center. Server 02 can include a processor, a memory, a network interface, etc.
[0058] In an implementable manner, the electronic device can be a terminal, an Internet of Things device, or other types of electronic devices, and the present disclosure does not limit this.
[0059] When the electronic device is a terminal, the terminal is used to provide voice and / or data connectivity services to the user. The terminal can have different names, such as UE, terminal unit, terminal station, mobile station, mobile unit, remote station, remote terminal, mobile device, wireless communication device, vehicle user equipment, terminal agent, or terminal device, etc. Optionally, the terminal can be various handheld devices, vehicle-mounted devices, wearable devices, computers with communication functions, and the embodiments of the present invention do not make any limitations on this. For example, the handheld device can be a smart phone. The vehicle-mounted device can be a vehicle navigation system. The wearable device can be a smart bracelet. The computer can be a personal digital assistant (PDA) computer, a tablet computer, and a laptop computer.
[0060] In an implementable manner, the number of electronic devices in the communication system is not limited. Figure 1 Taking two electronic devices as an example for illustration.
[0061] In an implementable manner, in combination with Figure 1 the shown communication system, this communication system can be an Internet of Things system. The Internet of Things system includes multiple Internet of Things devices. This application can divide the Internet of Things system into sets according to the communication protocol. Here, this set is vividly called a ring, and the devices in the set are called nodes. Rings are connected through a certain device to form a complete Internet of Things system. The device for connecting between rings is called a connection point.
[0062] The devices within the ring communicate with each other through a certain protocol and participate in the activities within the ring. This device is the node within the ring. The devices within each ring can communicate with each other without being affected by the outside. Using a certain protocol to become a node of a certain ring, this method is called a connection method.
[0063] There is a device inside the ring: It is itself a node of a certain ring and participates in the activities within the ring. At the same time, it is also a node of another ring, but does not participate in the activities within that ring. This device always directly sends the data of the ring that participates in the activities within the ring, which it receives, to another ring that does not participate in the activities. When it receives the data of the ring that does not participate in the activities within the ring, it sends the data to the target device within the ring, and converts the data format into the data format of the protocol of that ring before sending. This device is a connection point between the two rings. Using a certain protocol to become a node of another ring without participating in the activities of that ring, this method is called the forwarding method.
[0064] An embodiment of the present application provides a communication method. There is an account in an instant messaging software; this account can set the connection method, which is used to enable the device to become a node of a certain ring; this account can set the forwarding method, which is used to enable the device to become a connection point between two rings.
[0065] Among them, the connection method must be set, that is, the device must become a node of a certain ring, and the forwarding method can not be set, that is, the device does not necessarily need to become a connection point between two rings. There are multiple accounts in the instant messaging APP, enabling the device itself to become nodes of different rings and at the same time become connection points of multiple rings.
[0066] In order to facilitate the management of multiple accounts, the instant messaging APP has a main account, which is used to log in to the server on a certain hardware device to obtain and synchronize relevant data such as sub-accounts, and the sub-account users communicate with the sub-accounts of other electronic devices.
[0067] In this way, when a problem occurs in a certain link in the communication system and other devices cannot perform instant communication, the present application enables the device itself to become nodes of different rings and at the same time become connection points of multiple rings, thereby ensuring that other devices can perform instant communication and enriching the user experience.
[0068] Such as Figure 2 As shown, the communication method provided by the embodiment of the present invention is applied to a communication system including multiple electronic devices; the same main account is logged in to multiple electronic devices. This communication method includes the following S11 - S13.
[0069] S11. In the display page showing multiple electronic devices, in response to the trigger operation performed by the user on the target electronic device among the multiple electronic devices, display the multiple sub-accounts established in the main account.
[0070] In an embodiment of the present application, a main account can be logged in to multiple electronic devices. In this case, any one of the multiple electronic devices can display all the electronic devices on which the main account is currently logged in the display page showing the multiple electronic devices.
[0071] Specifically, instant messaging software for communication can be installed on the electronic device. When a user communicates with other users through the instant messaging software, the user can apply to create a login account and log in to the created login account on the instant messaging software to achieve instant messaging. In this case, the main account can be the login account created by the above user.
[0072] After creating the login account and logging in to the instant messaging software through the login account, the user can also open the user account management interface on the instant messaging software and apply for multiple user accounts.
[0073] The login account and the user accounts under the login account can be regarded as a whole. The login account is used for logging in, creating user accounts, and obtaining authorization; the user accounts are used for logging in, sending and receiving messages, adding friends, etc.
[0074] Correspondingly, the sub-accounts are the user accounts under the login account.
[0075] It should be noted that only one login account can be logged in on each electronic device. The user can use the login account or user accounts to log in on different electronic devices. Multiple user accounts can be created under one login account.
[0076] There are three types of user accounts, namely: personal accounts, star groups, and mesh groups. For a personal account, only the user can see the messages sent by others, and only the recipient can see the messages sent by the user. For a star group, the group owner's messages can be seen by everyone, and the messages sent by other members can only be seen by the group owner. For a mesh group, any member's messages can be seen by everyone.
[0077] S12. In response to a communication selection operation performed by the user on a target sub-account among multiple sub-accounts, display multiple communication controls corresponding to the communication selection operation.
[0078] Among them, the communication selection operation includes: an operation of selecting a connection method or an operation of selecting a forwarding method.
[0079] Specifically, after displaying the multiple sub-accounts established in the main account, the user can perform a communication selection operation on each of the multiple sub-accounts. In this case, the electronic device, in response to the communication selection operation performed by the user on the target sub-account among the multiple sub-accounts, displays multiple communication controls corresponding to the communication selection operation.
[0080] Optionally, when the communication selection operation is a connection method selection operation, the multiple communication controls include one or more of the following: server XMPP protocol control, server MQTT protocol control, MQTT protocol bridging control, personal hotspot WIFI-server control, local area network wireless communication technology (Wireless Fidelity, WIFI)-server control, local area network WIFI-client control, Bluetooth wireless mesh network-coordinator control, Bluetooth mesh network-server control, Bluetooth mesh network-client control, ZigBee protocol network-coordinator control, ZigBee network-router control, ZigBee network-client control, long range radio (LoRa) network-gateway control, LoRa network-client control.
[0081] When the communication selection operation is a forwarding method selection operation, the multiple communication controls include one or more of the following: second account control, serial port control, I2C bus control, controller area network (CAN) bus control, universal serial (USB) bus control, wireless transceiver module (RF433) control, MQTT client control, private (COPE) client control, Hyper Text Transfer Protocol (HTTP) client control, Transmission Control Protocol (TCP) / User Datagram Protocol (UDP)-client control, Bluetooth Low Energy (Bluetooh Low Energy, BLE) Bluetooth-slave control, local area network WIFI-client control, Bluetooth mesh network-client control, ZigBee network-client control, LoRa network-client control.
[0082] S13. In response to a trigger operation performed by the user on the target communication control among the multiple communication controls, control the target sub-account in the target electronic device to communicate with other accounts through the communication method corresponding to the target communication control.
[0083] Among them, the communication methods of other accounts are the same as those of the target sub-account. If the communication method of the friend account of the target sub-account is different from that of the target sub-account, then the messages of this friend account cannot be received.
[0084] Specifically, after displaying multiple communication controls corresponding to the communication selection operation, the user can perform a triggering operation on each of the displayed communication controls. In this case, the electronic device controls the target sub-account in the target electronic device to communicate with other accounts through the communication method corresponding to the target communication control in response to the triggering operation performed by the user on the target communication control among the multiple communication controls.
[0085] Exemplarily, as Figure 3 shown, the electronic device 31 can display all the electronic devices that the main account is logging in on the display page for configuring the logged-in devices, including: the electronic device with the device name "Android1001", the electronic device with the device name "Android1002", and the electronic device with the device name "Android1003". The device management page also includes management controls for each device, including: a logout control, a display enable control, a hardware interface binding control, etc. When the user wants to manage the communication method of the electronic device with the device name "Android1002", the user can perform a triggering operation on the hardware interface binding control corresponding to the electronic device with the device name "Android1002".
[0086] As Figure 3 shown, the electronic device 31 can display multiple sub-accounts, including: "Android2001", "Android2002", "Android2003", and "Android2004" on the display page of the user account created or obtained by itself (i.e., multiple sub-accounts established in the main account) in response to the triggering operation performed by the user on the electronic device with the device name "Android1002". Each user account corresponds to a connection binding control and a forwarding binding control. When the user wants to manage the communication method of the user account with the device name "Android1002", the user can perform a triggering operation on the connection binding control or the forwarding binding control corresponding to the user account with the device name "Android1002".
[0087] As Figure 3 shown, after the user performs a triggering operation on the connection binding control corresponding to the user account with the device name "Android1002", the electronic device displays communication controls corresponding to multiple connection methods, including: a server XMPP protocol control, a server MQTT protocol control, an MQTT protocol bridging control, a personal hotspot WIFI-server control, a local area network WIFI-server control, etc. on the display page for selecting the hardware interface in the connection binding.
[0088] Subsequently, the user can perform a triggering operation on the target communication control among the communication controls corresponding to multiple connection methods. In response to the triggering operation performed by the user, the electronic device controls the user account of "Android1002" to establish a communication connection with other accounts through the communication method corresponding to the target communication control.
[0089] As Figure 3 shown, after the user performs a triggering operation on the forwarding binding control corresponding to the user account of "Android1002", in response to the triggering operation performed by the user on the forwarding binding control corresponding to the user account of "Android1002", on the display page for selecting the hardware interface in the forwarding binding, communication controls corresponding to multiple forwarding methods are displayed, including: other account controls of its own, serial port control, I2C bus control, CAN bus control, USB bus control, etc.
[0090] Subsequently, the user can perform a triggering operation on the target communication control among the communication controls corresponding to multiple forwarding methods. In response to the triggering operation performed by the user, the electronic device controls the user account of "Android1002" to forward the received communication messages with the account or interface corresponding to the target communication control, and receive the communication messages sent by the account or interface corresponding to the target communication control.
[0091] In the communication method provided by the present invention, any one of multiple electronic devices logged in with the same main account can, on the display page showing multiple electronic devices, in response to the triggering operation performed by the user on the target electronic device among the multiple electronic devices, display multiple sub-accounts established in the main account. Subsequently, the electronic device can also, in response to the communication selection operation performed by the user on the target sub-account among the multiple sub-accounts, display multiple communication controls corresponding to the communication selection operation, and in response to the triggering operation performed by the user on the target communication control among the multiple communication controls, control the target sub-account in the target electronic device to communicate with other accounts (the communication methods of the other accounts are the same as those of the target sub-account) or other networks through the communication method corresponding to the target communication control.
[0092] Since the communication selection operation includes selecting a connection method operation or selecting a forwarding method operation, the electronic device can display multiple communication controls corresponding to the communication selection operation according to different communication selection operations, and after the user selects the target communication control, control the target sub-account in the target electronic device to communicate with other accounts through the communication method corresponding to the target communication control. In this way, the user can use different protocols for connection and forwarding methods under one sub-account according to needs, and connect two networks with different protocols. The method is simple, and the connection methods for all different protocols are the same and unified. As long as the connection method is the same, they can communicate with each other, which solves the problem in the prior art that instant messaging APPs must connect to the server to send and receive messages to each other.
[0093] In addition, in the prior art, if there are multiple communication protocols in the same communication system, the connection methods between each communication protocol are different. This application can use different communication protocols for connection and forwarding under one sub-account according to user needs, and connect two networks with different communication protocols, solving the technical problem that there is currently no simple and fast method for connecting different communication protocols, and no unified method for connecting and converting different communication protocols. Optionally, combined with Figure 2 ,like Figure 4 As shown, when the communication selection operation is to select a connection mode, in the above S13, in response to the user's triggering operation on a target communication control among the multiple communication controls, the method of controlling the target sub-account in the target electronic device to communicate with other accounts through the communication mode corresponding to the target communication control specifically includes:
[0094] S41. In response to a trigger operation performed by a user on a target communication control, control a target sub-account in a target electronic device to establish a communication connection with other accounts through a communication method corresponding to the target communication control.
[0095] Specifically, when the communication selection operation is a connection mode selection operation, the multiple communication controls include one or more of the following: server XMPP protocol control, server MQTT protocol control, MQTT protocol bridge control, personal hotspot WIFI-server control, local area network wireless communication technology (Wireless Fidelity, WIFI)-server control, local area network WIFI-client control, Bluetooth wireless mesh network (mesh) network-coordinator control, Bluetooth mesh network-server control, Bluetooth mesh network-client control, ZigBee protocol (ZigBee) network-coordinator control, ZigBee network-router control, ZigBee network-client control, long-range radio (LoRa) network-gateway control, LoRa network-client control.
[0096] In this case, the electronic device can perform a triggering operation on any one of the above-mentioned multiple communication controls. Correspondingly, in response to the triggering operation performed by the user on the target communication control, the electronic device controls the target sub-account in the target electronic device to establish a communication connection with other accounts through the communication method corresponding to the target communication control.
[0097] Optionally, if the user performs a triggering operation on the "Server XMPP Protocol Control", the electronic device, in response to the triggering operation performed by the user on the "Server XMPP Protocol Control", controls the target sub-account in the target electronic device to log in to the server through the network using the XMPP protocol and send and receive messages from other friends of the target sub-account.
[0098] If the user performs a triggering operation on the "Server MQTT Protocol Control", the electronic device, in response to the triggering operation performed by the user on the "Server MQTT Protocol Control", controls the target sub-account in the target electronic device to log in to the server through the network using the MQTT protocol and send and receive messages from other friends of the target sub-account.
[0099] If the user performs a triggering operation on the "MQTT Protocol Bridging Control", the electronic device, in response to the triggering operation performed by the user on the "MQTT Protocol Bridging Control", controls the target sub-account in the target electronic device to analyze the data after receiving the data. If the data meets the set protocol format, extract the ID in the data, use this ID as the topic, connect to the server, subscribe to this topic, and receive data from this topic.
[0100] If the user performs a triggering operation on the "Personal Hotspot WIFI - Server Control", the electronic device, in response to the triggering operation performed by the user on the "Personal Hotspot WIFI - Server Control", controls the target electronic device to turn on the personal hotspot and the device itself switches to the server state. If the user accounts of other devices want to communicate with the target sub-account, they must select the communication method of "LAN WIFI - Client". After the user connects to the WIFI of the device with the personal hotspot turned on and selects the communication method of "LAN WIFI - Client", they can communicate with other friends who have selected the communication method of "Personal Hotspot WIFI - Server" or "LAN WIFI - Client". The user accounts that have selected the communication method of "LAN WIFI - Client" in other devices that have connected to the personal hotspot of one of the devices can only communicate with the user accounts that have selected the communication method of "Personal Hotspot WIFI - Server" in the device with the personal hotspot turned on, or communicate with the user accounts that have selected the communication method of "LAN WIFI - Client" in the devices that have connected to the same personal hotspot.
[0101] If the user performs a trigger operation on the "LAN WIFI - Server Control", the electronic device responds to the trigger operation performed by the user on the "LAN WIFI - Server Control", controls the target sub - account in the target electronic device to connect to the local network via WIFI, and the device itself switches to the server state. If the user accounts of other devices want to communicate with this target sub - account, they must select the communication method of "LAN WIFI - Client". After the user connects to the WIFI local network and selects the communication method of "LAN WIFI - Client", they can communicate with friends who have selected the communication method of "LAN WIFI - Server" or "LAN WIFI - Client". Only one user account in a local area network can select "LAN WIFI - Server".
[0102] If there are multiple devices, and the user selects the communication method of "Bluetooth Mesh Network - Coordinator" for the connection method of the target sub - account of one of the devices, and one of the user accounts of other devices that are friends with this target sub - account selects the communication method of "Bluetooth Mesh Network - Router" or "Bluetooth Mesh Network - Client", then the Bluetooth hardware of these devices automatically forms a Bluetooth network, and the user accounts bound to "Bluetooth Mesh Network - Coordinator", "Bluetooth Mesh Network - Router", or "Bluetooth Mesh Network - Client" of these devices communicate with each other via the Bluetooth network and receive and send messages from friends.
[0103] If there are multiple devices, and the user selects the communication method of "ZigBee Network - Coordinator" for the connection method of the target sub - account of one of the devices, and one of the user accounts of other devices that are friends with this target sub - account selects the communication method of "ZigBee Network - Router" or "ZigBee Network - Client", then the ZigBee hardware of these devices automatically forms a ZigBee network, and the user accounts bound to "ZigBee Network - Coordinator", "ZigBee Network - Router", "ZigBee Network - Client" of these devices communicate with each other via the ZigBee network and receive and send messages from friends.
[0104] If there are multiple devices, and the user selects the communication method of "LoRa Network - Gateway" for the connection method of the target sub - account of one of the devices, and one of the user accounts of other devices that are friends with this target sub - account selects the communication method of "LoRa Network - Client", then the LoRa hardware of these devices automatically forms a LoRa network, and the user accounts bound to "LoRa Network - Gateway" or "LoRa Network - Client" of these devices communicate with each other via the LoRa network and receive and send messages from friends.
[0105] Optionally, combined with Figure 4 , such asFigure 5 As shown, when the target communication control is a server XMPP protocol control or a server MQTT protocol control, the communication method further includes:
[0106] S51. In response to a trigger operation performed by the user on the target communication control, control the target sub-accounts in each of the multiple electronic devices to establish a communication connection with other accounts through the communication method corresponding to the target communication control.
[0107] Specifically, when the user performs a trigger operation on the server XMPP protocol control or the server MQTT protocol control, since the server is located on the network side, the electronic device can, in response to the trigger operation performed by the user on the server XMPP protocol control or the server MQTT protocol control, control the target sub-accounts in each of the multiple electronic devices to establish a communication connection with other accounts through the communication methods of the server XMPP protocol or the server MQTT protocol.
[0108] That is, if the user selects the communication method of "server XMPP protocol" or "server MQTT protocol" for the target sub-account, the target sub-accounts of other logged-in devices will automatically switch to the communication method of "server XMPP protocol" or "server MQTT protocol".
[0109] Optionally, in combination with Figure 4 , such as Figure 5 shown, when the target communication control is any one of an MQTT protocol bridging control, a personal hotspot WIFI-server control, a local area network WIFI-server control, a local area network WIFI-client control, a Bluetooth mesh network-coordinator control, a Bluetooth mesh network-server control, a Bluetooth mesh network-client control, a ZigBee network-coordinator control, a ZigBee network-router control, a ZigBee network-client control, a LoRa network-gateway control, and a LoRa network-client control, the communication method further includes:
[0110] S52. In response to a trigger operation performed by the user on the target communication control, control the target sub-accounts in the other electronic devices except the target electronic device among the multiple electronic devices to stop establishing a communication connection with other accounts through the communication method corresponding to the target communication control.
[0111] Specifically, multiple electronic devices may be located at different geographical locations. When the target communication control is any one of the MQTT protocol bridging control, personal hotspot WIFI-server control, local area network WIFI-server control, local area network WIFI-client control, Bluetooth mesh network-coordinator control, Bluetooth mesh network-server control, Bluetooth mesh network-client control, ZigBee network-coordinator control, ZigBee network-router control, ZigBee network-client control, LoRa network-gateway control, and LoRa network-client control, electronic devices at other geographical locations may not be able to establish a communication connection through the communication method corresponding to the target communication control.
[0112] In this case, in response to a trigger operation performed by the user on the target communication control, the electronic device controls the target sub-account in other electronic devices among the multiple electronic devices except the target electronic device to stop establishing a communication connection with other accounts through the communication method corresponding to the target communication control.
[0113] That is, if the user selects a communication method of "MQTT protocol bridging", "personal hotspot WIFI-server", "local area network WIFI-server", "local area network WIFI-client", "Bluetooth mesh network-coordinator", "Bluetooth mesh network-server", "Bluetooth mesh network-client", "ZigBee network-coordinator", "ZigBee network-router", "ZigBee network-client", "LoRa network-gateway", or "LoRa network-client" for the target sub-account to establish a communication connection, then the target sub-account of other logged-in devices stops all communication connection methods.
[0114] S53. In response to a trigger operation performed by the user on the target communication control, control the first account to establish a communication connection with other accounts through the first communication method.
[0115] Among them, the first account is the target sub-account of the target electronic device; the first communication method is the communication method corresponding to the target communication control.
[0116] Specifically, when the target communication control is any one of an MQTT protocol bridging control, a personal hotspot WIFI-server control, a local area network WIFI-server control, a local area network WIFI-client control, a Bluetooth mesh network-coordinator control, a Bluetooth mesh network-server control, a Bluetooth mesh network-client control, a ZigBee network-coordinator control, a ZigBee network-router control, a ZigBee network-client control, a LoRa network-gateway control, and a LoRa network-client control, since an electronic device can only establish a communication connection through the communication method corresponding to one of the above communication controls, the electronic device controls the first account to establish a communication connection with other accounts through the first communication method in response to a trigger operation performed by the user on the target communication control.
[0117] That is, if the user selects a communication method such as "MQTT protocol bridging", "personal hotspot WIFI-server", "local area network WIFI-server", "local area network WIFI-client", "Bluetooth mesh network-coordinator", "Bluetooth mesh network-server", "Bluetooth mesh network-client", "ZigBee network-coordinator", "ZigBee network-router", "ZigBee network-client", "LoRa network-gateway", or "LoRa network-client" for the target sub-account to establish a communication connection, then other user accounts of the electronic device performing this operation cannot select this communication connection method.
[0118] It should be noted that the execution order of S52 and S53 by the electronic device is not limited. The electronic device may execute S52 first and then S53; it may also execute S53 first and then S52; or it may execute S52 and S53 simultaneously. The present disclosure does not limit this.
[0119] Optionally, in combination with Figure 5 as Figure 6 shown, the communication method further includes:
[0120] S61. Display a parameter setting page in response to a trigger operation performed by the user on the target communication control.
[0121] Among them, the parameter setting page is used to prompt the user to set communication parameters for the communication method corresponding to the target communication control.
[0122] Specifically, when the target communication control is any one of an MQTT protocol bridging control, a personal hotspot WIFI-server control, a local area network WIFI-server control, a local area network WIFI-client control, a Bluetooth mesh network-coordinator control, a Bluetooth mesh network-server control, a Bluetooth mesh network-client control, a ZigBee network-coordinator control, a ZigBee network-router control, a ZigBee network-client control, a LoRa network-gateway control, and a LoRa network-client control, and after the user performs a trigger operation on the target communication control, the electronic device displays a parameter setting page in response to the trigger operation performed by the user on the target communication control.
[0123] Exemplarily, as Figure 3 shown. After the user performs a trigger operation on the setting space corresponding to the personal hotspot WIFI-client control, the electronic device can display "Please enter the account number" and "Please enter the account number" on the display page of the connection binding setting. Subsequently, the user can enter the account password in the input area corresponding to "Please enter the account number" and the input area corresponding to "Please enter the account number", thereby completing the parameter setting of the personal hotspot WIFI-client.
[0124] Optionally, in combination with Figure 2 as Figure 7 shown, when the communication selection operation is a select forwarding method operation, in the above S13, the method for controlling the target sub-account in the target electronic device to communicate with other networks through the communication method corresponding to the target communication control in response to the trigger operation performed by the user on the target communication control among multiple communication controls specifically includes:
[0125] S71. In response to the trigger operation performed by the user on the target communication control, control the target sub-account in the target electronic device to forward the received communication message to the account or interface corresponding to the target communication control, and receive the communication message sent by the account or interface corresponding to the target communication control.
[0126] Specifically, when the communication selection operation is a select forwarding method operation, the multiple communication controls include one or more of the following: a second account control, a serial port control, an I2C bus control, a CAN bus control, a USB bus control, an RF433 control, an MQTT client control, a COPE client control, an HTTP client control, a TCP / UDP-client control, a BLE Bluetooth-slave control, a local area network WIFI-client control, a Bluetooth mesh network-client control, a ZigBee network-client control, and a LoRa network-client control.
[0127] In this case, the electronic device can perform a triggering operation on any one of the above-mentioned multiple communication controls. Correspondingly, in response to the triggering operation performed by the user on the target communication control, the target sub-account in the target electronic device is controlled to forward the received communication message to the account or interface corresponding to the target communication control, and receive the communication message sent by the account or interface corresponding to the target communication control. In this way, this operation can enable the target sub-account to access other networks with different protocols, and then conduct instant messaging through the networks with different protocols.
[0128] It should be noted that each user account can select different forwarding methods under different electronic devices.
[0129] Optionally, if the user performs a triggering operation on the "Second Account Control", the electronic device, in response to the triggering operation performed by the user on the "Second Account Control", controls all the messages received by the target sub-account in the target electronic device to be forwarded to another account of its own bound to the target sub-account, and the target sub-account immediately sends the messages sent by another account of its own bound to the target sub-account to all the friends of the target sub-account.
[0130] If the user performs a triggering operation on the "Serial Port Control", the electronic device, in response to the triggering operation performed by the user on the "Serial Port Control", controls the target electronic device to initialize the serial port according to the parameters, and all the messages received by the target sub-account are forwarded to the serial port, and the target sub-account immediately sends the messages sent by the serial port to all the friends of the target sub-account.
[0131] If the user performs a triggering operation on the "I2C Bus Control", the electronic device, in response to the triggering operation performed by the user on the "I2C Bus Control", controls the target electronic device to initialize the I2C bus according to the parameters, and all the messages received by the target sub-account are forwarded to the I2C bus, and the target sub-account immediately sends the messages sent by the I2C bus to all the friends of the target sub-account.
[0132] If the user performs a triggering operation on the "CAN Bus Control", the electronic device, in response to the triggering operation performed by the user on the "CAN Bus Control", controls the target electronic device to initialize the CAN bus according to the parameters, and all the messages received by the target sub-account are forwarded to the CAN bus, and the target sub-account immediately sends the messages sent by the CAN bus to all the friends of the target sub-account.
[0133] If the user performs a trigger operation on the "USB bus control", the electronic device responds to the trigger operation performed by the user on the "USB bus control", controls the target electronic device to initialize the USB bus according to the parameters, forwards all messages received by the target sub-account to the USB bus, and immediately sends the messages sent by the USB bus to all friends of the target sub-account.
[0134] If the user performs a trigger operation on the "RF433 control", the electronic device responds to the trigger operation performed by the user on the "RF433 control", controls the target electronic device to initialize RF433 according to the parameters, forwards all messages received by the target sub-account to RF433, and immediately sends the messages sent by RF433 to all friends of the target sub-account.
[0135] If the user performs a trigger operation on the "MQTT client control", the electronic device responds to the trigger operation performed by the user on the "MQTT client control", controls the target electronic device to initialize the MQTT client according to the parameters, forwards all messages received by the target sub-account to the MQTT server, and immediately sends the messages sent by the MQTT server to all friends of the target sub-account. If the device selects the connection method of "server MQTT protocol" when selecting the connection method, then it connects to a pre-set server with instant messaging function using the MQTT protocol to complete the instant messaging function. If the device selects the forwarding method of "MQTT client" when selecting the forwarding method, it directly sends the original data to the MQTT server, and this MQTT server can be any MQTT server.
[0136] If the user performs a trigger operation on the "COPE client control", the electronic device responds to the trigger operation performed by the user on the "COPE client control", controls the target electronic device to initialize the COPE client according to the parameters, forwards all messages received by the target sub-account to the COPE server, and immediately sends the messages sent by the COPE server to all friends of the target sub-account.
[0137] If the user performs a trigger operation on the "HTTP client control", the electronic device responds to the trigger operation performed by the user on the "HTTP client control", controls the target electronic device to initialize the HTTP client according to the parameters, forwards all messages received by the target sub-account to the HTTP server, and immediately sends the messages sent by the HTTP server to all friends of the target sub-account. The device and the server exchange data using the HTTP protocol.
[0138] If the user performs a trigger operation on the "TCP / UDP - Client Control", the electronic device responds to the trigger operation performed by the user on the "TCP / UDP - Client Control", controls the target electronic device to initialize the TCP / UDP - client according to the parameters, forwards all messages received by the target sub - account to the TCP / UDP server, and immediately sends the messages received from the TCP / UDP server by the target sub - account to all friends of the target sub - account. The device connects to the TCP / UDP server as the identity of the TCP / UDP client.
[0139] If the user performs a trigger operation on the "BLE Bluetooth - Slave Control", the electronic device responds to the trigger operation performed by the user on the "BLE Bluetooth - Slave Control", controls the target electronic device to initialize the BLE Bluetooth - slave according to the parameters, forwards all messages received by the target sub - account to the BLE Bluetooth - slave, and immediately sends the messages received from the BLE Bluetooth - slave by the target sub - account to all friends of the target sub - account. The Bluetooth mesh network requires device networking, while the BLE Bluetooth - slave device does not require networking. After connection, data is directly sent and received.
[0140] If the user performs a trigger operation on the "LAN WIFI - Client Control", the electronic device responds to the trigger operation performed by the user on the "LAN WIFI - Client Control", controls the target electronic device to connect to the "LAN WIFI Server" or "Personal Hotspot WIFI - Server" according to the parameters, forwards all messages received by the target sub - account to the "LAN WIFI Server" or "Personal Hotspot WIFI - Server", and immediately sends the messages received from the "LAN WIFI Server" or "Personal Hotspot WIFI - Server" by the target sub - account to all friends of the target sub - account.
[0141] If the user performs a trigger operation on the "Bluetooth Mesh Network - Client Control", the electronic device responds to the trigger operation performed by the user on the "Bluetooth Mesh Network - Client Control", controls the target electronic device to connect to the Bluetooth mesh network as the Bluetooth mesh client according to the parameters, forwards all messages received by the target sub - account to the Bluetooth mesh network, and immediately sends the messages received from the Bluetooth mesh network by the target sub - account to all friends of the target sub - account.
[0142] If the user performs a triggering operation on the "ZigBee Network - Client Control", the electronic device responds to the triggering operation performed by the user on the "ZigBee Network - Client Control", and controls the target electronic device to connect to the ZigBee network as a ZigBee client according to the parameters. All messages received by the target sub-account are forwarded to the ZigBee network, and when the target sub-account receives a message sent from the ZigBee network, it immediately sends it to all friends of the target sub-account.
[0143] If the user performs a triggering operation on the "LoRa Network - Client Control", the electronic device responds to the triggering operation performed by the user on the "LoRa Network - Client Control", and controls the target electronic device to connect to the LoRa network as a LoRa client according to the parameters. All messages received by the target sub-account are forwarded to the LoRa network, and when the target sub-account receives a message sent from the LoRa network, it immediately sends it to all friends of the target sub-account.
[0144] Optionally, in combination with Figure 7 , such as Figure 8 shown, the communication method further includes:
[0145] S81. In response to a triggering operation performed by the user on the second account control, control the second account to forward the received communication message through the second communication method, and receive the communication message sent by the third account through the second communication method.
[0146] Wherein, the third account is an account other than the target sub-account among multiple electronic devices; the second communication method is a communication method established through an account or interface other than the account or interface corresponding to the target communication control.
[0147] Specifically, when the target communication control is any one of the second account control, serial port control, I2C bus control, CAN bus control, USB bus control, RF433 control, MQTT client control, COPE client control, HTTP client control, TCP / UDP - client control, BLE Bluetooth - slave control, local area network WIFI - client control, Bluetooth mesh network - client control, ZigBee network - client control, LoRa network - client control, the electronic device can respond to the triggering operation performed by the user on the second account control, control the second account to forward the received communication message through the second communication method, and receive the communication message sent by the third account through the second communication method.
[0148] After a user account is selected to be forwarded to another user account B, other user accounts cannot be selected to be forwarded to user account B. After a user account A is selected to be forwarded to one of the hardware interfaces of "serial port", "I2C bus", "CAN bus", "USB bus", "RF433", "MQTT client", "COPE client", "HTTP client", "TCP / UDP-client", "BLE Bluetooth-slave", "LAN WIFI-client", "Bluetooth mesh network-client", "ZigBee network-client", "LoRa network-client", other accounts cannot be selected to be forwarded to this hardware interface.
[0149] Optionally, the user account selected as the "second account" by other accounts can only be an individual user account. The user account that selects the "second account" as the forwarding method can be a mesh group account, a star group account, or an individual account.
[0150] In an implementable manner, when the target communication control is any one of a serial port control, an I2C bus control, a CAN bus control, a USB bus control, an RF433 control, an MQTT client control, a COPE client control, an HTTP client control, a TCP / UDP-client control, a BLE Bluetooth-slave control, a LAN WIFI-client control, a Bluetooth mesh network-client control, a ZigBee network-client control, a LoRa network-client control, it further includes: in response to a trigger operation performed by the user on the target communication control, controlling other accounts in the target electronic device except the target sub-account to stop forwarding the received communication messages through the communication method corresponding to the target communication control; and controlling the same target sub-accounts in different electronic devices among multiple electronic devices to select the same or different forwarding methods.
[0151] In an implementable manner, this communication method further includes:
[0152] In response to a trigger operation performed by the user on the white list setting control of the electronic device, controlling whether the messages of the sub-devices under the electronic device where the main account is located can be sent to other target sub-accounts through the sub-account after being forwarded and bound to the selected communication method, or whether the sub-account can send the messages received from other target sub-accounts to the sub-devices under the electronic device where the main account is located in the communication method selected for forwarding and binding;
[0153] In response to a trigger operation performed by the user on the white list setting control of the electronic device, controlling the main account to poll and manage the sub-devices under the electronic device where the main account is located at all times.
[0154] Specifically, the user clicks on the hardware interface binding control, and then clicks on the whitelist configuration control in the opened interface to open the whitelist configuration interface. The interface lists the added sub-devices under the sub-account, as well as controls such as connecting devices and adding. Enter the device ID in the input box, and then click Add, and this device will be added to the list. Click on the delete control behind a certain device, and this device will be deleted and will not appear in the list. Click on the default all-off control, and the data of devices not added to the whitelist will be discarded. After the master device receives the data of the sub-devices under the sub-account using the communication method of forwarding binding, if it finds that the sub-device is in the whitelist, it will send the data to the target sub-account, otherwise it will be directly discarded. After the sub-device receives the data of other target sub-accounts, before forwarding the data using the communication method selected by forwarding binding, if it finds that the target sub-device is in the whitelist, it will forward the data to the target sub-device, otherwise it will directly discard the data without forwarding. It should be noted that when clicking on the default all-on control, any data received by the target sub-account from the sub-devices will be forwarded to other sub-accounts according to the rules, and any messages received by the target sub-account from other sub-accounts will be forwarded to the sub-devices under this sub-account.
[0155] After checking the automatic polling of devices, the sub-account will automatically and regularly obtain the status of the sub-devices under the sub-account and then save it. The user can click on the status control in the interface at any time to view the status of the device.
[0156] In an implementable manner, the communication protocol format between devices is: {"S":"1","D":"2","L":"3","R":"4","C":"5","N":6,"V":[7],"I":"8","M":"9","T":"20211110111110","P":"11","U":"12"}, and the data is in the form of a JSON format string; "S" is the source sub-account that sends data, "D" is the destination sub-account that receives data, "L" is the address of the source sub-device under an electronic device where a certain main account is located, "R" is the address of the destination sub-device under an electronic device where a certain main account is located; "C" is a command, representing an operation, and the command types include: read, write, notify, request, and report; "N" is the number of a certain operation, which is different each time, and the value is an integer; "V" is the actual data value of this frame of data, and the value is a JSON array; "I" indicates the direction of data flow of the command and is used to determine the type of the command; "M" is data required by the system internally and has nothing to do with the application; "T" is the time when the data is sent, "P" is the protocol type or version of the current protocol, and "U" is the ID of the main device of the data sender. When the device leaves the factory, a unique ID of the main device is assigned to each device. During use, the server modifies the ID of the main device through the protocol. When data from other target sub-accounts or data from sub-devices passes through the sub-account, the sub-account extracts the value of each field from the data and then performs the corresponding operation. The value of I has 12 types, which are: server-initiated, main-device response, from server to main device; server-initiated, main-device response, from main device to server; server-initiated, sub-device response, from server to sub device; server-initiated, sub-device response, from sub device to server; main-device initiated, sub-device response, from main device to sub device; main-device initiated, sub-device response, from sub device to main device; main-device initiated, server response, from main device to server; main-device initiated, server response, from server to main device; sub-device initiated, server response, from sub device to server; sub-device initiated, server response, from server to sub device; sub-device initiated, main-device response, from sub device to main device; sub-device initiated, main-device response, from main device to sub device; If the direction of data flow of the command is server-initiated, main-device response or server-initiated, sub-device response, then the type of the command is read, write or notify; if the direction of data flow of the command is main-device initiated, server response or sub-device initiated, server response, then the type of the command is request or report; the type of the command with the data flow direction of main-device initiated, sub-device response or sub-device initiated, main-device response is undefined.
[0157] In an implementable manner, the communication method further includes: in response to a user's triggering operation on the request and reporting binding control, and then in response to the user's triggering operation on the friend to be requested and reported, selecting the data of the request and reporting command and sending it to the target sub-account that receives the data of the command; after the sub-account receives the data from the sub-device, according to command C in the data, selecting the target sub-account, and then sending the data to the target sub-account.
[0158] Specifically, the user clicks on the hardware interface binding control, and then clicks on the request and reporting binding control in the opened interface to open the request and reporting binding interface. The list in the interface lists the added commands. Click on "Delete" to delete the command, and the command will no longer appear in the list. Enter a command in the input box and then click "Add", and the newly added command will appear in the list. Click on the friend account control behind a certain command to open the interface of the friend account to be requested and reported. Check the friend accounts that need to process the data of this command in the interface. After the sub-account receives the data from the sub-device, first obtain the value of I, and find from the value of I that C is a request or reporting command. Through this command, find the friend accounts corresponding to this command for request and reporting, and then send the message to these friend accounts. Click on the "My Account" control behind a certain command to open the interface of the "My Account" to be requested and reported. Check the "My Account" that needs to process the data of this command in the interface. After the sub-account receives the data from the sub-device, first obtain the value of I, and find from the value of I that C is a request or reporting command. Through this command, find the "My Account" corresponding to this command for request and reporting, and then send the message to these "My Accounts". The friend account is another target sub-account added by the target sub-account. "My Account" is another target sub-account created by oneself. Click on another target sub-account created by oneself to open a dialog box, and the message sent by the sub-device can be seen in the dialog box.
[0159] In an implementable manner, the communication method further includes: in response to a user's triggering operation on the local function selection control of the device, selecting one of the functions built into the device locally, so that the data from other target sub-accounts or from the sub-devices under the target sub-account is output to the selected function built into the device locally; after the local function is output with data, select a certain type of output function according to I, select a specific function according to command C, and the internal process determines whether the data is the data of the current process according to N, and finally use the data value V.
[0160] Specifically, the user clicks on the hardware interface binding control, and then clicks on the local function selection control in the opened interface to open the local function selection interface. The list in the interface lists the selectable local functions. After selecting a certain function, when the sub-account receives data of the target sub-account, it outputs to this local function. When the sub-account receives data of the sub-device, it also outputs to this local function. The local function first obtains I, C, N, and V from the data, then selects a certain type of output function according to I, and then finds the output function among these functions according to the command C. The data will be directly processed or saved. A certain thread of the local function actively selects the data output to the local function according to N, and then uses the data value of V in the data.
[0161] Combined with the above Figures 2 - 8 , the following takes multiple devices as an example to make an exemplary description of the embodiments of the present application.
[0162] Example 1:
[0163] Suppose there are multiple electronic devices currently, and due to some reasons, they cannot connect to the server. Each of these electronic devices has a user account that is a friend with a user account of another electronic device. Set the connection method of the user account in one of the electronic devices that is a friend with a user account of another electronic device to "Personal Hotspot WIFI - Server". Set the connection method of the user account in other electronic devices that is a friend with a user account of another electronic device to "LAN WIFI - Client".
[0164] In this case, these electronic devices do not need to log in to the external network server and can also send and receive messages through the user accounts that are friends with each other. "Bluetooth mesh network", "ZigBee network", and "LoRa network" can all form their own networks like "Personal Hotspot WIFI - Server" and friends can send and receive messages with each other.
[0165] Example 2:
[0166] Suppose there are three electronic devices. The D1 electronic device can only use the communication connection method of "Server XMPP protocol". The D2 electronic device can use the communication connection methods of "Server XMPP protocol" and "Server MQTT protocol". The D3 electronic device can only use the communication connection method of "Server MQTT protocol". D1 has a U1 user account, D2 has U21 and U22 user accounts, and D3 has a U3 user account. U1 and U21 are friends with each other, and U22 and U3 are friends with each other. U1 can only select the communication connection method of "Server XMPP protocol", and U3 can only select the communication connection method of "Server MQTT protocol".
[0167] In this case, the communication connection method of U21 can be set to the communication connection method of "server XMPP protocol", and the communication connection method of U22 can be set to the communication connection method of "server MQTT protocol". Select "other accounts of oneself (second account)" for the forwarding method of U21, and the user account for forwarding is U22.
[0168] In this way, when U1 sends a message to U21, U21 immediately forwards it to U22; after U22 receives the message, it sends the message to U3. After U22 receives the message from U3, it immediately forwards it to U21; after U21 receives the message, it immediately forwards it to U1. Although U1 and U3 use different protocols and are in different networks, they can also send messages to each other. The communication connection method of U22 is set to the communication connection method of "Bluetooth mesh network", and other settings of U22 are kept the same as those of U21, so as to connect "server XMPP protocol" and "Bluetooth mesh network". Similarly, the communication connection method of U22 can be set to the communication connection method of "ZigBee network" or "LoRa network".
[0169] Example 3:
[0170] Suppose there are three electronic devices. The B1 electronic device can only use the communication connection method of "server XMPP protocol" or "server MQTT protocol", the B2 electronic device can use the communication connection method of "server XMPP protocol" or "server MQTT protocol", or the "serial port" forwarding method, and the B3 electronic device can only communicate with other electronic devices using the serial port. B1 has the S1 user account, and B2 has the S2 user account. S1 and S2 are friends with each other. The communication connection methods of both S1 and S2 are selected as the communication connection method of "server XMPP protocol".
[0171] In this case, the forwarding method of S2 can be selected as "serial port". The serial ports of B2 and B3 are connected together. S1 sends a message to friend S2, and S2 immediately forwards it to the serial port. B3 receives the data of S1 forwarded by S2 from the serial port. B3 sends data to the serial port. After S2 receives the data sent by B3 from the serial port, it immediately sends it to friend S1.
[0172] In this way, the S1 user account on B1 can directly send data remotely to the B3 electronic device with only a serial port, and the B3 electronic device can also directly send data remotely to the S1 user account in the B1 electronic device. The user account can send and receive data from the remote serial port electronic device just like sending and receiving messages from friends. If the communication connection methods of S2 are "I2C bus", "CAN bus", "USB bus", "RF433", "MQTT client", "COPE client", "HTTP client", "TCP / UDP - client", "BLE Bluetooth - slave", "LAN WIFI - client", "Bluetooth mesh network - client", "ZigBee network - client", "LoRa network - client", their usage methods are the same. The difference lies in the hardware initialization methods.
[0173] Example 4:
[0174] Suppose there are four electronic devices, printer P1, electronic devices P2, P3, and P4. P2, P3, and P4 respectively have logged-in accounts P2, P3, and P4. Hereinafter, the electronic devices and the logged-in accounts are not distinguished. The external data interface of the P1 printer is the USB bus. P2 has a USB bus, can use the communication connection method of "server XMPP protocol", and has the R1 user account. P3 can use the communication connection method of "server XMPP protocol", and through authorization, obtains the R1 user account, and the permission it has is the permission to authorize others. P4 can use the communication connection method of "server XMPP protocol" and has the R2 user account, and the R2 user account is not yet a friend of R1.
[0175] In this case, the USB bus of the P1 printer can be connected to the USB bus of P2. Since P3 has the R1 user account and the permission is to authorize others, P3 can directly use R1 to add friends, set the communication connection method and forwarding method of R1, and specify that the electronic device executing this operation is P2. P3 uses the R1 user account to add R2 as a friend, and sets the communication connection method of R1 as "server XMPP protocol" and the forwarding method as "USB bus". P4 sets the communication connection method of R2 as "server XMPP protocol".
[0176] In this way, the R2 user account of P4 remotely sends a file to R1 of P3. After receiving the file, R1 of P3 does nothing. After R1 of P2 receives the file, it immediately forwards it to the "USB bus". P1 receives the file through the "USB bus" and then prints the file. P3 can use R1 to add any user account as a friend. After any user account becomes a friend with R1, it can send a file to R1. After R1 of P2 receives the file, it forwards it to the "USB bus". After P1 receives the file from the bus, it automatically prints the file. If a certain R3 user account is not allowed to remotely print files, P3 deletes the friend R3 of R1. In this way, it is convenient to remotely print files and manage users.
[0177] Example 5:
[0178] Suppose there are five electronic devices, namely W1, W2, X1, X2, and X3. W1 is connected to the MQTT server and subscribes to the 000001F1P1M1C10100D2 topic. W2 has a V1 user account and an I2C bus. X1, X2, and X3 all have I2C buses and are connected to the I2C bus of W2. The communication connection method of V1 is selected as "MQTT protocol bridging", and the forwarding method is selected as "I2C bus". V1 uses the pre-set parameters to connect to the MQTT server and subscribes to the topic on the MQTT server using its own account as the topic.
[0179] Among them, the pre-set protocol format is: {"S":"1","D":"2","L":"3","R":"4","I":"5","C":"6","N":"7","V":"8","M":"9","T":"20211110111110","P":"11","U":"12"}.
[0180] After V1 receives data from the I2C bus {"S":"000001F1P1M1C10100D1","D":"000001F1P1M1C10100D2","L":"000001F1P1M1C10100D3","R":"000001F1P1M1C10100D4","I":"D0T1A103","C":"C2H1N1E1","N":"1234","V":"00_","M":"message","T":"20211110175010","P":"version-1.1","U":"user12"}, since S is the address of the W2 electronic device itself, D is the address of the external network electronic device W1 and also the topic subscribed by W1, R is the I2C address of W2, and E is the address of one of the devices X1, X2, or X3. Therefore, V1 can extract the value 000001F1P1M1C10100D1 of the source address S as the topic, subscribe to the topic 000001F1P1M1C10100D1 on the server, and take the value 000001F1P1M1C10100D2 of the destination address D as the topic to be published, and publish the data to the topic 000001F1P1M1C10100D2.
[0181] After V1 publishes, the electronic device W1 receives data from the subscribed topic. W1 publishes the reply data to the topic 000001F1P1M1C10100D1, and V1 receives data from the topic 000001F1P1M1C10100D1: "S":"000001F1P1M1C10100D2","D":"000001F1P1M1C10100D1","L":"000001F1P1M1C10100D4","R":"000001F1P1M1C10100D3","I":"D0T1A103","C":"C2H1N1E1","N":"1234","V":"00_","M":"message","T":"20211110175310","P":"version-1.1","U":"user12"}.
[0182] V1 extracts the value 000001F1P1M1C10100D3 of the destination address R as the I2C target address, and then sends the data to the I2C bus. This is equivalent to the I2C bus electronic device being able to communicate directly with the external network electronic device like an MQTT client. The forwarding method can choose other forwarding methods, as long as the protocol format meets the pre-set format, this function can be achieved. The protocol format can be arbitrary, as long as the source address and destination address can be extracted from the data.
[0183] Example 6:
[0184] Suppose there are nine user accounts U11, U12, U13, U14, U15, U16, U17, U18, and U19 in the electronic device B1. U11 selects the communication connection method of "server XMPP protocol" or the communication connection method of "server MQTT protocol", and U12, U13, U14, U15, U16, U17, U18, and U19 can also select one of these two methods. U11 selects the communication connection method of "Bluetooth mesh network - coordinator", and U12, U13, U14, U15, U16, U17, U18, and U19 cannot select the communication connection method of "Bluetooth mesh network - coordinator" anymore, and so on for others. After U11 selects the communication connection method of "Bluetooth mesh network - coordinator", U12 can select the communication connection method of "ZigBee network - coordinator".
[0185] In this way, the electronic device B1 can be connected to the Bluetooth mesh network and the ZigBee network simultaneously. U11 selects the forwarding method of "its own other account (second account)". After the forwarded account is U19, other accounts can still select the forwarding method of "its own other account (second account)", but the forwarded account cannot be U19. U11 selects the forwarding method of "serial port", and U12, U13, U14, U15, U16, U17, U18, and U19 cannot select the forwarding method of "serial port" anymore, and so on for others. After U11 selects the forwarding method of "serial port", U12 can select the forwarding method of "I2C bus", and U12 can select the forwarding method of "LAN WIFI - client", so that the U1 electronic device can forward data to three different hardware interfaces simultaneously.
[0186] The above mainly introduces the solution provided by the embodiments of the present invention from the perspective of the method. To implement the above functions, it includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed in this article, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving the hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0187] Embodiments of the present invention can divide the communication device into functional modules according to the above method examples. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiments of the present invention is illustrative, only a logical function division, and there can be other division methods in actual implementation.
[0188] As Figure 9 shown, it is a schematic structural diagram of a communication device provided by an embodiment of the present invention. The communication device is applied to a communication system including multiple electronic devices; the same main account is logged in to multiple electronic devices; the communication device includes: a display unit 91 and a processing unit 92.
[0189] The display unit 91 is configured to display multiple sub-accounts established in the main account in response to a trigger operation performed by a user on a target electronic device among the multiple electronic devices in the display pages of the multiple electronic devices.
[0190] The display unit 91 is further configured to display multiple communication controls corresponding to the communication selection operation in response to a communication selection operation performed by the user on a target sub-account among the multiple sub-accounts; the communication selection operation includes: a selection connection mode operation or a selection forwarding mode operation.
[0191] The processing unit 92 is configured to control the target sub-account in the target electronic device to communicate with other accounts through a communication method corresponding to the target communication control in response to a trigger operation performed by the user on the target communication control among the multiple communication controls; the communication method of the other accounts is the same as that of the target sub-account.
[0192] In an implementable manner, when the communication selection operation is a selection connection mode operation, the multiple communication controls include one or more of the following: Server-Side Events (SSE) and Extensible Messaging and Presence Protocol (XMPP) protocol control, Message Queuing Telemetry Transport (MQTT) protocol control, MQTT protocol bridge control, personal hotspot Wi-Fi - server control, Local Area Network (LAN) Wi-Fi - server control, LAN Wi-Fi - client control, Bluetooth Mesh network - coordinator control, Bluetooth Mesh network - server control, Bluetooth Mesh network - client control, ZigBee network - coordinator control, ZigBee network - router control, ZigBee network - client control, Long Range (LoRa) network - gateway control, LoRa network - client control;
[0193] The processing unit 92 is specifically configured to: in response to a triggering operation performed by the user on the target communication control, control the target sub-account in the target electronic device to establish a communication connection with other accounts through the communication method corresponding to the target communication control.
[0194] In an implementable manner, when the target communication control is a server XMPP protocol control or a server MQTT protocol control,
[0195] The processing unit 92 is further configured to: in response to a triggering operation performed by the user on the target communication control, control the target sub-account in each of the multiple electronic devices to establish a communication connection with other accounts through the communication method corresponding to the target communication control.
[0196] In an implementable manner, when the target communication control is any one of an MQTT protocol bridging control, a personal hotspot WIFI-server control, a local area network WIFI-server control, a local area network WIFI-client control, a Bluetooth mesh network-coordinator control, a Bluetooth mesh network-server control, a Bluetooth mesh network-client control, a ZigBee network-coordinator control, a ZigBee network-router control, a ZigBee network-client control, a LoRa network-gateway control, and a LoRa network-client control,
[0197] The processing unit 92 is further configured to: in response to a triggering operation performed by the user on the target communication control, control the target sub-accounts in other electronic devices except the target electronic device among the multiple electronic devices to stop establishing a communication connection with other accounts through the communication method corresponding to the target communication control;
[0198] The processing unit 92 is further configured to control the first account to establish a communication connection with other accounts through the first communication method; the first account is the target sub-account of the target electronic device; the first communication method is the communication method corresponding to the target communication control.
[0199] In an implementable manner, the display unit 91 is further configured to: in response to a triggering operation performed by the user on the target communication control, display a parameter setting page; the parameter setting page is used to prompt the user to set communication parameters of the communication method corresponding to the target communication control.
[0200] In an implementable manner, when the communication selection operation is the selection and forwarding mode operation, the multiple communication controls include one or more of the following: a second account control, a serial port control, an I2C bus control, a controller area network CAN bus control, a universal serial USB bus control, a radio frequency transceiver module RF433 control, an MQTT client control, a private COPE client control, a hypertext transfer protocol HTTP client control, a transmission control protocol TCP / user datagram protocol UDP-client control, a Bluetooth low energy BLE Bluetooth-slave control, a local area network WIFI-client control, a Bluetooth mesh network-client control, a ZigBee network-client control, a LoRa network-client control;
[0201] The processing unit 92 is specifically configured to: in response to a trigger operation performed by the user on the target communication control, control the target sub-account in the target electronic device to forward the received communication message to the account or interface corresponding to the target communication control, and receive the communication message sent by the account or interface corresponding to the target communication control.
[0202] In an implementable manner, when the target communication control is any one of the second account control, the serial port control, the I2C bus control, the CAN bus control, the USB bus control, the RF433 control, the MQTT client control, the COPE client control, the HTTP client control, the TCP / UDP-client control, the BLE Bluetooth-slave control, the local area network WIFI-client control, the Bluetooth mesh network-client control, the ZigBee network-client control, the LoRa network-client control,
[0203] The processing unit 92 is further configured to, in response to a trigger operation performed by the user on the second account control, control the second account to forward the received communication message through a second communication method, and receive the communication message sent by a third account through the second communication method; the third account is an account other than the target sub-account among the multiple electronic devices; the second communication method is a communication method established through an account or interface other than the account or interface corresponding to the target communication control.
[0204] In an implementable manner, when the target communication control is any one of a serial port control, an I2C bus control, a CAN bus control, a USB bus control, an RF433 control, an MQTT client control, a COPE client control, an HTTP client control, a TCP / UDP - client control, a BLE Bluetooth - slave control, a local area network WIFI - client control, a Bluetooth mesh network - client control, a ZigBee network - client control, and a LoRa network - client control, the processing unit 92 is further configured to, in response to a triggering operation performed by the user on the target communication control, control other accounts in the target electronic device, except for the target sub - account, to stop forwarding the received communication messages through the communication method corresponding to the target communication control; and control the same target sub - accounts in different electronic devices among multiple electronic devices to select the same or different forwarding methods.
[0205] Of course, the communication device provided in the embodiments of the present invention includes but is not limited to the above - mentioned modules. For example, the communication device may further include a storage unit 93. The storage unit 93 can be used to store the program code of the communication device, and can also be used to store the data generated during the operation of the communication device, such as the data in the write request, etc.
[0206] Figure 10 is a schematic structural diagram of a communication device shown according to an exemplary embodiment. The communication device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle terminal, a wearable device, and a pedometer, etc. As Figure 10 shown, the communication device includes but is not limited to: a processor 101, a memory 102, a display 103, an input unit 104, an output unit 105, a network unit 106, an interface unit 107, a radio frequency unit 108, a power supply 109, and a sensor 110, etc.
[0207] It should be noted that those skilled in the art can understand that Figure 10 the structure of the communication device shown in Figure 10 does not constitute a limitation on the communication device. The communication device may include more or fewer components than
[0208] shown, or combine certain components, or have different component arrangements.
[0209] The processor 101 is the control center of the communication device, connecting various parts of the entire communication device through various interfaces and lines. By running or executing software programs and / or modules stored in the memory 102, and by invoking the data stored in the memory 102, it executes various functions of the communication device and processes data, thereby monitoring the communication device as a whole. The processor 101 may include one or more processing units; optionally, the processor 101 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 101 either.
[0210] The memory 102 can be used to store software programs and various data. The memory 102 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory 102 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage devices.
[0211] The display 103 is used to display information input by the user or information provided to the user. The display 103 may include a display panel, and the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0212] The input unit 104 can be used to receive audio or video signals. The input unit 104 may include a graphics processing unit (GPU) and a microphone. The graphics processing unit processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frames can be displayed on the display 103. The processed image frames can be stored in the memory 102 (or other storage media) or transmitted via the radio frequency unit 108 or the network unit 106. The microphone can receive sounds and can process such sounds into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 108 in the case of a phone call mode.
[0213] The input unit 104 can be a user input unit, which is used to receive input numerical or character information, and generate key signal inputs related to the user settings and function control of the communication device. Specifically, the user input unit includes a touch panel and other input devices. The touch panel, also known as a touch screen, can collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel). The touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 101, and receives and executes the commands sent by the processor 101. In addition, various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch panel. In addition to the touch panel, the user input unit can also include other input devices. Specifically, the other input devices can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, which will not be elaborated here.
[0214] Furthermore, the touch panel can cover the display panel. After the touch panel detects a touch operation on or near it, it transmits the operation to the processor 101 to determine the type of the touch event. Subsequently, the processor 101 provides corresponding visual output on the display panel according to the type of the touch event. The touch panel and the display panel can be implemented as two independent components to realize the input and output functions of the communication device, or the touch panel and the display panel can be integrated to realize the input and output functions of the communication device. Specifically, it is not limited here.
[0215] The output unit 105 can be an audio output unit, which can convert the audio data received by the radio frequency unit 108 or the network unit 106 or stored in the memory 102 into an audio signal and output it as sound. Moreover, the audio output unit can also provide audio output related to specific functions executed by the communication device (for example, call signal receiving sound, message receiving sound, etc.). The audio output unit includes a speaker, a buzzer, a receiver, etc.
[0216] The communication device provides wireless broadband Internet access for users through the network unit 106, such as helping users to send and receive emails, browse web pages, and access streaming media, etc.
[0217] The interface unit 107 is an interface for connecting an external device to the communication device. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. The interface unit 107 can be used to receive inputs from an external device (such as data information, power, etc.) and transfer the received inputs to one or more components within the communication device or can be used to transfer data between the communication device and the external device.
[0218] The radio frequency unit 108 can be used for receiving and transmitting information or signals during a call. Specifically, after receiving the downlink data from the base station, it is given to the processor 101 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 108 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. In addition, the radio frequency unit 108 can also communicate with the network and other devices through a wireless communication system.
[0219] The power supply 109 (such as a battery) can be used to supply power to each component. Optionally, the power supply 109 can be logically connected to the processor 101 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system.
[0220] The sensor 110 can include at least one of an optical sensor, a motion sensor, and other sensors. Specifically, the optical sensor includes an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor can turn off the display panel and / or the backlight when the communication device is moved to the ear. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as a pedometer, tapping), etc.; the sensor 110 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be elaborated here.
[0221] In addition, the communication device includes some functional modules not shown (such as a camera), which will not be elaborated here.
[0222] In an exemplary embodiment, an embodiment of the present disclosure further provides a storage medium including instructions, such as a memory 102 including instructions, and the above instructions can be executed by a processor 101 of a communication device to complete the above method. Optionally, the storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0223] In an exemplary embodiment, an embodiment of the present disclosure further provides a computer program product including one or more instructions, and the one or more instructions can be executed by a processor 101 of a communication device to complete the above method.
[0224] It should be noted that when the instructions in the above storage medium or the one or more instructions in the computer program product are executed by the processor 101, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be elaborated here.
[0225] Another embodiment of the present invention further provides a computer-readable storage medium, and instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute the method shown in the above method embodiment.
[0226] In some embodiments, the disclosed method may be implemented as computer program instructions encoded in a computer-readable storage medium in a machine-readable format or encoded on other non-transitory media or articles.
[0227] In an exemplary embodiment, an embodiment of the present disclosure further provides a storage medium including instructions, such as a memory 102 including instructions, and the above instructions can be executed by a processor 101 of a server 02 to complete the above method. Optionally, the storage medium may be a non-transitory computer-readable storage medium. For example, the non-transitory computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0228] In an exemplary embodiment, an embodiment of the present disclosure further provides a computer program product including one or more instructions, and the one or more instructions can be executed by a processor 101 of a server 02 to complete the above method.
[0229] Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be allocated to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0230] In several embodiments provided by the present invention, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0231] The unit described as a separated component may or may not be physically separated. The component displayed as a unit may be a physical unit or multiple physical units, that is, it can be located in one place or distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0232] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0233] 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 readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs that can store program codes. As described above, this is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A communication method, characterized in that, The communication method is applied to a communication system including multiple electronic devices; the same main account is logged in to the multiple electronic devices; the communication method includes: In the display pages of the multiple electronic devices, in response to a trigger operation performed by the user on a target electronic device among the multiple electronic devices, display multiple sub-accounts established in the main account; In response to a communication selection operation performed by the user on a target sub-account among the multiple sub-accounts, display multiple communication controls corresponding to the communication selection operation; the communication selection operation includes: a selection connection mode operation or a selection forwarding mode operation; In response to a trigger operation performed by the user on a target communication control among the multiple communication controls, control the target sub-account in the target electronic device to communicate with other accounts through a communication method corresponding to the target communication control; the communication method of the other accounts is the same as that of the target sub-account; When the communication selection operation is the selection connection mode operation, the multiple communication controls include one or more of the following: Server-Side Scalable Communications and the XMPP Protocol Control, the MQTT (Message Queuing Telemetry Transport) Protocol Control, the MQTT Protocol Bridging Control, the Personal Hotspot WIFI-Server Control, the LAN (Local Area Network) Wireless Communication Technology WIFI-Server Control, the LAN WIFI-Client Control, the Bluetooth Wireless Mesh Network Mesh Network-Coordinator Control, the Bluetooth Mesh Network-Server Control, the Bluetooth Mesh Network-Client Control, the ZigBee (ZigBee) Network-Coordinator Control, the ZigBee Network-Routing Control, the ZigBee Network-Client Control, the Long Range Radio (LoRa) Network-Gateway Control, the LoRa Network-Client Control; When the communication selection operation is the selection forwarding mode operation, the multiple communication controls include one or more of the following: the Second Account Control, the Serial Port Control, the I2C (Inter-Integrated Circuit) Bus Control, the Controller Area Network (CAN) Bus Control, the Universal Serial Bus (USB) Control, the Radio Frequency (RF) 433 Wireless Transceiver Module Control, the MQTT Client Control, the Private COPE Client Control, the Hypertext Transfer Protocol (HTTP) Client Control, the Transmission Control Protocol (TCP) / User Datagram Protocol (UDP)-Client Control, the Bluetooth Low Energy (BLE) Bluetooth-Slave Control, the LAN WIFI-Client Control, the Bluetooth Mesh Network-Client Control, the ZigBee Network-Client Control, the LoRa Network-Client Control.
2. The communication method according to claim 1, characterized in that, The step of, in response to a trigger operation performed by the user on a target communication control among the multiple communication controls, controlling the target sub-account in the target electronic device to communicate with other accounts through a communication method corresponding to the target communication control includes: In response to a trigger operation performed by the user on the target communication control, control the target sub-account in the target electronic device to establish a communication connection with other accounts through a communication method corresponding to the target communication control.
3. The communication method according to claim 2, characterized in that, When the target communication control is the server XMPP protocol control or the server MQTT protocol control, it further includes: In response to the triggering operation performed by the user on the target communication control, controlling the target sub-accounts in each of the multiple electronic devices to establish a communication connection with the other accounts through the communication method corresponding to the target communication control.
4. The communication method according to claim 2, characterized in that, When the target communication control is any one of the MQTT protocol bridging control, the personal hotspot WIFI - server control, the local area network WIFI - server control, the local area network WIFI - client control, the Bluetooth mesh network - coordinator control, the Bluetooth mesh network - server control, the Bluetooth mesh network - client control, the ZigBee network - coordinator control, the ZigBee network - routing control, the ZigBee network - client control, the LoRa network - gateway control, the LoRa network - client control, it further includes: In response to the triggering operation performed by the user on the target communication control, controlling the target sub-accounts in the other electronic devices except the target electronic device among the multiple electronic devices to stop establishing a communication connection with the other accounts through the communication method corresponding to the target communication control; Controlling the first account to establish a communication connection with the other accounts through the first communication method; the first account is the target sub-account in the target electronic device; the first communication method is the communication method corresponding to the target communication control.
5. The communication method according to claim 4, characterized in that, It further includes: In response to the triggering operation performed by the user on the target communication control, displaying a parameter setting page; the parameter setting page is used to prompt the user to set the communication parameters of the communication method corresponding to the target communication control.
6. The communication method according to claim 1, characterized in that, The controlling the target sub-account in the target electronic device to communicate with other accounts through the communication method corresponding to the target communication control in response to the triggering operation performed by the user on the target communication control among the multiple communication controls includes: In response to the triggering operation performed by the user on the target communication control, controlling the target sub-account in the target electronic device to forward the received communication messages to the account or interface corresponding to the target communication control, and receiving the communication messages sent by the account or interface corresponding to the target communication control.
7. The communication method according to claim 6, characterized in that, When the target communication control is any one of the second account control, the serial port control, the I2C bus control, the CAN bus control, the USB bus control, the RF433 control, the MQTT client control, the COPE client control, the HTTP client control, the TCP / UDP - client control, the BLE Bluetooth - slave control, the local area network WIFI - client control, the Bluetooth mesh network - client control, the ZigBee network - client control, the LoRa network - client control, it further includes: In response to the triggering operation performed by the user on the second account control, control the second account to forward the received communication message through the second communication method, and receive the communication message sent by the third account through the second communication method; the third account is an account other than the target sub-account among the multiple electronic devices; the second communication method is a communication method established through an account or interface other than the account or interface corresponding to the target communication control.
8. The communication method according to claim 7, characterized in that, When the target communication control is any one of the serial port control, the I2C bus control, the CAN bus control, the USB bus control, the RF433 control, the MQTT client control, the COPE client control, the HTTP client control, the TCP / UDP-client control, the BLE Bluetooth-slave control, the local area network WIFI-client control, the Bluetooth mesh network-client control, the ZigBee network-client control, the LoRa network-client control, it further includes: In response to the triggering operation performed by the user on the target communication control, control other accounts in the target electronic device except the target sub-account to stop forwarding the received communication message through the communication method corresponding to the target communication control; And, control the same target sub-account in different electronic devices among the multiple electronic devices to select the same or different forwarding methods.
9. The communication method according to claim 1, characterized in that, The method further includes: In response to the triggering operation performed by the user on the white list setting control of the electronic device, control whether the message of the sub-device under the electronic device where the main account is located can be sent to other target sub-accounts through the sub-account after being forwarded and bound to the selected communication method, or whether the sub-account can send the message to the sub-device under the electronic device where the main account is located in the communication method selected for forwarding after receiving the message from the other target sub-account; In response to the triggering operation performed by the user on the white list setting control of the electronic device, control the main account to poll and manage the sub-devices under the electronic device where the main account is located at all times.
10. The communication method according to claim 9, characterized in that, The communication protocol format between devices is: {"S":"1","D":"2","L":"3","R":"4","C":"5","N":6,"V":[7],"I":"8","M":"9","T":"20211110111110","P":"11","U":"12"}, and the data is in the form of a JSON string; "S" is the source sub-account that sends the data, "D" is the destination sub-account that receives the data, "L" is the address of the source sub-device under an electronic device where a certain main account is located, "R" is the address of the destination sub-device under the electronic device where the certain main account is located; "C" is a command, representing an operation, and the command types are: read, write, notify, request, and report; "N" is the number of a certain operation, which is different each time, and the value is an integer; "V" is the actual data value of the data, and the value is a JSON array; "I" indicates the direction of data flow of the command and is used to determine what type of command it is; "M" is data required by the system internally and has nothing to do with the application; "T" is the time when the data is sent, "P" is the protocol type or version of the current protocol, and "U" is the ID of the main device of the data sender; The report command corresponds to the reported friend accounts and my account; The friend accounts are other target sub-accounts added to the target sub-account; my account is other target sub-accounts created by the main account; In response to clicking on the other target sub-account created, a dialog box is opened, and the message sent by the sub-device is displayed in the dialog box.
11. The communication method according to claim 10, characterized in that, It also includes: In response to the user's triggering operation on the request and report binding control, and then in response to the user's triggering operation on the friend requested and reported, select the data of the request and report command and send it to the target sub-account that needs to receive the command data; After the sub-account receives the data from the sub-device, according to the command C in the data, select the target sub-account, and then send the data to the target sub-account; In response to the user's triggering operation on the local function selection control of the device, select one of the functions built into the device locally, so that the data from the other target sub-account or from the sub-device under the target sub-account is output to the selected function built into the device locally; after the local function of the device is output with data, select a certain type of output function according to I, select a specific function according to the command C, and judge whether the data is the data of the current process according to N in the internal process, and finally use the data value V.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer-executable instructions, and when the computer-executable instructions run on a computer, the computer is caused to execute the communication method according to any one of claims 1-7.
Citation Information
Patent Citations
Instant messaging message processing method and device, medium and electronic equipment
CN112311654A
Gateway structure for multi-protocol conversion
CN112671638A