CN114095363A - Communication method, device and system, upper computer and lower computer - Google Patents

Communication method, device and system, upper computer and lower computer Download PDF

Info

Publication number
CN114095363A
CN114095363A CN202111333721.0A CN202111333721A CN114095363A CN 114095363 A CN114095363 A CN 114095363A CN 202111333721 A CN202111333721 A CN 202111333721A CN 114095363 A CN114095363 A CN 114095363A
Authority
CN
China
Prior art keywords
communication
communication protocol
protocol
switching
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111333721.0A
Other languages
Chinese (zh)
Inventor
杨华生
吴学伟
邹宏亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Green Refrigeration Technology Center Co Ltd of Zhuhai
Original Assignee
Gree Green Refrigeration Technology Center Co Ltd of Zhuhai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Green Refrigeration Technology Center Co Ltd of Zhuhai filed Critical Gree Green Refrigeration Technology Center Co Ltd of Zhuhai
Priority to CN202111333721.0A priority Critical patent/CN114095363A/en
Publication of CN114095363A publication Critical patent/CN114095363A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/18Multiprotocol handlers, e.g. single devices capable of handling multiple protocols

Abstract

The invention discloses a communication method, a communication device, a communication system, an upper computer and a lower computer. The method applied to the upper computer comprises the following steps: in the communication process, judging whether the current communication protocol meets the communication quality requirement; if the communication quality requirement is not met, switching from the current communication protocol to a target communication protocol for communication; the anti-interference capability of the target communication protocol is higher than that of the current communication protocol. According to the invention, under the condition that the current communication protocol does not meet the communication quality requirement, the current communication protocol is switched to the communication protocol with higher anti-interference capability for communication, and the influence of interference on normal communication is reduced and the communication reliability is improved through the variable communication protocol.

Description

