A communication method, apparatus and system

By carrying device data, reception status identifiers, and queue length during communication, and dynamically adjusting the message sending interval, the problem of low communication efficiency is solved, achieving efficient inter-device communication and resource conservation.

CN116133156BActive Publication Date: 2026-01-20GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211662720.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2026-01-20
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

Existing communication methods are inefficient and the fixed data transmission frequency leads to resource waste.

Method used

By carrying device data, reception status identifiers, and queue length during communication, and dynamically adjusting the message sending interval, efficient communication between devices can be achieved.

Benefits of technology

It improves communication efficiency between devices, reduces communication pressure, and saves resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116133156B_ABST
    Figure CN116133156B_ABST
Patent Text Reader

Abstract

The application provides a communication method, device and system. The communication method is applied to a first device and includes the following steps: sending a first message to a second device, wherein the first message carries first device data, a first receiving state identifier and a first device queue length, the first receiving state identifier is used to identify whether the first device successfully receives a message sent by the second device in a previous round; and receiving a response message sent by the second device in response to the first message, wherein the response message carries second device data, a second receiving state identifier and a second device queue length, the second receiving state identifier is used to identify whether the second device successfully receives the first message. By carrying device data, a receiving state identifier and a queue length in a sent message, the application effectively solves the technical problem of low communication efficiency in the related art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of communication, in particular to a communication method, device and system. BACKGROUND

[0002] The existing communication generally adopts that a first device sends first device data, and a second device responds; the second device sends second device data, and the first device responds to perform single-step communication, which has low communication efficiency. Therefore, there is an urgent need for an efficient communication mode. SUMMARY

[0003] The present application aims to overcome the above technical deficiencies, and provides a communication method, device and system to solve the technical problem of low communication efficiency in related technologies.

[0004] To achieve the above technical purposes, the present application adopts the following technical solutions:

[0005] According to one aspect of the present application, a communication method is provided, applied to a first device, and the method comprises: sending a first message to a second device, wherein the first message carries first device data, a first receiving state identifier and a first device queue length, the first receiving state identifier is used to identify whether the first device successfully receives a message sent by the second device in the last round; receiving a response message sent by the second device in response to the first message, wherein the response message carries second device data, a second receiving state identifier and a second device queue length, the second receiving state identifier is used to identify whether the second device successfully receives the first message.

[0006] Optionally, the method further comprises: determining a message sending time interval for sending a second message according to the first device queue length and the second device queue length; and sending the second message to the second device according to the message sending time interval.

[0007] Optionally, the determination of the message sending time interval for sending the second message according to the first device queue length and the second device queue length comprises: calculating the message sending time interval according to the following formula: T =Tmax / (An+Bn), wherein Tmax is a preset maximum message sending time interval, An is the first device queue length, Bn is the second device queue length, wherein An and Bn are not 0 at the same time.

[0008] Optionally, the determination of the message sending time interval for sending the second message according to the first device queue length and the second device queue length comprises: in the case that the first device queue length and the second device queue length are both 0, determining the preset maximum message sending time interval as the message sending time interval for sending the second message.

[0009] Optionally, the determining the message sending time interval for sending the second message according to the first device queue length and the second device queue length comprises: updating the second device queue length according to the second receiving state identifier to obtain an updated second device queue length; and determining the message sending time interval for sending the second message according to the updated second device queue length and the first device queue length.

[0010] Optionally, in the case that the first message is a message sent by the first device to the second device for the first time and the second device has not sent any message to the first device, the empty message is determined as the message sent by the second device in the last round.

[0011] According to another aspect of the present application, there is also provided a communication device applied to a first device, the device comprising: a first message sending unit configured to send a first message to a second device, the first message carrying first device data, a first receiving state identifier and a first device queue length, the first receiving state identifier being used to identify whether the first device successfully receives a message sent by the second device in the last round; and a response message receiving unit configured to receive a response message sent by the second device in response to the first message, the response message carrying second device data, a second receiving state identifier and a second device queue length, the second receiving state identifier being used to identify whether the second device successfully receives the first message.

[0012] Optionally, the device further comprises: a time interval determining unit configured to determine a message sending time interval for sending a second message according to the first device queue length and the second device queue length; and a second message sending unit configured to send the second message to the second device according to the message sending time interval.

[0013] Optionally, the time interval determining unit is further configured to calculate the message sending time interval according to the following formula: T = Tmax / (An+Bn), wherein Tmax is a preset maximum message sending time interval, An is the first device queue length, and Bn is the second device queue length, wherein An and Bn are not equal to 0 at the same time.

