Summary of the invention
In view of this, can reduce net it is an object of the invention to propose the communication means and gateway of a kind of micro-grid system
The cost of pass, and improve the utilization rate of communication channel.
Communication means based on above-mentioned purpose micro-grid system provided by the invention, comprising:
Gateway is communicated chip and switches between the first communication pattern and the second communication pattern;
The gateway establishes the communication connection with generated energy acquisition equipment when being switched to first communication pattern;
The gateway establishes the communication connection with mobile terminal when being switched to second communication pattern.
Further, the gateway is communicated chip and switches between the first communication pattern and the second communication pattern
Before, further includes:
First communication pattern is arranged according to the data volume that the generated energy acquires equipment timing acquiring in the gateway
First communication time, and the communication cycle according to needed for the mobile terminal be arranged second communication pattern second communication when
It is long.
Further, the gateway is communicated chip and is cut between the first communication pattern and the second communication pattern
It changes, specifically includes:
The gateway is communicated chip and is replaced between first communication pattern and second communication pattern
Switching, and while making the switching of first communication pattern a length of first communication time, make cutting for second communication pattern
A length of second communication time when changing.
Further, the method also includes:
In the second communication mode, if the movement is eventually at the end of the gateway detects second communication time
Communication pattern after then pending datas being waited to be transmitted, is switched to the first communication pattern still in transmission data by end.
Further, the method also includes:
In the first communication mode, if the gateway detects the generated energy at the end of first communication time
Equipment is acquired still in transmission data, then abandons the data of transmission, and communication pattern is switched to the second communication pattern.
Further, after the data for abandoning transmission, further includes:
When the gateway is switched to the first communication pattern again, the data of discarding are retransmitted.
Preferably, the communication chip of the gateway is the chip of model EFR32MG1.
Preferably, first communication pattern is Zigbee communication mode, and second communication pattern is Bluetooth communication mould
Formula.
The present invention also provides a kind of gateways, including communication chip and antenna;
The communication chip between the first communication pattern and the second communication pattern for switching over;
The antenna is used for when the communication chip is switched to first communication pattern, is established and is set with generated energy acquisition
Standby communication connection;When the communication chip is switched to second communication pattern, the communication connection with mobile terminal is established.
Preferably, first communication pattern is Zigbee communication mode, and second communication pattern is Bluetooth communication mould
Formula;
The communication chip is the chip of model EFR32MG1.
From the above it can be seen that the communication means and gateway of micro-grid system provided by the invention, can make gateway will
Its communication chip switches under two kinds of communication patterns, and when being switched to the first communication pattern, establishes and acquires equipment with generated energy
Communication connection established with the communication connection of mobile terminal, no setting is required two communication cores when being switched to the second communication pattern
Piece or two communication modules, reduce the cost of gateway, and the conversion of communication pattern is carried out under a communication chip, improve conversion
Efficiency;Two kinds of communication pattern timesharing switchings, improve the utilization rate of communication channel;Use Zigbee and bluetooth as two kinds of gateway
Communication pattern reduces the communications cost of gateway.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with specific embodiment, and reference
Attached drawing, the present invention is described in more detail.
It is the flow diagram of the communication means of micro-grid system provided in an embodiment of the present invention, the method packet referring to Fig. 1
It includes:
101, gateway is communicated chip and switches between the first communication pattern and the second communication pattern.
In the present embodiment, a communication chip is equipped in gateway, which supports the communication of the first communication pattern
The communication protocol of agreement and the second communication pattern, so that gateway can switch between two communication patterns.Wherein, first is logical
Letter mode is the communication pattern between gateway and generated energy acquisition equipment, and generated energy acquisition equipment includes the electric current inspection of film assembly
Device and inverter are surveyed, the current detector of film assembly is for detecting current data and being sent to gateway, and inverter is for acquiring
Output voltage data and output current data are simultaneously sent to gateway.Communication of second communication pattern between gateway and mobile terminal
Mode, mobile terminal are used to send data inquiry request to gateway, to inquire the history of real-time generated energy situation and gateway storage
Data, and receive the fault alarm information of gateway.
Preferably, the communication chip of the gateway is sillion labs EFR32MG1 family chip, which can be simultaneously
Support the Zigbee protocol and Bluetooth protocol of 2.4G frequency range, therefore the first communication pattern is preferably Zigbee communication mode, second
Communication pattern is preferably Ble (bluetooth) communication pattern.
It should be noted that due to the super low-power consumption of two kinds of wireless technologys of two kinds of Zigbee and Ble and the advantage of low cost,
So that photovoltaic communication equipment is few using component electricity, component wiring cost is saved, so that photovoltaic apparatus deployment way is more flexible.
Further, before step 101, further includes:
First communication pattern is arranged according to the data volume that the generated energy acquires equipment timing acquiring in the gateway
First communication time, and the communication cycle according to needed for the mobile terminal be arranged second communication pattern second communication when
It is long.
It should be noted that in order to while receiving the data that generated energy acquisition equipment is sent, it can be to movement
Terminal provides the service such as data query, also needs that the first communication pattern and the second communication pattern are arranged according to interactive data characteristics
Switching duration.
The interactive features of gateway and generated energy acquisition equipment are that data volume is small, but the period is long, therefore according to the generated energy
The first communication time of first communication pattern is arranged in the data volume of acquisition equipment timing acquiring.
Preferably, the first communication pattern is Zigbee communication mode.Zigbee sends 100 words under 802.15.4 agreement
Section, at its best, about time-consuming 3.7ms, worst situation is 52.8ms.And lower of first communication pattern of the present embodiment
Acquire electric current, information of voltage, single frames payload less than 20 bytes, therefore with 20 byte of load calculate generated energy acquisition equipment with
The time-consuming of data is sent between gateway between 0.74ms to 10.56ms, therefore designs the first communication time of Zigbee communication
For T1=Tz+Tzs=15ms.Wherein, Tz is to send worst case duration, and Tzs is redundancy duration.
It is random to the time to send instructions under gateway that the interactive features of gateway and mobile terminal are mobile terminals, and gateway uploads to
The data volume of mobile terminal is big, and transmission time is long, therefore the setting of the communication cycle according to needed for mobile terminal second communication
Second communication time of mode.
Preferably, the second communication pattern is Ble communication pattern.Calculating single packet maximum delay range in communication cycle is
230 microseconds to 2350 microseconds, and regulation communication cycle connInterval must be the multiple of 1.25ms, therefore it is logical to set bluetooth
Letter time slot is T2=Tb+Tbs=15ms.Wherein, Tb is communication cycle value, and Tbs is redundancy duration.
After the first communication time and the second communication time is arranged, gateway is communicated chip in first communication pattern
Alternately switching is carried out between second communication pattern.Specifically, if gateway does not receive generated energy acquisition equipment and movement
The data of terminal transmission, then gateway replaces according to the first communication time and the second communication time switches the first communication pattern and
Two communication patterns, i.e., when switching of described first communication pattern a length of first communication time, second communication pattern
A length of second communication time when switching.As shown in Fig. 2, gateway is first switched to Zigbee Rx, and communication time is T1, then
It is switched to Ble Rx, and communication time is T2, a length of t0 when so alternately switching, and switching.
102, the gateway establishes the communication link with generated energy acquisition equipment when being switched to first communication pattern
It connects.
In the present embodiment, when being switched to the first communication pattern, gateway is only acquired with generated energy the communication chip of gateway
Equipment establishes communication connection, realizes and transmits with the data of generated energy acquisition equipment.
103, the gateway establishes the communication connection with mobile terminal when being switched to second communication pattern.
In the present embodiment, the communication chip of gateway when being switched to the second communication pattern, only build with mobile terminal by gateway
Vertical communication connection, realizes and transmits with the data of mobile terminal.
It should be noted that being arranged in the communication chip of gateway when being communicated using Zigbee and Ble
BleAppTask and ZigbeeAppTask transmits information by inter-process communication mechanisms between task.BleAppTask passes through indigo plant
Tooth stack sends data to Radio radio-frequency module, and ZigbeeAppTask is by calling communication interface Rail stack to Radio radio frequency mould
Block sends data.Radio trigger event is handled by data of the judgement to bluetooth stack or Rail stack.
In view of the degree of concern of mobile terminal accessing data is higher, first meets the needs of mobile terminal is to data, therefore set
The priority for determining bluetooth stack is higher than the priority of Zigbee stack.
Further, the method also includes:
In the second communication mode, if the movement is eventually at the end of the gateway detects second communication time
Communication pattern after then pending datas being waited to be transmitted, is switched to the first communication pattern still in transmission data by end.
It should be noted that gateway cannot interrupt its transmission, i.e., when gateway continuously receives the data of mobile terminal transmission
Terminate the second communication time, gateway still will continue to the data of processing mobile terminal, until the data processing of mobile terminal is complete
At communication pattern is switched to the first communication pattern by gateway.
As shown in figure 3, Ble Rx continues to transmit T1 duration after T2 duration when being switched to Ble communication pattern.?
In Ble Rx transmission process, the transmission of Zigbee Tx2 is abandoned by gateway, and after Ble Rx is transmitted, gateway will communicate mould
Formula is switched to Zigbee communication mode, and Zigbee Tx2 is just retransmitted.
Further, the method also includes:
In the first communication mode, if the gateway detects the generated energy at the end of first communication time
Equipment is acquired still in transmission data, then abandons the data of transmission, and communication pattern is switched to the second communication pattern.
After the data for abandoning transmission, further includes:
When the gateway is switched to the first communication pattern again, the data of discarding are retransmitted.
It should be noted that when the data under the first communication pattern continuously transmit, if the first communication time of discovery is not enough,
Then gateway can abandon the data of transmission, communication pattern is switched to the second communication pattern, and be switched to again in communication pattern
The data of discarding are retransmitted when one communication pattern.
As shown in figure 4, Zigbee tx1 data do not interfere with the transmission of Ble Rx just in T1 duration.And
When Zigbee tx2 data are located at Zigbee T1 duration and close to an end, the transmission duration of Zigbee tx2 is inadequate, therefore abandons
Zigbee tx2, and be Ble communication by communication Protocol Conversion, Ble Rx is received.After Ble Rx is finished receiving, it will communicate
Protocol conversion is Zigbee communication, is retransmitted to Zigbee tx2.
The communication means of micro-grid system provided by the invention can make gateway be communicated chip under two kinds of communication patterns
Switching, and when being switched to the first communication pattern, the communication connection with generated energy acquisition equipment is established, the second communication is being switched to
When mode, the communication connection with mobile terminal is established, no setting is required two communication chips or two communication modules reduce gateway
Cost, and under a communication chip carry out communication pattern conversion, improve transfer efficiency, in addition two kinds of communication pattern timesharing are cut
It changes, improves the utilization rate of communication channel;Zigbee and bluetooth is used to reduce the communication of gateway as two kinds of communication patterns of gateway
Cost.
Correspondingly, the present invention also provides a kind of gateway, it can be realized the communication means of the micro-grid system in above-described embodiment
All processes.
It is the structural schematic diagram of gateway provided in an embodiment of the present invention referring to Fig. 5, the gateway includes 1 He of communication chip
Antenna 2;
The communication chip 1 between the first communication pattern and the second communication pattern for switching over;
The antenna 2 is used for when the communication chip is switched to first communication pattern, is established and is acquired with generated energy
The communication connection of equipment;When the communication chip is switched to second communication pattern, the communication link with mobile terminal is established
It connects.
Preferably, first communication pattern is Zigbee communication mode, and second communication pattern is Bluetooth communication mould
Formula.The communication chip is sillion labs EFR32MG1 family chip, which supports the Zigbee of 2.4G frequency range simultaneously
Agreement and Ble agreement.The antenna is 2.4G antenna, preferably outdoor omnidirectional antenna.
Further, the gateway further includes LED light 3, key 4, display 5, translation interface 6, sequence number chip 7, electricity
Press detection module 8, buzzer 9, board temperature detecting module 10, memory module 11 and power supply 12.
Wherein, LED light 3 can be two, and one prompts fault alarm when shown in red, when another is shown as blue
Show that gateway is in communications status.Key 4 can be two, and one is page turning key under screen, another is acknowledgement key.Display
5 use 128*128LCD-TFT display screen.Translation interface 6 is that UART turns USB interface.Sequence number chip 7 provides unique establishment net
Close mark.Gateway uses 5V direct current supply, and power supply 12 is that 220v turns 5v adapter and lithium battery.Voltage detection module 8 is used
In detection electric quantity of lithium battery information.Buzzer 9 is alarmed for gateway fails.Board temperature detecting module 10 is for detecting gateway board
Card temperature.Memory module 11 uses 8M FLASH low-power chip.
Correspondingly, the present invention also provides a kind of micro-grid systems, as shown in fig. 6, the system comprises generated energy to acquire equipment
61, gateway 62 and mobile terminal 63.Under the first communication pattern, generated energy acquires equipment 61 and gateway 62 is established and communicated to connect,
Under the second communication pattern, mobile terminal 63 and gateway 62 are established and are communicated to connect.
Wherein, generated energy acquisition equipment 61 includes the current detector 611 and inverter 612 of film assembly, film assembly
Current detector 611 for detecting current data and being sent to gateway 62, inverter 612 for acquire output voltage data and
Output current data is simultaneously sent to gateway 62.Mobile terminal 63 is used to send data inquiry request to gateway, to inquire hair in real time
The historical data of charge condition and gateway storage, and receive the fault alarm information of gateway.Mobile terminal 63 can also be with service
Device is communicated, and the data of inquiry are sent to server.Gateway 62 is the gateway in above-described embodiment, herein no longer in detail
It repeats.
Gateway provided by the invention can make gateway be communicated chip and switch under two kinds of communication patterns, and switch
When for the first communication pattern, establish the communication connection with generated energy acquisition equipment, when being switched to the second communication pattern, establish with
The communication connection of mobile terminal, no setting is required two communication chips or two communication modules, reduces the cost of gateway, and at one
The conversion that communication pattern is carried out under communication chip, improves transfer efficiency, in addition two kinds of communication pattern timesharing switchings, improves communication letter
The utilization rate in road;Zigbee and bluetooth is used to reduce the communications cost of gateway as two kinds of communication patterns of gateway.
It should be understood by those ordinary skilled in the art that: the discussion of any of the above embodiment is exemplary only, not
It is intended to imply that the scope of the present disclosure (including claim) is limited to these examples;Under thinking of the invention, above embodiments
Or can also be combined between the technical characteristic in different embodiments, step can be realized with random order, and be existed such as
Many other variations of the upper different aspect of the invention, for simplicity, they are not provided in details.
In addition, to simplify explanation and discussing, and in order not to obscure the invention, it can in provided attached drawing
It is connect with showing or can not show with the well known power ground of integrated circuit (IC) chip and other components.Furthermore, it is possible to
Device is shown in block diagram form, to avoid obscuring the invention, and this has also contemplated following facts, i.e., about this
The details of the embodiment of a little block diagram arrangements be height depend on will implementing platform of the invention (that is, these details should
It is completely within the scope of the understanding of those skilled in the art).Elaborating that detail (for example, circuit) is of the invention to describe
In the case where exemplary embodiment, it will be apparent to those skilled in the art that can be in these no details
In the case where or implement the present invention in the case that these details change.Therefore, these descriptions should be considered as explanation
Property rather than it is restrictive.
Although having been incorporated with specific embodiments of the present invention, invention has been described, according to retouching for front
It states, many replacements of these embodiments, modifications and variations will be apparent for those of ordinary skills.Example
Such as, discussed embodiment can be used in other memory architectures (for example, dynamic ram (DRAM)).
The embodiment of the present invention be intended to cover fall into all such replacements within the broad range of appended claims,
Modifications and variations.Therefore, all within the spirits and principles of the present invention, any omission, modification, equivalent replacement, the improvement made
Deng should all be included in the protection scope of the present invention.