The content of the invention
In view of this, it is an object of the invention to provide a kind of data communications method and device, to be effectively improved above-mentioned lack
Fall into.
Embodiments of the invention are realized in the following way:
In a first aspect, the embodiments of the invention provide a kind of data communications method, applied in a data communication system
Gateway device, the data communication system also include:X terminal device being connected with the gateway device, the X terminal are set
It is standby to include:M terminal device and N number of terminal device, X are integer more than or equal to 2, and M and N are the integer more than or equal to 1, M+
N≤X.Methods described includes:When the M terminal device is in the communication shape that can carry out data transmission with the gateway device
State, and during N number of terminal device is in the low power consumpting state that can not carry out data transmission with the gateway device,
Each terminal device that the transmission of each terminal device in the M terminal device comes is obtained to gather in the low power consumpting state
The first continuous data.The low power consumpting state is in the M terminal device, and N number of terminal device is in described
During communications status, obtain each terminal device in N number of terminal device and transmit each terminal device come in institute
State the second continuous data gathered during low power consumpting state.
Further, each terminal device that each terminal device transmission obtained in the M terminal device comes
The first continuous data gathered in the low power consumpting state.Including:Judge whether to obtain each in the M terminal device
First continuous data that each terminal device that terminal device transmission comes gathers in the low power consumpting state;For
When no, each terminal device in the M terminal device is controlled to transmit each terminal device again in preset duration
First continuous data, obtain first continuous data of each terminal device in the M terminal device, it is described
Preset duration is the duration in the communications status.
Further, each terminal device transmission for judging whether to obtain in the M terminal device comes described
After first continuous data that each terminal device gathers in the low power consumpting state.Also include:For it is no when, by institute
The total degree for stating the bust this of each terminal device in M terminal device adds 1;Judging the total degree of the bust this is
It is no to meet threshold number;When to be, each terminal device in the M terminal device is controlled to carry out automatic fault selftesting;
For it is no when, perform step:Control each terminal device in the M terminal device in preset duration again transmission described in
First continuous data of each terminal device, obtains described first of each terminal device in the M terminal device
Continuous data, the preset duration are the duration in the communications status.
Further, each terminal device in the control M terminal device transmits again in preset duration
First continuous data of each terminal device, obtain the described of each terminal device in the M terminal device
After first continuous data.Methods described also includes:By the timing time of each terminal device in the M terminal device with
The timing time of the gateway device synchronizes, so that what each terminal device timing in the M terminal device reached
The preset duration is synchronous with the preset duration holding that the gateway device timing reaches.
Further, it is described to be in the low power consumpting state in the M terminal device, and at N number of terminal device
During the communications status, obtain each terminal that the transmission of each terminal device in N number of terminal device comes and set
After standby the second continuous data gathered in the low power consumpting state.Methods described also includes:Based in the gateway device
To the default sampling order of the X terminal device, judge whether not obtain the transmission of any one terminal device described low
The continuous data gathered during power consumption state;For it is no when, return perform step:When the M terminal device be in can be with institute
The communications status that gateway device carries out data transmission is stated, and N number of terminal device is in the gateway device to enter
During the low power consumpting state of row data transfer, obtain in the M terminal device each terminal device transmission come it is every
The first continuous data that individual terminal device gathers in the low power consumpting state.
Further, the continuous data includes corresponding user's:Water usage data, gas consumption data or power consumption number
According to.
Second aspect, the embodiments of the invention provide a kind of data communication equipment, applied in a data communication system
Gateway device, the data communication system also include:X terminal device being connected with the gateway device, the X terminal are set
It is standby to include:M terminal device and N number of terminal device, X are integer more than or equal to 2, and M and N are the integer more than or equal to 1, M+
N≤X.Described device includes:First acquisition module, for being in the gateway device to enter when the M terminal device
The communications status of row data transfer, and N number of terminal device is in what can not be carried out data transmission with the gateway device
During low power consumpting state, obtain each terminal device that the transmission of each terminal device in the M terminal device comes and exist
The first continuous data gathered during the low power consumpting state.Second acquisition module, for being in described in the M terminal device
Low power consumpting state, and during N number of terminal device is in the communications status, obtain in N number of terminal device
The second continuous data that each terminal device that each terminal device transmission comes gathers in the low power consumpting state.
Further, first acquisition module includes:First judging unit, for judging whether to obtain described M eventually
Each terminal device that each terminal device transmission in end equipment comes gathered in the low power consumpting state described the
One continuous data.Obtaining unit, for for it is no when, control each terminal device in the M terminal device when default
Again first continuous data of each terminal device is transmitted in long, obtains each end in the M terminal device
First continuous data of end equipment, the preset duration are the duration in the communications status.
Further, first acquisition module also includes:Second judging unit, for for it is no when, by described M eventually
The total degree of the bust this of each terminal device in end equipment adds 1.3rd judging unit, for judging the bust this
Total degree whether meet threshold number.Step execution unit, it is every in the M terminal device for when to be, controlling
Individual terminal device carries out automatic fault selftesting;For it is no when, perform step:Control each terminal in the M terminal device
Equipment transmits first continuous data of each terminal device again in preset duration, obtains the M terminal and sets
First continuous data of each terminal device in standby, the preset duration is the duration in the communications status.
Further, first acquisition module also includes:Synchronization unit, for will be every in the M terminal device
The timing time of the timing time of individual terminal device and the gateway device synchronizes, so that in the M terminal device
The preset duration that each terminal device timing reaches keeps same with the preset duration that the gateway device timing reaches
Step.
The beneficial effect of the embodiment of the present invention is:
When M terminal device is in the communications status that can carry out data transmission with gateway device, and at N number of terminal device
During the low power consumpting state that can not carry out data transmission with gateway device, gateway device just obtains M terminal device
In the first continuous data for being gathered in low power consumpting state of each terminal device for coming of each terminal device transmission.And with M
After individual terminal device enters row data communication, low power consumpting state is in M terminal device, and N number of terminal device is in communication shape
During state, each terminal device that gateway device is just gone to obtain in N number of terminal device again transmits each terminal device of coming
The second continuous data gathered in low power consumpting state.Therefore, number in batches is carried out to X terminal device by gateway device
According to collection, the load of the gateway device effectively reduced, and Communication Jamming during collection.In addition, adopted again due to not carrying out data
The terminal device of collection is to be in low power consumpting state, therefore also effectively reduces power consumption of the X terminal device when data communicate.
To enable the above objects, features and advantages of the present invention to become apparent, preferred embodiment cited below particularly, and coordinate
Appended accompanying drawing, is described in detail below.
Embodiment
Below in conjunction with accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Ground describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.Generally exist
The component of the embodiment of the present invention described and illustrated in accompanying drawing can be configured to arrange and design with a variety of herein.Cause
This, the detailed description of the embodiments of the invention to providing in the accompanying drawings is not intended to limit claimed invention below
Scope, but it is merely representative of the selected embodiment of the present invention.Based on embodiments of the invention, those skilled in the art are not doing
The every other embodiment obtained on the premise of going out creative work, belongs to the scope of protection of the invention.
First embodiment
Referring to Fig. 1, first embodiment of the invention provides a kind of data communication system 10, the data communication system 10 is wrapped
Include:X terminal device 11, gateway device 12 and server 13.Wherein, gateway device 12 respectively with server 13 and X terminal
Equipment 11 connects.
In X terminal device 11, X is the integer more than or equal to 2, therefore X terminal device 11 may include:M terminal is set
Standby 11 and N number of terminal device 11, and M and N are the integer more than or equal to 1, and M+N≤X.Further, M terminal device 11
It is connected with N number of terminal device 11 with gateway device 12, and forms data interaction.In the present embodiment, in X terminal device 11
Each terminal device 11 can be the continuous data for gathering a corresponding user, and the continuous data includes:Water usage data,
Gas consumption data or power consumption data, i.e., each terminal device 11 can be the integrated form meter reading of water meter, gas meter and/or ammeter
Equipment can also be single water meter, gas meter or ammeter.
Gateway device 12 can be the conventional equipment model in the technical field.Gateway device 12 with X terminal by setting
Standby 11 connection, then can be to X terminal so as to form data interaction with each terminal device 11 in X terminal device 11
Equipment 11 carries out data acquisition successively in batches.
Server 13 is data server or webserver etc., server 13 also by the connection with gateway device 12 and
Data interaction is formed with gateway device 12.Thus, after the collection of gateway device 12 to data, gateway device 12 will can gather
Data send to server 13, so that the server 13 is by data storage or display.
Second embodiment
Referring to Fig. 2, second embodiment of the invention provides a kind of data communications method, the data communications method is applied to
Gateway device in data communication system.The data communications method includes:Step S100 and step S200.
Step S100:When the M terminal device is in the communication shape that can carry out data transmission with the gateway device
State, and during N number of terminal device is in the low power consumpting state that can not carry out data transmission with the gateway device,
Each terminal device that the transmission of each terminal device in the M terminal device comes is obtained to gather in the low power consumpting state
The first continuous data.
When carrying out data acquisition to X terminal device, gateway device needs to carry out networking with X terminal device.Specifically
, the facility information of X terminal device can be input in gateway device by operating personnel.Its input mode can be to pass through service
The facility information of X terminal device is input to gateway device by device, or its input mode can also be that operating personnel set in gateway
The She Beixinxi of X terminal device is directly input to gateway device by standby installation place.In the equipment of X terminal device of input
In information, the facility information of each terminal device includes in X terminal device:Device id and channel data.In input process,
Operating personnel's is the facility information for inputting each terminal device in certain sequence, then gateway device is according to acquisition facility information
The data for gathering X terminal device are divided at least two priority batches by order, and then are then made using the sequencing of batch
To preset sampling order.After the facility information of X terminal device is all sequentially input, gateway device is then believed all equipment
Breath is stored, to realize the configuration to X terminal device.Afterwards, the information and each end that gateway device then can be according to storage
End equipment establishes connection, and the time of synchronous each terminal device after connection, so that the time meter of each terminal device
When can be formed with the time timing of gateway device it is synchronous.
In the present embodiment, each terminal device of X terminal device is respectively provided with two kinds of working conditions.A kind of working condition is low
Power consumption state, when terminal device is in low power consumpting state, terminal device can not enter line number due to low in energy consumption with gateway device
The continuous data of corresponding user can be gathered according to interaction, but when terminal device is in low power consumpting state.Another working condition is logical
Letter state, when terminal device is in communications status, the power consumption of this state can ensure that terminal device carries out data with gateway device
Interaction, but the continuous data of correspondence user can be gathered when terminal device be in low power consumpting state.
The working condition switching of X terminal device is with presetting corresponding to batch holding corresponding to sampling order, i.e., at least
The working condition of the terminal device of one and only one batch is held in communications status in two batches, except other batches of the batch
It is secondary to ensure in low power consumpting state, and the working condition of each terminal device in each batch is that real-time holding is synchronous.
In the present embodiment, each terminal device of each batch is previously provided with a preset duration, and the preset duration is place
In the duration of communications status.In addition, each terminal device of each batch is also previously provided with a sleep time, the sleep time
For the duration in low power consumpting state.Because the time timing of each terminal device of each batch is synchronous with gateway device holding,
By taking the beginning of communications status as an example, when the duration of the time timing of each terminal device of each batch is equal to preset duration, then often
Each terminal device of individual batch is then synchronous to switch to low power consumpting state from communications status.Afterwards, when each terminal of each batch is set
When the duration of standby time timing is equal to sleep time, then each terminal device of each batch is then synchronous switches from low power consumpting state
To communications status, so as to form circulation.
And then after networking, gateway device can then sample in batches according to the default sampling order of configuration is corresponding, and
Switched according to the working condition of each batch terminal device, then gateway device in batches to X terminal device progress data
Collection.
Wherein, in two successive batches of at least two sample batch, the batch first sampled sets for M terminal
It is standby, and a batch of post-sampling is N number of terminal device, and M and N are the integer more than or equal to 1.
The terminal device sampling of current once individual batch terminates, and when sampling M terminal device of present lot.Can be with
It is understood that in this condition, M terminal device is in the communications status that can carry out data transmission with gateway device, and X whole
Except M terminal device in end equipment, be in can not be with gateway device for all terminal devices including N number of terminal device
The low power consumpting state carried out data transmission.And then in this process, the biography based on each terminal device in M terminal device
Defeated, gateway device can be it is first determined whether obtain each terminal device that each terminal device transmission in M terminal device comes
The first continuous data gathered in low power consumpting state.
When being judged as YES, then characterize gateway device and have been obtained for the first continuous data corresponding to each terminal device.
And then gateway device can continuously transmit multiple each terminal devices successfully fed back in M terminal device.So that M whole
Each terminal device in end equipment obtains any one feedback information and then would know that data transfer success, enters without transmitting number again
According to.
When being judged as NO, then characterize gateway device and do not obtain the first continuous data corresponding to each terminal device.And then
The total degree of the bust this of each terminal device in M terminal device is added 1 by gateway device, and judges the total of bust this
Whether number meets threshold number.When judging to meet threshold number, illustrate that each terminal device in M terminal device is in
Malfunction, then gateway device control each terminal device in the M terminal device to carry out automatic fault selftesting so that M
Each terminal device in individual terminal device carries out equipment verification with gateway device.When the process of checking apparatus information has hair
Existing error message is simultaneously corrected, then each terminal device being regarded as in M terminal device eliminates failure, and then M whole
Each terminal device in end equipment is waken up.Conversely, not finding error message when the process of checking apparatus information is present, then may be used
It is considered that failure can not be from exclusion, and then gateway device will generate warning message to server, with teaching process, personnel are examined
Repair.When judging to be unsatisfactory for threshold number, then each terminal device in M terminal device is controlled to be passed again in preset duration
First continuous data of defeated each terminal device.Further, during the non-failure of each terminal device in M terminal device,
Then gateway device can obtain the first continuous data of each terminal device in M terminal device.
It should be noted that do not receive the first continuous data every time, gateway device can perform it is above-mentioned do not receive sentence
Stop journey.After the time synchronisation duration of each terminal device and gateway device in M terminal device reaches preset duration, nothing
The first continuous data whether is have received by gateway device, and each terminal device in M terminal device is cut from communications status
Low power consumpting state is bonded to, and gateway device is also according to default sampling order, corresponding to go to obtain next batch, i.e., N number of terminal
The data of equipment.
As the another embodiment of the present embodiment, it can also be that each terminal device is being sent out in M terminal device
After first continuous data corresponding to sending, each terminal device goes to judge whether the multiple success feedback letters for obtaining gateway device feedback
Any one in breath.When being judged as YES, then each terminal device knows transmission success.It is and then every in M terminal device
Individual terminal device switching state after preset duration.When being judged as NO, i.e. each terminal device is waiting in M terminal device
Any one success feedback information is not obtained after certain time length, then each terminal device knows bust this.And then M terminal is set
Failure total degree is also added 1 by each terminal device in standby, and it is each whole in M terminal device to judge unsuccessfully whether total degree meets
Threshold number set by end equipment.If satisfied, then each terminal device interacts with gateway device in M terminal device
To perform automatic fault selftesting.If not satisfied, then each terminal device is again corresponding to gateway device transmission in M terminal device
The first continuous data.If each bust this of terminal device always repeatedly in M terminal device, and in M terminal device
In the case that each terminal device failure total degree is unsatisfactory for threshold number again, each terminal device is being counted in M terminal device
Also it is directly switch into low power consumpting state when constantly length reaches preset duration.
Step S200:The low power consumpting state is in the M terminal device, and N number of terminal device is in institute
During stating communications status, obtain each terminal device that the transmission of each terminal device in N number of terminal device comes and exist
The second continuous data gathered during the low power consumpting state.
At the end of the collection of M terminal device of last time batch, in X terminal device except N number of terminal device with
Outside, remaining all terminal device for including M terminal device is in corresponding low power consumpting state, and then present lot is N number of
Terminal device also switches from low power consumpting state and is in communications status accordingly, further, in the process in communications status
In, transmission of the gateway device just based on each terminal device in N number of terminal device, obtain each in N number of terminal device
The second continuous data that each terminal device that terminal device transmission comes gathers in low power consumpting state.
It is understood that gateway device obtains the second continuous data corresponding to each terminal device in N number of terminal device
Mode it is identical with abovementioned steps S100, just do not do excessive tired state herein.
In addition, after data acquisition is carried out to N number of terminal device, gateway device can go to judge X according to default sampling order
Whether individual terminal device samples completion.If not completing, continue to sample it is next, if completing, again according to default sampling order,
Remove to sample each terminal device of a batch of most initial in default sampling order, so as to form circulation.
3rd embodiment
Referring to Fig. 3, third embodiment of the invention provides a kind of data communication equipment 100, communicated applied to a data
Gateway device in system, data communication equipment 100 include:
First acquisition module 110, for when the M terminal device is in data biography can be carried out with the gateway device
Defeated communications status, and N number of terminal device is in the low-power consumption shape that can not carry out data transmission with the gateway device
During state, obtain each terminal device in the M terminal device and transmit each terminal device come in the low work(
The first continuous data gathered during consumption state;
Second acquisition module 120, for being in the low power consumpting state, and N number of terminal in the M terminal device
During equipment is in the communications status, each terminal device transmission in acquisition N number of terminal device comes each
The second continuous data that terminal device gathers in the low power consumpting state.
Referring to Fig. 4, in a kind of data communication equipment 100 that third embodiment of the invention provides, the first acquisition module
110 include:
First judging unit 111, come for judging whether to obtain the transmission of each terminal device in the M terminal device
First continuous data that is gathered in the low power consumpting state of each terminal device.
Second judging unit 112, for for it is no when, by the transmission of each terminal device in the M terminal device
The total degree of failure adds 1.
3rd judging unit 113, for judging whether the total degree of the bust this meets threshold number.
Step execution unit 114, for when to be, controlling each terminal device in the M terminal device to enter
Row automatic fault selftesting;For it is no when, perform step:Each terminal device in the M terminal device is controlled in preset duration
First continuous data of each terminal device is inside transmitted again, obtains each terminal in the M terminal device
First continuous data of equipment, the preset duration are the duration in the communications status.
Obtaining unit 115, for for it is no when, control each terminal device in the M terminal device when default
Again first continuous data of each terminal device is transmitted in long, obtains each end in the M terminal device
First continuous data of end equipment, the preset duration are the duration in the communications status.
Synchronization unit 116, for by the timing time of each terminal device in the M terminal device and the gateway
The timing time of equipment synchronizes, so that each terminal device timing in the M terminal device reaches described default
Duration is synchronous with the preset duration holding that the gateway device timing reaches.
It should be noted that due to it is apparent to those skilled in the art that, convenience and letter for description
It is clean, the specific work process of the system of foregoing description, device and unit, it may be referred to corresponding in preceding method embodiment
Journey, it will not be repeated here.
The computer-readable of non-volatile program code that the progress processor that the embodiment of the present invention is provided can perform is deposited
The computer program product of storage media, including the computer-readable recording medium of program code is stored, described program code bag
The instruction included can be used for performing the method described in previous methods embodiment, and specific implementation can be found in embodiment of the method, herein not
Repeat again.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, can be with
Realize by another way.Device embodiment described above is only schematical, for example, the division of the unit,
Only a kind of division of logic function, can there is other dividing mode when actually realizing, in another example, multiple units or component can
To combine or be desirably integrated into another system, or some features can be ignored, or not perform.It is another, it is shown or beg for
The mutual coupling of opinion or direct-coupling or communication connection can be by some communication interfaces, device or unit it is indirect
Coupling or communication connection, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit
The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also
That unit is individually physically present, can also two or more units it is integrated in a unit.
If the function is realized in the form of SFU software functional unit and is used as independent production marketing or in use, can be with
It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially in other words
The part to be contributed to prior art or the part of the technical scheme can be embodied in the form of software product, the meter
Calculation machine software product is stored in a storage medium, including some instructions are causing a computer equipment (can be
People's computer, server, or network equipment etc.) perform all or part of step of each embodiment methods described of the present invention.
And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only Memory), arbitrary access are deposited
Reservoir (RAM, Random Access Memory), magnetic disc or CD etc. are various can be with the medium of store program codes.
In summary, the embodiments of the invention provide a kind of data communications method and device, applied to a data communication system
Gateway device in system, data communication system also include:X terminal device being connected with gateway device, X terminal device bag
Include:M terminal device and N number of terminal device, X are integer more than or equal to 2, and M and N are the integer more than or equal to 1, M+N≤
X.Method includes:When M terminal device is in the communications status that can carry out data transmission with gateway device, and N number of terminal is set
It is standby during the low power consumpting state that can not carry out data transmission with gateway device, obtain every in M terminal device
The first continuous data that each terminal device that individual terminal device transmission comes gathers in low power consumpting state.In M terminal device
In low power consumpting state, and during N number of terminal device is in communications status, each terminal in N number of terminal device is obtained
The second continuous data that each terminal device that equipment transmission comes gathers in low power consumpting state.
When M terminal device is in the communications status that can carry out data transmission with gateway device, and at N number of terminal device
During the low power consumpting state that can not carry out data transmission with gateway device, gateway device just obtains M terminal device
In the first continuous data for being gathered in low power consumpting state of each terminal device for coming of each terminal device transmission.And with M
After individual terminal device enters row data communication, low power consumpting state is in M terminal device, and N number of terminal device is in communication shape
During state, each terminal device that gateway device is just gone to obtain in N number of terminal device again transmits each terminal device of coming
The second continuous data gathered in low power consumpting state.Therefore, number in batches is carried out to X terminal device by gateway device
According to collection, the load of the gateway device effectively reduced, and Communication Jamming during collection.In addition, adopted again due to not carrying out data
The terminal device of collection is to be in low power consumpting state, therefore also effectively reduces power consumption of the X terminal device when data communicate.
The preferred embodiments of the present invention are these are only, are not intended to limit the invention, for those skilled in the art
For member, the present invention can have various modifications and variations.Any modification within the spirit and principles of the invention, being made,
Equivalent substitution, improvement etc., should be included in the scope of the protection.It should be noted that:Similar label and letter are under
Similar terms is represented in the accompanying drawing in face, therefore, once be defined in a certain Xiang Yi accompanying drawing, then need not in subsequent accompanying drawing
It is further defined and explained.
More than, it is only embodiment of the invention, but protection scope of the present invention is not limited thereto, and it is any to be familiar with
Those skilled in the art the invention discloses technical scope in, change or replacement can be readily occurred in, should all be covered
Within protection scope of the present invention.Therefore, protection scope of the present invention should be defined by scope of the claims.