[0014] According to another aspect of the present application, there is also provided a communication system comprising: a first device configured to send a first message to a second device, the first message carrying first device data, a first reception status identifier and a first device queue length, the first reception status identifier being used to identify whether the first device successfully received a message sent by the second device in a previous round; and the second device configured to send a response message to the first device in response to the first message, the response message carrying second device data, a second reception status identifier and a second device queue length, the second reception status identifier being used to identify whether the second device successfully received the first message.

[0015] The present application provides a communication method. The method is applied to a first device, and comprises the following steps: sending a first message to a second device, the first message carrying first device data, a first reception status identifier and a first device queue length, the first reception status identifier being used to identify whether the first device successfully received a message sent by the second device in a previous round; and receiving a response message sent by the second device in response to the first message, the response message carrying second device data, a second reception status identifier and a second device queue length, the second reception status identifier being used to identify whether the second device successfully received the first message. By carrying device data, a reception status identifier and a queue length in a sent message, the technical problem of low communication efficiency in the prior art is effectively solved. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 Fig. 1 is a schematic diagram of a communication method according to an embodiment of the present application;

[0017] Figure 2 Fig. 2 is a schematic diagram of another communication method according to an embodiment of the present application;

[0018] Figure 3 Fig. 3 is a schematic diagram of a communication device according to an embodiment of the present application. DETAILED DESCRIPTION

[0019] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative work should fall within the scope of protection of the present application.

[0020] Embodiment one

[0021] According to an embodiment of the present application, there is provided a communication method. Please refer to Fig. 1, which is a schematic diagram of a communication method according to an embodiment of the present application. Figure 1The method can be executed by the first device. The first device can be a master device or a slave device. The method can include:

[0022] In step S101, a first message is sent to a second device, wherein the first message carries first device data, a first receiving state identifier and a first device queue length, and the first receiving state identifier is used to identify whether the first device successfully receives a message sent by the second device in a previous round.

[0023] In this step, the first device data is used to represent the device state of the first device.

[0024] In this step, the first device queue length represents the length of a queue in which data to be sent by the first device to the second device is arranged. Specifically, the data to be sent by the first device to the second device is arranged in a queue and sent to the second device one by one.

[0025] In this step, the first device can be a master device or a slave device.

[0026] In this step, in the case where the message sent in the previous round does not exist, an empty message can be used as the message sent in the previous round.

[0027] In step S102, a response message sent by the second device in response to the first message is received, wherein the response message carries second device data, a second receiving state identifier and a second device queue length, and the second receiving state identifier is used to identify whether the second device successfully receives the first message.

[0028] In this step, the second device data is used to represent the device state of the second device.

[0029] In this step, the second device queue length represents the length of a queue in which data to be sent by the second device to the first device is arranged. Specifically, the data to be sent by the second device to the first device is arranged in a queue and sent to the first device one by one.

[0030] In this embodiment, the data sent by both parties contains not only the state data of the two parties but also the handshake data of the two parties, so that the handshake efficiency and the data interaction efficiency of the two parties can be improved.

[0031] The embodiment provides the following technical solutions: sending a first message to a second device, wherein the first message carries device data of the first device, a first receiving state identifier and a first device queue length, the first receiving state identifier is used for identifying whether the first device successfully receives a message sent by the second device in a previous round; and receiving a response message sent by the second device in response to the first message, wherein the response message carries device data of the second device, a second receiving state identifier and a second device queue length, the second receiving state identifier is used for identifying whether the second device successfully receives the first message, and by carrying device data, a receiving state identifier and a queue length in a sent message, the technical problem of low communication efficiency in the prior art is effectively solved.

[0032] Optionally, the method further comprises: determining a message sending time interval for sending a second message according to the first device queue length and the second device queue length; and sending the second message to the second device according to the message sending time interval. In the embodiment, the communication sending frequency of the first device (or the second device) can be automatically adjusted according to the queue lengths of the two parties, and the communication pressure can be reduced. The problem that the sending frequency of data is fixed and cannot be automatically adjusted, and communication resources are wasted when the data of the two parties is stable is solved.

[0033] Optionally, the determining of the message sending time interval for sending the second message according to the first device queue length and the second device queue length comprises: calculating the message sending time interval according to the following formula: T =Tmax / (An+Bn), wherein Tmax is a preset maximum message sending time interval, An is the first device queue length, Bn is the second device queue length, An and Bn are not 0 at the same time. In the embodiment, the preset maximum message sending time interval Tmax can be specified according to specific needs of a user, and is not limited herein. The method can effectively adjust the communication sending frequency between the first device and the second device, and the communication pressure can be reduced.