Communication method, device and system, upper computer and lower computer
Technical Field
The invention relates to the technical field of communication, in particular to a communication method, a communication device, a communication system, an upper computer and a lower computer.
Background
In a communication system, the communication protocol between two nodes is generally fixed. Taking an air conditioning unit as an example, the interaction of instructions and states between each node of the air conditioning unit is required to maintain the normal operation of the system, the interaction of the data is carried out depending on a certain communication protocol, the protocol can customize corresponding identification, data states and data verification rules, and the upper computer and the lower computer carry out analysis processing according to the corresponding rules.
The conventional communication protocol in the air conditioning unit is fixed and invariable, and contains all control instructions, operation parameters, fault states and other information of the unit, and the more complex the system is, the more data volume needs to be interacted through the protocol. If one data in one frame of data is tampered due to interference, the verification of the whole frame of data cannot pass, and the data can be discarded by the analysis party finally, so that the data interaction fails.
Disclosure of Invention
The embodiment of the invention provides a communication method, a communication device, a communication system, an upper computer and a lower computer, which are used for at least solving the problem that communication interference influences normal communication of the system in the prior art.
In order to solve the above technical problem, an embodiment of the present invention provides a communication method, applied to an upper computer, including:
in the communication process, judging whether the current communication protocol meets the communication quality requirement;
if the communication quality requirement is not met, switching the current communication protocol to a target communication protocol for communication;
the anti-interference capability of the target communication protocol is higher than that of the current communication protocol.
Optionally, determining whether the current communication protocol meets the communication quality requirement includes:
under the current communication protocol, after data replied by a lower computer is received for the first time, periodically acquiring a data reply rate according to a preset time interval, and if the data reply rate is smaller than or equal to a first threshold value, determining that the current communication protocol does not meet the communication quality requirement; and/or the presence of a gas in the gas,
and timing communication faults under the current communication protocol, and if the data replied by the lower computer is not received within the continuous set time, determining that the current communication protocol does not meet the communication quality requirement, wherein the set time is less than the specified time, and the specified time is a time threshold value for determining the occurrence of the communication faults.
Optionally, after switching from the current communication protocol to the target communication protocol for communication, the method further includes:
judging whether a protocol switch-back condition is met or not under the target communication protocol;
if the protocol switching-back condition is met, switching back to an original communication protocol from the target communication protocol for communication, wherein the original communication protocol is a communication protocol used before switching to the target communication protocol;
and if the protocol switch-back condition is not met, continuing to use the target communication protocol for communication.
Optionally, the determining whether the protocol back-cut condition is satisfied includes:
under the target communication protocol, after data replied by the lower computer is received for the first time, periodically acquiring a data reply rate according to a preset time interval;
if the data reply rate is greater than or equal to a second threshold value, determining that the protocol cut-back condition is met;
and if the data reply rate is smaller than the second threshold value, determining that the protocol switch-back condition is not met.
Optionally, the baud rate of the target communication protocol is lower than that of the current communication protocol, and the data content included in the format of the target communication protocol is less than that included in the format of the current communication protocol.
Optionally, the upper computer supports at least two levels of communication protocols, the formats of the communication protocols are different, and the level ordering is performed according to the anti-interference capability, and the higher the level of the communication protocol is, the stronger the anti-interference capability is.
Optionally, after switching from the current communication protocol to the target communication protocol for communication, the method further includes:
judging whether the target communication protocol meets the communication quality requirement or not;
if the target communication protocol does not meet the communication quality requirement, switching to a communication protocol with a higher level than the target communication protocol for communication;
and if the target communication protocol meets the communication quality requirement, continuing to use the target communication protocol for communication.
Optionally, after switching from the current communication protocol to the target communication protocol for communication, the method further includes: and if the target communication protocol is the highest-level communication protocol and the data replied by the lower computer are not received within the specified time, outputting communication fault prompt information and stopping the communication.
Optionally, the method further includes: and after the power is on, communication is carried out by using a specified communication protocol.
The embodiment of the invention also provides a communication method, which is applied to a lower computer and comprises the following steps:
in the communication process, judging whether the roll call of the upper computer is not received within continuous first preset time;
if yes, switching the communication protocol periodically according to a preset sequence;
if the switching stopping condition is met after the communication protocols are switched, the switching of the communication protocols is stopped, and the switched communication protocols are continuously used for communication;
wherein, the anti-interference capability of each communication protocol for switching is different.
Optionally, before the condition of stopping switching is met after the communication protocol is switched, the method further includes: after the communication protocols are switched, if the roll names of the upper computer are received within a second preset time, the switching stopping condition is determined to be met, wherein the second preset time is a protocol switching period.
Optionally, after the switching of the communication protocol is stopped and the switched communication protocol is continuously used for communication, the method further includes: if the roll call of the upper computer is not received within the appointed time, the communication fault prompt information is output and the machine is stopped.
Optionally, the method further includes: and after the power is on, communication is carried out by using a specified communication protocol.
Optionally, the interference resistance of the first communication protocol is higher than that of the second communication protocol, the baud rate of the first communication protocol is lower than that of the second communication protocol, and the data content included in the format of the first communication protocol is less than that included in the format of the second communication protocol.
Optionally, the lower computer supports at least two levels of communication protocols, the formats of the communication protocols are different, and the communication protocols are ranked according to the anti-interference capability, and the higher the rank of the communication protocol is, the stronger the anti-interference capability is.
The embodiment of the invention also provides a communication device, which is applied to an upper computer and comprises:
the first judging module is used for judging whether the current communication protocol meets the communication quality requirement or not in the communication process;
the first switching module is used for switching the current communication protocol to a target communication protocol for communication if the communication quality requirement is not met;
the anti-interference capability of the target communication protocol is higher than that of the current communication protocol.
The embodiment of the invention also provides a communication device, which is applied to a lower computer and comprises:
the second judgment module is used for judging whether the roll call of the upper computer is not received within the first preset time continuously in the communication process;
the second switching module is used for periodically switching the communication protocols according to a preset sequence from the current communication protocol if the current communication protocol is the current communication protocol;
the control module is used for stopping switching the communication protocols and continuously using the switched communication protocols for communication if the switching stopping conditions are met after the communication protocols are switched;
wherein, the anti-interference capability of each communication protocol for switching is different.
An embodiment of the present invention further provides an upper computer, including: the embodiment of the invention provides a communication device applied to an upper computer.
The embodiment of the present invention further provides a lower computer, including: the embodiment of the invention provides a communication device applied to a lower computer.
An embodiment of the present invention further provides a communication system, including: the upper computer and at least one lower computer are provided.
An embodiment of the present invention further provides a computer device, including: the communication method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the steps of the communication method applied to the upper computer in the embodiment of the invention are realized when the processor executes the computer program, or the steps of the communication method applied to the lower computer in the embodiment of the invention are realized.
The embodiment of the present invention further provides a non-volatile computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the communication method applied to the upper computer according to the embodiment of the present invention, or implements the steps of the communication method applied to the lower computer according to the embodiment of the present invention.
By applying the technical scheme of the invention, under the condition that the current communication protocol does not meet the communication quality requirement, the current communication protocol is switched to the communication protocol with higher anti-interference capability for communication, and the influence of interference on normal communication is reduced and the communication reliability is improved through the variable communication protocol.
Drawings
Fig. 1 is a flowchart of a communication method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a format of a conventional communication protocol according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a simplified communication protocol according to an embodiment of the present invention;
fig. 4 is a flowchart of a communication method according to a second embodiment of the present invention;
fig. 5 is a flowchart of protocol switching provided by the third embodiment of the present invention;
fig. 6 is a block diagram of a communication device according to a fourth embodiment of the present invention;
fig. 7 is a block diagram of a communication device according to a fifth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
Alternative embodiments of the present invention are described in detail below with reference to the accompanying drawings.
Example one
The embodiment provides a communication method which can be applied to an upper computer. Fig. 1 is a flowchart of a communication method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
s101, in the communication process, judging whether the current communication protocol meets the communication quality requirement.
And S102, if the communication quality requirement is not met, switching the current communication protocol to a target communication protocol for communication.
The anti-interference capability of the target communication protocol is higher than that of the current communication protocol.
If the current communication protocol used by the upper computer does not meet the communication quality requirement, the data transmitted is possibly interfered and tampered, and the communication protocol with higher anti-interference capability is switched to communicate, so that the influence of interference on normal communication can be reduced.
And if the current communication protocol used by the upper computer meets the communication quality requirement, continuing to use the current communication protocol for communication.
According to the embodiment, under the condition that the current communication protocol does not meet the communication quality requirement, the current communication protocol is switched to the communication protocol with higher anti-interference capability for communication, the influence of interference on normal communication is reduced through the variable communication protocol, and the communication reliability is improved.
In an optional embodiment, the determining whether the current communication protocol meets the communication quality requirement may be implemented by at least one of:
(1) under the current communication protocol, after data replied by the lower computer is received for the first time, periodically acquiring a data reply rate according to a preset time interval, and if the data reply rate is smaller than or equal to a first threshold value, determining that the current communication protocol does not meet the communication quality requirement;
(2) and timing communication faults under the current communication protocol, and if the data replied by the lower computer is not received within the continuous set time, determining that the current communication protocol does not meet the communication quality requirement, wherein the set time is less than the specified time, and the specified time is a time threshold value for determining the occurrence of the communication faults.
The preset time interval may be set according to an actual communication requirement, for example, the preset time interval may be a value greater than or equal to 10 min. The data reply rate is the ratio of the number of reply data frames received by the upper computer and sent by the lower computer to the number of roll call data frames sent by the upper computer within a preset time interval. The data recovery rate can reflect the communication interference condition in a period of time. The first threshold may be set according to actual demand, for example, the first threshold is set to 60%.
If the communication fault timing time reaches the specified time, the data replied by the lower computer is not received, that is, the data replied by the lower computer is not received within the specified time, the communication fault can be determined to occur, for example, the specified time can be a value greater than or equal to 3 min. The set time is less than the designated time, which can ensure that the communication protocol is switched for a period of time before the communication fault is determined. Preferably, the set time may be a time of-1.
The embodiment provides a plurality of modes for judging the communication quality, and can ensure that whether the current communication protocol meets the communication quality requirement can be judged accurately, quickly and reliably, thereby ensuring that the protocol is switched in time and reducing the influence of interference on data transmission.
In one embodiment, the baud rate of the target communication protocol is lower than the baud rate of the current communication protocol, and the format of the target communication protocol contains less data content than the format of the current communication protocol. That is, the amount of data transmitted by the target communication protocol is lower than the amount of data transmitted by the current communication protocol in the same time.
Taking the air conditioning unit as an example, the format of the conventional communication protocol used by the air conditioning unit is shown in fig. 2, and the format of the simplified communication protocol is shown in fig. 3. Interactive data in the simplified communication protocol is not complete unit data any more, the data can be compressed according to the change of the baud rate to be M% of the original data volume, the compression degree can be specifically determined according to the deletable data of the unit, and the data transmission adopts a lower communication baud rate and is changed to be M% of the baud rate of the conventional communication protocol.
When interference tampering occurs in high-rate data transmission, the data protocol is actively switched to a simplified data protocol and interaction is performed at a low rate, so that the influence of interference on data transmission can be weakened, and the communication reliability is improved. The data interaction efficiency is reduced due to the reduction of the baud rate of the communication protocol, the reduction of the data interaction efficiency caused by the reduction of the baud rate can be compensated to a certain extent by compressing data contents, the data interaction efficiency of the upper computer and the lower computer is basically kept unchanged, and the influence caused by interference is reduced while the interaction efficiency is guaranteed.
For example, it takes about 64ms to transmit 64Byte data at 9600bps baud rate before switching, the data is compressed to 8Byte after switching, the baud rate is reduced to 1200bps, and the data transmission time is about 64ms, which are similar, indicating that the data interaction efficiency is basically unchanged.
After switching from the current communication protocol to the target communication protocol for communication, the method further comprises the following steps: under the target communication protocol, judging whether a protocol back-cut condition is met; if the protocol switching-back condition is met, switching back to the original communication protocol from the target communication protocol for communication, wherein the original communication protocol is the communication protocol used before switching to the target communication protocol; and if the protocol switch-back condition is not met, continuing to use the target communication protocol for communication.
After the protocols are switched, according to the communication condition after the protocols are switched, under the condition that the protocol switching-back condition is met, the protocols are switched back to the original communication protocol in time, and data transmission is carried out according to the original communication protocol as far as possible, so that the data quantity of data interaction is improved, and the comprehensiveness of data transmission is ensured.
Further, determining whether the protocol back-cut condition is satisfied includes: under a target communication protocol, after data replied by a lower computer is received for the first time, periodically acquiring a data reply rate according to a preset time interval; if the data reply rate is greater than or equal to a second threshold value, determining that a protocol switch-back condition is met; and if the data reply rate is less than the second threshold value, determining that the protocol switching-back condition is not met.
The second threshold may be set according to actual requirements, and is greater than the first threshold, and preferably, the second threshold is greater than the first threshold by more than 20%. For example, the second threshold is set to 90%.
If the data recovery rate is greater than or equal to the second threshold, it indicates that the current communication quality is relatively stable, and may try to switch back to the communication protocol with the highest priority for communication, so as to increase the data volume of data interaction. If the data recovery rate is less than the second threshold, it indicates that there is still some interference in the current communication, and at this time, the current communication protocol can be continuously maintained to operate.
It should be noted that the switching of the communication protocol is not limited to the switching of the two-level protocol, and the switching can be performed in more levels of protocols to implement the protocol switching of higher protection levels.
In one embodiment, the upper computer supports at least two levels of communication protocols, the formats of the communication protocols are different, the communication protocols are ranked according to the anti-interference capacity, and the higher the level of the communication protocol is, the stronger the anti-interference capacity is.
The communication protocol supported and used by the upper computer can comprise: a regular communication protocol, a simplified communication protocol, and a protocol with a repair function. For example, in the case where the simplified communication protocol does not satisfy the communication quality requirement, the protocol having the repair function may be switched to perform communication.
The lower computer can also support the use of at least two-stage communication protocols, and the communication protocols supported by the upper computer and the lower computer for communication are the same, so that a receiver can be ensured to correctly analyze received data.
After switching from the current communication protocol to the target communication protocol for communication, the method further comprises the following steps: judging whether the target communication protocol meets the communication quality requirement or not; if the target communication protocol does not meet the communication quality requirement, switching to a communication protocol with a higher level than the target communication protocol for communication; and if the target communication protocol meets the communication quality requirement, continuing to use the target communication protocol for communication. The determination of the communication quality requirement is the same as the above-mentioned manner, and is not described in detail herein. And under the condition that the target communication protocol does not meet the communication quality requirement, the communication protocol is continuously switched to the communication protocol with higher level, the influence of interference on normal communication is further reduced by utilizing the variable communication protocol, and the communication reliability is improved.
In practical application, the protocol switching can be performed step by step according to the level sequence, and the protocol switching can also be performed according to the switching rule set by the user, without the necessity of step by step switching.
In one embodiment, after switching from the current communication protocol to the target communication protocol for communication, the method further includes: if the target communication protocol is the highest-level communication protocol (namely, the switching can not be continued any more) and the data replied by the lower computer is not received within the specified time, the communication fault prompt message is output and the lower computer is stopped, and the fault is repaired in time.
In one embodiment, after power-on, communication is performed using a specified communication protocol. For example, the use of conventional communication protocols may be specified.
Example two
The embodiment provides a communication method which can be applied to a lower computer. The same or corresponding terms as those in the above embodiments are explained, and detailed description is omitted here, for details, refer to embodiment one.
Fig. 4 is a flowchart of a communication method according to a second embodiment of the present invention, as shown in fig. 4, the method includes the following steps:
s401, in the communication process, judging whether the roll call of the upper computer is not received within continuous first preset time.
S402, if yes, starting from the current communication protocol, switching the communication protocol periodically according to a preset sequence.
And S403, if the switching stopping condition is met after the communication protocols are switched, stopping switching the communication protocols, and continuing to use the switched communication protocols for communication.
Wherein, the anti-interference capability of each communication protocol for switching is different.
The first preset time may be set according to actual conditions, for example, the first preset time may be set to 1 min. Because the protocol switching is automatically executed by the upper computer, the lower computer does not know when to switch, and therefore the protocol switching is automatically carried out after the roll call of the upper computer is not received for a period of time, so that the synchronization of the communication protocol between the lower computer and the upper computer is ensured.
The preset sequence can be protocol switching step by step according to the rank sequence, and can also be protocol switching according to the switching rule set by the user, and the protocol switching does not need to be step by step.
The protocol switching period for switching the communication protocol may be set according to actual conditions, and the protocol switching period is a time that can ensure that a plurality of roll call data frames are received, for example, the protocol switching period may be set to 10 s.
The lower computer of the embodiment automatically switches protocols under the condition that the roll call of the upper computer is not received within continuous first preset time, so that the communication protocols between the lower computer and the upper computer are synchronized, normal data transmission under the current communication protocol is realized, the influence of interference on normal communication is reduced through the variable communication protocol, and the communication reliability is improved.
Before the condition of stopping switching is met after the communication protocol is switched, the method further comprises the following steps: after the communication protocols are switched, if the roll name of the upper computer is received within a second preset time, which is the protocol switching period, and the communication protocols of the lower computer and the upper computer are synchronous, determining that the switching stopping condition is met. And if the roll name of the upper computer is not received within the second preset time and the switching stopping condition is not met, continuing to switch the protocol.
After stopping switching the communication protocol and continuing to use the switched communication protocol for communication, the method may further include: if the upper computer roll call is not received within the appointed time, the communication fault prompt information is output and the machine is shut down, and the fault is timely repaired.
In one embodiment, after power-on, communication is performed using a specified communication protocol. For example, the use of conventional communication protocols may be specified.
In one embodiment, the interference rejection capability of the first communication protocol is higher than the interference rejection capability of the second communication protocol, the baud rate of the first communication protocol is lower than the baud rate of the second communication protocol, and the format of the first communication protocol contains less data content than the format of the second communication protocol. That is, the amount of data transmitted by the first communication protocol is less than the amount of data transmitted by the second communication protocol at the same time.
When interference tampering occurs in high-rate data transmission, the data protocol is actively switched to a simplified data protocol and interaction is performed at a low rate, so that the influence of interference on data transmission can be weakened, and the communication reliability is improved. The data interaction efficiency is reduced due to the reduction of the baud rate of the communication protocol, the reduction of the data interaction efficiency caused by the reduction of the baud rate can be compensated to a certain extent by compressing data contents, the data interaction efficiency of the upper computer and the lower computer is basically kept unchanged, and the influence caused by interference is reduced while the interaction efficiency is guaranteed.
It should be noted that the switching of the communication protocol is not limited to the switching of the two-level protocol, and the switching can be performed in more levels of protocols to implement the protocol switching of higher protection levels.
In one embodiment, the lower computer supports at least two levels of communication protocols, the formats of the communication protocols are different, and the communication protocols are ranked according to the anti-interference capability, and the higher the rank of the communication protocol is, the stronger the anti-interference capability is.
The communication protocol supported and used by the lower computer can comprise: a regular communication protocol, a simplified communication protocol, and a protocol with a repair function.
The upper computer also supports at least two-stage communication protocols, and the communication protocols supported by the upper computer and the lower computer for communication are the same, so that a receiver can be ensured to correctly analyze received data.
EXAMPLE III
The above communication method is described below with reference to an embodiment, but it should be noted that the embodiment is only for better describing the present application and is not to be construed as limiting the present application. The same or corresponding terms as those of the above-described embodiments are explained, and the description of the present embodiment is omitted.
The present embodiment provides a communication scheme with a variable communication protocol, for example, to support two communication protocols, specifically referring to the conventional communication protocol shown in fig. 2 and the simplified communication protocol shown in fig. 3.
As shown in fig. 5, which is a flow chart of protocol switching, the protocol switching includes the following steps:
and S501, powering up.
And S502, the upper computer operates according to a conventional communication protocol, and the Baud rate is Abps.
And S503, the upper computer judges whether the data reply rate is less than or equal to X% and/or the data replied by the lower computer is not received in N-1 min, if so, the operation enters S504, and if not, the operation returns to S502 for continuous operation.
And S504, switching the upper computer to the simplified communication protocol for operation.
S505, judging whether the data recovery rate is larger than or equal to Y%, if so, returning to S502 to switch back to the operation of the conventional communication protocol, otherwise, entering S506.
And S506, the upper computer maintains the operation of the simplified communication protocol.
And S507, the lower computer operates according to a conventional communication protocol, and the Baud rate is Abps.
And S508, judging whether the upper computer roll call is not received within 1 minute, if so, entering S509, otherwise, returning to S507 to continue operation.
S509, the protocol is switched every 10S.
And S510, judging whether the roll call of the upper computer is received within 10S after the protocol is switched, if so, entering S511, otherwise, returning to S509 to continue switching the protocol.
And S511, maintaining the operation of the current communication protocol.
S512, judging whether the data is not received in N minutes, if so, entering S513, otherwise, returning to S506 and S511.
And S513, communication fault shutdown is performed.
When the unit is powered on, data interaction is carried out according to a conventional communication protocol by default, and the communication baud rate is Abps. And the upper computer counts the data recovery rate in real time and synchronously starts communication fault timing (if the lower computer data is not received in N minutes, the communication fault is judged, and N is greater than or equal to 3). And when the upper computer judges that the data recovery rate is less than or equal to X percent (equivalent to the first threshold value) and/or the communication fault timing reaches N-1 min, triggering the communication protocol switching of the upper computer and the lower computer.
The interactive data in the switched communication protocol is no longer complete unit data, and can be compressed according to the change of the baud rate to be M% of the original data volume. And the data transmission adopts a lower communication baud rate and is changed into M% of the Abps, so that the efficiency of data interaction between the upper computer and the lower computer can be basically kept unchanged.
After the communication protocol switching is completed, the upper computer restarts the communication fault timing, and the data recovery rate is counted again after the lower computer receives the new protocol recovery for the first time.
If the data recovery rate within a period of time T (equivalent to the preset time interval) is greater than or equal to Y% (equivalent to the second threshold), it is proved that the current communication quality is relatively stable, and the upper computer can try to switch to a conventional communication protocol for communication, so as to improve the data volume of data interaction.
If the data recovery rate does not reach Y% in a period of time T, the current communication is proved to have certain interference, and at the moment, the simplified communication protocol can be continuously maintained to operate, and meanwhile, the data recovery rate statistics of the time T is restarted.
If the upper computer still cannot receive the reply of the lower computer within N minutes, the communication fault is reported and the machine is stopped for processing.
If the lower computer does not receive the roll call of the upper computer for 1 minute (equivalent to the first preset time), the protocol is actively switched every 10 seconds (equivalent to the second preset time, namely the protocol switching period), and the switching is stopped after the roll call of the upper computer is received.
The embodiment provides a variable communication protocol scheme, an upper computer dynamically identifies the current communication quality, when the data recovery rate and/or the communication fault timing indicate that the communication quality requirement is not met, the current conventional communication protocol is switched to a simplified communication protocol, only basic parameters required by the unit operation are reserved, the data transmission rate is synchronously reduced, the fault tolerance is improved, the interaction efficiency of the unit is guaranteed, and meanwhile, the influence caused by interference is reduced. Through the condition switching of the conventional communication protocol and the simplified communication protocol, after interference tampering occurs in high-rate data transmission, the data can be actively switched to the simplified data protocol and interacted at a lower rate, the influence of the interference on the data transmission is weakened, and the reliability of a unit is improved.
Of course, the present invention is not limited to two-level protocol switching, and can also perform protocol switching of higher protection level under the condition that the simplified communication protocol is abnormal.
Example four
Based on the same inventive concept, the present embodiment provides a communication device, which can be applied to an upper computer and can be used to implement the communication method of the upper computer side described in the first embodiment. The communication means may be implemented by software and/or hardware.
Fig. 6 is a block diagram of a communication device according to a fourth embodiment of the present invention, and as shown in fig. 6, the communication device includes:
the first judging module 61 is configured to judge whether a current communication protocol meets a communication quality requirement in a communication process;
the first switching module 62 is configured to switch the current communication protocol to a target communication protocol for communication if the communication quality requirement is not met;
the anti-interference capability of the target communication protocol is higher than that of the current communication protocol.
Optionally, the first determining module 61 is specifically configured to:
under the current communication protocol, after data replied by a lower computer is received for the first time, periodically acquiring a data reply rate according to a preset time interval, and if the data reply rate is smaller than or equal to a first threshold value, determining that the current communication protocol does not meet the communication quality requirement; and/or the presence of a gas in the gas,
and timing communication faults under the current communication protocol, and if the data replied by the lower computer is not received within the continuous set time, determining that the current communication protocol does not meet the communication quality requirement, wherein the set time is less than the specified time, and the specified time is a time threshold value for determining the occurrence of the communication faults.
Optionally, the communication device further includes:
the back-cut control module is used for judging whether a protocol back-cut condition is met or not under a target communication protocol after the current communication protocol is switched to the target communication protocol for communication; if the protocol switching-back condition is met, switching back to an original communication protocol from the target communication protocol for communication, wherein the original communication protocol is a communication protocol used before switching to the target communication protocol; and if the protocol switch-back condition is not met, continuing to use the target communication protocol for communication.
Optionally, the cut-back control module includes:
the acquisition unit is used for periodically acquiring the data reply rate according to a preset time interval after receiving the data replied by the lower computer for the first time under the target communication protocol;
a first determining unit, configured to determine that the protocol cut-back condition is satisfied if the data recovery rate is greater than or equal to a second threshold;
a second determining unit, configured to determine that the protocol cut-back condition is not satisfied if the data recovery rate is smaller than the second threshold.
Optionally, the baud rate of the target communication protocol is lower than that of the current communication protocol, and the data content included in the format of the target communication protocol is less than that included in the format of the current communication protocol.
Optionally, the upper computer supports at least two levels of communication protocols, the formats of the communication protocols are different, and the level ordering is performed according to the anti-interference capability, and the higher the level of the communication protocol is, the stronger the anti-interference capability is.
Optionally, the communication device further includes:
the third switching module is used for judging whether the target communication protocol meets the communication quality requirement or not after the current communication protocol is switched to the target communication protocol for communication; if the target communication protocol does not meet the communication quality requirement, switching to a communication protocol with a higher level than the target communication protocol for communication; and if the target communication protocol meets the communication quality requirement, continuing to use the target communication protocol for communication.
Optionally, the communication device further includes:
and the first processing module is used for outputting communication fault prompt information and stopping the communication if the target communication protocol is the highest-level communication protocol and does not receive data replied by the lower computer within a specified time after the current communication protocol is switched to the target communication protocol for communication.
Optionally, the communication device further includes: and the first communication module is used for carrying out communication by using a specified communication protocol after being electrified.
The communication device can execute the communication method of the upper computer side provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided in the first embodiment of the present invention.
EXAMPLE five
Based on the same inventive concept, the present embodiment provides a communication device, which can be applied to a lower computer and can be used to implement the communication method of the lower computer side described in the second embodiment. The communication means may be implemented by software and/or hardware.
Fig. 7 is a block diagram of a communication device according to a fifth embodiment of the present invention, and as shown in fig. 7, the communication device includes:
the second judging module 71 is configured to judge whether the roll call of the upper computer is not received within a first preset time in the communication process;
a second switching module 72, configured to, if yes, periodically switch the communication protocols according to a preset sequence from the current communication protocol;
the control module 73 is configured to stop switching the communication protocols and continue to use the switched communication protocols for communication if the conditions for stopping switching are met after the communication protocols are switched;
wherein, the anti-interference capability of each communication protocol for switching is different.
Optionally, the communication device further includes:
the determining module is used for determining that the switching stopping condition is met if the roll name of the upper computer is received within a second preset time after the communication protocol is switched and before the switching stopping condition is met after the communication protocol is switched, wherein the second preset time is a protocol switching period.
Optionally, the communication device further includes:
and the second processing module is used for outputting communication fault prompt information and stopping the communication if the roll call of the upper computer is not received within the specified time after the switching of the communication protocols is stopped and the switched communication protocols are continuously used for communication.
Optionally, the communication device further includes: and the second communication module is used for carrying out communication by using a specified communication protocol after being electrified.
Optionally, the interference resistance of the first communication protocol is higher than that of the second communication protocol, the baud rate of the first communication protocol is lower than that of the second communication protocol, and the data content included in the format of the first communication protocol is less than that included in the format of the second communication protocol.
Optionally, the lower computer supports at least two levels of communication protocols, the formats of the communication protocols are different, and the communication protocols are ranked according to the anti-interference capability, and the higher the rank of the communication protocol is, the stronger the anti-interference capability is.
The communication device can execute the communication method of the lower computer side provided by the second embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. For details of the communication method provided in the embodiment of the present invention, reference may be made to the technical details not described in detail in the embodiment.
EXAMPLE six
This embodiment provides a host computer, includes: the communication device according to the fourth embodiment.
This embodiment still provides a next machine, includes: the communication device according to the fifth embodiment.
EXAMPLE seven
The present embodiment provides a communication system, including: the upper computer of the above embodiment and at least one lower computer of the above embodiment.
Example eight
The present embodiment provides a computer device, including: the communication method comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor implements the steps of the communication method of the first embodiment or implements the steps of the communication method of the second embodiment when executing the computer program.
Example nine
The present embodiment provides a non-transitory computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the communication method according to the above embodiment, or implements the steps of the communication method according to the second embodiment.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (22)

