Solve the method and system of many message channels control message conflict in Internet of Things
Technical field
The present invention relates to a kind of method and system solving many message channels control message conflict in Internet of Things.
Background technology
In environment of internet of things, terminal unit and device generally require to accept the control of multiple voltage inputs, control message
May be transmitted by various control message channel.On the other hand, Internet of Things, particularly domestic internet-of-things terminal equipment and device,
It is commonly stored that capacity is little, disposal ability is weak, the network bandwidth is little, the reliability of network environment is relatively low.Therefore, limited
In resource environment, the control message conflict that many voltage inputs, many message channels are likely to result in is the one of Internet of things system needs solution
Individual concrete technical problems.
The most mechanism using simple " First Come First Served " of existing Internet of things system, or only repetition is done to single control source
Control message detection and collision detection.
The queue mechanism of " First Come First Served ", i.e. Lothrus apterus detection;
Randomly choose, that is, have collision detection but no priority;
Repetitive controller message detection on single control source;
On single control source, collision detection is carried out to the control message of specific resources.
See Chinese patent《A kind of Web service concurrency control method based on internet of things oriented application and system》(application number:
CN201010590345.9 a kind of Web service concurrent control system based on internet of things oriented application) proposing, this system exists
Increase concurrency model after SOAP Body Context resolution module to realize the con current control of Web service, described concurrently control
System processed, comprises:Two thread pools and a concurrency model, this concurrency model comprises:Repeat and collision detection mould
Block, priority level initializing module and performing module;Described repetition and collision detection module comprise:Pretreatment submodule, repeats to examine
Survey submodule, filter submodule, and conflict monitoring submodule;Described priority level initializing module comprises:Priority level initializing
Module, for carrying out prioritization to the service request control message that there is conflict;Described performing module comprises:Request control
Message pretreatment submodule processed, for being ranked up and distributing thread to the service request of priority-labeled;With addressing submodule
Wherein, all operations of above-mentioned module have been based on defined in SOAP Body service equipment resource Unify legislation framework.
In summary, in prior art only for single voltage input (such as:Web service).And practical situation is Internet of Things end
End generally requires to accept the control message in various control source, such as simultaneously:Wi-Fi network, blueteeth network, infrared remote control, radio frequency
(RF2.4) control etc.;Collision detection is based only upon accessed resource.Because not introducing other environment to become in collision detection
Amount and context parameters, so this static collision detection cannot tackle relative complex Internet of Things practical application request.Fortune
Relatively costly.Prior art needs multiple threads, and most Internet of Things network processor (MCU) does not support multithreading, and this is just
Prior art is caused to can be only applied to server end or higher internet-of-things terminal.Lack the consideration to user's scene, control
The geographical position in source, user role etc..
In view of above-mentioned defect, the design people's actively in addition research and innovation, to found a kind of solve many in Internet of Things
The method and system of message channel control message conflict are so as to more the value in industry.
Content of the invention
For solving above-mentioned technical problem, it is an object of the invention to provide a kind of computational complexity is low, can process many controls
The side solving many message channels control message conflict in Internet of Things of the control message conflict under source, many control messages channel environment
Method and system.
The method that the present invention solves many message channels control message conflict in Internet of Things, in Internet of Things, a control end is even
Connect multiple message channels, and a message channel then simultaneously serves multiple voltage inputs, wherein said voltage input includes moving
Terminal, active controller;The method of many message channels control message conflict, including:
The attribute of the control message being sent based on the voltage input in Internet of Things, the priority set up based on user's scene is public
Formula;
The control message entering control message queue is compared with control message existing in queue, abandons repetition
Control message;
If certain voltage input constantly sends Repetitive controller message, this voltage input is labeled as exception, does not reprocess
The control message that this voltage input sends, until abnormal marking time-out automatically terminates or is released by hand by user, the genus of control message
Property brings control message queue into;
Scan each control message queue, the mark according to control object and attribute respectively, labelling has the control of conflict
Message, calculates the index of control message using the priority formula based on user's scene, and this index includes three parts:One mark
Note, represents that conflict control message is mutual exclusion conflict or PRI conflict;One priority factor, represents the preferential of control message
Rank;One control message processes timeliness;
Scan each control message queue, the control message reaching control message process timeliness is uniformly processed;
Control message in each control message queue is transferred to one be uniformly controlled in Message Processing queue:For mark
It is designated as the control message of mutual exclusion conflict, only retains the control message of highest priority, other control messages are directly replied operation and lost
Lose;For the control message being labeled as PRI conflict, according to priority order from high to low, add and be uniformly controlled Message Processing
In queue;For being labeled as conflict free control message, by the precedence of control message arrival, add and be uniformly controlled at message
In reason queue;
Scan in order and process the control message being uniformly controlled in Message Processing queue.
Further, described based on the priority formula expression of user's scene it is:P=f (wTX),
Wherein, p is priority indicator, p={ p1,p2,p3, p1For boolean's phenotypic marker, expression conflict control message is mutual exclusion
Conflict or PRI conflict;p2For numeric type priority factor, represent the priority level of control message;p3For numeric type control
Message Processing timeliness, unit is millisecond;
W is weight vectors, w={ w1,w2,…,wn};
X is parameter vector, X={ x1,x2,…,xn, X at least includes message channel, voltage input, positional information, time, use
Family information;
Methods described also includes setting the weight of parameters in the priority formula based on user's scene, increases or decreases
The quantity of Parameters in Formula, completes the renewal of parameters weighting and parameter list.
Further, priority indicator formula is included in independent function module, also includes modification and comprises to calculate preferentially
The function module of level Index Formula, completes the renewal of formula, the form of function f at least includes linear formula, quadratic function, high-order
Function, and machine learning model, described machine learning model, at least include random forest, neutral net.
Further, described Internet of Things includes electronic product, carries out data with electronic product by RF2.4 module
The active controller of communication, described active controller at least possesses RF2.4 module, wifi module, bluetooth module, SIM module
Four kinds of data communication methods;The means of communication between described mobile terminal and active controller include:
Set up the communication annexation between electronic product, mobile terminal and active controller, including:Set up in RF2.4
Netcom interrogates and connects, set up the connection of wifi Local network communication, set up bluetooth local area network communication connection or mobile terminal by wifi mould
Block, SIM module access cloud platform and set up wide area network and communicate with active controller and be connected;
Mobile terminal sends control message to active controller, and described active controller exports this control by RF2.4 module
Message processed is to described electronic product;
Mobile terminal sends control message by RF2.4 module to electronic product;
Active controller sends control message by RF2.4 module to electronic product.
Further, the method setting up communication relations between electronic product, mobile terminal and active controller is specifically wrapped
Include:
S2.1 obtains this electronic product, mobile terminal reads device id from local storage;
If S2.1.1 device id reads successfully, this electronic product, mobile terminal and active controller carry out testing shaking hands, and test
Card device id,
If S2.1.1.1 device id is proved to be successful, this electronic product, mobile terminal is allowed to access active controller, electronics
Set up between product, mobile terminal and active controller wifi Local network communication be connected, set up bluetooth local area network communication connect or
Mobile terminal is accessed cloud platform and is set up wide area network and communicate with active controller by wifi module, SIM module and is connected;
If S2.1.1.2 ID checking is unsuccessful, electronic product, mobile terminal send configuration device id to active controller
Request, active controller is this electronic product, mobile terminal configuration device id, and this electronic product, mobile terminal are by described equipment
ID carries out locally stored, jumps to step S2.1.1;
If the reading of S2.1.2 device id is unsuccessful, electronic product, mobile terminal send configuration equipment to active controller
ID asks, and active controller is this electronic product, mobile terminal configuration device id, and this electronic product, mobile terminal set described
Carry out for ID locally stored, jump to step S2.1.1.
Further, Active Terminal configuration electronic product, the device id of mobile terminal specifically include:
The self ID of active controller is combined together the corresponding electronics of composition with the device id of electronic product, mobile terminal and produces
Product, the overall identification of mobile terminal, the overall situation indicates can registration and unregistration in cloud platform;Lead to cloud platform in active controller
When letter connects, active controller and cloud platform synchronized update are stored in locally stored active controller self ID and electronics product
Product, the device id list of mobile terminal;
Read active controller self ID and the locally stored electronic product of active controller, the device id of mobile terminal
List;
Receive electronic product, device id that mobile terminal sends request control message, described device id control message
In comprise an equipment character string of electronic product, mobile terminal;Wherein, described equipment character string is electronic product, moves eventually
The physical address MAC at end or serial number or microprocessor numbering;
Electronic product, the device id list of mobile terminal search whether to should equipment character string device id,
If having, verify that whether effectively this device id, if effectively, exports the result;If this device id is invalid, give birth to
Become the new device id of electronic product, mobile terminal, update electronic product, the device id list of mobile terminal, update cloud platform electricity
Sub- product, the device id list of mobile terminal;
If no, the new device id of generation electronic product, mobile terminal, updates electronic product, the equipment of mobile terminal
ID list, electronic product, the device id list of mobile terminal, update cloud platform electronic product, the device id list of mobile terminal.
The present invention solves the system of many message channels control message conflict in Internet of Things, including:
From the message channel of some voltage input receiving control messages, the corresponding message queue of each described message channel, message
During inbound message queue, it is compared with message existing in queue, abandon the message repeating;
Formula generation module, for the parameter, weight and the formula that are provided based on system configuration module and platform management module
Configuration information, generates the priority formula based on user's scene;
Collision detection module, for detecting that certain voltage input constantly sends repetition message, then collision detection module can be by this
Voltage input is labeled as exception, not processing the control message that this voltage input sends, automatically terminate until abnormal marking time-out or
Released by hand by user, wherein, the attribute such as the voltage input of message, positional information, time, user profile brings message team into simultaneously
Row;
Collision detection module, for scanning each message queue respectively, the mark according to control object and attribute, labelling is deposited
In the control message of conflict, calculate the index of message using the priority formula based on user's scene, this index includes three parts:
One labelling, represents that collision message is mutual exclusion conflict or PRI conflict;One priority factor, represents the priority of message
Not;One Message Processing timeliness;
Clash handle module, for scanning each message queue, unifies for the message reaching Message Processing timeliness
Process;
Clash handle module, for the message transfers in each message queue are processed in queue to a unified message,
For the message being labeled as mutual exclusion conflict, only retain the message of highest priority, other message directly reply operation failure, failure
Reason is message collision;For the message being labeled as PRI conflict, according to priority order from high to low, add unified message
Process in queue;For being labeled as conflict free message, by the precedence of message arrival, unified message is added to process queue
In;
Message processing module, processes the message in queue for scanning in order and processing unified message.
Further, also include system configuration module, for setting each ginseng in the priority formula based on user's scene
The weight of number, increases or decreases the quantity of Parameters in Formula, completes the renewal of parameters weighting and parameter list;
It is included in independent function module based on the priority formula of user's scene, platform management module, for changing
Comprise to calculate the formula generation module of priority indicator formula, complete the renewal of formula.
Further, Internet of Things electronic product, enters the Active control of row data communication with electronic product by RF2.4 module
Device, mobile terminal and cloud platform, wherein
Described active controller, is connected, sets up wifi Local network communication for setting up the communication of RF2.4 Intranet with mobile terminal
Connect, set up bluetooth local area network communication connection or wide area network communication is set up even by wifi module access cloud platform and mobile terminal
Connect;
Mobile terminal sends control message by wifi module, bluetooth module to active controller, described active controller
This control message is exported to described electronic product by RF2.4 module;
Mobile terminal sends control message by RF2.4 module to electronic product;
Active controller sends control message by RF2.4 module to electronic product.
Further, described active controller includes:Communication module, protocol process module, mark generate and management module
And business logic modules and other functions module;
Wherein, communication module includes RF2.4 interface and queue, Wi-Fi interface and queue and blue tooth interface and queue;
Each interface is used for realizing reception and the transmission of data, and individual queue is buffered to data and subpackage;
Protocol process module is made up of three protocol analysis units and a conversion unit of protocol, and protocol analysis unit is responsible for
By the concrete agreement of corresponding communication modes, message is parsed;Conversion unit of protocol is responsible for connect from different agreement channel
The message transformation receiving is unified control message, submits to business logic modules and other functional modules and processes, and by industry
The control message of business logic module and the offer of other functional modules is converted into the agreement specified, and then gives communication module, by right
The passage answered sends;
Mark generates and management module, and for obtaining this electronic product, mobile terminal reads device id from local storage,
And run following steps:
If S6.1 device id reads successfully, this electronic product, mobile terminal and active controller carry out testing shaking hands, checking
Device id,
If S6.11 device id is proved to be successful, between electronic product, mobile terminal and active controller, set up wifi local
Netcom news connect, set up bluetooth local area network communication connect or mobile terminal pass through wifi module, SIM module access cloud platform with
Active controller is set up wide area network communication and is connected;
If S6.12 ID checking is unsuccessful, electronic product, mobile terminal send configuration device id to active controller please
Ask, active controller is this electronic product, mobile terminal configuration device id, and this electronic product, mobile terminal are by described device id
Carry out locally stored;Jump to step S6.1;
If the reading of S6.2 device id is unsuccessful, electronic product, mobile terminal send configuration device id to active controller
Request, active controller is this electronic product, mobile terminal configuration device id, and this electronic product, mobile terminal are by described equipment
ID carries out locally stored, jumps to step S6.1;
The self ID of active controller is combined together the corresponding electronics of composition with the device id of electronic product, mobile terminal and produces
Product, the overall identification of mobile terminal, described cloud platform is used for the registration and unregistration that the overall situation indicates;In active controller and cloud platform
During communication connection, active controller and cloud platform synchronized update storage locally stored active controller self ID and electronics
Product, the device id list of mobile terminal.
By such scheme, the present invention at least has advantages below:
The interaction detecting and resloving mechanism based on user's scene for the present invention, will voltage input, control object, the ground of voltage input
The combined factors such as reason position, user role, time, control message context form user's scenario parameters index, carry out repeating to control
Message screening processed, control message priority arrangement and collision detection and process.This technical scheme efficiently solves Internet of Things
The filtration of Repetitive controller message in environment, the inspection of conflict control message and process problem;And computing low cost, the scope of application
Extensively, can be applicable on most internet-of-things terminal equipment and device;Meet the many voltage inputs of Internet of Things, many message channels and answer
With diversified, the personalized practical situation of scene and development trend.In this technical foundation, application developer is capable of more
Abundant, the more preferable function and application of Consumer's Experience.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And can be practiced according to the content of description, below with presently preferred embodiments of the present invention and coordinate accompanying drawing describe in detail as after.
Brief description
Fig. 1 is the flow chart that the present invention solves the method for many message channels control message conflict in Internet of Things.
Specific embodiment
With reference to the accompanying drawings and examples, the specific embodiment of the present invention is described in further detail.Hereinafter implement
Example is used for the present invention is described, but is not limited to the scope of the present invention.
Embodiment 1
The method that the present embodiment solves many message channels control message conflict in Internet of Things, Internet of Things network information transmits:Internet of Things
In net environment, a voltage input may connect multiple message channels;And a message channel then simultaneously serves multiple controls
Source.Methods described includes:
The attribute of the control message being sent based on the voltage input in Internet of Things, the priority set up based on user's scene is public
Formula;
The control message entering control message queue is compared with control message existing in queue, abandons repetition
Control message;
If certain voltage input constantly sends Repetitive controller message, this voltage input is labeled as exception, does not reprocess
The control message that this voltage input sends, until abnormal marking time-out automatically terminates or is released by hand by user, the genus of control message
Property brings control message queue into;
Scan each control message queue, the mark according to control object and attribute respectively, labelling has the control of conflict
Message, calculates the index of control message using the priority formula based on user's scene, and this index includes three parts:One mark
Note, represents that conflict control message is mutual exclusion conflict or PRI conflict;One priority factor, represents the preferential of control message
Rank;One control message processes timeliness.
Scan each control message queue, the control message reaching control message process timeliness is uniformly processed.
Control message in each control message queue is transferred to one be uniformly controlled in Message Processing queue:For
It is labeled as the control message of mutual exclusion conflict, only retains the control message of highest priority, other control messages directly reply operation
Failure;For the control message being labeled as PRI conflict, according to priority order from high to low, add and be uniformly controlled at message
In reason queue;For being labeled as conflict free control message, by the precedence of control message arrival, add and be uniformly controlled message
Process in queue;
Scan in order and process the control message being uniformly controlled in Message Processing queue.
The present embodiment, also includes setting the weight of parameters in the priority formula based on user's scene, increasing adds deduct
The quantity of few Parameters in Formula, completes the renewal of parameters weighting and parameter list.Priority indicator formula is included in independent letter
In digital-to-analogue block, also include changing the function module comprising to calculate priority indicator formula, complete the renewal of formula.Described control
The attribute of message at least includes message channel, voltage input, positional information, time, user profile.
The present embodiment, can process many voltage inputs, the control message conflict under many message channels environment.Based on user's scene
Interaction detecting and resloving mechanism, will voltage input, control object, the geographical position of voltage input, user role, time, control
The combined factors such as message context formed user's scenario parameters index, carry out repetition message filtration, message priority arrangement and
Collision detection and process.Method has relatively low computational complexity, and single thread executes, can be in most Internet of Things network processors
Upper operation.
Embodiment 2
The present embodiment solves the system of many message channels control message conflict in Internet of Things, including:
From the message channel of some voltage input receiving control messages, the corresponding message queue of each described message channel, message
During inbound message queue, it is compared with message existing in queue, abandon the message repeating;
Formula generation module, for the parameter, weight and the formula that are provided based on system configuration module and platform management module
Configuration information, generates the priority formula based on user's scene.
Clash handle module, if constantly sending repetition message for certain voltage input, clash handle module temporarily can
This voltage input is labeled as exception, does not process the control message that this voltage input sends, until abnormal marking time-out solves automatically
Remove or released by hand by user;The attributes such as the voltage input of message, positional information, time, user profile bring message queue into simultaneously.
Collision detection module scans each message queue respectively, the mark according to control object and attribute, and labelling has punching
Prominent control message, and be based on according to attribute (passage, voltage input, positional information, the time, user profile etc.) use of message
The priority formula of user's scene calculates the index of message.This index includes three parts:One labelling, represents that collision message is mutual
Scold conflict or PRI conflict;One priority factor, represents the priority level of message;One Message Processing timeliness.
Clash handle module, within the specific time cycle, scans each message queue, for reaching Message Processing timeliness
Message be uniformly processed.
Message transfers in each message queue are processed in queue by clash handle module to a unified message:For mark
It is designated as the message of mutual exclusion conflict, only retains the message of highest priority, other message directly reply operation failure, and failure cause is
Message collision;For the message being labeled as PRI conflict, according to priority order from high to low, unified message is added to process team
In row;For being labeled as conflict free message, the precedence reaching by message, in addition unified message process queue.
Message processing module scans in order and processes unified message and processes the message in queue.
Also include system configuration module, for setting the weight of parameters in the priority formula based on user's scene,
Increase or decrease the quantity of Parameters in Formula, complete the renewal of parameters weighting and parameter list.Priority based on user's scene
Formula is included in independent function module, platform management module, comprises the function calculating priority indicator formula for modification
Module, completes the renewal of formula.
Parameter updates:User can be by parameters in the priority formula based on user's scene for the system configuration module setting
Weight, increase or decrease the quantity of Parameters in Formula, and parameters weighting and parameter list completed by system configuration message
Update.
Firmware upgrade:It is included in independent function module based on the priority formula of user's scene, developer is permissible
The function module only specified, and by platform management module to firmware upgrade, updated with the formula completing terminal unit and device.
In the various embodiments described above, the described priority formula based on user's scene, this formula does not limit particular form,
Vague generalization can be described as p=f (wTX)
Wherein, p is priority indicator (vectorial), p={ p1,p2,p3, p1For boolean's phenotypic marker, represent conflict control message
For mutual exclusion conflict or PRI conflict;p2For numeric type priority factor, represent the priority level of control message;p3For numerical value
Type control message processes timeliness, and unit is millisecond.
W is weight vectors, w={ w1,w2,…,wn}
X is parameter vector, X={ x1,x2,…,xn}
Specifically, X includes but is not limited to the content such as message channel, voltage input, positional information, time, user profile.
Specifically, the form of function f includes but is not limited to linear formula, quadratic function, higher-order function, and machine learning
Model (as random forest, neutral net) etc..
According to method of the present invention, user can be with the concrete form of self-defined priority formula, as long as output result p
Meet the requirements (including described three parts).
In the various embodiments described above, described mobile terminal includes mobile phone, PAD, personal computer and possesses wifi, bluetooth
The wearing terminal of communication function, possesses the Passive Shape Control device of RF2.4 communication function.
Embodiment 3
The method that the present embodiment solves many message channels control message conflict in Internet of Things, on the basis of embodiment 1, thing
Networked electronic product, enters the active controller of row data communication, described active controller is extremely with electronic product by RF2.4 module
Possess RF2.4 module, wifi module, bluetooth module, four kinds of data communication methods of SIM module less;The described means of communication include:
Set up the communication annexation between electronic product, mobile terminal and active controller, including:Set up in RF2.4
Netcom interrogates and connects, set up the connection of wifi Local network communication, set up bluetooth local area network communication connection or mobile terminal by wifi mould
Block, SIM module access cloud platform and set up wide area network and communicate with active controller and be connected;
Mobile terminal sends control instruction to active controller, and described active controller exports this control by RF2.4 module
System instruction is to described electronic product;
Mobile terminal sends instruction by RF2.4 module to electronic product;
Active controller sends instruction by RF2.4 module to electronic product.
In this enforcement, an Internet of Things terminal unit applies multiple communication modes simultaneously, can simultaneously using Wi-Fi,
Bluetooth and tri- kinds of communication modes of RF2.4, play the advantage of different communication modes, terminal unit, active controller, passive remote control
Device, smart mobile phone APP and cloud platform, have versatility.The channel parallel of Wi-Fi, bluetooth and tri- kinds of communication modes of RF2.4
And isolation, not only will not interact but also can backup each other, there is high reliability, and above-mentioned three kinds of communication modes can be played each
Advantage, improve user experience.
Embodiment 4
The method that the present embodiment solves many message channels control message conflict in Internet of Things, on the basis of embodiment 3, electricity
The method setting up communication relations between sub- product, mobile terminal and active controller specifically includes:
S2.1 obtains this electronic product, mobile terminal reads device id from local storage;
If S2.1.1 device id reads successfully, this electronic product, mobile terminal and active controller carry out testing shaking hands, and test
Card device id,
If S2.1.1.1 device id is proved to be successful, this electronic product, mobile terminal is allowed to access active controller, electronics
Set up between product, mobile terminal and active controller wifi Local network communication be connected, set up bluetooth local area network communication connect or
Mobile terminal is accessed cloud platform and is set up wide area network and communicate with active controller by wifi module, SIM module and is connected;
If S2.1.1.2 ID checking is unsuccessful, electronic product, mobile terminal send configuration device id to active controller
Request, active controller is this electronic product, mobile terminal configuration device id, and this electronic product, mobile terminal are by described equipment
ID carries out locally stored, jumps to step S2.1.1;
If the reading of S2.1.2 device id is unsuccessful, electronic product, mobile terminal send configuration equipment to active controller
ID asks, and active controller is this electronic product, mobile terminal configuration device id, and this electronic product, mobile terminal set described
Carry out for ID locally stored, jump to step S2.1.1.
In the present embodiment, Active Terminal configuration electronic product, the device id of mobile terminal specifically include:
The self ID of active controller is combined together the corresponding electronics of composition with the device id of electronic product, mobile terminal and produces
Product, the overall identification of mobile terminal, the overall situation indicates can registration and unregistration in cloud platform;Communicate with cloud platform in active controller
During connection, the locally stored active controller self ID of active controller and the storage of cloud platform synchronized update and electronics produce
Product, the device id list of mobile terminal;
Read active controller self ID and the locally stored electronic product of active controller, the device id of mobile terminal
List;
Receive electronic product, device id request instruction that mobile terminal sends, comprise electricity in described device id instruction
Sub- product, an equipment character string of mobile terminal;
Electronic product, the device id list of mobile terminal search whether to should equipment character string device id,
If having, verify that whether effectively this device id, if effectively, exports the result;If this device id is invalid, give birth to
Become the new device id of electronic product, mobile terminal, update electronic product, the device id list of mobile terminal, update cloud platform electricity
Sub- product, the device id list of mobile terminal;
If no, the new device id of generation electronic product, mobile terminal, updates electronic product, the equipment of mobile terminal
ID list, electronic product, the device id list of mobile terminal, update cloud platform electronic product, the device id list of mobile terminal.
The present embodiment allows multiple electronic products, multiple passive remote controller and multiple smart mobile phone APP to be concurrently accessed one
Individual active controller, mark generates and management module is responsible for generating and manage the mark of these equipment being connected on active controller
Know.When a new equipment access controller, mark generates and management module distributes a unique mark (ID) for it;When one
When individual existing device reconnects to controller, mark generates and whether effectively management module then checks its mark (ID), if
Invalid, redistribute for it.Communication message between active controller and subordinate's equipment is required for comprising device identification (ID).
The mark of controller itself is combined together the overall identification constituting corresponding device, overall situation mark with the device identification of controller subordinate
Know and registration and unregistration is carried out in cloud platform by controller, therefore, cloud platform user can quote any one by overall identification
Individual controller and its subordinate's equipment.
Need to comprise the identification string of an electronic product, mobile terminal in the request message obtaining device id, this identification string
It is used as reference when generating device identification (ID), and by controller record in device id list.When a terminal request is new
Device id, if having found the identification string of this equipment in controller equiment ID list, using this identification go here and there corresponding equipment
ID, without the new device id of generation.Therefore, after terminal unit reinitializes, device identification (ID) can be kept constant.
Can include as the information of equipment identification string:The physical address (MAC) of equipment, serial number, microprocessor numbering.
Embodiment 5
The present embodiment solves the system of many message channels control message conflict in Internet of Things, on the basis of embodiment 2, thing
Networked electronic product, enters the active controller of row data communication with electronic product by RF2.4 module, and mobile terminal and cloud are put down
Platform, wherein
Described active controller, is connected, sets up wifi Local network communication for setting up the communication of RF2.4 Intranet with mobile terminal
Connect, set up bluetooth local area network communication connection or wide area network communication is set up even by wifi module access cloud platform and mobile terminal
Connect;
Mobile terminal sends control instruction by wifi module, bluetooth module to active controller, described active controller
This control instruction is exported to described electronic product by RF2.4 module;
Mobile terminal sends instruction by RF2.4 module to electronic product;
Active controller sends instruction by RF2.4 module to electronic product.
Described active controller includes:Communication module, protocol process module, mark generation and management module and business are patrolled
Collect module and other functions module;
Wherein, communication module includes RF2.4 interface and queue, Wi-Fi interface and queue and blue tooth interface and queue;
Each interface is used for realizing reception and the transmission of data, and individual queue is buffered to data and subpackage;
Protocol process module is made up of three protocol analysis units and a conversion unit of protocol, and protocol analysis unit is responsible for
By the concrete agreement of corresponding communication modes, message is parsed;Conversion unit of protocol is responsible for connect from different agreement channel
The message transformation receiving is unified instruction, submits to business logic modules and other functional modules are processed, and business is patrolled
Collect the instruction morphing agreement for specifying that module and other functional modules provide, then give communication module, by corresponding passage
Send;
Mark generates and management module, and for obtaining this electronic product, mobile terminal reads device id from local storage,
And run following steps:
If S6.1 device id reads successfully, this electronic product, mobile terminal and active controller carry out testing shaking hands, checking
Device id,
If S6.11 device id is proved to be successful, between electronic product, mobile terminal and active controller, set up wifi local
Netcom news connect, set up bluetooth local area network communication connect or mobile terminal pass through wifi module, SIM module access cloud platform with
Active controller is set up wide area network communication and is connected;
If S6.12 ID checking is unsuccessful, electronic product, mobile terminal send configuration device id to active controller please
Ask, active controller is this electronic product, mobile terminal configuration device id, and this electronic product, mobile terminal are by described device id
Carry out locally stored;Jump to step S6.1;
If the reading of S6.2 device id is unsuccessful, electronic product, mobile terminal send configuration device id to active controller
Request, active controller is this electronic product, mobile terminal configuration device id, and this electronic product, mobile terminal are by described equipment
ID carries out locally stored, jumps to step S6.1.
In the present embodiment, the self ID of active controller and electronic product, the device id of mobile terminal are combined together structure
Become corresponding electronic product, the overall identification of mobile terminal, described cloud platform is used for the registration and unregistration that the overall situation indicates;In active control
When device processed is communicated to connect with cloud platform, the locally stored active controller of active controller and the storage of cloud platform synchronized update is certainly
Body ID and the device id list of electronic product, mobile terminal.
In the various embodiments described above, described mobile terminal includes mobile phone, PAD, personal computer and possesses wifi, bluetooth
The wearing terminal of communication function, possesses the Passive Shape Control device of RF2.4 communication function.
The system that the present embodiment is related to is by internet-of-things terminal equipment, active controller, passive remote controller, smart mobile phone APP
And five parts of cloud platform form.One active controller can support multiple terminal devices, multiple Passive Shape Control device and
Multi-section smart mobile phone.
Wherein, active controller possesses Wi-Fi, bluetooth and tri- kinds of communication module group of RF2.4;Internet-of-things terminal equipment possesses
RF2.4 communication module group;Passive remote controller possesses RF2.4 communication module group;Smart mobile phone is generally configured with Wi-Fi and two kinds of communications of bluetooth
Module.
Wi-Fi, bluetooth and tri- kinds of communication modes of RF2.4 come into force simultaneously, form three networks:The internal private network of RF2.4, Wi-
Fi LAN and bluetooth local area network.Wherein, the internal private network of RF2.4 connects internet-of-things terminal equipment, passive remote controller and active
Controller.Wi-Fi LAN connects active controller and smart mobile phone.Bluetooth local area network connects active controller and intelligent handss
Machine.For smart mobile phone, Wi-Fi LAN and bluetooth local area network backup each other, and multi-section smart mobile phone can select any
A kind of communication modes.
Additionally, active controller passes through Wi-Fi module connecting wan, and access cloud platform.Therefore, access cloud platform
Smart mobile phone can remotely manipulate to active controller and internet-of-things terminal equipment.
Active controller, as this method and system core part, is configured with microprocessor, and RF2.4, Wi-Fi and indigo plant
Three kinds of communication module group of tooth, are to be bi-directionally connected between microprocessor and communication module group.The internal logic structure of active controller, bag
Include:Communication module, protocol process module, mark generate and management module, business logic modules and other functions module.
Wherein, communication module includes RF2.4 interface and queue;Wi-Fi interface and queue;And blue tooth interface and queue.
Each interface is responsible for interacting with physical communication module, realizes reception and the transmission of data;Individual queue is buffered to data and subpackage.
Protocol process module is made up of three protocol analysis units and a conversion unit of protocol.
Protocol analysis unit is responsible for the concrete agreement by corresponding communication modes, and message is parsed;Conversion unit of protocol
Be responsible for by from different agreement channel reception to message transformation be unified instruction, submit to business logic modules and other work(
Can resume module;And the instruction morphing agreement for specifying that business logic modules and other functional modules are provided, Ran Houjiao
Send to communication module, by corresponding passage.
Concrete application of the present invention:For example a Intelligent lamp product, can be by mobile phone, Web client, remote control and wall
The switch of face on-off control light fixture, regulation brightness and color, or read sensor parameters;Message channel include Wi-Fi (local or
Remotely), bluetooth, Zig-Bee and RF2.4G.
For example:User uses mobile phone locally the switch of light fixture, regulation can controlled bright by bluetooth or LAN Wi-Fi
Degree and color;User remotely can do same control by the Internet using mobile phone.Assume that several users use mobile phone simultaneously
Same or one group of light fixture are switched, the priority formula if based on user's scene sets local control compared with remotely control
There is higher priority, and bluetooth has higher priority compared with Wi-Fi, is defined as mutual exclusion conflict to the switch of light fixture, then very
In close timeslice, even if remote switch message first reaches Intelligent lamp than local bluetooth switch message, this method can be preferential
Execution local bluetooth switch message, and mistake is returned to remote switch message.
For example:There was a mechanical failure or button is pushed down by other article for remote control, constantly sends control message, and this method is examined
Can be temporarily abnormal by remote control after measuring a large amount of repetition messages in the short time, user can receive abnormal notice, and repetition message stops
Abnormal marking releases afterwards.
For example:The priority formula local wall surface switch of setting if based on user's scene has limit priority (weight
Very high), then when user uses local wall surface switch to control, the control message that other voltage inputs send all can be by as conflict
It is ostracised or delay process.
For example:More another user of priority formula user (as the head of a family) (as child) if based on user's scene has
Higher priority, if then two users are while attempt to control this Intelligent lamp, the control message of the priority treatment head of a family.
Above Intelligent lamp is only for example, and this method is applied to various internet-of-things terminals, such as:Intelligent switch, intelligent air condition,
Intelligent video camera head, intelligent door lock etc..
Concrete application of the present invention:Intelligent lamp product, light fixture part possesses RF2.4 communication module group;Active controller is integrated
In wall switch panel, possess RF2.4, bluetooth and Wi-Fi communication module group;Passive remote controller is powered using battery, possesses
RF2.4 communication module group.
For example:At home, old man and child can control the switch of light fixture, regulation using remote control and wall switch panel
Lamplight brightness;Smart phone user can pass through bluetooth connection controller, can also connect control by home Wi-Fi network
Device, controls switch, brightness and the color of light fixture.Smart phone user can also remotely access cloud platform, by cloud platform even
Connect controller, realize the control to light fixture.Above-mentioned several control mode does not fight for Internet resources, is independent of each other.
For example:When breaking down in the broadband of family, Intelligent lamp cannot connect cloud platform, therefore smart phone user also no
Method is from remotely control light fixture.But at home, smart mobile phone passes through bluetooth, LAN;And remote control, wall surface switch can be just
Often use.
For example:When the Wi-Fi network of family also breaks down, thoroughly there is no network.Now, smart mobile phone passes through bluetooth,
And remote control, wall surface switch remain to normally control light fixture.
Above Intelligent lamp is only for example, and this method is applied to various internet-of-things terminals, such as:Intelligent switch, intelligent air condition,
Intelligent video camera head, intelligent door lock etc..
The present invention, active controller is the core component of this patent, collectively forms a system with miscellaneous part.One is
An active controller is included (as one family) in system, and multiple electronic product, Passive Shape Control device and mobile terminal.Cause
This, active controller and electronic product are the relations of one-to-many.The advantage of this design is:
Cost advantage:RF module is lower with respect to other module costs such as WiFi, bluetooth.If having multiple in a system
Electronic product, then using RF module just more aobvious cost advantage;
Functionality advantage:Can be simultaneously using WiFi, bluetooth or RF, by active control according to the multiple mobile terminal of the design
Device indirect control electronic equipment processed;The multiple communication modes of mobile terminal not only can play a role simultaneously, according to the ring of user
Border (as locally or remotely) automatically selects optimal communication modes, and can backup each other.But if mobile terminal is direct
If electronic equipment communication, because electronic equipment generally only possesses a kind of communication module, only equipment is with egf block
Mobile terminal just have feasible communicate therewith, once and environment change, communication be easy to lost efficacy.Such as:User is away from home,
Bluetooth just fails;Family suspension, Wi-Fi just fails.High availability cannot be accomplished.
Odds for effectiveness:Internet of Things electronic product, because being limited by all many condition such as cost, volume, power supply, generally configures
The assemblies such as processor, storage are economy, disposal ability and memory space all limited it is impossible to realize more complicated algorithm and
Application function.If mobile terminal is directly communicated it is desirable to electronic product possesses stronger protocal analysis, place with electronic product
Reason ability, and realize function and the algorithm of multiple application layers, this is obviously and its hardware configuration is contradiction.And active controller is then
There is not this problem, in addition to larger, active controller can also be put down with cloud except its own processing capabilities and memory space all ratios
Platform communicates, by the powerful calculating of cloud platform and storage so that include big data, intelligent including senior application become can
Energy.
Security advantages:Under active controller mode, electronic product be not directly exposed to user (electronic product itself anti-
Shield ability is just poor), decrease invasion point.
Consumer's Experience advantage:According to the design, user only needs to configure an active controller, and miscellaneous part can be fast
Fast access system.And if mobile terminal and electronic product Direct Communication, then need each mobile terminal of user configuring and electricity
Sub- product.Additionally, no in the case of controller, the centralized Control of electronic product difficult to realize, if there are multiple electronic products, use
Family experience can be excessively poor.
The present invention, the overall situation indicates the extension that (Global ID) is that equipment indicates (ID),
The overall situation indicates (Global ID)=active controller sign+equipment and indicates (ID)
Equipment indicates internal system (the south orientation system that (ID) is used in the composition such as active controller and electronic product, mobile terminal
System).And the overall situation indicates (Global ID) and is used for active controller and cloud platform communication (north orientation system).
The above is only the preferred embodiment of the present invention, is not limited to the present invention it is noted that for this skill
For the those of ordinary skill in art field, on the premise of without departing from the technology of the present invention principle, can also make some improve and
Modification, these improve and modification also should be regarded as protection scope of the present invention.