[0034] Optionally, the determining of the message sending time interval for sending the second message according to the first device queue length and the second device queue length comprises: in the case that the first device queue length and the second device queue length are both 0, determining the preset maximum message sending time interval as the message sending time interval for sending the second message. In the embodiment, in the case that the queue lengths of the two parties are both 0, that is, there is no data to be sent in the queue, the preset maximum message sending time interval can be used, and the communication resources are further saved.

[0035] Optionally, the determining the message sending time interval for sending the second message according to the first device queue length and the second device queue length comprises: updating the second device queue length according to the second receiving state identifier to obtain an updated second device queue length; and determining the message sending time interval for sending the second message according to the updated second device queue length and the first device queue length. In this embodiment, the first device can update the second device queue length according to the second receiving state identifier to obtain the latest second device queue length, and then can make an accurate decision on the next sending time interval based on this.

[0036] Optionally, in the case that the first message is a message sent by the first device to the second device for the first time and the second device has not sent a message to the first device, an empty message is determined as the message sent by the second device in the last round. In this embodiment, in the first round of communication, since the second device has not sent a message to the first device, the successful reception of the empty message can be used as an identifier carried in the first message, thereby providing a flexible and simple data operation mode.

[0037] Embodiment two

[0038] Figure 2 is a schematic diagram of another communication method provided by the embodiment of the application, as shown in Figure 2 , in the communication of the method, the host initiates communication to the slave, and the slave returns the slave state data and the slave queue length when responding, the host determines the time for the host to send data next time according to the host queue length and the slave queue length. Since the lengths of the host queue and the slave queue are different, the time for the host to send data is different, and the communication sending frequency of the host can be automatically adjusted. The sending time T0 of the host, the receiving interval time coefficient k, and the maximum communication time interval Tmax can be set according to the communication requirements of both parties. The host carries the receiving state of the host receiving the data of the slave in the sent data, and the slave carries the receiving state of the slave receiving the data of the host in the sent data. This mode integrates the sent data and the response state into one data packet, and this method can improve the data communication efficiency.

[0039] Specifically, referring to Figure 2 , the host and the slave have performed multiple rounds of communication. The sending time T0 of the host, the receiving time kT0 of the slave, the receiving interval time coefficient k, the minimum communication time interval Tmin = (2+2k)*T0, the maximum communication time interval Tmax, and T = Tmax / (An+Bn) are shown in the figure. An represents the total number of the host queue, and Bn represents the total number of the slave queue. For example, k = 0.25, T0 = 10 ms, Tmin = (2+2k)*T0 = 25 ms, and Tmax = 1 s.

[0040] In this embodiment, it is assumed that the time for the master or slave to send a data packet is T=10 ms, the fastest communication interval for the master or slave to send two data packets is set to Tmin=2.5*T=25 ms, and fmax=1 / Tm=40 Hz. Specifically, 2.5*T is obtained in the following manner: master sending time T + slave receiving time 0.25T + slave sending time T + master receiving time 0.25T. When there is no change in data on both sides, the lowest frequency fmin=1 / Tmax (where Tmax is set to 1 s) is used for sending.

[0041] The first round of communication is as follows:

[0042] When communication is started, it is assumed that there are 3 pieces of data on the master side to be sent to the slave, and there are 0 pieces of data on the slave side, because the slave data has not been obtained. Because the master uses the highest communication frequency for the first time, the next data packet sending time interval is 25 ms. At this time, the master sends state A1 data and the total number of master queue is 3, and simultaneously responds to the slave with a successful slave data receiving flag.

[0043] After the slave receives the data, because it is the first time to establish communication, all states are pushed into the sending queue, and the slave responds to the master with a slave state data B1 and a slave queue total number of 3, and simultaneously responds to the master with a successful master data receiving flag.

[0044] The second round of communication is as follows:

[0045] After the master sends the first round of data for 25 ms, the first round of data from the slave is received, and the master knows that the slave queue length is 3. Because the slave receives successfully, the master queue still has 2 pieces of data at this time, so the next data packet sending time interval is 1 s / (2+3)=200 ms. At this time, the master sends state A2 data and the total number of master queue is 2, and simultaneously responds to the slave with a failed slave data receiving flag.

[0046] After the slave receives the data, because the master receives unsuccessfully, the slave queue length is still 3, and the slave state data B1 and the slave queue total number of 3 are re-sent, and simultaneously a successful master data receiving flag is responded to the master.

