AllJoyn internet message sends and disposal route and device
Technical field
The present invention relates to AllJoyn network field, particularly relate to a kind of AllJoyn internet message and send and disposal route and device.
Background technology
AllJoyn is an open source software project, and it is that different electronic equipments provides a kind of general communications framework; AllJoyn is the communications framework of a kind of P2P (PeertoPeer, peer to peer connection), and communicating pair is service provider respectively and serves user.In the communication mechanism of AllJoyn, service provider kimonos is make sure with side by realizing identical interface specification to communicate.AllJoyn interface comprises method, attribute and signal three members, and wherein, method and function call, accept one or more input parameter, carries out respective handling, and return one or more output parameter; Attribute be comprise read-only, only write and the readable variable writing three kinds of modes; Signal is asynchronous announcement information, and receiving side signal carries out corresponding operating by signal transacting mechanism.
In addition, AllJoyn provides event-motion mechanism, event is the interface signal comprising human-readable word, action is the interface method comprising human-readable word, user can by the trigger relation between UI Preferences event and action, and regulation engine can preserve the trigger relation between the event of user's setting and action, regulation engine needs to operate on the equipment being connected to AP (AccessPoint, access point) long-term and stably as an application program.
In Smart Home, often have the application demand that scene links, in AllJoyn, signal transacting mechanism and event-motion mechanism can provide technical feasibility for scene interlock.
But inventor finds when realizing of the present invention, prior art has following defect:
Event in AllJoyn is exactly signal on message format, but with the addition human-readable word, cannot distinguish from type of message to event and signal, thus also can trigger pip treatment mechanism, can cause the conflict of AllJoyn Network.Be described as follows:
In AllJoyn use scenes, the service that equipment vendor or developer can provide according to one's own side and monitor a certain signal, once signal occurs, just performs corresponding operating.But, user may owing to providing the ignorant of service to equipment vendor or developer, arrange the trigger relation between same event and action by the event-motion mechanism of AllJoyn, this will cause repeating of AllJoyn business, causes unpredictable effect.
For scene interlock, the situation of the service conflict that may occur in current AllJoyn network as shown in Figure 1.
When Intelligent door is opened or close time, can send the event of Men Kai and door pass, when Intelligent door sends event time, the signal processor in intelligent lighting can listen to event, and triggers operation of turning on light or turn off the light;
User is matched by the action of event and intelligent lighting execution that event-motion mechanism in AllJoyn is provided with Intelligent door transmission in regulation engine;
When the event that Intelligent door transmission door is opened, the signal processor in intelligent lighting listens to the event that door is opened, and just triggers the operation of turning on light, and meanwhile, owing to being provided with the pair relationhip between Intelligent door and intelligent lighting in regulation engine, also can trigger the operation of turning on light.This repeating of operation that will cause turning on light, causes AllJoyn Network conflict, as shown in Figure 1.Solid line wherein with arrow represents signal transacting mechanism, the dotted line presentation of events-motion mechanism of band arrow.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of AllJoyn internet message and sends and disposal route and device, in order to solve the problem that prior art AllJoyn Network conflicts.
For solving the problems of the technologies described above, the invention provides a kind of AllJoyn internet message sending method, said method comprising the steps of:
Transmitting terminal generating messages, described message comprises type of message, and described type of message comprises signal and sends and event transmission;
The message of generation is sent to receiving end by described transmitting terminal.
The present invention also provides a kind of AllJoyn network message processing method, said method comprising the steps of:
Receiving end receipt message;
Obtain the type of message in the message received;
When the type of described message is signal transmission, by signal transacting mechanism, described message is processed; When the type of described message is event transmission, by event-motion mechanism, described message is processed.
Further, describedly process is carried out to described message be specially by signal transacting mechanism: by described Message Transmission to signal processor, described signal processor processes described message.
Further, describedly by event-motion mechanism, process is carried out to described message and be specially: by described Message Transmission to regulation engine, described regulation engine processes described message.
Further, described type of message comprises signal transmission and event transmission.
The present invention also provides a kind of AllJoyn network transmitting terminal, comprising:
Message generation unit, for generating messages, described message comprises type of message, and described type of message comprises signal and sends and event transmission;
Message sending unit, for being sent to receiving end by the message of generation.
The present invention also provides a kind of AllJoyn network receiving terminal, comprising:
Message reception units, for the message that receiving end/sending end sends;
Type of message acquiring unit, for obtaining the type of message in the message that receives;
Signal transacting mechanism, during for being signal transmission when the type of described message, processes described message;
Event-motion mechanism, during for being event transmission when the type of described message, processes described message.
Further, described signal processor is made as signal processor.
Further, described event-motion mechanism is regulation engine.
Further, described type of message comprises signal transmission and event transmission.
Beneficial effect of the present invention is as follows:
The present invention by increasing the method for event transmission types in the type of message of AllJoyn internet message, distinguish signal and event, signal only understands trigger pip treatment mechanism, event only understands trigger event-motion mechanism, thus avoid same event simultaneously trigger pip treatment mechanism and event-motion mechanism and the AllJoyn business that causes repeats problem, avoid AllJoyn Network collision problem, improve the robustness of AllJoyn, improve Consumer's Experience.
The present invention is distinguished signal and event by the type of message definition of amendment AllJoyn message format, only needs just to manage conflict from root for signal and event define type of message respectively, realizes simple.
Accompanying drawing explanation
Fig. 1 is the schematic diagram realizing scene interlock in a kind of AllJoyn network of prior art;
Fig. 2 is the process flow diagram of a kind of AllJoyn Network disposal route of the embodiment of the present invention;
Fig. 3 is the structural drawing of a kind of AllJoyn Network disposal system of the embodiment of the present invention;
Fig. 4 a and Fig. 4 b is the schematic diagram realizing scene interlock in a kind of AllJoyn network of the embodiment of the present invention.
Embodiment
In order to solve the problem of prior art AllJoyn Network conflict, the invention provides a kind of AllJoyn internet message and sending and disposal route and device, below in conjunction with accompanying drawing and embodiment, the present invention being further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, do not limit the present invention.
Embodiment 1
A kind of AllJoyn internet message sending method of the embodiment of the present invention comprises the following steps: transmitting terminal generating messages, and described message comprises type of message, and described type of message comprises signal and sends and event transmission; The message of generation is sent to receiving end by described transmitting terminal.
Embodiment 2
A kind of AllJoyn network message processing method of the embodiment of the present invention comprises the following steps: receiving end receipt message; Obtain the type of message in the message received, described type of message comprises signal and sends and event transmission; When the type of described message is signal transmission, by signal transacting mechanism, described message is processed; When the type of described message is event transmission, by event-motion mechanism, described message is processed.In the present embodiment, describedly process is carried out to described message be specially by signal transacting mechanism: by described Message Transmission to signal processor, described signal processor processes described message; Describedly by event-motion mechanism, process is carried out to described message and be specially: by described Message Transmission to regulation engine, described regulation engine processes described message.
Embodiment 3
A kind of AllJoyn Network disposal route of the embodiment of the present invention as shown in Figure 2, said method comprising the steps of:
Step s201, transmitting terminal generating messages, described message comprises type of message, and described type of message comprises signal and sends and event transmission;
Step s202, the message of generation is sent to receiving end by described transmitting terminal;
Step s203, described receiving end receipt message;
Step s204, obtains the type of message in the message received;
Step s205, when the type of described message is signal transmission, is processed described message by signal transacting mechanism; When the type of described message is event transmission, by event-motion mechanism, described message is processed.
Embodiment 4
A kind of AllJoyn network transmitting terminal of the embodiment of the present invention, comprising: message generation unit, for generating messages, described message comprises type of message, and described type of message comprises signal and sends and event transmission; Message sending unit, for being sent to receiving end by the message of generation.
Embodiment 5
A kind of AllJoyn network receiving terminal of the embodiment of the present invention, comprising: message reception units, for the message that receiving end/sending end sends; Type of message acquiring unit, for obtaining the type of message in the message that receives, described type of message comprises signal and sends and event transmission; Signal transacting mechanism, during for being signal transmission when the type of described message, process described message, in the present embodiment, described signal processor is made as signal processor; Event-motion mechanism, during for being event transmission when the type of described message, process described message, in the present embodiment, described event-motion mechanism is regulation engine.
Embodiment 6
As shown in Figure 3, described system comprises transmitting terminal 31 and receiving end 32 to a kind of AllJoyn Network disposal system of the embodiment of the present invention, and wherein said transmitting terminal 31 is connected with receiving end 32.
Transmitting terminal 31 comprises message generation unit 311 and message sending unit 312, and wherein said message generation unit 311 is connected with message sending unit 312.Described message generation unit 311 is for generating messages, and described message comprises type of message, and described type of message comprises signal and sends and event transmission; Described message sending unit 312 is for being sent to described receiving end 32 by the message of generation.
Described receiving end 32 comprises message reception units 321, type of message acquiring unit 322, signal processor 323 Sum fanction engine 3 24, and wherein type of message acquiring unit 322 is connected with message reception units 321, signal processor 323 Sum fanction engine 3 24 respectively.The message that described message reception units 321 sends for receiving end/sending end; Described type of message acquiring unit 322 is for obtaining the type of message in the message that receives; When described signal processor 323 is for being signal transmission when the type of described message, described message is processed; When described regulation engine 324 is for being event transmission when the type of described message, described message is processed.
Embodiment 7
Realize the situation of scene interlock in a kind of AllJoyn network of the embodiment of the present invention as shown in figures 4 a and 4b, wherein Fig. 4 a is the schematic diagram of signal transacting mechanism, and Fig. 4 b is the schematic diagram of event-motion mechanism.Its process is:
Time Intelligent door is opened or closed, event or the signal of Men Kai and door pass can be sent; When Intelligent door sends signal time, the signal processor in intelligent lighting can listen to signal, and triggers operation of turning on light or turn off the light; User is provided with same Trigger Logic in regulation engine, when Intelligent door sends event time, is triggered the operation of turning on light or turning off the light by event-motion mechanism.Because the present invention have modified the type definition about event and signal in AllJoyn message format, so the signal processor in light only can process the signal that Intelligent door sends, and regulation engine only can process the event that Intelligent door sends.
In the present embodiment, message format in AllJoyn has continued to use the message format in D-Bus agreement, AllJoyn message comprises message header and message body, define type of message in message header, the type of message in AllJoyn comprises five types: INVALID, METHOD_CALL, METHOD_RETURN, ERROR and SIGNAL.Event and signal are all SIGNAL on type of message.The present invention adds separately a kind of new type of message for event on the basis of original type of message---EVENT, from type of message, event and signal are distinguished, as shown in table 1, thus realize the signal transacting mechanism only meeting processing signals of AllJoyn, and the event-motion mechanism of AllJoyn only can process event, avoid the service conflict of AllJoyn network.
Table 1
Title |
Value |
Describe |
INVALID |
0 |
Inefficient type |
METHOD_CALL |
1 |
Method call |
METHOD_RETURN |
2 |
Method returns |
ERROR |
3 |
Mistake returns |
SIGNAL |
4 |
Signal sends |
EVENT |
5 |
Event sends |
The present invention by increasing the method for event transmission types in the type of message of AllJoyn internet message, distinguish signal and event, signal only understands trigger pip treatment mechanism, event only understands trigger event-motion mechanism, thus avoid same event simultaneously trigger pip treatment mechanism and event-motion mechanism and the AllJoyn business that causes repeats problem, avoid AllJoyn Network collision problem, improve the robustness of AllJoyn, improve Consumer's Experience.
The present invention is distinguished signal and event by the type of message definition of amendment AllJoyn message format, only needs just to manage conflict from root for signal and event define type of message respectively, realizes simple.
Although be example object, disclose the preferred embodiments of the present invention, it is also possible for those skilled in the art will recognize various improvement, increase and replacement, and therefore, scope of the present invention should be not limited to above-described embodiment.