1. A communication method is characterized by being applied to an upper computer and comprising the following steps:
in the communication process, judging whether the current communication protocol meets the communication quality requirement;
if the communication quality requirement is not met, switching the current communication protocol to a target communication protocol for communication;
the anti-interference capability of the target communication protocol is higher than that of the current communication protocol.
2. The method of claim 1, wherein determining whether the current communication protocol satisfies the communication quality requirement comprises:
under the current communication protocol, after data replied by a lower computer is received for the first time, periodically acquiring a data reply rate according to a preset time interval, and if the data reply rate is smaller than or equal to a first threshold value, determining that the current communication protocol does not meet the communication quality requirement; and/or the presence of a gas in the gas,
and timing communication faults under the current communication protocol, and if the data replied by the lower computer is not received within the continuous set time, determining that the current communication protocol does not meet the communication quality requirement, wherein the set time is less than the specified time, and the specified time is a time threshold value for determining the occurrence of the communication faults.
3. The method of claim 1, further comprising, after switching from the current communication protocol to a target communication protocol for communication:
judging whether a protocol switch-back condition is met or not under the target communication protocol;
if the protocol switching-back condition is met, switching back to an original communication protocol from the target communication protocol for communication, wherein the original communication protocol is a communication protocol used before switching to the target communication protocol;
and if the protocol switch-back condition is not met, continuing to use the target communication protocol for communication.
4. The method of claim 3, wherein determining whether a protocol cut-back condition is satisfied comprises:
under the target communication protocol, after data replied by the lower computer is received for the first time, periodically acquiring a data reply rate according to a preset time interval;
if the data reply rate is greater than or equal to a second threshold value, determining that the protocol cut-back condition is met;
and if the data reply rate is smaller than the second threshold value, determining that the protocol switch-back condition is not met.
5. The method of claim 1, wherein the baud rate of the target communication protocol is lower than the baud rate of the current communication protocol, and the format of the target communication protocol comprises less data content than the format of the current communication protocol.
6. The method according to any one of claims 1 to 5, wherein the upper computer supports at least two levels of communication protocols, each communication protocol having a different format and being ranked in order of interference rejection, the higher the level of the communication protocol, the greater the interference rejection.
7. The method of claim 6, further comprising, after switching from the current communication protocol to the target communication protocol for communication:
judging whether the target communication protocol meets the communication quality requirement or not;
if the target communication protocol does not meet the communication quality requirement, switching to a communication protocol with a higher level than the target communication protocol for communication;
and if the target communication protocol meets the communication quality requirement, continuing to use the target communication protocol for communication.
8. The method of claim 6, further comprising, after switching from the current communication protocol to the target communication protocol for communication:
and if the target communication protocol is the highest-level communication protocol and the data replied by the lower computer are not received within the specified time, outputting communication fault prompt information and stopping the communication.
9. The method of any one of claims 1 to 8, further comprising:
and after the power is on, communication is carried out by using a specified communication protocol.
10. A communication method is characterized by being applied to a lower computer and comprising the following steps:
in the communication process, judging whether the roll call of the upper computer is not received within continuous first preset time;
if yes, starting from the current communication protocol, and periodically switching the communication protocols according to a preset sequence;
if the switching stopping condition is met after the communication protocols are switched, the switching of the communication protocols is stopped, and the switched communication protocols are continuously used for communication;
wherein, the anti-interference capability of each communication protocol for switching is different.
11. The method of claim 10, further comprising, before the stop-switching condition is satisfied after switching the communication protocol:
after the communication protocols are switched, if the roll names of the upper computer are received within a second preset time, the switching stopping condition is determined to be met, wherein the second preset time is a protocol switching period.
12. The method of claim 10, further comprising, after ceasing to switch the communication protocol and continuing to use the switched communication protocol for communication:
if the roll call of the upper computer is not received within the appointed time, the communication fault prompt information is output and the machine is stopped.
13. The method of claim 10, further comprising:
and after the power is on, communication is carried out by using a specified communication protocol.
14. The method of claim 10, wherein a first communication protocol has a higher interference rejection than a second communication protocol, wherein a baud rate of the first communication protocol is lower than a baud rate of the second communication protocol, and wherein a format of the first communication protocol comprises less data content than a format of the second communication protocol.
15. The method according to any one of claims 10 to 14, wherein the lower computer supports at least two levels of communication protocols, each communication protocol having a different format and being ranked in order of interference rejection, the higher the level of the communication protocol, the greater the interference rejection.
16. The utility model provides a communication device which characterized in that is applied to the host computer, includes:
the first judging module is used for judging whether the current communication protocol meets the communication quality requirement or not in the communication process;
the first switching module is used for switching the current communication protocol to a target communication protocol for communication if the communication quality requirement is not met;
the anti-interference capability of the target communication protocol is higher than that of the current communication protocol.
17. The utility model provides a communication device which characterized in that is applied to the next machine, includes:
the second judgment module is used for judging whether the roll call of the upper computer is not received within the first preset time continuously in the communication process;
the second switching module is used for periodically switching the communication protocols according to a preset sequence from the current communication protocol if the current communication protocol is the current communication protocol;
the control module is used for stopping switching the communication protocols and continuously using the switched communication protocols for communication if the switching stopping conditions are met after the communication protocols are switched;
wherein, the anti-interference capability of each communication protocol for switching is different.
18. A host computer, comprising: the communication device of claim 16.
19. A lower computer, comprising: the communication device of claim 17.
20. A communication system, comprising: the upper computer of claim 18 and at least one lower computer of claim 19.
21. A computer device, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 9 or the steps of the method according to any one of claims 10 to 15 when executing the computer program.
22. A non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements the steps of the method of any one of claims 1 to 9 or the steps of the method of any one of claims 10 to 15.
CN202111333721.0A 2021-11-11 2021-11-11 Communication method, device and system, upper computer and lower computer Pending CN114095363A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111333721.0A CN114095363A (en) 2021-11-11 2021-11-11 Communication method, device and system, upper computer and lower computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111333721.0A CN114095363A (en) 2021-11-11 2021-11-11 Communication method, device and system, upper computer and lower computer