[0047] The third round of communication is as follows:

[0048] After the master sends the second round of data for 200 ms, the second round of data from the slave is received, and the master knows that the slave queue length is 3. Because the slave receives successfully, the master queue has 1 piece of data at this time, so the next data packet sending time interval is 1 s / (1+3)=250 ms. At this time, the master sends state A3 data and the total number of master queue is 1, and simultaneously responds to the slave with a successful slave data receiving flag.

[0049] After receiving the data from the slave, the slave responds with slave state data B2 and a total number of slave queues of 2, while responding to the host with a data reception failure flag.

[0050] The fourth round of communication is as follows:

[0051] After the host sends the third round of data for 250 ms, the host receives the third round of data from the slave, and knows that the length of the queue of the slave is 2. Since the slave fails to receive, the remaining data in the queue of the host is 1 at this moment, so the time interval for sending the next data packet is 1s / (1+2)=330 ms. At this moment, the host sends state A3 and a total number of host queues of 1, while responding to the slave with a data reception success flag.

[0052] After receiving the data from the slave, the slave responds with slave state data B1 and a total number of slave queues of 1, while responding to the host with a data reception success flag.

[0053] The fifth round of communication is as follows:

[0054] After the host sends the fourth round of data for 330 ms, the host receives the fourth round of data from the slave, and knows that the length of the queue of the slave is 1. At this moment, the remaining data in the queue of the host is 0, so the time interval for sending the next data packet is 1s / (1+0)=1s. At this moment, the host sends state A 空 and a total number of host queues of 0, while responding to the slave with a data reception success flag.

[0055] After receiving the data from the slave, the slave responds with slave state data B 空 and a total number of slave queues of 0, while responding to the host with a data reception success flag.

[0056] The sixth round of communication is as follows:

[0057] After the host sends the fifth round of data for 1s, the host receives the fifth round of data from the slave, and knows that the length of the queue of the slave is 0. At this moment, the remaining data in the queue of the host is 0, so the time interval for sending the next data packet is Tmax=1s. At this moment, the host sends state A

[0058] After receiving the data from the slave, the slave responds with slave state data B

[0059] The above is only an example, and subsequent communication processes are similar, and can be specifically referred to Figure 2 , which will not be described here.

[0060] The above embodiment can automatically mediate the host communication sending frequency according to the return queue length of both sides, and can reduce the communication pressure; the data sent by both sides simultaneously contains the state data of itself and the handshake data of both sides, which aims to improve the handshake and data interaction efficiency of both sides; and the data type of the data packet can be accurately positioned according to the master-slave keyword, and the controllability of the data interaction of both sides can be improved. The problems of low communication efficiency caused by the single-step communication mode that the host sends host data, the slave responds, the slave sends slave data, and the host responds are solved, and the problem of waste of communication resources caused by the fixed frequency of host data sending and the inability to automatically mediate is solved. The embodiment provides a mode that takes into account efficiency and saves communication resources.

[0061] Embodiment three

[0062] Figure 3 It is a schematic diagram of a communication device provided by the embodiment of the application, which can be applied to a first device, which can be a host or a slave, as shown in Figure 3 The device comprises:

[0063] A first message sending unit 30 is configured to send a first message to a second device, wherein the first message carries first device data, a first receiving state identifier and a first device queue length, and the first receiving state identifier is used to identify whether the first device successfully receives a message sent by the second device in the last round;

[0064] A response message receiving unit 31 is configured to receive a response message sent by the second device in response to the first message, wherein the response message carries second device data, a second receiving state identifier and a second device queue length, and the second receiving state identifier is used to identify whether the second device successfully receives the first message.

[0065] Optionally, the device further comprises a time interval determining unit configured to determine a message sending time interval for sending a second message according to the first device queue length and the second device queue length; and a second message sending unit configured to send the second message to the second device according to the message sending time interval.

[0066] Optionally, the time interval determining unit is further configured to calculate the message sending time interval according to the following formula: T = Tmax / (An+Bn), wherein Tmax is a preset maximum message sending time interval, An is the first device queue length, and Bn is the second device queue length, wherein An and Bn are not 0 at the same time.

[0067] Optionally, the time interval determination unit is further configured to determine the preset maximum message sending time interval as the message sending time interval for sending the second message when the first device queue length and the second device queue length are both 0.

[0068] Optionally, the time interval determination unit is further configured to update the second device queue length according to the second receiving state identifier to obtain an updated second device queue length, and determine the message sending time interval for sending the second message according to the updated second device queue length and the first device queue length.

