Invention content
It is a primary object of the present invention to provide method of data synchronization, user equipment and computer readable storage medium, purport
Solving the user equipment technology different from the running state of air conditioner that air-conditioning side is shown when network environment is poor in the prior art
Problem.
To achieve the above object, the present invention provides a kind of method of data synchronization, and the method for data synchronization includes following step
Suddenly:
User device responsive determines corresponding in air-conditioning regulating command input by user according to the air-conditioning regulating command
One running state of air conditioner sends first running state of air conditioner to server so that the server will be locally stored the
Two running state of air conditioner are revised as first running state of air conditioner, generate and feed back return information;
Judge whether the return information is to adjust successful information, and the adjusting successful information is used to characterize the server
It is successfully modified to the operating status of air-conditioning side;
When the return information is the adjusting successful information, the first air-conditioning fortune is shown in current display interface
Row state, to realize that data synchronize.
Preferably, the user device responsive is in air-conditioning regulating command input by user, according to the air-conditioning regulating command
It determines corresponding first running state of air conditioner, first running state of air conditioner is sent to server, so that the server will
The second running state of air conditioner being locally stored is revised as first running state of air conditioner, before generating and feeding back return information,
The method of data synchronization further includes:
User device responsive reads user identifier, according to institute in log-in instruction input by user from the log-in instruction
It states user identifier and inquires corresponding air-conditioning mark;
The air-conditioning mark is sent to server, so that the server is identified according to the air-conditioning from default mapping relations
It is middle to inquire corresponding third running state of air conditioner, when inquiring the third running state of air conditioner, feed back the third air-conditioning
Operating status, the default mapping relations include air-conditioning mark and the correspondence of running state of air conditioner;
When receiving the third running state of air conditioner, the third operation of air conditioner shape is shown in current display interface
State.
Preferably, the user device responsive reads user in log-in instruction input by user from the log-in instruction
Mark, after inquiring corresponding air-conditioning mark according to the user identifier, the method for data synchronization further includes:
Detection instruction is sent to air-conditioning corresponding with air-conditioning mark, so that the air-conditioning refers in response to the detection
It enables, detects the network connection state of network residing for the air-conditioning, when the network connection state is presence, described in feedback
Presence;
It monitors whether to receive the presence that the air-conditioning is fed back in the first preset time;
When the presence that the air-conditioning feedback is received in first preset time, perform described to server
The air-conditioning mark is sent, so that the server inquires corresponding third according to air-conditioning mark from default mapping relations
Running state of air conditioner, when inquiring the third running state of air conditioner, the step of feeding back the third running state of air conditioner.
Preferably, it is described to send the air-conditioning to server and identify so that the server according to the air-conditioning identify from
Corresponding third running state of air conditioner is inquired in default mapping relations, when inquiring the third running state of air conditioner, feedback
After the third running state of air conditioner, the method for data synchronization further includes:
When not receiving the third running state of air conditioner, default operating condition is obtained, in the current display interface
The middle displaying default operating condition;
State more new command is sent to the server according to predetermined period, so that the server is in response to the state
More new command inquires corresponding 4th running state of air conditioner according to air-conditioning mark, is inquiring the 4th operation of air conditioner
During state, the 4th running state of air conditioner is fed back;
When four running state of air conditioner for not receiving the server feedback in the second preset time, displaying is default
Prompting interface, the default prompting interface are used to prompt user that current network is unstable.
Preferably, it is described to send state more new command to the server according to predetermined period, so that the server is rung
The more new command of state described in Ying Yu inquires corresponding 4th running state of air conditioner according to air-conditioning mark, described inquiring
During four running state of air conditioner, after feeding back the 4th running state of air conditioner, the method for data synchronization further includes:
It, will be described current when four running state of air conditioner that the server feedback is received in the second preset time
Equipment state shown in display interface is switched to the 4th running state of air conditioner by the default operating condition.
Preferably, it is described to send state more new command to the server according to predetermined period, so that the server is rung
The more new command of state described in Ying Yu inquires corresponding 4th running state of air conditioner according to air-conditioning mark, described inquiring
During four running state of air conditioner, before feeding back the 4th running state of air conditioner, the method for data synchronization further includes:
Calculate present packet loss;
When the present packet loss is less than predetermined threshold value, execution is described to send shape according to predetermined period to the server
State more new command, so that the server is in response to the state more new command, according to air-conditioning mark inquiry corresponding the
Four running state of air conditioner, when inquiring four running state of air conditioner, feed back four running state of air conditioner the step of.
Preferably, it is described when the return information is the adjusting successful information, institute is shown in current display interface
The first running state of air conditioner is stated, after realizing that data synchronize, the method for data synchronization further includes:
In response to synchronic command input by user, obtain the operating status being locally stored and be used as the first synchronous regime;
The synchronic command is sent to the server, so that the server obtains this in response to the synchronic command
The operating status of ground storage is simultaneously used as the second synchronous regime, feeds back second synchronous regime;
The synchronic command is sent to the air-conditioning, so that the air-conditioning obtains local deposit in response to the synchronic command
The operating status of storage is simultaneously used as third synchronous regime, feeds back the third synchronous regime;
First synchronous regime, second synchronous regime and the third synchronous regime are compared;
In first synchronous regime, second synchronous regime and the identical third synchronous regime three, exhibition
Show and synchronize successful prompt message.
Preferably, it is described by first synchronous regime, second synchronous regime and the third synchronous regime into
After row compares, the method for data synchronization further includes:
When first synchronous regime, second synchronous regime and the third synchronous regime three differ,
The first synchronous regime being locally stored is revised as the third synchronous regime;
State more positive order is sent to the server, so that the server is incited somebody to action in response to the state more positive order
The second synchronous regime being locally stored is revised as the third synchronous regime.
In addition, to achieve the above object, the present invention also provides a kind of user equipment, the user equipment includes:Memory,
Processor and the data synchronization program that can be run on the memory and on the processor is stored in, the data synchronize journey
Sequence is arranged for carrying out the step of method of data synchronization as described above.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium
Data synchronization program is stored on storage medium, number as described above is realized when the data synchronization program is executed by processor
The step of according to synchronous method.
In the present invention before user equipment shows the first running state of air conditioner, first to the operation of server side and air-conditioning side
State is modified, and the first running state of air conditioner is shown after the completion of operating status modification, then in user equipment side, so as to protect
The operating status for having demonstrate,proved smart mobile phone side, server side and air-conditioning side keeps synchronizing, and also just solves and works as net in the prior art
The technical issues of user equipment is different from the running state of air conditioner that air-conditioning side is shown when network environment is poor.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
With reference to Fig. 1, Fig. 1 is the user device architecture schematic diagram of hardware running environment that the embodiment of the present invention is related to.
As shown in Figure 1, the user equipment can include:Processor 1001, such as CPU, communication bus 1002, user interface
1003, network interface 1004, memory 1005.Wherein, communication bus 1002 is used to implement the connection communication between these components.
User interface 1003 can include display screen (Display), optional user interface 1003 can also include standard wireline interface,
Wireless interface, the wireline interface for user interface 1003 can be USB interface in the present invention.Network interface 1004 optionally may be used
To include standard wireline interface and wireless interface (such as WI-FI interfaces).Memory 1005 can be high-speed RAM memory, also may be used
To be stable memory (non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be
Independently of the storage device of aforementioned processor 1001.
It will be understood by those skilled in the art that the structure shown in Fig. 1 does not form the restriction to user equipment, can wrap
It includes and either combines certain components or different components arrangement than illustrating more or fewer components.
As shown in Figure 1, as operation can be included in a kind of memory 1005 of computer computer readable storage medium
System, network communication module, Subscriber Interface Module SIM and data synchronization program.
In user equipment shown in Fig. 1, network interface 1004 is mainly used for connecting background server, is taken with the backstage
Device be engaged in into row data communication;User interface 1003 is mainly used for connecting peripheral hardware;The user equipment is called by processor 1001
The data synchronization program stored in memory 1005, and perform following operate:
In response to air-conditioning regulating command input by user, determine that corresponding first air-conditioning is transported according to the air-conditioning regulating command
Row state sends first running state of air conditioner to server, so that the server transports the second air-conditioning being locally stored
Row status modifier is first running state of air conditioner, generates and feeds back return information;
Judge whether the return information is to adjust successful information, and the adjusting successful information is used to characterize the server
It is successfully modified to the operating status of air-conditioning side;
When the return information is the adjusting successful information, the first air-conditioning fortune is shown in current display interface
Row state, to realize that data synchronize.
Further, processor 1001 can call the data synchronization program stored in memory 1005, also perform following
Operation:
In response to log-in instruction input by user, user identifier is read from the log-in instruction, is marked according to the user
Know and inquire corresponding air-conditioning mark;
The air-conditioning mark is sent to server, so that the server is identified according to the air-conditioning from default mapping relations
It is middle to inquire corresponding third running state of air conditioner, when inquiring the third running state of air conditioner, feed back the third air-conditioning
Operating status, the default mapping relations include air-conditioning mark and the correspondence of running state of air conditioner;
When receiving the third running state of air conditioner, the third operation of air conditioner shape is shown in current display interface
State.
Further, processor 1001 can call the data synchronization program stored in memory 1005, also perform following
Operation:
Detection instruction is sent to air-conditioning corresponding with air-conditioning mark, so that the air-conditioning refers in response to the detection
It enables, detects the network connection state of network residing for the air-conditioning, when the network connection state is presence, described in feedback
Presence;
It monitors whether to receive the presence that the air-conditioning is fed back in the first preset time;
When the presence that the air-conditioning feedback is received in first preset time, perform described to server
The air-conditioning mark is sent, so that the server inquires corresponding third according to air-conditioning mark from default mapping relations
Running state of air conditioner, when inquiring the third running state of air conditioner, the step of feeding back the third running state of air conditioner.
Further, processor 1001 can call the data synchronization program stored in memory 1005, also perform following
Operation:
When not receiving the third running state of air conditioner, default operating condition is obtained, in the current display interface
The middle displaying default operating condition;
State more new command is sent to the server according to predetermined period, so that the server is in response to the state
More new command inquires corresponding 4th running state of air conditioner according to air-conditioning mark, is inquiring the 4th operation of air conditioner
During state, the 4th running state of air conditioner is fed back;
When four running state of air conditioner for not receiving the server feedback in the second preset time, displaying is default
Prompting interface, the default prompting interface are used to prompt user that current network is unstable.
Further, processor 1001 can call the data synchronization program stored in memory 1005, also perform following
Operation:
It, will be described current when four running state of air conditioner that the server feedback is received in the second preset time
Equipment state shown in display interface is switched to the 4th running state of air conditioner by the default operating condition.
Further, processor 1001 can call the data synchronization program stored in memory 1005, also perform following
Operation:
Calculate present packet loss;
When the present packet loss is less than predetermined threshold value, execution is described to send shape according to predetermined period to the server
State more new command, so that the server is in response to the state more new command, according to air-conditioning mark inquiry corresponding the
Four running state of air conditioner, when inquiring four running state of air conditioner, feed back four running state of air conditioner the step of.
Further, processor 1001 can call the data synchronization program stored in memory 1005, also perform following
Operation:
In response to synchronic command input by user, obtain the operating status being locally stored and be used as the first synchronous regime;
The synchronic command is sent to the server, so that the server obtains this in response to the synchronic command
The operating status of ground storage is simultaneously used as the second synchronous regime, feeds back second synchronous regime;
The synchronic command is sent to the air-conditioning, so that the air-conditioning obtains local deposit in response to the synchronic command
The operating status of storage is simultaneously used as third synchronous regime, feeds back the third synchronous regime;
First synchronous regime, second synchronous regime and the third synchronous regime are compared;
In first synchronous regime, second synchronous regime and the identical third synchronous regime three, exhibition
Show and synchronize successful prompt message.
Further, processor 1001 can call the data synchronization program stored in memory 1005, also perform following
Operation:
When first synchronous regime, second synchronous regime and the third synchronous regime three differ,
The first synchronous regime being locally stored is revised as the third synchronous regime;
State more positive order is sent to the server, so that the server is incited somebody to action in response to the state more positive order
The second synchronous regime being locally stored is revised as the third synchronous regime.
In the present embodiment before user equipment shows the first running state of air conditioner, first to the fortune of server side and air-conditioning side
Row state is modified, and the first running state of air conditioner is shown after the completion of operating status modification, then in user equipment side, so as to
Ensure that smart mobile phone side, server side and air-conditioning side operating status keep synchronize, also just solve in the prior art when
The technical issues of user equipment is different from the running state of air conditioner that air-conditioning side is shown when network environment is poor.
Based on above-mentioned hardware configuration, the embodiment of method of data synchronization of the present invention is proposed.
With reference to Fig. 2, Fig. 2 is the flow diagram of method of data synchronization first embodiment of the present invention.
In the first embodiment, the method for data synchronization includes the following steps:
Step S10:In response to air-conditioning regulating command input by user, corresponding is determined according to the air-conditioning regulating command
One running state of air conditioner sends first running state of air conditioner to server so that the server will be locally stored the
Two running state of air conditioner are revised as first running state of air conditioner, generate and feed back return information;
It is understood that executive agent is user equipment, the user equipment can be that smart mobile phone, PC etc. can
Connect the electronic equipment of internet.Air-conditioning is controlled by smart mobile phone in order to realize, smart mobile phone and air-conditioning can be connected into
Internet, also, can also change due to air-conditioning there are different operating statuses and with the operation operating status of user, institute
It is consistent need to ensure that smart mobile phone, server and air-conditioning side ensure the record of air-conditioning information.Wherein, operation of air conditioner shape
State includes the customized parameters such as airconditioning control temperature, humidity.
In the concrete realization, user can open preset web or air-conditioning in smart mobile phone by operating smart mobile phone
Relevant application program, user can input the operation for air-conditioning in open interface, for example, the sky currently shown in interface
The temperature of regulation and control system is " 23 degrees Celsius of room temperature ", and operation input by user is that temperature is adjusted to " 26 degrees Celsius of room temperature ", can be incited somebody to action
The adjusting operation of " 26 degrees Celsius of room temperature " is sent to server.When server receives the adjusting operation of " 26 degrees Celsius of the room temperature "
Afterwards, the running state of air conditioner pre-saved due to server side is " 23 degrees Celsius of room temperature ", can will be preserved in server side the
Two running state of air conditioner are that " 23 degrees Celsius of room temperature " is revised as the first running state of air conditioner i.e. " 26 degrees Celsius of room temperature ", when successfully repairing
After changing, return information can be generated and send the return information to smart mobile phone.
Step S20:Judge whether the return information is to adjust successful information, and the adjusting successful information is used to characterize institute
It is successfully modified to the second running state of air conditioner being locally stored to state server;
It is understood that if smart mobile phone can receive the return information, also indicate that smart mobile phone can normally join
Net.At this point, the operating status of server side record is " 26 degrees Celsius of room temperature ", when the operating status of server side is successfully changed
Afterwards, server can send temperature adjustment instructions to air-conditioning, so that the air-conditioning will be locally stored according to the temperature adjustment instructions
Running state of air conditioner be revised as first running state of air conditioner, so, can will be same after server side real-time synchronization data
Data after step are that " 26 degrees Celsius of room temperature " is sent to air-conditioning, to realize the modification for air-conditioner temperature.
It should be understood that after completing for the operating status modification of air-conditioning side, air-conditioning generation adjusts successful information, and
The adjusting successful information is fed back to server.It is adjusted after server receives the adjusting successful information of air-conditioning transmission, then by this
Successful information is sent to smart mobile phone.
Step S30:When the return information is the adjusting successful information, described the is shown in current display interface
One running state of air conditioner, to realize that data synchronize.
It is understood that when smart mobile phone receives the adjusting successful information, server side record is also just characterized
Operating status has been successfully modified as " 26 degrees Celsius of room temperature ", and control temperature has successfully been revised as that " room temperature 26 is taken the photograph by air-conditioning side
Family name's degree " after server and the successfully modification of air-conditioning side, can show " 26 degrees Celsius of the room temperature " in smart mobile phone side, at this point,
The operating status of smart mobile phone side, server side and air-conditioning side is " 26 degrees Celsius of room temperature ", is also achieved that and is set at three
Standby side is for the real-time synchronization of running state of air conditioner.Also, even if unstable networks, user equipment side and air-conditioning will not occur
The temperature that side is shown has differences, because can just send out air-conditioning regulating command when the network stabilization residing for mobile phone, when air-conditioning institute
It can successfully modify during the network stabilization at place to air-conditioning parameter, also, after air-conditioning side successfully completes parameter modification
User can just watch the operating status after operation in mobile phone side, so, when unstable networks, user equipment side and air-conditioning side
Operating status will not change.
In the present embodiment before user equipment shows the first running state of air conditioner, first to the fortune of server side and air-conditioning side
Row state is modified, and the first running state of air conditioner is shown after the completion of operating status modification, then in user equipment side, so as to
Ensure that smart mobile phone side, server side and air-conditioning side operating status keep synchronize, also just solve in the prior art when
The technical issues of user equipment is different from the running state of air conditioner that air-conditioning side is shown when network environment is poor.
With reference to Fig. 3, Fig. 3 is the flow diagram of method of data synchronization second embodiment of the present invention, based on shown in above-mentioned Fig. 2
First embodiment, propose the second embodiment of method of data synchronization of the present invention.
In a second embodiment, before the step S10, the method for data synchronization further includes:
Step S101:In response to log-in instruction input by user, user identifier is read from the log-in instruction, according to institute
It states user identifier and inquires corresponding air-conditioning mark;
It is understood that when using the air conditioning applications program in smart mobile phone, pass through the air-conditioning for the ease of user
The current operating status of application program real time inspection air-conditioning, user is when logging in the air conditioning applications program, for example, user inputs account
Name in an account book and the password login air conditioning applications program, to obtain user identifier.Wherein, user identifier can be account name or unique
Character code, for uniquely determining user identity.
In the concrete realization, each account can bind one or more air-conditionings mark, each air-conditioning mark for uniquely with
One air-conditioning equipment corresponds to.After corresponding air-conditioning mark is determined according to the user identifier, show that user wishes to check the air-conditioning
Identify the real-time running state of corresponding air-conditioning.
Step S102:The air-conditioning mark is sent to server, so that the server is identified according to the air-conditioning from pre-
If inquiring corresponding third running state of air conditioner in mapping relations, when inquiring the third running state of air conditioner, institute is fed back
Third running state of air conditioner is stated, the default mapping relations include air-conditioning mark and the correspondence of running state of air conditioner;
It should be understood that after air-conditioning mark is determined, which can be identified and be sent to server to realize for sky
The inquiry of the real-time running state of tune, because, whenever the operating status of air-conditioning changes Shi Douhui by the operating status of air-conditioning
Automatic synchronization to server, so, real time execution shape that can directly by learning air-conditioning in server side Query Running Status
State.For example, server is according to the corresponding third running state of air conditioner that air-conditioning mark is inquired from default mapping relations
" 17 degrees Celsius of room temperature " then characterizes the practical temperature controlled of air-conditioning at this time as " 17 degrees Celsius of room temperature ".
Step S103:When receiving the third running state of air conditioner, the third is shown in current display interface
Running state of air conditioner.
It is understood that when the running state of air conditioner for receiving server feedback is " 17 degrees Celsius of room temperature ", it will be
The information of " 17 degrees Celsius of room temperature " is shown in the display interface of smart mobile phone side, in order to which user can in real time be seen by user equipment
Survey the real-time running state of air-conditioning.
Further, after the step S101, the method for data synchronization may also include:To with the air-conditioning mark pair
The air-conditioning answered sends detection instruction, so that the air-conditioning is instructed in response to the detection, detects the net of network residing for the air-conditioning
Network connection status when the network connection state is presence, feeds back the presence;It monitors whether default first
The presence of the air-conditioning feedback is received in time;When receiving air-conditioning feedback in first preset time
During presence, perform it is described send the air-conditioning to server and identify so that the server according to the air-conditioning identify from
Corresponding third running state of air conditioner is inquired in default mapping relations, when inquiring the third running state of air conditioner, feedback
The step of third running state of air conditioner.
It is understood that as user in smart mobile phone side logon account to carry out the inquiry of air-conditioning real-time running state
When, it can first judge whether air-conditioning can normally connect networking, because the present embodiment is in the operation shape of user equipment side searching air conditioner
The realization flow of state, substantially only in the information of the air-conditioning of server side inquiry server record.Although the operation of air-conditioning
State changes all by real time automatic update to server, so, user equipment directly inquires the air-conditioning of server side record
Information is not in problem, and still, if air-conditioning cannot normally connect networking, the air-conditioning information of server side record is likely to occur
Mistake also results in the real-time running state that the air-conditioning information that user equipment side is shown is not air-conditioning yet.So in order to avoid upper
It states the inconsistent situation of air-conditioning information to occur, can first detect whether air-conditioning can normally connect networking, if air-conditioning can normally connect
Net is accessed, then the actual motion state with air-conditioning is consistent by the running state of air conditioner of server side record.
In the concrete realization, after user is in Successful login in the air conditioning applications program of smart mobile phone, will to air-conditioning mark
Know corresponding air-conditioning and send detection instruction, to judge whether air-conditioning can normally connect networking.Certainly, it can also be sent out by user equipment
Inspection surveys instruction to server, so that detection instruction is forwarded to air-conditioning by server.
It is understood that air-conditioning is receiving detection instruction, the network environment of network residing for air-conditioning will be examined
It surveys, if the network environment of network residing for air-conditioning enables to air-conditioning steadily to carry out the synchronous of running state of air conditioner with server,
Presence can then be generated and feed back to user equipment, so that user equipment is performed subsequently from operation;The net of network residing for air-conditioning
Network environment cannot cause air-conditioning steadily to carry out the synchronous of running state of air conditioner with server, in fact it could happen that suspension or network speed mistake
The problem of low, can not then generate presence and feed back to user equipment.If user equipment does not receive in the first preset time
The presence, the then network environment that can prompt network residing for user's air-conditioning are poor.
Pass through the operating status of user equipment real-time query air-conditioning in the present embodiment so that user can be directly in user equipment
The real-time running state of air-conditioning is observed in side.
With reference to Fig. 4, Fig. 4 is the flow diagram of method of data synchronization 3rd embodiment of the present invention, based on shown in above-mentioned Fig. 3
Second embodiment, propose the 3rd embodiment of method of data synchronization of the present invention.
In the third embodiment, after the step S102, the method for data synchronization further includes:
Step S103':When not receiving the third running state of air conditioner, default operating condition is obtained, is worked as described
The default operating condition is shown in preceding display interface;
It is understood that when by the operating status of smart mobile phone real-time query air-conditioning, user can be directly in user
The real-time running state of air-conditioning is observed in equipment side, if smart mobile phone does not receive the third air-conditioning inquired the fortune of server feedback
Row state then shows the unstable networks of smart mobile phone, alternatively, server side fails to run simultaneously shape from air-conditioning equipment side in time
State information can obtain default operating condition and show default operating condition in smart mobile phone side.Wherein, the default operating condition can
To be successfully received the running state of air conditioner of server feedback before, if for example, being successfully received server feedback before 3 minutes
Running state of air conditioner is " 15 degrees Celsius of room temperature ", but fails to successfully receive the operation of air conditioner shape of server Real-time Feedback this moment
State can then continue to show that operating status is " 15 degrees Celsius of room temperature ".
Step S104:State more new command is sent to the server according to predetermined period, so that the server responds
In the state more new command, corresponding 4th running state of air conditioner is inquired according to air-conditioning mark, is inquiring described the
During four running state of air conditioner, the 4th running state of air conditioner is fed back;
It should be understood that the actual motion state of air-conditioning is " 15 degrees Celsius of room temperature ", still, current air-conditioning before 3 minutes
Actual motion state but differ and be set to " 15 degrees Celsius of room temperature ", probably due to the operation of user or other reasons are become
Change.So state more new command will be sent to server according to predetermined period, continuously attempt to inquire in server side to realize
Real-time running state of air conditioner.
Step S105:When the 4th running state of air conditioner for not receiving the server feedback in the second preset time
When, show default prompting interface, the default prompting interface is used to prompt user that current network is unstable.
In the concrete realization, it when the running state of air conditioner for not receiving server Real-time Feedback, can be sent out to server within every 2 seconds
Next state update instruction is sent to obtain the real-time running state of air-conditioning.When the air-conditioning for not receiving server feedback in 8 seconds
During operating status, then default prompting interface can be shown on smart mobile phone, to prompt user network unstable.Also, in order to keep away
Exempt from, because the instruction of user's operation air-conditioning caused by unstable networks is failed, user's operation air-conditioning can be forbidden in advance, until receiving
To the running state of air conditioner of server Real-time Feedback, then enabling state, user can normal operating air-conditionings.
Further, after the step S104, the method for data synchronization may also include:When in the second preset time
When receiving four running state of air conditioner of the server feedback, by equipment state shown in the current display interface by
The default operating condition is switched to the 4th running state of air conditioner.
It is understood that when smart mobile phone does not receive the running state of air conditioner of server Real-time Feedback early period, first
Temporarily " default operating condition " is shown in current display interface, for example, " 15 degrees Celsius of room temperature ", until receiving server reality
When feed back running state of air conditioner when, for example, " 18 degrees Celsius of room temperature ", then can be switched to " room temperature 18 by " 15 degrees Celsius of room temperature "
Degree Celsius ", with ensure smart mobile phone side can real-time update air-conditioning newest running state information.
Further, before the step S104, the method for data synchronization may also include:Calculate present packet loss;When
When the present packet loss is less than predetermined threshold value, performs described updated according to predetermined period to server transmission state and refer to
It enables, so that the server is inquired corresponding 4th air-conditioning according to air-conditioning mark and transported in response to the state more new command
Row state, when inquiring four running state of air conditioner, feed back four running state of air conditioner the step of.
It is understood that in view of that when network environment is poor, user may be caused to adjust air-conditioning by smart mobile phone
Operation fail to reach air-conditioning equipment in time to realize that parameter is changed, it is also possible to lead to smart mobile phone, server and air-conditioning
Three record running state of air conditioner cannot be guaranteed unanimously, so, predetermined threshold value will be pre-set to limit packet loss, only existed
When present packet loss is less than the predetermined threshold value, it can just perform subsequent query running state of air conditioner and be shown with changing smart mobile phone side
The flow of operation information ensures that the running state of air conditioner of smart mobile phone, server and air-conditioning three record is consistent.Than
Such as, setting predetermined threshold value is 10%, when the packet loss of current network is less than 10%, can just perform subsequent operation.
It, can be to server periodicity in the present embodiment when not receiving the real-time running state of air-conditioning of server feedback
Ground sends state more new command, to continuously attempt to obtain the real-time running state of air-conditioning.
With reference to Fig. 5, Fig. 5 is the flow diagram of method of data synchronization fourth embodiment of the present invention, based on shown in above-mentioned Fig. 2
First embodiment, propose the fourth embodiment of method of data synchronization of the present invention.
In the fourth embodiment, after the step S30, the method for data synchronization further includes:
Step S40:In response to synchronic command input by user, obtain the operating status being locally stored and synchronized as first
State;
It is understood that although the realization method of method of data synchronization first embodiment to 3rd embodiment of the present invention can
It is consistent with the running state of air conditioner for ensureing smart mobile phone, server and air-conditioning three record, still, it is contemplated that Ke Nengyin
Operation for any appliance in network problem or three, which goes wrong, causes the running state of air conditioner of three's record to fail to protect
It holds unanimously, the above problem can occur by periodically inquiring the operating status of three's record.
In the concrete realization, user can hit the option of " data synchronization " to generate synchronic command in smart mobile phone side point, when
So, smart mobile phone can also periodically generate synchronic command, for example, at interval of 10 minutes generation synchronic commands.It is same in response to this
Step instruction, to obtain running state of air conditioner i.e. the first synchronous regime of smart mobile phone sidelights record, for example, " 15 degrees Celsius of room temperature ".
Step S50:The synchronic command is sent to the server, so that the server refers in response to described synchronize
It enables, obtain the operating status being locally stored and is used as the second synchronous regime, feed back second synchronous regime;
It should be understood that after " 15 degrees Celsius of the room temperature " for inquiring smart mobile phone sidelights record, can be sent to server
The synchronic command can be that " room temperature 15 is taken the photograph to inquire real-time status i.e. the second synchronous regime of the operation of air conditioner of server side record
Family name's degree ".
Step S60:The synchronic command is sent to the air-conditioning, so that the air-conditioning is obtained in response to the synchronic command
It takes the operating status being locally stored and is used as third synchronous regime, feed back the third synchronous regime;
It is understood that recorded in " 15 degrees Celsius of the room temperature " and server side for inquiring smart mobile phone sidelights record
After " 15 degrees Celsius of room temperature ", can synchronic command be sent to air-conditioning again, with equipment state, that is, third of searching air conditioner side actual motion
Synchronous regime can be " 15 degrees Celsius of room temperature ".
Step S70:First synchronous regime, second synchronous regime and the third synchronous regime are compared
It is right;
It should be understood that after the operating status for getting smart mobile phone, server and air-conditioning sidelights record respectively, it can
First synchronous regime, the second synchronous regime and third synchronous regime are compared.
Step S80:In first synchronous regime, second synchronous regime and third synchronous regime three's phase
Meanwhile displaying synchronizes successful prompt message.
It is understood that the state of three's record is " 15 degrees Celsius of room temperature ", then can be prompted in smart mobile phone side " same
It walks successfully ".
Further, after the step S70, the method for data synchronization may also include:First synchronous regime,
When second synchronous regime and the third synchronous regime three differ, the first synchronous regime being locally stored is changed
For the third synchronous regime;State more positive order is sent to the server, so that the server is in response to the state
The second synchronous regime being locally stored is revised as the third synchronous regime by more positive order.
In the concrete realization, if the state and non-equal of three's record, for example, the first of smart mobile phone sidelights record synchronizes shape
State is " 15 degrees Celsius of room temperature ", and the second synchronous regime of server side record is " 16 degrees Celsius of room temperature ", the of air-conditioning sidelights record
Three synchronous regimes are " 17 degrees Celsius of room temperature ", wherein, the state of air-conditioning sidelights record is the state of air-conditioning real time execution, so, it can
The state of smart mobile phone side and server side record is revised as to the state of air-conditioning sidelights record.It so can be by smart mobile phone side
" 15 degrees Celsius of the room temperature " of record is revised as " 17 degrees Celsius of room temperature ", and " 16 degrees Celsius of room temperature " that server side records is revised as
" 17 degrees Celsius of room temperature " is revised as third synchronous regime so as to fulfill by the state of server and user equipment side record,
It is achieved that the running state of air conditioner of three's record is consistent.
The operation of air conditioner information recorded in the present embodiment by user in real equipment, server and air-conditioning three,
And the operation of air conditioner information of three is compared, whether it is consistent with the running state of air conditioner for verifying three's record in real time.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium
On be stored with data synchronization program, following operation is realized when the data synchronization program is executed by processor:
In response to air-conditioning regulating command input by user, determine that corresponding first air-conditioning is transported according to the air-conditioning regulating command
Row state sends first running state of air conditioner to server, so that the server transports the second air-conditioning being locally stored
Row status modifier is first running state of air conditioner, generates and feeds back return information;
Judge whether the return information is to adjust successful information, and the adjusting successful information is used to characterize the server
It is successfully modified to the operating status of air-conditioning side;
When the return information is the adjusting successful information, the first air-conditioning fortune is shown in current display interface
Row state, to realize that data synchronize.
Further, following operation is also realized when the data synchronization program is executed by processor:
In response to log-in instruction input by user, user identifier is read from the log-in instruction, is marked according to the user
Know and inquire corresponding air-conditioning mark;
The air-conditioning mark is sent to server, so that the server is identified according to the air-conditioning from default mapping relations
It is middle to inquire corresponding third running state of air conditioner, when inquiring the third running state of air conditioner, feed back the third air-conditioning
Operating status, the default mapping relations include air-conditioning mark and the correspondence of running state of air conditioner;
When receiving the third running state of air conditioner, the third operation of air conditioner shape is shown in current display interface
State.
Further, following operation is also realized when the data synchronization program is executed by processor:
Detection instruction is sent to air-conditioning corresponding with air-conditioning mark, so that the air-conditioning refers in response to the detection
It enables, detects the network connection state of network residing for the air-conditioning, when the network connection state is presence, described in feedback
Presence;
It monitors whether to receive the presence that the air-conditioning is fed back in the first preset time;
When the presence that the air-conditioning feedback is received in first preset time, perform described to server
The air-conditioning mark is sent, so that the server inquires corresponding third according to air-conditioning mark from default mapping relations
Running state of air conditioner, when inquiring the third running state of air conditioner, the step of feeding back the third running state of air conditioner.
Further, following operation is also realized when the data synchronization program is executed by processor:
When not receiving the third running state of air conditioner, default operating condition is obtained, in the current display interface
The middle displaying default operating condition;
State more new command is sent to the server according to predetermined period, so that the server is in response to the state
More new command inquires corresponding 4th running state of air conditioner according to air-conditioning mark, is inquiring the 4th operation of air conditioner
During state, the 4th running state of air conditioner is fed back;
When four running state of air conditioner for not receiving the server feedback in the second preset time, displaying is default
Prompting interface, the default prompting interface are used to prompt user that current network is unstable.
Further, following operation is also realized when the data synchronization program is executed by processor:
It, will be described current when four running state of air conditioner that the server feedback is received in the second preset time
Equipment state shown in display interface is switched to the 4th running state of air conditioner by the default operating condition.
Further, following operation is also realized when the data synchronization program is executed by processor:
Calculate present packet loss;
When the present packet loss is less than predetermined threshold value, execution is described to send shape according to predetermined period to the server
State more new command, so that the server is in response to the state more new command, according to air-conditioning mark inquiry corresponding the
Four running state of air conditioner, when inquiring four running state of air conditioner, feed back four running state of air conditioner the step of.
Further, following operation is also realized when the data synchronization program is executed by processor:
In response to synchronic command input by user, obtain the operating status being locally stored and be used as the first synchronous regime;
The synchronic command is sent to the server, so that the server obtains this in response to the synchronic command
The operating status of ground storage is simultaneously used as the second synchronous regime, feeds back second synchronous regime;
The synchronic command is sent to the air-conditioning, so that the air-conditioning obtains local deposit in response to the synchronic command
The operating status of storage is simultaneously used as third synchronous regime, feeds back the third synchronous regime;
First synchronous regime, second synchronous regime and the third synchronous regime are compared;
In first synchronous regime, second synchronous regime and the identical third synchronous regime three, exhibition
Show and synchronize successful prompt message.
Further, following operation is also realized when the data synchronization program is executed by processor:
When first synchronous regime, second synchronous regime and the third synchronous regime three differ,
The first synchronous regime being locally stored is revised as the third synchronous regime;
State more positive order is sent to the server, so that the server is incited somebody to action in response to the state more positive order
The second synchronous regime being locally stored is revised as the third synchronous regime.
In the present embodiment before user equipment shows the first running state of air conditioner, first to the fortune of server side and air-conditioning side
Row state is modified, and the first running state of air conditioner is shown after the completion of operating status modification, then in user equipment side, so as to
Ensure that smart mobile phone side, server side and air-conditioning side operating status keep synchronize, also just solve in the prior art when
The technical issues of user equipment is different from the running state of air conditioner that air-conditioning side is shown when network environment is poor.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row
His property includes, so that process, method, article or system including a series of elements not only include those elements, and
And it further includes other elements that are not explicitly listed or further includes intrinsic for this process, method, article or system institute
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this
Also there are other identical elements in the process of element, method, article or system.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.Word first, second, with
And the use of third etc. does not indicate that any sequence, can be title by these word explanations.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on such understanding, technical scheme of the present invention substantially in other words does the prior art
Going out the part of contribution can be embodied in the form of software product, which is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), used including some instructions so that a station terminal equipment (can be mobile phone, computer takes
Be engaged in device, air conditioner or the network equipment etc.) perform method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair
The equivalent structure or equivalent flow shift that bright specification and accompanying drawing content are made directly or indirectly is used in other relevant skills
Art field, is included within the scope of the present invention.