Publications (1)

Publication Number Publication Date
CN114095363A true CN114095363A (en) 2022-02-25

Family

ID=80299912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111333721.0A Pending CN114095363A (en) 2021-11-11 2021-11-11 Communication method, device and system, upper computer and lower computer

Country Status (1)

Country Link
CN (1) CN114095363A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050182847A1 (en) * 2004-01-21 2005-08-18 Dell Products L.P. System and method for dynamic switching between wireless network protocols
CN108224680A (en) * 2017-12-07 2018-06-29 珠海格力电器股份有限公司 The air-conditioning internal-external machine means of communication, device, storage medium and air-conditioning
CN110138810A (en) * 2019-06-28 2019-08-16 阳光电源股份有限公司 Communications protocol switching method and system
CN111224999A (en) * 2020-01-21 2020-06-02 安徽文香信息技术有限公司 Transmission protocol switching method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050182847A1 (en) * 2004-01-21 2005-08-18 Dell Products L.P. System and method for dynamic switching between wireless network protocols
CN108224680A (en) * 2017-12-07 2018-06-29 珠海格力电器股份有限公司 The air-conditioning internal-external machine means of communication, device, storage medium and air-conditioning
CN110138810A (en) * 2019-06-28 2019-08-16 阳光电源股份有限公司 Communications protocol switching method and system
CN111224999A (en) * 2020-01-21 2020-06-02 安徽文香信息技术有限公司 Transmission protocol switching method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN102638417B (en) The communication means of information, Apparatus and system
CN102868560A (en) System and method for realizing hot standby of servers
CN110601945A (en) Dual-redundancy CAN bus communication system and communication method
US10803004B2 (en) Modular UPS system and data transmission method for power device
CN110011926B (en) Method, device, equipment and storage medium for adjusting message sending time
CN104092822A (en) Mobile phone state switching method and system based on face detection and eyeball tracking
CN103560898A (en) Port state setting method, and port priority selection method and device
CN108847958A (en) Monitoring of tools management method, device, computer equipment and storage medium
CN110457176A (en) For the monitoring method of distributed system, device, storage medium and electronic equipment
CN110519727A (en) Data processing method and CGW based on central gateway CGW
CN114357495A (en) Prediction machine under-chain aggregation method, device, equipment and medium based on block chain
CN101667942B (en) The control method of home gateway and device
CN114095363A (en) Communication method, device and system, upper computer and lower computer
CN104580523B (en) Self-aided terminal supervising data storage method and self-aided terminal monitoring server
CN105517025A (en) Terminal state processing method and terminal state processing device
CN109215299A (en) A kind of intelligent electric appliance early warning system
CN103037422B (en) Dynamic adaptive service recovery method and dynamic adaptive service recovery device for mobile ad hoc network
CN102594696B (en) A kind of method and device managing network device link aggregation group
CN104954148B (en) Control method, device and the router of node device
CN116546079A (en) Method and device for data interaction, electronic device and interaction system
CN105721231B (en) A kind of quality of service perception detection method and device
CN101771975B (en) Fault-tolerance processing method and terminal of long short message
CN106293996B (en) Method of data synchronization, main equipment, alternate device and system
CN107977068A (en) The method, apparatus and terminal of a kind of delay display of terminal
CN108170527B (en) Remote multi-activity distributed message consumption method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20220225