[0069] Optionally, when the first message is a message sent by the first device to the second device for the first time and the second device has not sent any message to the first device, an empty message is determined as the message sent by the second device in the last round.

[0070] The communication device provided by the application is applied to a first device, and a first message is sent to a second device, the first message carrying first device data, a first receiving state identifier and a first device queue length, the first receiving state identifier being used to identify whether the first device successfully receives a message sent by the second device in the last round; a response message sent by the second device to the first message is received, the response message carrying second device data, a second receiving state identifier and a second device queue length, the second receiving state identifier being used to identify whether the second device successfully receives the first message, and the device data, the receiving state identifier and the queue length carried in the sent message effectively solve the technical problem of low communication efficiency in the related art.

[0071] Embodiment Four

[0072] According to the embodiments of the application, a communication system is further provided, which comprises: a first device configured to send a first message to a second device, the first message carrying first device data, a first receiving state identifier and a first device queue length, the first receiving state identifier being used to identify whether the first device successfully receives a message sent by the second device in the last round; and the second device configured to send a response message to the first message to the first device, the response message carrying second device data, a second receiving state identifier and a second device queue length, the second receiving state identifier being used to identify whether the second device successfully receives the first message.

[0073] The first device and the second device can be any of the first device and the second device described above, and will not be described here again.

[0074] The communication system provided in the embodiment, the first device sends a first message to the second device, the first message carries first device data, a first receiving state identifier and a first device queue length, the first receiving state identifier is used to identify whether the first device successfully receives a message sent by the second device in the last round; and then the second device sends a response message to the first device, the response message carries second device data, a second receiving state identifier and a second device queue length, the second receiving state identifier is used to identify whether the second device successfully receives the first message, by carrying device data, a receiving state identifier and a queue length in the sent message, the technical problem of low communication efficiency in the related art is effectively solved.

[0075] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0076] Optionally, specific examples in the embodiment can refer to the examples described in the above-described embodiments, and the embodiment will not be described here again.

[0077] The sequence numbers of the embodiments of the present application described above are only for description, and do not represent the advantages or disadvantages of the embodiments.

[0078] The integrated units in the above-described embodiments, if realized in the form of software function units and sold or used as independent products, can be stored in the above-mentioned computer-readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0079] In the above-described embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0080] In several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other manners. Of course, the described apparatus embodiments are merely schematic, and the division of units is merely logical function division, and there can be other division manners in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, units or modules, and can be in electrical, mechanical or other forms.

[0081] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

[0082] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0083] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. A communication method, characterized in that, Applied to a first device, the method includes: Send a first message to the second device. The first message carries the first device data, a first reception status identifier and a first device queue length. The first reception status identifier is used to indicate whether the first device has successfully received the message sent by the second device in the previous round. The device receives a response message from the second device in response to the first message. The response message carries second device data, a second reception status identifier, and a second device queue length. The second reception status identifier is used to indicate whether the second device has successfully received the first message. The message sending time interval for sending the second message is determined based on the length of the first device queue and the length of the second device queue. The second message is sent to the second device according to the message sending time interval; The step of determining the message sending time interval for sending the second message based on the length of the first device queue and the length of the second device queue includes: The message sending time interval is calculated using the following formula: T = Tmax / (An + Bn), Where Tmax is the preset maximum message sending time interval, An is the length of the first device queue, and Bn is the length of the second device queue, wherein An and Bn are not both 0; The step of determining the message sending time interval for sending the second message based on the length of the first device queue and the length of the second device queue includes: Based on the second receiving status identifier, update the second device queue length to obtain the updated second device queue length; The message sending time interval for sending the second message is determined based on the updated second device queue length and the first device queue length.

2. The method according to claim 1, characterized in that, The step of determining the message sending time interval for sending the second message based on the length of the first device queue and the length of the second device queue includes: When both the length of the first device queue and the length of the second device queue are 0, the preset maximum message sending time interval is determined as the message sending time interval for sending the second message.

3. The method according to claim 1, characterized in that, If the first message is a message sent by the first device to the second device in the first round, and the second device has not yet sent a message to the first device, the empty message is determined to be a message sent by the second device in the previous round.

4. A communication device, characterized in that, The device is applied to a first device, the device comprising a first message sending unit, a response message receiving unit, a time interval determining unit, and a second message sending unit, for implementing the method described in any one of claims 1-3.

5. A communication system, characterized in that, It includes a first device and a second device for implementing the method according to any one of claims 1-3.