CN108900620B - Bluetooth mesh multi-gateway local and remote control coexistence method and device - Google Patents

Bluetooth mesh multi-gateway local and remote control coexistence method and device Download PDF

Info

Publication number
CN108900620B
CN108900620B CN201810739458.7A CN201810739458A CN108900620B CN 108900620 B CN108900620 B CN 108900620B CN 201810739458 A CN201810739458 A CN 201810739458A CN 108900620 B CN108900620 B CN 108900620B
Authority
CN
China
Prior art keywords
instruction
local
serial number
gateway
instruction information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810739458.7A
Other languages
Chinese (zh)
Other versions
CN108900620A (en
Inventor
周瑞鑫
黄凯
朱盛庚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Tuya Information Technology Co Ltd
Original Assignee
Hangzhou Tuya Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Tuya Information Technology Co Ltd filed Critical Hangzhou Tuya Information Technology Co Ltd
Priority to CN201810739458.7A priority Critical patent/CN108900620B/en
Publication of CN108900620A publication Critical patent/CN108900620A/en
Application granted granted Critical
Publication of CN108900620B publication Critical patent/CN108900620B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • H04L67/125Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks involving control of end-device applications over a network
    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C17/00Arrangements for transmitting signals characterised by the use of a wireless electrical link
    • G08C17/02Arrangements for transmitting signals characterised by the use of a wireless electrical link using a radio link
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q9/00Arrangements in telecontrol or telemetry systems for selectively calling a substation from a main station, in which substation desired apparatus is selected for applying a control signal thereto or for obtaining measured values therefrom
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q2209/00Arrangements in telecontrol or telemetry systems
    • H04Q2209/40Arrangements in telecontrol or telemetry systems using a wireless architecture
    • H04Q2209/43Arrangements in telecontrol or telemetry systems using a wireless architecture using wireless personal area networks [WPAN], e.g. 802.15, 802.15.1, 802.15.4, Bluetooth or ZigBee

Abstract

The invention provides a method and a device for coexistence of local control and remote control of a Bluetooth mesh multi-gateway, aiming at solving the problem that the Bluetooth mesh multi-gateway technology in the prior art is easy to conflict when the local control and the remote control coexist. The method comprises the following steps: acquiring instruction information and an instruction serial number issued by a local or gateway; judging whether the connection state of the equipment exists in the local connection and the remote gateway connection; if yes, the equipment shields the instruction information issued by the gateway according to the issued instruction serial number, and processes the instruction information issued locally.

Description

Bluetooth mesh multi-gateway local and remote control coexistence method and device
Technical Field
The invention relates to the technical field of computer network communication, in particular to a Bluetooth mesh multi-gateway coexistence method and device.
Background
The Bluetooth mesh technology is a many-to-many key technology based on Bluetooth, is applied to a plurality of fields such as intelligent lighting, building automation, whole-house intelligence and the like, and realizes the intellectualization of equipment.
When the user equipment is dispersed and can not form a single mesh network, the single Bluetooth mesh gateway needs a multi-gateway technology. The differences between single gateway and multi-gateway technologies are as follows: limitations of a single gateway: (1) the single gateway has higher requirement on the distance of the equipment; (2) the devices are not grouped together in actual usage scenarios; the technical characteristics of the multiple gateways are as follows: (1) The device distance limit is broken through, and remote devices can form a mesh network; (2) And uniformly managing and uniformly grouping all the devices under the user account.
However, when the multi-gateway technology is applied, when local control and remote control coexist, a conflict problem is easily caused, so that a method for realizing coexistence of bluetooth mesh multi-gateway local control and remote control is urgently needed, and the following problems can be solved:
(1) When local and remote coexistence is realized, one message instruction device is executed only once;
(2) Local and remote control are carried out simultaneously, so that the equipment state is free from problems;
(3) Communication resources are saved, and the risk problem of data disorder is solved;
(4) The device remotely synchronizes with the client display state.
Disclosure of Invention
The invention provides a method and a device for coexistence of local control and remote control of a Bluetooth mesh multi-gateway, aiming at solving the problem that the Bluetooth mesh multi-gateway technology in the prior art is easy to conflict when the local control and the remote control coexist
The embodiment of the invention provides a Bluetooth mesh multi-gateway local and remote control coexistence method, which comprises the following steps:
acquiring instruction information and an instruction serial number issued by a local or gateway;
judging whether the connection state of the equipment exists in the local connection and the remote gateway connection;
if yes, the equipment shields the instruction information issued by the gateway according to the issued instruction serial number, and processes the instruction information issued locally.
Preferably, the step of obtaining the instruction information and the instruction serial number issued by the local or gateway further includes:
when the client uses MQTT to issue a local instruction message, a random number is randomly generated and used as a local instruction sequence number;
when the server side issues the remote instruction message, a random number is randomly generated and used as a remote instruction sequence number.
Preferably, the step of the device shielding the instruction information issued by the gateway according to the issued instruction serial number and processing the locally issued instruction information further includes:
the equipment checks the obtained command serial number and judges whether the received command serial number is a local command serial number or not;
if so, processing the instruction information corresponding to the instruction serial number;
if not, shielding the instruction information corresponding to the instruction serial number.
Preferably, the method further comprises the following steps:
the device carries the current unique timestamp mark for detection, and redundant repeated instruction information of the device is filtered.
The embodiment of the invention simultaneously discloses a Bluetooth mesh multi-gateway local and remote control coexistence device, which is characterized by comprising the following components:
the acquisition module is used for acquiring the instruction information and the instruction serial number issued by the local or gateway;
the judging module is used for judging whether the local connection and the remote gateway connection exist simultaneously or not;
and the processing module is used for shielding the instruction information issued by the gateway and processing the instruction information issued locally according to the issued instruction serial number when the equipment has local connection and remote gateway connection at the same time.
Preferably, the acquiring module includes:
the client randomly generates a random number as a local instruction sequence number when issuing a local instruction message by using the MQTT;
and the second sequence number unit is used for randomly generating a random number as the remote instruction sequence number when the server side issues the remote instruction message.
Preferably, the processing module further comprises:
and the checking unit is used for checking the acquired instruction serial number by the equipment and judging whether the received instruction serial number is the local instruction serial number or not.
The first execution unit is used for processing the instruction information corresponding to the instruction serial number if the checking unit judges that the received instruction serial number is the local instruction serial number;
and the second execution unit is used for shielding the instruction information corresponding to the instruction serial number if the checking unit judges that the received instruction serial number is not the local instruction serial number.
Preferably, the system further comprises a filtering unit, and the filtering module is used for detecting the device with the current unique timestamp mark and filtering redundant repeat instruction information of the device.
The invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of the above when executing the program.
The invention also provides a computer-readable storage medium, on which a computer program is stored which, when executed by a processor, implements the method of any one of the above.
Based on the method, the following problems can be solved:
(1) When local and remote coexistence is realized, one message instruction device is executed only once;
(2) Local and remote control are carried out simultaneously, so that the equipment state is free from problems;
(3) Communication resources are saved, and the risk problem of data disorder is solved;
(4) The device remotely synchronizes with the client display status.
Drawings
Fig. 1 is a flowchart of a bluetooth mesh multi-gateway local and remote control coexistence method according to the present invention.
Fig. 2 is a flowchart of another bluetooth mesh multi-gateway local and remote control coexistence method according to the present invention.
Fig. 3 is a block diagram of a bluetooth mesh multi-gateway local and remote control coexistence device according to the present invention.
Fig. 4 is a block diagram of another bluetooth mesh multi-gateway local and remote control coexistence apparatus according to the present invention.
Fig. 5 is a block diagram of a computer device according to the present invention.
Detailed Description
The invention is further described with reference to the following figures and detailed description.
As shown in fig. 1, the present invention provides a bluetooth mesh multi-gateway local and remote control coexistence method, which comprises the following steps:
s101, obtaining instruction information and an instruction serial number issued by a local or gateway.
S102, judging whether the connection state of the equipment exists in the local connection and the remote gateway connection.
And S103, if yes, shielding the instruction information issued by the gateway by the equipment according to the issued instruction serial number, and processing the instruction information issued locally.
In the embodiment, whether the issued instruction information is from the local or the gateway is identified through the instruction serial number, and only the locally sent instruction information is received for the connection state existing in both local connection and remote gateway connection, so that when local and remote coexistence is realized, one message instruction device is only executed once; saving communication resources and repairing the risk problem of data disorder.
As shown in fig. 2, another bluetooth mesh multi-gateway local and remote control coexistence method is provided in the present invention. In the method, the step of S101 obtaining the instruction information and the instruction serial number issued by the local or gateway further comprises:
s201, when the client uses MQTT to issue the local instruction message, a random number is randomly generated and used as a local instruction sequence number.
S202, when the server side issues the remote instruction message, a random number is randomly generated to serve as a remote instruction serial number.
Whether the local instruction message sent by the client side through the MQTT or the remote instruction message sent by the server through the gateway far-end gateway is used, a unique random number is randomly generated to serve as a local instruction serial number or a remote instruction serial number and serve as a basis for identifying an instruction information source of the equipment.
In the present embodiment, the instruction sequence number generation is implemented by:
// support multiple gateways, maximum sequence number of newly added 3 byte random number 16777215
if(randonS==0||randonS==16777215){
randonS=arc4random()%16777215;}
V/now pv =2.1
NSData*publishData=[TYMQModel getPublishData:[pv tp_toDouble]devId:@""data:data localKey:localKey protocol:protocol time:time publishS:randonS publishR:0];
randon s + +; // increment
If S103 is yes, the step of checking the obtained command serial number by the device, and receiving the command information with the command serial number consistent with the local serial number further includes:
s203, the device checks the acquired command serial number and judges whether the received command serial number is a local command serial number.
And if so, processing the instruction information corresponding to the instruction serial number.
And S205, if not, shielding the instruction information corresponding to the instruction serial number.
S206, the equipment sets the current unique timestamp mark for detection and filters redundant repeated instruction information.
In this embodiment, the filtering step is implemented by:
void app_mesh_api_cmds(u8len,u8*pData){//get
int sno=(((u32)pData[MESH_DATA_SNO])<<16)|
(((u32)pData[MESH_DATA_SNO+1])<<8)|((u32)pData[MESH_DATA_SNO+2]);
for (u 8i =1
j=(mMeshDataFifo.index+MESH_DATA_FIFO_SIZE-i)%MESH_DATA_FIFO_SIZE;
u8*p=mMeshDataFifo.meshdata[j].data;
int sno2=(((u32)p[MESH_DATA_SNO])<<16)|
(((u32)p[MESH_DATA_SNO+1])<<8)|((u32)p[MESH_DATA_SNO+2]);
if(sno2==sno)return;}}
Through the steps, the equipment can identify whether the obtained instruction serial number is the local instruction serial number, only process local instruction information with the local instruction serial number, and only execute the repeated instruction once through setting the current unique timestamp for detection.
As shown in fig. 3, the present invention provides a bluetooth mesh multi-gateway local and remote control coexistence apparatus, comprising:
the obtaining module 301 is configured to obtain instruction information and an instruction sequence number issued by a local or gateway.
The determining module 302 is configured to determine whether the local connection and the remote gateway connection exist in the device connection status at the same time.
And the processing module 303 is configured to shield the instruction information issued by the gateway according to the issued instruction sequence number and process the instruction information issued locally when the device has a local connection and a remote gateway connection at the same time.
As shown in fig. 4, another bluetooth mesh multi-gateway local and remote control coexistence device is provided in the present invention.
The obtaining module 301 includes:
a first sequence number unit 401, when the client uses MQTT to issue the local instruction message, randomly generating a random number as the local instruction sequence number;
the second sequence number unit 402 randomly generates a random number as the remote command sequence number when the server issues the remote command message.
The processing module 303 further comprises:
the device checks the acquired command serial number, and determines whether the received command serial number is a local command serial number.
The first execution unit 404, if the check unit determines that the received command sequence number is the local command sequence number, processes the command information corresponding to the command sequence number.
If the checking unit determines that the received command sequence number is not the local command sequence number, the second execution unit 405 masks the command information corresponding to the command sequence number.
And a filtering unit 406, configured to filter redundant repeat instruction information of the device with the current unique timestamp mark detection.
As shown in fig. 5, the present invention further provides a computer device 5, which includes a memory 501, a processor 502 and a computer program 503 stored on the memory and running on the processor, wherein the processor executes the program to implement the method according to any of the above embodiments.
The invention further provides a computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of the above-mentioned embodiments.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations could be devised by those skilled in the art in light of the present teachings without departing from the inventive concept. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (4)

1. A Bluetooth mesh multi-gateway local and remote control coexistence method, characterized in that the method comprises the following steps:
acquiring instruction information and an instruction serial number issued by a local or gateway;
judging whether the connection state of the equipment exists in the local connection and the remote gateway connection;
if yes, the device shields the instruction information issued by the gateway according to the issued instruction serial number, and processes the instruction information issued locally, including: the equipment checks the obtained command serial number and judges whether the received command serial number is a local command serial number or not; if so, processing the instruction information corresponding to the instruction serial number; if not, shielding the instruction information corresponding to the instruction serial number;
the equipment sets the current unique timestamp mark detection and filters redundant repeated instruction information;
the step of obtaining the instruction information and the instruction sequence number issued by the local or gateway further includes:
when the client uses MQTT to issue a local instruction message, a random number is randomly generated and used as a local instruction sequence number;
when the server side issues the remote instruction message, a random number is randomly generated and used as a remote instruction serial number.
2. A bluetooth mesh multi-gateway local and remote control coexistence apparatus, the apparatus comprising:
the acquisition module is used for acquiring the instruction information and the instruction serial number issued by the local or gateway;
the judging module is used for judging whether the local connection and the remote gateway connection exist simultaneously or not;
a processing module, configured to shield the instruction information issued by the gateway according to the issued instruction sequence number and process the instruction information issued locally when the device has a local connection and a remote gateway connection at the same time, where the processing module further includes:
the checking unit is used for checking the acquired instruction serial number by the equipment and judging whether the received instruction serial number is a local instruction serial number or not;
the first execution unit is used for processing the instruction information corresponding to the instruction serial number if the check unit judges that the received instruction serial number is the local instruction serial number;
the second execution unit is used for shielding the instruction information corresponding to the instruction serial number if the checking unit judges that the received instruction serial number is not the local instruction serial number;
the filtering unit is used for detecting the current unique timestamp mark set by the equipment and filtering redundant repeated instruction information;
the acquisition module comprises:
the client randomly generates a random number as a local instruction sequence number when issuing a local instruction message by using the MQTT;
and the second serial number unit is used for randomly generating a random number as the remote instruction serial number when the server side issues the remote instruction message.
3. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of claim 1 when executing the computer program.
4. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of claim 1.
CN201810739458.7A 2018-07-06 2018-07-06 Bluetooth mesh multi-gateway local and remote control coexistence method and device Active CN108900620B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810739458.7A CN108900620B (en) 2018-07-06 2018-07-06 Bluetooth mesh multi-gateway local and remote control coexistence method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810739458.7A CN108900620B (en) 2018-07-06 2018-07-06 Bluetooth mesh multi-gateway local and remote control coexistence method and device

Publications (2)

Publication Number Publication Date
CN108900620A CN108900620A (en) 2018-11-27
CN108900620B true CN108900620B (en) 2022-11-15

Family

ID=64349133

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810739458.7A Active CN108900620B (en) 2018-07-06 2018-07-06 Bluetooth mesh multi-gateway local and remote control coexistence method and device

Country Status (1)

Country Link
CN (1) CN108900620B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110381606A (en) * 2019-07-05 2019-10-25 奇酷互联网络科技(深圳)有限公司 Mesh audio system, management method and storage medium
CN115884114A (en) * 2022-11-29 2023-03-31 四川启睿克科技有限公司 Bluetooth mesh control optimization method based on edge calculation

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095816A (en) * 2012-12-31 2013-05-08 广东卓耐普智能技术股份有限公司 Household distributed gateway control system and implementation method thereof
CN104486886A (en) * 2014-12-17 2015-04-01 杭州固态照明有限公司 Smart-lighting remote control system and method based on mobile intelligent terminal
CN104736100A (en) * 2012-10-18 2015-06-24 电子技术应用设计公司 Device for controlling a surgical handpiece

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104736100A (en) * 2012-10-18 2015-06-24 电子技术应用设计公司 Device for controlling a surgical handpiece
CN103095816A (en) * 2012-12-31 2013-05-08 广东卓耐普智能技术股份有限公司 Household distributed gateway control system and implementation method thereof
CN104486886A (en) * 2014-12-17 2015-04-01 杭州固态照明有限公司 Smart-lighting remote control system and method based on mobile intelligent terminal

Also Published As

Publication number Publication date
CN108900620A (en) 2018-11-27

Similar Documents

Publication Publication Date Title
CN107317730B (en) Method, equipment and system for monitoring state of block chain node
US9911093B2 (en) Intelligent service management and process control using policy-based automation and predefined task templates
CN108900620B (en) Bluetooth mesh multi-gateway local and remote control coexistence method and device
CN108139964B (en) Cloud service configuration method and device, storage medium and cloud service system
CN113867913A (en) Business request processing method, device, equipment and storage medium for microservice
CN105045114A (en) Information processing method, cloud service platform and information processing system
WO2021190659A1 (en) System data acquisition method and apparatus, and medium and electronic device
CA2920015A1 (en) Dynamic sensor driver loading over a wireless network
CN103684792A (en) Safety authentication method for OAM (Operation, Administration and Maintenance) and OAM message sending/receiving device
CN107729213A (en) A kind of background task monitoring method and device
CN117131516B (en) Operation and maintenance method and device
EP3828705A1 (en) Method and apparatus for processing a service of an abnormal server
CN108965403A (en) O&amp;M monitors establishment of connection method and terminal device
CN112948822A (en) Big data audit scene analysis method and system applied to intelligent education system
CN110555308B (en) Terminal application behavior tracking and threat risk assessment method and system
CN106254040B (en) Command response processing method and device
CN109859038B (en) Method and device for taking block chain intelligent contract into effect
CN113486100A (en) Service management method, device, server and computer storage medium
CN114070889A (en) Configuration method, traffic forwarding method, device, storage medium, and program product
CN110888772A (en) Remote monitoring method, monitoring device, computer equipment and readable storage medium
CN111786837A (en) System and method for wirelessly modifying configuration parameters of KNX (Konnex) equipment
CN113343221A (en) Terminal early warning method and device
CN110633182A (en) System, method and apparatus for monitoring server stability
CN103838615A (en) Strategy execution method, strategy execution device and strategy execution system
US11353855B1 (en) Configuring and deploying gateway connectors and workflows for data sources at client networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant