WO2019062129A1 - Serial duplex communication method and device, and computer readable storage medium - Google Patents

Serial duplex communication method and device, and computer readable storage medium Download PDF

Info

Publication number
WO2019062129A1
WO2019062129A1 PCT/CN2018/086209 CN2018086209W WO2019062129A1 WO 2019062129 A1 WO2019062129 A1 WO 2019062129A1 CN 2018086209 W CN2018086209 W CN 2018086209W WO 2019062129 A1 WO2019062129 A1 WO 2019062129A1
Authority
WO
WIPO (PCT)
Prior art keywords
consecutive
rate
transmission
reception
data
Prior art date
Application number
PCT/CN2018/086209
Other languages
French (fr)
Chinese (zh)
Inventor
王冰春
Original Assignee
深圳市道通智能航空技术有限公司
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 深圳市道通智能航空技术有限公司 filed Critical 深圳市道通智能航空技术有限公司
Publication of WO2019062129A1 publication Critical patent/WO2019062129A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received

Definitions

  • the present application relates to the field of communications, and more particularly to a serial duplex communication method, apparatus, and computer readable storage medium.
  • serial communication is that the data communicated at the transmitting end is sent to the communication line bit by bit in bit order, and the receiving end receives the data bit by bit in order, and reassembles into data.
  • Duplex communication is that both parties can send and receive at the same time without being affected by each other.
  • the present invention provides a serial duplex communication method, apparatus, and computer readable storage medium, which can adaptively adjust a communication rate according to a transmission condition.
  • an embodiment of the present invention provides a serial duplex communication method, including:
  • the transmission quality information is used to reflect the communication interference when transmitting the data
  • the transmission quality information includes: consecutively receiving the number of errors and/or continuously receiving the correct number of times.
  • the transmitting the data in the serial manner and the peer end, and collecting the transmission quality information includes:
  • the data the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared. If it is consistent, it is judged that the reception is correct, the correct reception indication is sent to the opposite end, the correct number of consecutive receptions is increased by one, and the number of consecutive reception errors is cleared.
  • the adaptively adjusting the communication rate with the peer end transmission data according to the transmission quality information includes:
  • the reception rate When the number of consecutive reception errors is greater than the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is cleared; when the consecutive reception correct times are greater than the reception correct number threshold, and the data When the receiving rate does not reach the highest receiving rate, the receiving rate is increased, and the correct number of consecutive receiving times is cleared; or,
  • the reception rate When the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, the reception rate is reduced by one level; when the consecutive reception correct times are greater than the current level of the reception correct number threshold, and When the data reception rate does not reach the maximum reception rate, the reception rate is increased by one level.
  • the transmission quality information includes: consecutively transmitting the number of errors and/or continuously transmitting the correct number of times.
  • the transmitting the data in the serial manner and the peer end, and collecting the transmission quality information includes:
  • the data and the corresponding check code are sent to the opposite end in a serial manner and timed; if the correct receiving indication sent by the opposite end is received within the timeout threshold time range, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared. If the timeout threshold has not received the correct indication of the reception sent by the peer, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
  • the adaptively adjusting the communication rate with the peer end transmission data according to the transmission quality information includes:
  • the transmission rate When the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared; when the consecutive number of consecutive transmissions is greater than the threshold for sending the correct number of times, and the data When the transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive receptions is cleared; or,
  • the transmission rate is reduced by one level; when the correct number of consecutive transmissions is greater than the current level of the correct number of transmission thresholds, and When the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
  • the method further includes determining a data write rate according to the bandwidth indication information.
  • the embodiment of the invention further provides a serial duplex communication device, comprising: a memory, a processor and a computer program stored on the memory and operable on the processor, the processor implementing the program to implement the following steps:
  • the transmission quality information is used to reflect the communication interference when transmitting the data
  • the transmission quality information includes: consecutively receiving the number of errors and/or continuously receiving the correct number of times; the apparatus further includes a receiving port, and the processor further implements when the program is executed:
  • the method further implements:
  • the reception rate When the number of consecutive reception errors is greater than the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is cleared; when the consecutive reception correct times are greater than the reception correct number threshold, and the data When the receiving rate does not reach the highest receiving rate, the receiving rate is increased, and the correct number of consecutive receiving times is cleared; or,
  • the reception rate When the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, the reception rate is reduced by one level; when the consecutive reception correct times are greater than the current level of the reception correct number threshold, and When the data reception rate does not reach the maximum reception rate, the reception rate is increased by one level.
  • the transmission quality information includes: consecutively transmitting the number of errors and/or continuously transmitting the correct number of times; the apparatus further includes a sending port, where the processor further implements:
  • the method further implements:
  • the transmission rate When the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared; when the consecutive number of consecutive transmissions is greater than the threshold for sending the correct number of times, and the data When the transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive receptions is cleared; or,
  • the transmission rate is reduced by one level; when the consecutive number of consecutive transmissions is greater than the correct number of times of sending the current level, and When the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
  • the embodiment of the present invention further provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the serial duplex communication method as described above.
  • Embodiments of the present invention include: transmitting data through a serial manner and a peer end, and collecting transmission quality information; the transmission quality information is used to reflect a situation of communication interference when transmitting data; and adaptively adjusting a communication rate according to the transmission quality information. . Since the transmission quality information can reflect the situation of the communication interference, in the embodiment of the present invention, the communication interference can be used as a decision basis, and the communication rate can be flexibly adjusted. Further, by adaptively adjusting the communication rate, the problem that the communication link is disturbed and causing the failure is solved without increasing the cost, the safety of the drone is guaranteed, and the property safety of the user is protected.
  • FIG. 1 is a flowchart of a serial duplex communication method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a serial duplex communication application scenario according to an application example of the present invention.
  • FIG. 3 is a flow chart of receiving data according to an application example 1 of the present invention.
  • FIG. 6 is a flow chart of sending data according to application example 2 of the present invention.
  • FIG. 7 is a schematic diagram of a serial duplex communication device according to an embodiment of the present invention.
  • serial duplex communication device may further include a communication interface, and the communication interface may include a transmitting port and a receiving port, and the sending port and the receiving port may work independently of each other, thereby implementing the dual pair of the serial duplex communication device and the opposite end. Communication.
  • the serial duplex communication device can be connected to a module in the drone, which can communicate with other modules in the drone using a serial duplex communication device.
  • the host module is connected to a serial duplex communication device, and the flight control module, the vision module, the sensor module and the like that communicate with the host module can be respectively connected with another serial duplex communication device, and the host module and other modules can be utilized.
  • the serial duplex communication devices connected to each other implement a communication connection.
  • one of the serial duplex communication devices can serve as the opposite end of the serial duplex communication device with which it communicates.
  • a serial communication device connected to the flight control module can serve as the opposite end of the serial communication device connected to the host module.
  • logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • the serial duplex communication method of the embodiment of the present invention includes:
  • Step 101 Transmit data through the serial mode and the opposite end, and collect transmission quality information
  • the transmission quality information is used to reflect the communication interference when transmitting data, for example, by continuously receiving the number of errors/continuous reception, the number of consecutive transmission errors, or the number of consecutive transmissions, reflecting the communication interference when transmitting data: continuous reception error
  • continuous reception error The more the number of times or the number of connection transmission errors, the more serious the interference; conversely, the more the correct number of consecutive receptions or the more consecutive transmissions, the smaller the interference.
  • the application uses the serial mode and the peer end to transmit data, which can save the pin resources and reduce the transmission power consumption of the device.
  • data may be transmitted to the opposite end by using a transmission port in the serial duplex communication device, or may be received by the receiving port in the serial duplex communication device.
  • Step 102 Adaptively adjust a communication rate with the peer end transmission data according to the transmission quality information.
  • the adaptive adjustment of the communication rate means that the communication parties can communicate at a plurality of rates, and the switching of different rates is automatically completed without external intervention.
  • the communication interference can be used as a decision basis, and the communication rate can be flexibly adjusted. Further, by adaptively adjusting the communication rate, the problem that the communication link is disturbed and causing the failure is solved without increasing the cost, the safety of the drone is guaranteed, and the property safety of the user is protected. It can guarantee the validity and stability of communication between modules in the drone.
  • the transmission quality information includes: consecutively receiving the number of errors and/or continuously receiving the correct number of times.
  • the data is transmitted in a serial manner with the opposite end
  • the transmission of the quality information includes: receiving the data sent by the opposite end and the corresponding check code in a serial manner, and calculating the data according to the received data. Check the code and compare it with the received check code. If it is inconsistent, it is judged that an error has occurred, the received data is discarded, the number of consecutive receiving errors is increased by one, and the number of consecutive receiving is cleared. If they are consistent, the receiving is correct. Send the correct indication to the peer, continuously receive the correct number of times, and clear the number of consecutive reception errors.
  • adaptively adjusting the communication rate according to the transmission quality information includes: when the continuous reception error number is greater than the reception error threshold, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased. The number of consecutive reception errors is cleared; when the correct number of consecutive receptions is greater than the threshold for receiving the correct number of times, and the data reception rate does not reach the highest reception rate, the reception rate is increased, and the correct number of consecutive receptions is cleared.
  • the threshold of the number of reception errors is set to 5, when the number of consecutive reception errors reaches 6, and the data reception rate does not reach the minimum reception rate, the reception rate is lowered, and the number of consecutive reception errors is cleared; when the number of consecutive reception errors is once again When the accumulated value reaches 6, and the data receiving rate does not reach the minimum receiving rate, the receiving rate will continue to decrease, and so on. It can be understood that the same is true for the method of increasing the receiving rate according to the correct number of consecutive receptions, and details are not described herein again.
  • the reception rate when the number of consecutive reception errors is greater than or equal to the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is cleared;
  • the correct number of consecutive receptions is greater than or equal to the threshold for receiving the correct number of times, and the data reception rate does not reach the highest reception rate, the reception rate is increased, and the correct number of consecutive receptions is cleared. How to set the comparison criterion is based on the threshold of the number of reception errors and the threshold of receiving the correct number of times.
  • the comparison result with the threshold of the number of reception errors in the above scheme is 5
  • the rate is adjusted when the number of consecutive reception errors or the number of consecutive receptions reaches 6. Therefore, it can be considered that the scheme also falls within the protection range of the above scheme.
  • the setting of the threshold number of receiving errors and the threshold of receiving the correct number of times can be set according to specific occasions, and is not strictly required here.
  • the receiving rate can be divided into multiple levels. Each time the receiving rate is lowered, one rate level is lowered until the lowest receiving rate is reached; each time the receiving rate is increased, a rate level is increased until the highest receiving rate is reached.
  • the number of consecutive reception errors when the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, the number of consecutive reception errors may not be cleared; when the correct number of consecutive receptions is greater than a threshold of the correct number of receptions of the current level, The number of consecutive receptions can be eliminated without clearing.
  • the number of consecutive reception errors and the number of consecutive receptions are counted in a cumulative manner. At this time, the data can be cleared according to the last time (this data clear may be the number of consecutive reception errors cleared. It is also possible that the level corresponding to the correct number of consecutive times is cleared. For each level, a threshold of the number of reception errors and a threshold of the number of receptions are set, that is, the threshold of the number of reception errors corresponding to each level and the threshold of the number of receptions are dynamically changed.
  • Step 102 adaptively adjusting the communication rate according to the transmission quality information, when the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, and the reception rate is decreased. Level; when the consecutive number of consecutive receptions is greater than the current level of the correct number of reception thresholds, and the data reception rate does not reach the highest reception rate, the reception rate is increased by one level.
  • the receiving rate is divided into first to fifth levels according to the level, where the first level is the lowest rate level, and the fifth level is the highest rate level. If the last data clear is the number of consecutive receive errors that occur at the third level is cleared, a corresponding receive error threshold and a receive correct threshold are set for each corresponding level, such as the third level of receive errors.
  • the threshold is 5, the second level of the receiving error threshold is 10, the first level of the receiving error threshold is 15, the third level of the correct number of receiving threshold is 5, and the fourth level of the correct number of receiving threshold is 10, the fifth level
  • the threshold for receiving the correct number of times is 15.
  • the current level is the third level
  • the number of consecutive receiving errors is greater than 5
  • the receiving rate is decreased by one level to the second level, and the current level becomes the second level, and the number of consecutive receiving errors can continue to be accumulated.
  • the reception rate will continue to decrease from one level to the first level.
  • a corresponding reception error threshold and reception are reset for each corresponding level. The correct number of thresholds.
  • the transmission quality information includes: consecutively transmitting the number of errors and/or continuously transmitting the correct number of times.
  • the data is transmitted in a serial manner with the opposite end, and the transmission of the quality information includes: transmitting the data and the corresponding check code to the opposite end in a serial manner and timing; if the timeout threshold time is If the correct receiving indication sent by the peer end is received within the range, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared; if the timeout threshold is exceeded, the correct indication of the receiving by the opposite end is not received, then the data is resent. The number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared to zero.
  • the check code is obtained according to the data, and the check code algorithm may be: cyclic redundancy check, parity check, The code distance, Hamming check, etc., are not specifically limited in the present invention.
  • adaptively adjusting the communication rate according to the transmission quality information includes: when the consecutive transmission error number is greater than the transmission error threshold, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased. The number of consecutive transmission errors is cleared; when the correct number of consecutive transmissions is greater than the threshold for transmitting the correct number of times, and the data transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive receptions is cleared.
  • the threshold of the number of transmission errors is set to 5, when the number of consecutive transmission errors reaches 6, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is lowered, and the number of consecutive transmission errors is cleared; when the number of consecutive transmission errors is once again When the total reaches 6, and the data transmission rate does not reach the minimum transmission rate, the transmission rate will continue to decrease, and so on. It can be understood that the same is true for the method of increasing the transmission rate according to the correct number of consecutive transmissions, and details are not described herein again.
  • the transmission rate when the number of consecutive transmission errors is greater than or equal to the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared;
  • the correct number of consecutive transmissions is greater than or equal to the threshold for transmitting the correct number of times, and the data transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive transmissions is cleared.
  • How to set the comparison criterion is based on the setting of the number of transmission error thresholds and the threshold of sending the correct number of times.
  • the comparison result with the threshold of the number of transmission errors in the above scheme is 5
  • the rate is adjusted when the number of consecutive transmission errors or the number of consecutive transmissions reaches 6. Therefore, it can be considered that the scheme is also within the protection scope of the above scheme.
  • the sending rate can be divided into multiple levels. Each time the sending rate is lowered, one rate level is lowered until the lowest sending rate is reached; each time the sending rate is increased, a rate level is increased until the highest sending rate is reached.
  • the number of consecutive transmission errors when the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, the number of consecutive transmission errors may not need to be cleared; when the correct number of consecutive transmissions is greater than a threshold of the correct number of transmissions of the current level, The number of consecutive receptions can be cleared without clearing.
  • the data can be cleared according to the last time.
  • the data can be cleared according to the last time.
  • the level corresponding to each level is set to a number of transmission error thresholds and a threshold number of transmission correct times, that is, the number of transmission error thresholds and the number of correct transmission times corresponding to each level are dynamically changed.
  • Step 102 adaptively adjusting the communication rate according to the transmission quality information, when the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, and the data transmission rate does not reach the minimum transmission rate, and the transmission rate is decreased.
  • Level When the consecutive number of consecutive transmissions is greater than the current level of the correct number of transmission thresholds, and the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
  • the sending rate is divided into first to fifth levels according to the level, where the first level is the lowest rate level, and the fifth level is the highest rate level. If the last data clear is the number of consecutive transmission errors that occur at the third level is cleared, a corresponding number of transmission error thresholds and a correct number of transmission thresholds are set for each corresponding level, such as the number of transmission errors of the third level.
  • the threshold is 5, the second level of the transmission error threshold is 10, the first level of the transmission error threshold is 15, the third level of the correct number of transmissions is 5, and the fourth level of the correct number of times is 10, the fifth level
  • the threshold for sending the correct number of times is 15.
  • the number of consecutive transmission errors greater than 5 will reduce the receiving rate by one level to the second level, at which time the current level becomes the second level, and the number of consecutive transmission errors can continue to be accumulated when When the number of consecutive transmission errors is greater than 10, the transmission rate will continue to decrease by one level to the first level.
  • the number of consecutive transmissions is increased by one at the second level (that is, the number of consecutive transmission errors is cleared)
  • a corresponding number of transmission error thresholds and transmissions are reset for each corresponding level. The correct number of thresholds.
  • FIG. 2 is a schematic diagram of a serial duplex communication application scenario according to an application example of the present invention, wherein two serial duplex communication devices communicate in a serial duplex mode, and one of them is used as a local serial duplex communication.
  • the device is another serial duplex communication device.
  • the local serial duplex communication device is used as an example. If not specified, the serial duplex communication device refers to the local serial duplex communication.
  • the implementation process of the peer end can be the same as the local one, and will not be described again.
  • the serial duplex communication device is connected to the host module, and the serial duplex communication device is provided with a data writing interface and a data reading interface, and the serial duplex communication device notifies the host module of the current adoption by transmitting a bandwidth indication signal to the host module.
  • the bandwidth rate at which the host module writes data to the data write interface based on the currently indicated bandwidth rate.
  • the bandwidth indication signal may be obtained by a transmission port in the serial duplex communication device, and the transmission port can control the data write rate by monitoring the bandwidth rate, thereby ensuring the smoothness of data transmission through the transmission port. Avoid data congestion in serial duplex communication devices.
  • the processor in the serial duplex communication device can determine the currently acceptable data write rate according to the bandwidth rate detected by the sending port, and further send a bandwidth indication signal to the host module, where the bandwidth indication is The signal is used to indicate the data write rate when the host module writes data. The host module then writes the data according to the data write rate indicated in the bandwidth indication signal.
  • the processor in the serial duplex communication device can also determine the data transmission rate in conjunction with the data write rate, for example, the data write rate is equal to the data transmission rate to ensure the timeliness of data transmission, and the like.
  • the processor in the serial duplex communication device can also determine the data transmission rate in conjunction with the data write rate and the data reception rate from the receiving port.
  • the determined data transmission rate may refer to an initial data transmission rate of the serial duplex communication device, and the initial data transmission rate may be adjusted by using the method of the embodiment of the present application.
  • the serial duplex communication device of the first application example of the present invention receives data according to the following steps:
  • Step 301 Receive data and a check code sent by the opposite end.
  • the data is usually sent and received in the form of data packets.
  • Step 302 Calculate the check code according to the received data, and compare with the received check code. If not, it is determined that an error has occurred, and step 303 is performed. If they are consistent, it is determined that the reception is correct, and step 308 is performed.
  • step 303 the received data is discarded, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared.
  • Step 304 Determine whether the number of consecutive reception errors is greater than a threshold number of reception errors. If yes, go to step 305. If no, go to step 306.
  • Step 305 Determine whether the data receiving rate reaches the minimum receiving rate. If yes, go to step 306; if no, go to step 307.
  • step 306 the current receiving rate is kept unchanged.
  • an alarm may be generated, indicating that the transmission line may be faulty, or the interference is too strong to transmit data.
  • step 307 the receiving rate is reduced by one level, and the number of consecutive receiving errors is cleared.
  • Step 308 waiting for the host module to read data from the data read interface, and send the correct indication to the opposite end, continuously receiving the correct number of times plus one, and the number of consecutive receiving errors is cleared.
  • Step 309 Determine whether the number of consecutive receiving correct times is greater than the receiving correct number threshold. If yes, go to step 310. If no, go to step 306.
  • Step 310 Determine whether the data receiving rate reaches the highest receiving rate. If yes, go to step 306. If no, go to step 311.
  • step 311 the receiving rate is increased by one level, and the consecutive receiving correct times are cleared.
  • the serial duplex communication device of the first application example of the present invention transmits data including the following steps:
  • Step 401 Send the data written by the host module and the corresponding check code to the peer end and time.
  • Step 402 Determine whether the correct receiving indication sent by the peer end is not received within the timeout threshold time range. If yes, go to step 403. If no, go to step 408.
  • step 403 the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
  • step 404 it is determined whether the number of consecutive transmission errors is greater than the number of transmission error thresholds. If yes, step 405 is performed, and if no, step 406 is performed.
  • Step 405 Determine whether the data transmission rate reaches the minimum transmission rate. If yes, go to step 406. If no, go to step 407.
  • step 406 the current transmission rate is kept unchanged.
  • an alarm may be generated, indicating that the transmission line may be faulty, or the interference is too strong to transmit data.
  • step 407 the transmission rate is reduced by one level, and the host module is notified by the bandwidth indication signal, and the number of consecutive transmission errors is cleared.
  • step 408 the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared.
  • step 409 it is determined whether the number of consecutive transmissions is greater than the number of times the transmission is correct. If yes, step 410 is performed, and if no, step 406 is performed.
  • Step 410 Determine whether the data transmission rate reaches the highest transmission rate. If yes, go to step 406. If no, go to step 411.
  • step 411 the transmission rate is increased by one level, and the host module is notified by the bandwidth indication signal, and the correct number of consecutive receptions is cleared.
  • the serial duplex communication device of the second application of the present invention receives data according to the following steps:
  • Step 501 Receive data and a check code sent by the peer end.
  • the data is usually sent and received in the form of data packets.
  • Step 502 Calculate the check code according to the received data, and compare it with the received check code. If it is inconsistent, it is determined that an error has occurred, and step 503 is performed. If they are consistent, it is determined that the reception is correct, and step 508 is performed.
  • step 503 the received data is discarded, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared to zero.
  • Step 504 Determine whether the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level. If yes, go to step 505. If no, go to step 506.
  • Step 505 Determine whether the data receiving rate reaches the minimum receiving rate. If yes, go to step 506; if no, go to step 507.
  • step 506 the current receiving rate is kept unchanged.
  • an alarm may be generated, indicating that the transmission line may be faulty, or the interference is too strong to transmit data.
  • step 507 the receiving rate is lowered by one level.
  • Step 508 Wait for the host module to read data from the data readout interface, and send the correct indication to the opposite end, and continuously receive the correct number of times plus one, and the number of consecutive receive errors is cleared.
  • step 509 it is determined whether the correct number of consecutive receptions is greater than the current correct reception threshold. If yes, go to step 510. If no, go to step 506.
  • Step 510 Determine whether the data receiving rate reaches the highest receiving rate. If yes, go to step 506. If no, go to step 511.
  • step 511 the receiving rate is increased by one level.
  • the serial duplex communication device of the second application of the present invention transmits data including the following steps:
  • Step 601 Send the data written by the host module and the corresponding check code to the peer end and time.
  • Step 602 Determine whether the correct receiving indication sent by the peer end is not received within the timeout threshold time range. If yes, go to step 603. If no, go to step 608.
  • step 603 the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
  • step 604 it is determined whether the number of consecutive transmission errors is greater than the current level of the number of transmission error thresholds. If yes, step 605 is performed, and if no, step 606 is performed.
  • Step 605 Determine whether the data transmission rate reaches the minimum transmission rate. If yes, go to step 606. If no, go to step 607.
  • step 606 the current transmission rate is kept unchanged.
  • an alarm may be generated, indicating that the transmission line may be faulty, or the interference is too strong to transmit data.
  • step 607 the transmission rate is reduced by one level, and the host module is notified by the bandwidth indication signal.
  • step 608 the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared.
  • step 609 it is determined whether the number of consecutive transmissions is greater than the current level of the correct number of transmission thresholds. If yes, step 610 is performed, and if no, step 606 is performed.
  • Step 610 Determine whether the data transmission rate reaches the highest transmission rate. If yes, go to step 606. If no, go to step 611.
  • step 611 the transmission rate is increased by one level, and the host module is notified by the bandwidth indication signal.
  • the rate adaptive serial duplex communication mode by adopting the rate adaptive serial duplex communication mode, high-rate communication is used in the case of no interference or small interference, the bandwidth is improved, the flying quality of the drone is improved, and the high-quality task is ensured; In the case of moderate interference or severe interference, reduce the communication rate and ensure the basic data requirements, so that the drone can guarantee basic safe flight and return flight or initiate emergency measures.
  • the transmission quality information is used to reflect the communication interference when the data is transmitted.
  • the transmission quality information includes: the number of consecutive reception errors and the number of consecutive receptions; and the transmission quality information for the transmission data. This includes the number of consecutive transmission errors and the number of consecutive transmissions.
  • the present invention is not limited thereto, and the transmission quality information may also be represented by other information.
  • the transmission quality information may include: a reception success rate and/or a reception failure rate; for transmitting data, transmission The quality information may include a transmission success rate and/or a transmission failure rate.
  • the receiving success rate may be the correct number of times received within a specified time range (for example, 5 minutes) at the current receiving rate divided by the total number of received times; the receiving failure rate may be the number of receiving errors within a specified time range (for example, 5 minutes) at the current receiving rate. Divide by the total number of receptions.
  • the transmission success rate may be the correct number of transmissions within the specified time range (for example, 5 minutes) divided by the total number of transmissions at the current transmission rate; the transmission failure rate may be the number of transmission errors within a specified time range (for example, 5 minutes) at the current transmission rate divided by The total number of times sent.
  • the embodiment of the present invention further provides a serial duplex communication device, which is used to implement the foregoing embodiments and implementation manners, and has not been described again.
  • the serial duplex communication device of the embodiment of the invention comprises: a memory, a processor and a computer program stored on the memory and operable on the processor, the processor implementing the program to implement the following steps:
  • the transmission quality information is used to reflect the communication interference when transmitting the data
  • the transmission quality information includes: consecutively receiving the number of errors and/or continuously receiving the correct number of times.
  • the processor further implements when executing the program:
  • the data the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared. If it is consistent, it is judged that the reception is correct, the correct reception indication is sent to the opposite end, the correct number of consecutive receptions is increased by one, and the number of consecutive reception errors is cleared.
  • the processor executes the program, when the number of consecutive reception errors is greater than the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is received. Cleared; when the correct number of consecutive receptions is greater than the threshold for receiving the correct number of times, and the data reception rate does not reach the highest reception rate, the reception rate is increased, and the correct number of consecutive receptions is cleared.
  • the reception rate when the processor executes the program, when the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, the reception rate is reduced by one level. When the consecutive number of consecutive receptions is greater than the current level of the correct number of reception thresholds, and the data reception rate does not reach the highest reception rate, the reception rate is increased by one level.
  • the transmission quality information includes: the number of consecutive transmission errors and the number of consecutive transmissions.
  • the processor further implements when executing the program:
  • the data and the corresponding check code are sent to the opposite end in a serial manner and timed; if the correct receiving indication sent by the opposite end is received within the timeout threshold time range, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared. If the timeout threshold has not received the correct indication of the reception sent by the peer, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
  • the processor further implements when executing the program:
  • the transmission rate is decreased, and the number of consecutive transmission errors is cleared; when the consecutive number of consecutive transmissions is greater than the threshold for sending the correct number of times, and the data When the transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the number of consecutive receptions is cleared to zero.
  • the processor further implements when executing the program:
  • the transmission rate is reduced by one level; when the consecutive number of consecutive transmissions is greater than the correct number of times of sending the current level, and When the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
  • the communication interference can be used as a decision basis, and the communication rate can be flexibly adjusted. Further, by adaptively adjusting the communication rate, the problem that the communication link is disturbed and causing the failure is solved without increasing the cost, the safety of the drone is guaranteed, and the property safety of the user is protected.
  • the embodiment of the present invention further provides a serial duplex communication device, which is used to implement the foregoing embodiments and implementation manners, and has not been described again.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the devices described in the following embodiments may be implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • the serial duplex communication device of the embodiment of the present invention includes:
  • the transmission module 71 is configured to transmit data through the serial manner and the opposite end, and collect transmission quality information; the transmission quality information is used to reflect a communication interference situation when transmitting data;
  • the adjusting module 72 is configured to adaptively adjust a communication rate with the peer end transmission data according to the transmission quality information.
  • the transmission quality information includes: the number of consecutive reception errors and the number of consecutive receptions.
  • the transmission module 71 is further configured to:
  • the data the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared. If it is consistent, it is judged that the reception is correct, the correct reception indication is sent to the opposite end, the correct number of consecutive receptions is increased by one, and the number of consecutive reception errors is cleared.
  • the adjusting module 72 is further configured to:
  • the reception rate is increased, and the correct number of consecutive receptions is cleared.
  • the adjusting module 72 is further configured to:
  • the reception rate is reduced by one level
  • the reception rate is increased by one level.
  • the transmission quality information includes: the number of consecutive transmission errors and the number of consecutive transmissions.
  • the transmission module 71 is further configured to:
  • the data and the corresponding check code are sent to the opposite end in a serial manner and timed; if the correct receiving indication sent by the opposite end is received within the timeout threshold time range, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared. If the timeout threshold has not received the correct indication of the reception sent by the peer, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
  • the adjusting module 72 is further configured to:
  • the transmission rate is increased, and the correct number of consecutive receptions is cleared.
  • the adjusting module 72 is further configured to:
  • the transmission rate is reduced by one level
  • the transmission rate is increased by one level.
  • the communication interference can be used as a decision basis, and the communication rate can be flexibly adjusted. Further, by adaptively adjusting the communication rate, the problem that the communication link is disturbed and causing the failure is solved without increasing the cost, the safety of the drone is guaranteed, and the property safety of the user is protected.
  • Embodiments of the present invention also provide a storage medium.
  • the above storage medium may be arranged to store program code for performing, for example, the following steps:
  • the transmission quality information is used to reflect the communication interference when transmitting the data
  • the foregoing storage medium may include, but not limited to, a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • mobile hard disk a magnetic disk
  • magnetic disk a magnetic disk
  • optical disk a variety of media that can store program code.
  • the embodiment further provides a serial duplex communication device, the device includes a processor, and the processor is configured to implement the functions of the foregoing transmission module 71 and the adjustment module 72. Specifically, the device performs the following process: through serial mode and pair The terminal transmits data and calculates transmission quality information; the transmission quality information is used to reflect a situation of communication interference when transmitting data; and the communication rate is adaptively adjusted according to the transmission quality information.
  • modules or steps of the embodiments of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device or distributed over a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed either separately as an integrated circuit module, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • embodiments of the invention are not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

Disclosed in the present invention are a serial duplex communication method and device, and a computer readable storage medium. The method comprises: performing data transmission with a peer end in a serial mode, and collecting statistics about transmission quality information, the transmission quality information being used for reflecting communication interference during the data transmission; and adaptively adjusting a communication rate according to the transmission quality information. In embodiments of the present invention, the communication interference can be used as a decision basis, so that the communication rate can be adjusted flexibly.

Description

串行双工通讯方法、装置和计算机可读存储介质Serial duplex communication method, device and computer readable storage medium
本申请要求于2017年09月28日提交中国专利局、申请号为201710901596.6、申请名称为“串行双工通讯方法、装置和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application entitled "Serial Duplex Communication Method, Apparatus, and Computer Readable Storage Medium" filed on September 28, 2017 by the Chinese Patent Office, Application No. 201710901596.6, the entire contents of which is hereby incorporated by reference. This is incorporated herein by reference.
技术领域Technical field
本申请涉及通讯领域,尤指一种串行双工通讯方法、装置和计算机可读存储介质。The present application relates to the field of communications, and more particularly to a serial duplex communication method, apparatus, and computer readable storage medium.
背景技术Background technique
串行通讯是在发送端通讯的数据按照比特顺序逐位送到通讯的线路上,同时接收端按照比特顺序逐位接收下来,重新组装成数据。双工通讯是通讯双方可以同时进行收发而互不受影响。The serial communication is that the data communicated at the transmitting end is sent to the communication line bit by bit in bit order, and the receiving end receives the data bit by bit in order, and reassembles into data. Duplex communication is that both parties can send and receive at the same time without being affected by each other.
在无人机的应用场景中,存在两个模块或者传感器之间通讯的需求,而这两个模块由于无人机的设计需求,放置的位置距离并不固定,因此该通讯场景需求存在以下特点:In the application scenario of the drone, there is a need for communication between two modules or sensors, and the distance between the two modules is not fixed due to the design requirements of the drone, so the communication scene needs the following characteristics. :
1、容易受到干扰,并且干扰大小、强弱、持续时间不确定;1, is susceptible to interference, and the size, strength, and duration of the disturbance are uncertain;
2、在受到干扰的情况下,数据接收错误,造成结果比较严重。2. In the case of interference, the data is received incorrectly, resulting in serious results.
虽然可以使用复杂的线路调制方法和昂贵的带屏蔽的线路材料,以抵抗外界的干扰,但会增加无人机制作成本和无人机的重量,影响续航历程。Although complex line modulation methods and expensive shielded line materials can be used to resist external interference, it will increase the cost of drone production and the weight of the drone, affecting the life course.
发明内容Summary of the invention
为了解决上述技术问题,本发明提供了一种串行双工通讯方法、装置和计算机可读存储介质,可以根据传输情况自适应地调整通讯速率。In order to solve the above technical problem, the present invention provides a serial duplex communication method, apparatus, and computer readable storage medium, which can adaptively adjust a communication rate according to a transmission condition.
为了达到本发明目的,本发明实施例提供了一种串行双工通讯方法,包括:In order to achieve the object of the present invention, an embodiment of the present invention provides a serial duplex communication method, including:
通过串行方式与对端传输数据,并统计传输质量信息;所述传输质量信息用于反映传输数据时通讯干扰的情况;Transmitting data through the serial mode and the opposite end, and counting the transmission quality information; the transmission quality information is used to reflect the communication interference when transmitting the data;
根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率。And adaptively adjusting a communication rate with the peer end transmission data according to the transmission quality information.
可选地,所述传输质量信息包括:连续接收错误次数和/或连续接收正确次数。Optionally, the transmission quality information includes: consecutively receiving the number of errors and/or continuously receiving the correct number of times.
可选地,所述通过串行方式与对端传输数据,并统计传输质量信息包括:Optionally, the transmitting the data in the serial manner and the peer end, and collecting the transmission quality information includes:
通过串行方式接收对端发送的数据和相应的校验码,根据接收到的数据计算校验码,并与接收到的校验码进行比对,若不一致,则判断发生错误,丢弃接收到的数据,连续接收错误次数加一,连续接收正确次数清零;若一致,则判断接收正确,将接收正确指示发送给对端,连续接收正确次数加一,连续接 收错误次数清零。Receiving the data sent by the opposite end and the corresponding check code in a serial manner, calculating the check code according to the received data, and comparing with the received check code, if not, determining that an error occurs, discarding the received The data, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared. If it is consistent, it is judged that the reception is correct, the correct reception indication is sent to the opposite end, the correct number of consecutive receptions is increased by one, and the number of consecutive reception errors is cleared.
可选地,所述根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率包括:Optionally, the adaptively adjusting the communication rate with the peer end transmission data according to the transmission quality information includes:
当所述连续接收错误次数大于接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率,连续接收错误次数清零;当所述连续接收正确次数大于接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率,连续接收正确次数清零;或者,When the number of consecutive reception errors is greater than the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is cleared; when the consecutive reception correct times are greater than the reception correct number threshold, and the data When the receiving rate does not reach the highest receiving rate, the receiving rate is increased, and the correct number of consecutive receiving times is cleared; or,
当所述连续接收错误次数大于当前级别的接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率一个级别;当所述连续接收正确次数大于当前级别的接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率一个级别。When the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, the reception rate is reduced by one level; when the consecutive reception correct times are greater than the current level of the reception correct number threshold, and When the data reception rate does not reach the maximum reception rate, the reception rate is increased by one level.
可选地,所述传输质量信息包括:连续发送错误次数和/或连续发送正确次数。Optionally, the transmission quality information includes: consecutively transmitting the number of errors and/or continuously transmitting the correct number of times.
可选地,所述通过串行方式与对端传输数据,并统计传输质量信息包括:Optionally, the transmitting the data in the serial manner and the peer end, and collecting the transmission quality information includes:
通过串行方式将数据和相应的校验码发送给对端并计时;若在超时阈值时间范围内接收到对端发送的接收正确指示,则连续发送正确次数加一,连续发送错误次数清零;若超过超时阈值还未收到对端发送的接收正确指示,则重新发送所述数据,连续发送错误次数加一,连续发送正确次数清零。The data and the corresponding check code are sent to the opposite end in a serial manner and timed; if the correct receiving indication sent by the opposite end is received within the timeout threshold time range, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared. If the timeout threshold has not received the correct indication of the reception sent by the peer, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
可选地,所述根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率包括:Optionally, the adaptively adjusting the communication rate with the peer end transmission data according to the transmission quality information includes:
当所述连续发送错误次数大于发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率,连续发送错误次数清零;当所述连续发送正确次数大于发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率,连续接收正确次数清零;或者,When the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared; when the consecutive number of consecutive transmissions is greater than the threshold for sending the correct number of times, and the data When the transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive receptions is cleared; or,
当所述连续发送错误次数大于当前级别的发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率一个级别;当所述连续发送正确次数大于当前级别的发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率一个级别。When the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is reduced by one level; when the correct number of consecutive transmissions is greater than the current level of the correct number of transmission thresholds, and When the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
可选地,所述方法还包括:根据带宽指示信息,确定数据写入速率。Optionally, the method further includes determining a data write rate according to the bandwidth indication information.
本发明实施例还提供一种串行双工通讯装置,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现以下步骤:The embodiment of the invention further provides a serial duplex communication device, comprising: a memory, a processor and a computer program stored on the memory and operable on the processor, the processor implementing the program to implement the following steps:
通过串行方式与对端传输数据,并统计传输质量信息;所述传输质量信息用于反映传输数据时通讯干扰的情况;Transmitting data through the serial mode and the opposite end, and counting the transmission quality information; the transmission quality information is used to reflect the communication interference when transmitting the data;
根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率。And adaptively adjusting a communication rate with the peer end transmission data according to the transmission quality information.
可选地,所述传输质量信息包括:连续接收错误次数和/或连续接收正确 次数;所述装置还包括接收端口,所述处理器执行所述程序时还实现:Optionally, the transmission quality information includes: consecutively receiving the number of errors and/or continuously receiving the correct number of times; the apparatus further includes a receiving port, and the processor further implements when the program is executed:
控制所述接收端口以串行方式接收对端发送的数据和相应的校验码,根据接收到的数据计算校验码,并与接收到的校验码进行比对,若不一致,则判断发生错误,丢弃接收到的数据,连续接收错误次数加一,连续接收正确次数清零;若一致,则判断接收正确,将接收正确指示发送给对端,连续接收正确次数加一,连续接收错误次数清零。Controlling, by the receiving port, the data sent by the opposite end and the corresponding check code in a serial manner, calculating a check code according to the received data, and comparing with the received check code, if not, determining that occurs Error, discard the received data, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared. If it is consistent, it is judged that the reception is correct, and the correct reception indication is sent to the opposite end. The number of consecutive receptions is increased by one, and the number of consecutive reception errors is consecutive. Cleared.
可选地,所述处理器执行所述程序时还实现:Optionally, when the processor executes the program, the method further implements:
当所述连续接收错误次数大于接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率,连续接收错误次数清零;当所述连续接收正确次数大于接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率,连续接收正确次数清零;或者,When the number of consecutive reception errors is greater than the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is cleared; when the consecutive reception correct times are greater than the reception correct number threshold, and the data When the receiving rate does not reach the highest receiving rate, the receiving rate is increased, and the correct number of consecutive receiving times is cleared; or,
当所述连续接收错误次数大于当前级别的接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率一个级别;当所述连续接收正确次数大于当前级别的接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率一个级别。When the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, the reception rate is reduced by one level; when the consecutive reception correct times are greater than the current level of the reception correct number threshold, and When the data reception rate does not reach the maximum reception rate, the reception rate is increased by one level.
可选地,所述传输质量信息包括:连续发送错误次数和/或连续发送正确次数;所述装置还包括发送端口,所述处理器执行所述程序时还实现:Optionally, the transmission quality information includes: consecutively transmitting the number of errors and/or continuously transmitting the correct number of times; the apparatus further includes a sending port, where the processor further implements:
控制所述发送端口以串行方式将数据和相应的校验码发送给对端并计时;若在超时阈值时间范围内接收到对端发送的接收正确指示,则连续发送正确次数加一,连续发送错误次数清零;若超过超时阈值还未收到对端发送的接收正确指示,则重新发送所述数据,连续发送错误次数加一,连续发送正确次数清零。Controlling the sending port to send the data and the corresponding check code to the opposite end in a serial manner and timing; if receiving the correct receiving indication sent by the opposite end within the timeout threshold time range, continuously sending the correct number of times plus one consecutive If the number of transmission errors is cleared, if the correct indication of the reception sent by the peer is not received, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
可选地,所述处理器执行所述程序时还实现:Optionally, when the processor executes the program, the method further implements:
当所述连续发送错误次数大于发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率,连续发送错误次数清零;当所述连续发送正确次数大于发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率,连续接收正确次数清零;或者,When the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared; when the consecutive number of consecutive transmissions is greater than the threshold for sending the correct number of times, and the data When the transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive receptions is cleared; or,
当所述连续发送错误次数大于当前级别的发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率一个级别;当所述连续发送正确次数大于发送当前级别的正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率一个级别。When the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is reduced by one level; when the consecutive number of consecutive transmissions is greater than the correct number of times of sending the current level, and When the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
本发明实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述的串行双工通讯方法的步骤。The embodiment of the present invention further provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the steps of the serial duplex communication method as described above.
本发明实施例包括:通过串行方式与对端传输数据,并统计传输质量信息;所述传输质量信息用于反映传输数据时通讯干扰的情况;根据所述传输质量信 息,自适应调整通讯速率。由于传输质量信息可以反映通讯干扰的情况,所以在本发明实施例中,可以将通讯干扰的情况作为决策依据,灵活调整通讯速率。进一步地,通过自适应调整通讯速率,在成本不增加的情况下,解决通讯链路被干扰导致失效的问题,保障了无人机的安全,保护了使用者的财产安全。Embodiments of the present invention include: transmitting data through a serial manner and a peer end, and collecting transmission quality information; the transmission quality information is used to reflect a situation of communication interference when transmitting data; and adaptively adjusting a communication rate according to the transmission quality information. . Since the transmission quality information can reflect the situation of the communication interference, in the embodiment of the present invention, the communication interference can be used as a decision basis, and the communication rate can be flexibly adjusted. Further, by adaptively adjusting the communication rate, the problem that the communication link is disturbed and causing the failure is solved without increasing the cost, the safety of the drone is guaranteed, and the property safety of the user is protected.
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the invention will be set forth in the description which follows, The objectives and other advantages of the invention may be realized and obtained by means of the structure particularly pointed in the appended claims.
附图说明DRAWINGS
附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本发明的技术方案,并不构成对本发明技术方案的限制。The drawings are used to provide a further understanding of the technical solutions of the present invention, and constitute a part of the specification, which together with the embodiments of the present application are used to explain the technical solutions of the present invention, and do not constitute a limitation of the technical solutions of the present invention.
图1为本发明实施例的串行双工通讯方法的流程图;1 is a flowchart of a serial duplex communication method according to an embodiment of the present invention;
图2为本发明应用示例的串行双工通讯应用场景示意图;2 is a schematic diagram of a serial duplex communication application scenario according to an application example of the present invention;
图3为本发明应用示例一的接收数据流程图;3 is a flow chart of receiving data according to an application example 1 of the present invention;
图4为本发明应用示例一的发送数据流程图;4 is a flow chart of sending data according to application example 1 of the present invention;
图5为本发明应用示例二的接收数据流程图;5 is a flow chart of receiving data according to application example 2 of the present invention;
图6为本发明应用示例二的发送数据流程图;6 is a flow chart of sending data according to application example 2 of the present invention;
图7为本发明实施例的串行双工通讯装置示意图。FIG. 7 is a schematic diagram of a serial duplex communication device according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚明白,下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机***中执行。例如,下述方法可以应用在串行双工通讯装置的处理器中,该串行双工通讯装置还可以包括存储器,该存储器中可以存储有上述计算机可执行指令,由处理器执行该指令,即可实现以下任意一种方法。进一步地,该串行双工通讯装置还可以包括通讯接口,该通讯接口可以包括发送端口和接收端口,发送端口和接收端口可以相互独立工作,进而实现该串行双工通讯装置与对端的双工通讯。串行双工通讯装置可以与无人机中的一个模块连接,该模块可以利用串行双工通讯装置实现与无人机中的其他模块进行通讯。例如,主机模块连接有一个串行双工通讯装置,与主机模块通信的飞控模块、视觉模块、传感器模块等可以分别连接有另一个串行双工通讯装置,进而主机模块与其他模块可以利用各自连接的串行双工通讯装置实现通讯连接。其中,串行双工通 讯装置中的一者可以作为与之通讯的串行双工通讯装置的对端。例如,与飞控模块连接的串行通讯装置可以作为与主机模块连接的串行通讯装置的对端。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps illustrated in the flowchart of the figures may be executed in a computer system such as a set of computer executable instructions. For example, the following method can be applied to a processor of a serial duplex communication device, and the serial duplex communication device can further include a memory in which the computer executable instructions can be stored, and executed by the processor, You can implement any of the following methods. Further, the serial duplex communication device may further include a communication interface, and the communication interface may include a transmitting port and a receiving port, and the sending port and the receiving port may work independently of each other, thereby implementing the dual pair of the serial duplex communication device and the opposite end. Communication. The serial duplex communication device can be connected to a module in the drone, which can communicate with other modules in the drone using a serial duplex communication device. For example, the host module is connected to a serial duplex communication device, and the flight control module, the vision module, the sensor module and the like that communicate with the host module can be respectively connected with another serial duplex communication device, and the host module and other modules can be utilized. The serial duplex communication devices connected to each other implement a communication connection. Among them, one of the serial duplex communication devices can serve as the opposite end of the serial duplex communication device with which it communicates. For example, a serial communication device connected to the flight control module can serve as the opposite end of the serial communication device connected to the host module. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
如图1所示,本发明实施例的串行双工通讯方法包括:As shown in FIG. 1, the serial duplex communication method of the embodiment of the present invention includes:
步骤101,通过串行方式与对端传输数据,并统计传输质量信息;Step 101: Transmit data through the serial mode and the opposite end, and collect transmission quality information;
所述传输质量信息用于反映传输数据时通讯干扰的情况,例如:通过连续接收错误次数/连续接收正确次数、连续发送错误次数/连续发送正确次数反映传输数据时通讯干扰的情况:连续接收错误次数或连接发送错误次数越多说明干扰越严重;相反地,连续接收正确次数或连续发送正确次数越多说明干扰越小。The transmission quality information is used to reflect the communication interference when transmitting data, for example, by continuously receiving the number of errors/continuous reception, the number of consecutive transmission errors, or the number of consecutive transmissions, reflecting the communication interference when transmitting data: continuous reception error The more the number of times or the number of connection transmission errors, the more serious the interference; conversely, the more the correct number of consecutive receptions or the more consecutive transmissions, the smaller the interference.
本申请利用串行方式与对端传输数据,可以节省管脚资源,降低装置的传输功耗。The application uses the serial mode and the peer end to transmit data, which can save the pin resources and reduce the transmission power consumption of the device.
具体地,可以利用串行双工通讯装置中的发送端口向对端发送数据,或者利用串行双工通讯装置中的接收端口接收对端发送的数据。Specifically, data may be transmitted to the opposite end by using a transmission port in the serial duplex communication device, or may be received by the receiving port in the serial duplex communication device.
步骤102,根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率。Step 102: Adaptively adjust a communication rate with the peer end transmission data according to the transmission quality information.
其中,自适应调整通讯速率是指:通讯双方可以按多种速率来进行通讯,不同速率的切换自动完成,无需外界干预。Among them, the adaptive adjustment of the communication rate means that the communication parties can communicate at a plurality of rates, and the switching of different rates is automatically completed without external intervention.
由于传输质量信息可以反映通讯干扰的情况,所以在本发明实施例中,可以将通讯干扰的情况作为决策依据,灵活调整通讯速率。进一步地,通过自适应调整通讯速率,在成本不增加的情况下,解决通讯链路被干扰导致失效的问题,保障了无人机的安全,保护了使用者的财产安全。可以保证无人机中各模块之间通讯的有效性以及稳定性。Since the transmission quality information can reflect the situation of the communication interference, in the embodiment of the present invention, the communication interference can be used as a decision basis, and the communication rate can be flexibly adjusted. Further, by adaptively adjusting the communication rate, the problem that the communication link is disturbed and causing the failure is solved without increasing the cost, the safety of the drone is guaranteed, and the property safety of the user is protected. It can guarantee the validity and stability of communication between modules in the drone.
在一实施方式中,所述传输质量信息包括:连续接收错误次数和/或连续接收正确次数。In an embodiment, the transmission quality information includes: consecutively receiving the number of errors and/or continuously receiving the correct number of times.
在一实施方式中,步骤101,通过串行方式与对端传输数据,并统计传输质量信息包括:通过串行方式接收对端发送的数据和相应的校验码,根据接收到的数据计算校验码,并与接收到的校验码进行比对,若不一致,则判断发生错误,丢弃接收到的数据,连续接收错误次数加一,连续接收正确次数清零;若一致,则判断接收正确,将接收正确指示发送给对端,连续接收正确次数加一,连续接收错误次数清零。In an embodiment, in step 101, the data is transmitted in a serial manner with the opposite end, and the transmission of the quality information includes: receiving the data sent by the opposite end and the corresponding check code in a serial manner, and calculating the data according to the received data. Check the code and compare it with the received check code. If it is inconsistent, it is judged that an error has occurred, the received data is discarded, the number of consecutive receiving errors is increased by one, and the number of consecutive receiving is cleared. If they are consistent, the receiving is correct. Send the correct indication to the peer, continuously receive the correct number of times, and clear the number of consecutive reception errors.
在一实施方式中,步骤102,根据所述传输质量信息,自适应调整通讯速率包括:当所述连续接收错误次数大于接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率,连续接收错误次数清零;当所述连续接收正确次数大于接收正确次数阈值,且数据接收速率未达到最高接收速率时, 提高接收速率,连续接收正确次数清零。In an embodiment, in step 102, adaptively adjusting the communication rate according to the transmission quality information includes: when the continuous reception error number is greater than the reception error threshold, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased. The number of consecutive reception errors is cleared; when the correct number of consecutive receptions is greater than the threshold for receiving the correct number of times, and the data reception rate does not reach the highest reception rate, the reception rate is increased, and the correct number of consecutive receptions is cleared.
比如,若接收错误次数阈值被设为5,则当连续接收错误次数达到6,且数据接收速率未达到最低接收速率时,降低接收速率,连续接收错误次数清零;当连续接收错误次数再一次累计达到6,且数据接收速率未达到最低接收速率时,会继续降低接收速率,以此类推。可以理解,根据连续接收正确次数提高接收速率方法也是同样的道理,这里不再赘述。For example, if the threshold of the number of reception errors is set to 5, when the number of consecutive reception errors reaches 6, and the data reception rate does not reach the minimum reception rate, the reception rate is lowered, and the number of consecutive reception errors is cleared; when the number of consecutive reception errors is once again When the accumulated value reaches 6, and the data receiving rate does not reach the minimum receiving rate, the receiving rate will continue to decrease, and so on. It can be understood that the same is true for the method of increasing the receiving rate according to the correct number of consecutive receptions, and details are not described herein again.
进一步地,在其他实施例中,也可以设定当所述连续接收错误次数大于等于接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率,连续接收错误次数清零;当所述连续接收正确次数大于等于接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率,连续接收正确次数清零。如何设定比较的标准是基于接收错误次数阈值和接收正确次数阈值的设定,比如该方案中若将接收错误次数阈值设为6,其实与上述方案中接收错误次数阈值为5的比较结果是一样的,都是在连续接收错误次数或连续接收正确次数达到6的时候进行速率的调整,因此可以认为该方案也属于上述方案的保护范围内。Further, in other embodiments, when the number of consecutive reception errors is greater than or equal to the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is cleared; When the correct number of consecutive receptions is greater than or equal to the threshold for receiving the correct number of times, and the data reception rate does not reach the highest reception rate, the reception rate is increased, and the correct number of consecutive receptions is cleared. How to set the comparison criterion is based on the threshold of the number of reception errors and the threshold of receiving the correct number of times. For example, if the threshold of the number of reception errors is set to 6 in this scheme, the comparison result with the threshold of the number of reception errors in the above scheme is 5 In the same way, the rate is adjusted when the number of consecutive reception errors or the number of consecutive receptions reaches 6. Therefore, it can be considered that the scheme also falls within the protection range of the above scheme.
可以理解,接收错误次数阈值和接收正确次数阈值的设定可以根据具体场合进行设定,这里不作严格要求。It can be understood that the setting of the threshold number of receiving errors and the threshold of receiving the correct number of times can be set according to specific occasions, and is not strictly required here.
其中,接收速率可以分为多个级别,每次降低接收速率时,则降低一个速率级别,直至达到最低接收速率;每次提高接收速率时,则提高一个速率级别,直至达到最高接收速率。The receiving rate can be divided into multiple levels. Each time the receiving rate is lowered, one rate level is lowered until the lowest receiving rate is reached; each time the receiving rate is increased, a rate level is increased until the highest receiving rate is reached.
在另一实施方式中,当所述连续接收错误次数大于当前级别的接收错误次数阈值时,连续接收错误次数可以不必清零;当所述连续接收正确次数大于当前级别的接收正确次数阈值时,连续接收正确次数可以不必清零,连续接收错误次数和连续接收正确次数用累计的方式进行统计,此时,可根据最近一次数据清零(该数据清零有可能是连续接收错误次数清零,也有可能是连续接收正确次数清零)所对应的级别给每级设置一接收错误次数阈值和接收正确次数阈值,即每级对应的接收错误次数阈值和接收正确次数阈值是动态变化的。In another embodiment, when the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, the number of consecutive reception errors may not be cleared; when the correct number of consecutive receptions is greater than a threshold of the correct number of receptions of the current level, The number of consecutive receptions can be eliminated without clearing. The number of consecutive reception errors and the number of consecutive receptions are counted in a cumulative manner. At this time, the data can be cleared according to the last time (this data clear may be the number of consecutive reception errors cleared. It is also possible that the level corresponding to the correct number of consecutive times is cleared. For each level, a threshold of the number of reception errors and a threshold of the number of receptions are set, that is, the threshold of the number of reception errors corresponding to each level and the threshold of the number of receptions are dynamically changed.
其中,步骤102,根据所述传输质量信息,自适应调整通讯速率包括:当所述连续接收错误次数大于当前级别的接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率一个级别;当所述连续接收正确次数大于当前级别的接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率一个级别。Step 102: adaptively adjusting the communication rate according to the transmission quality information, when the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, and the reception rate is decreased. Level; when the consecutive number of consecutive receptions is greater than the current level of the correct number of reception thresholds, and the data reception rate does not reach the highest reception rate, the reception rate is increased by one level.
在一个应用场景,设接收速率按级别分为第一~第五级别,其中第一级别为速率最低的级别,第五级别为速率最高的级别。若最近一次数据清零是发生在第三级别的连续接收错误次数清零,则会依此而给每个对应级别设置一接收错误次数阈值和接收正确次数阈值,比如第三级别的接收错误次数阈值为5, 第二级别的接收错误阈值为10,第一级别的接收错误阈值为15,第三级别的接收正确次数阈值为5,第四级别的接收正确次数阈值为10,第五级别的接收正确次数阈值为15。若当前级别为第三级别,所述连续接收错误次数大于5时便会降低接收速率一个级别至第二级别,这时当前级别变为第二级别,连续接收错误次数可以继续累计,当所述连续接收错误次数大于10时,便会继续降低接收速率一个级别至第一级别。当然,若在第二级别出现一次连续接收正确次数加1的情况(即连续接收错误次数被清零),则会依此而给每个对应级别再重新设置一对应的接收错误次数阈值和接收正确次数阈值。In an application scenario, the receiving rate is divided into first to fifth levels according to the level, where the first level is the lowest rate level, and the fifth level is the highest rate level. If the last data clear is the number of consecutive receive errors that occur at the third level is cleared, a corresponding receive error threshold and a receive correct threshold are set for each corresponding level, such as the third level of receive errors. The threshold is 5, the second level of the receiving error threshold is 10, the first level of the receiving error threshold is 15, the third level of the correct number of receiving threshold is 5, and the fourth level of the correct number of receiving threshold is 10, the fifth level The threshold for receiving the correct number of times is 15. If the current level is the third level, the number of consecutive receiving errors is greater than 5, the receiving rate is decreased by one level to the second level, and the current level becomes the second level, and the number of consecutive receiving errors can continue to be accumulated. When the number of consecutive reception errors is greater than 10, the reception rate will continue to decrease from one level to the first level. Of course, if there is a case where the number of consecutive receptions is increased by one at the second level (that is, the number of consecutive reception errors is cleared), a corresponding reception error threshold and reception are reset for each corresponding level. The correct number of thresholds.
在一实施方式中,所述传输质量信息包括:连续发送错误次数和/或连续发送正确次数。In an embodiment, the transmission quality information includes: consecutively transmitting the number of errors and/or continuously transmitting the correct number of times.
在一实施方式中,步骤101,通过串行方式与对端传输数据,并统计传输质量信息包括:通过串行方式将数据和相应的校验码发送给对端并计时;若在超时阈值时间范围内接收到对端发送的接收正确指示,则连续发送正确次数加一,连续发送错误次数清零;若超过超时阈值还未收到对端发送的接收正确指示,则重新发送所述数据,连续发送错误次数加一,连续发送正确次数清零。In an embodiment, in step 101, the data is transmitted in a serial manner with the opposite end, and the transmission of the quality information includes: transmitting the data and the corresponding check code to the opposite end in a serial manner and timing; if the timeout threshold time is If the correct receiving indication sent by the peer end is received within the range, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared; if the timeout threshold is exceeded, the correct indication of the receiving by the opposite end is not received, then the data is resent. The number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared to zero.
其中,通过串行方式将数据和相应的校验码发送给对端之前,根据所述数据进行计算,得到所述校验码,校验码算法可以采用:循环冗余校验、奇偶检验、码距、海明校验等,本发明不做具体限定。Wherein, before the data and the corresponding check code are sent to the peer end in a serial manner, the check code is obtained according to the data, and the check code algorithm may be: cyclic redundancy check, parity check, The code distance, Hamming check, etc., are not specifically limited in the present invention.
在一实施方式中,步骤102,根据所述传输质量信息,自适应调整通讯速率包括:当所述连续发送错误次数大于发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率,连续发送错误次数清零;当所述连续发送正确次数大于发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率,连续接收正确次数清零。In an embodiment, in step 102, adaptively adjusting the communication rate according to the transmission quality information includes: when the consecutive transmission error number is greater than the transmission error threshold, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased. The number of consecutive transmission errors is cleared; when the correct number of consecutive transmissions is greater than the threshold for transmitting the correct number of times, and the data transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive receptions is cleared.
比如,若发送错误次数阈值被设为5,则当连续发送错误次数达到6,且数据发送速率未达到最低发送速率时,降低发送速率,连续发送错误次数清零;当连续发送错误次数再一次累计达到6,且数据发送速率未达到最低发送速率时,会继续降低发送速率,以此类推。可以理解,根据连续发送正确次数提高发送速率方法也是同样的道理,这里不再赘述。For example, if the threshold of the number of transmission errors is set to 5, when the number of consecutive transmission errors reaches 6, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is lowered, and the number of consecutive transmission errors is cleared; when the number of consecutive transmission errors is once again When the total reaches 6, and the data transmission rate does not reach the minimum transmission rate, the transmission rate will continue to decrease, and so on. It can be understood that the same is true for the method of increasing the transmission rate according to the correct number of consecutive transmissions, and details are not described herein again.
进一步地,在其他实施例中,也可以设定当所述连续发送错误次数大于等于发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率,连续发送错误次数清零;当所述连续发送正确次数大于等于发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率,连续发送正确次数清零。如何设定比较的标准是基于发送错误次数阈值和发送正确次数阈值的设定,比如该方案中若将发送错误次数阈值设为6,其实与上述方案中发送错误次数阈值为5的比较结果是一样的,都是在连续发送错误次数或连续发送正确次数达到6的时候进行速率的调整,因此可以认为该方案也属于上述方案的 保护范围内。Further, in other embodiments, when the number of consecutive transmission errors is greater than or equal to the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared; When the correct number of consecutive transmissions is greater than or equal to the threshold for transmitting the correct number of times, and the data transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive transmissions is cleared. How to set the comparison criterion is based on the setting of the number of transmission error thresholds and the threshold of sending the correct number of times. For example, if the threshold of the number of transmission errors is set to 6 in the scheme, the comparison result with the threshold of the number of transmission errors in the above scheme is 5 In the same way, the rate is adjusted when the number of consecutive transmission errors or the number of consecutive transmissions reaches 6. Therefore, it can be considered that the scheme is also within the protection scope of the above scheme.
可以理解,发送错误次数阈值和发送正确次数阈值的设定可以根据具体场合进行设定,这里不作严格要求。It can be understood that the setting of the number of transmission error thresholds and the threshold of the number of transmission correct times can be set according to specific occasions, and is not strictly required here.
其中,发送速率可以分为多个级别,每次降低发送速率时,则降低一个速率级别,直至达到最低发送速率;每次提高发送速率时,则提高一个速率级别,直至达到最高发送速率。The sending rate can be divided into multiple levels. Each time the sending rate is lowered, one rate level is lowered until the lowest sending rate is reached; each time the sending rate is increased, a rate level is increased until the highest sending rate is reached.
在另一实施方式中,当所述连续发送错误次数大于当前级别的发送错误次数阈值时,连续发送错误次数可以不必清零;当所述连续发送正确次数大于当前级别的发送正确次数阈值时,连续接收正确次数可以不必清零,用累计的方式进行统计,此时,可根据最近一次数据清零(该数据清零有可能是连续发送错误次数清零,也有可能是连续发送正确次数清零)所对应的级别给每级设置一发送错误次数阈值和发送正确次数阈值,即每级对应的发送错误次数阈值和发送正确次数阈值是动态变化的。In another embodiment, when the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, the number of consecutive transmission errors may not need to be cleared; when the correct number of consecutive transmissions is greater than a threshold of the correct number of transmissions of the current level, The number of consecutive receptions can be cleared without clearing. In this case, the data can be cleared according to the last time. The data can be cleared according to the last time. (The data clearing may be the number of consecutive transmission errors cleared, or it may be the correct number of consecutive transmissions. The level corresponding to each level is set to a number of transmission error thresholds and a threshold number of transmission correct times, that is, the number of transmission error thresholds and the number of correct transmission times corresponding to each level are dynamically changed.
其中,步骤102,根据所述传输质量信息,自适应调整通讯速率包括:当所述连续发送错误次数大于当前级别的发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率一个级别;当所述连续发送正确次数大于当前级别的发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率一个级别。Step 102: adaptively adjusting the communication rate according to the transmission quality information, when the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, and the data transmission rate does not reach the minimum transmission rate, and the transmission rate is decreased. Level: When the consecutive number of consecutive transmissions is greater than the current level of the correct number of transmission thresholds, and the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
在一个应用场景,设发送速率按级别分为第一~第五级别,其中第一级别为速率最低的级别,第五级别为速率最高的级别。若最近一次数据清零是发生在第三级别的连续发送错误次数清零,则会依此而给每个对应级别设置一发送错误次数阈值和发送正确次数阈值,比如第三级别的发送错误次数阈值为5,第二级别的发送错误阈值为10,第一级别的发送错误阈值为15,第三级别的发送正确次数阈值为5,第四级别的发送正确次数阈值为10,第五级别的发送正确次数阈值为15。若当前级别为第三级别,所述连续发送错误次数大于5时便会降低接收速率一个级别至第二级别,这时当前级别变为第二级别,连续发送错误次数可以继续累计,当所述连续发送错误次数大于10时,便会继续降低发送速率一个级别至第一级别。当然,若在第二级别出现一次连续发送正确次数加1的情况(即连续发送错误次数被清零),则会依此而给每个对应级别再重新设置一对应的发送错误次数阈值和发送正确次数阈值。In an application scenario, the sending rate is divided into first to fifth levels according to the level, where the first level is the lowest rate level, and the fifth level is the highest rate level. If the last data clear is the number of consecutive transmission errors that occur at the third level is cleared, a corresponding number of transmission error thresholds and a correct number of transmission thresholds are set for each corresponding level, such as the number of transmission errors of the third level. The threshold is 5, the second level of the transmission error threshold is 10, the first level of the transmission error threshold is 15, the third level of the correct number of transmissions is 5, and the fourth level of the correct number of times is 10, the fifth level The threshold for sending the correct number of times is 15. If the current level is the third level, the number of consecutive transmission errors greater than 5 will reduce the receiving rate by one level to the second level, at which time the current level becomes the second level, and the number of consecutive transmission errors can continue to be accumulated when When the number of consecutive transmission errors is greater than 10, the transmission rate will continue to decrease by one level to the first level. Of course, if there is a case where the number of consecutive transmissions is increased by one at the second level (that is, the number of consecutive transmission errors is cleared), a corresponding number of transmission error thresholds and transmissions are reset for each corresponding level. The correct number of thresholds.
如图2所示,为本发明应用示例的串行双工通讯应用场景示意图,其中,两个串行双工通讯装置采用串行双工方式通讯,将其中一个作为本地的串行双工通讯装置,另一个作为对端的串行双工通讯装置,本文以本地的串行双工通讯装置为例进行说明,如果没有特别说明,文中串行双工通讯装置均指本地的串行双工通讯装置,对端的实现过程可以与本地一样,不再赘述。FIG. 2 is a schematic diagram of a serial duplex communication application scenario according to an application example of the present invention, wherein two serial duplex communication devices communicate in a serial duplex mode, and one of them is used as a local serial duplex communication. The device is another serial duplex communication device. The local serial duplex communication device is used as an example. If not specified, the serial duplex communication device refers to the local serial duplex communication. The implementation process of the peer end can be the same as the local one, and will not be described again.
串行双工通讯装置与主机模块相连,串行双工通讯装置设置有数据写入接 口和数据读出接口,串行双工通讯装置通过向主机模块发送带宽指示信号,告知主机模块当前采用的带宽速率,主机模块根据当前指示的带宽速率向数据写入接口写入数据。当串行双工通讯装置接收到对端发送的数据,判断数据正确时,存储该数据,等待主机模块从数据读出接口读出数据。The serial duplex communication device is connected to the host module, and the serial duplex communication device is provided with a data writing interface and a data reading interface, and the serial duplex communication device notifies the host module of the current adoption by transmitting a bandwidth indication signal to the host module. The bandwidth rate at which the host module writes data to the data write interface based on the currently indicated bandwidth rate. When the serial duplex communication device receives the data sent by the opposite end and judges that the data is correct, the data is stored and waits for the host module to read data from the data read interface.
其中,该带宽指示信号可以是由串行双工通讯装置中的发送端口获得的,发送端口通过监测带宽速率,可以使主机模块控制数据写入速率,进而保证数据通过发送端口传输的流畅性,避免数据在串行双工通讯装置中拥堵。The bandwidth indication signal may be obtained by a transmission port in the serial duplex communication device, and the transmission port can control the data write rate by monitoring the bandwidth rate, thereby ensuring the smoothness of data transmission through the transmission port. Avoid data congestion in serial duplex communication devices.
另一种实现方式中,串行双工通讯装置中的处理器可以根据发送端口检测到的带宽速率,确定当前所能接受的数据写入速率,进而向主机模块发送带宽指示信号,该带宽指示信号用以指示主机模块写入数据时的数据写入速率。进而主机模块根据带宽指示信号中所指示的数据写入速率来写入数据。In another implementation manner, the processor in the serial duplex communication device can determine the currently acceptable data write rate according to the bandwidth rate detected by the sending port, and further send a bandwidth indication signal to the host module, where the bandwidth indication is The signal is used to indicate the data write rate when the host module writes data. The host module then writes the data according to the data write rate indicated in the bandwidth indication signal.
进一步地,串行双工通讯装置中的处理器还可以结合数据写入速率来确定数据发送速率,例如,数据写入速率等于数据发送速率,以保证数据传输的及时性,等等。Further, the processor in the serial duplex communication device can also determine the data transmission rate in conjunction with the data write rate, for example, the data write rate is equal to the data transmission rate to ensure the timeliness of data transmission, and the like.
进一步地,串行双工通讯装置中的处理器还可以结合数据写入速率和从接收端口的数据接收速率,来确定数据发送速率。Further, the processor in the serial duplex communication device can also determine the data transmission rate in conjunction with the data write rate and the data reception rate from the receiving port.
在此,所确定的数据发送速率可以是指串行双工通讯装置的初始数据发送速率,并可以利用本申请实施例的方法,对该初始数据发送速率进行调节。Here, the determined data transmission rate may refer to an initial data transmission rate of the serial duplex communication device, and the initial data transmission rate may be adjusted by using the method of the embodiment of the present application.
应用示例一Application example one
如图3所示,本发明应用示例一的串行双工通讯装置接收数据包括如下步骤:As shown in FIG. 3, the serial duplex communication device of the first application example of the present invention receives data according to the following steps:
步骤301,接收对端发送的数据和校验码。Step 301: Receive data and a check code sent by the opposite end.
其中,数据通常以数据包的方式发送和接收。Among them, the data is usually sent and received in the form of data packets.
步骤302,根据接收到的数据计算校验码,并与接收到的校验码进行比对,若不一致,则判断发生错误,执行步骤303,若一致,则判断接收正确,执行步骤308。Step 302: Calculate the check code according to the received data, and compare with the received check code. If not, it is determined that an error has occurred, and step 303 is performed. If they are consistent, it is determined that the reception is correct, and step 308 is performed.
步骤303,丢弃接收到的数据,连续接收错误次数加一,连续接收正确次数清零。In step 303, the received data is discarded, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared.
步骤304,判断连续接收错误次数是否大于接收错误次数阈值,若是,执行步骤305,若否,执行步骤306。Step 304: Determine whether the number of consecutive reception errors is greater than a threshold number of reception errors. If yes, go to step 305. If no, go to step 306.
步骤305,判断数据接收速率是否达到最低接收速率,若是,执行步骤306;若否,执行步骤307。Step 305: Determine whether the data receiving rate reaches the minimum receiving rate. If yes, go to step 306; if no, go to step 307.
步骤306,保持当前接收速率不变。In step 306, the current receiving rate is kept unchanged.
其中,若连续接收错误次数大于接收错误次数阈值,且数据接收速率达到最低接收速率,则可以进行告警,表示传输线路可能出现故障,或者干扰太强不适合传输数据。If the number of consecutive receiving errors is greater than the threshold of the number of receiving errors, and the data receiving rate reaches the minimum receiving rate, an alarm may be generated, indicating that the transmission line may be faulty, or the interference is too strong to transmit data.
步骤307,降低接收速率一个级别,连续接收错误次数清零。In step 307, the receiving rate is reduced by one level, and the number of consecutive receiving errors is cleared.
步骤308,等待主机模块从数据读出接口读出数据,并将接收正确指示发送给对端,连续接收正确次数加一,连续接收错误次数清零。 Step 308, waiting for the host module to read data from the data read interface, and send the correct indication to the opposite end, continuously receiving the correct number of times plus one, and the number of consecutive receiving errors is cleared.
步骤309,判断连续接收正确次数是否大于接收正确次数阈值,若是,执行步骤310,若否,执行步骤306。Step 309: Determine whether the number of consecutive receiving correct times is greater than the receiving correct number threshold. If yes, go to step 310. If no, go to step 306.
步骤310,判断数据接收速率是否达到最高接收速率,若是,则执行步骤306,若否,则执行步骤311。Step 310: Determine whether the data receiving rate reaches the highest receiving rate. If yes, go to step 306. If no, go to step 311.
步骤311,提高接收速率一个级别,连续接收正确次数清零。In step 311, the receiving rate is increased by one level, and the consecutive receiving correct times are cleared.
如图4所示,本发明应用示例一的串行双工通讯装置发送数据包括如下步骤:As shown in FIG. 4, the serial duplex communication device of the first application example of the present invention transmits data including the following steps:
步骤401,将主机模块写入的数据和相应的校验码发送给对端并计时。Step 401: Send the data written by the host module and the corresponding check code to the peer end and time.
步骤402,判断在超时阈值时间范围内是否未接收到对端发送的接收正确指示,若是,则执行步骤403,若否,则执行步骤408。Step 402: Determine whether the correct receiving indication sent by the peer end is not received within the timeout threshold time range. If yes, go to step 403. If no, go to step 408.
步骤403,重新发送所述数据,连续发送错误次数加一,连续发送正确次数清零。In step 403, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
步骤404,判断连续发送错误次数是否大于发送错误次数阈值,若是,则执行步骤405,若否,则执行步骤406。In step 404, it is determined whether the number of consecutive transmission errors is greater than the number of transmission error thresholds. If yes, step 405 is performed, and if no, step 406 is performed.
步骤405,判断数据发送速率是否达到最低发送速率,若是,则执行步骤406,若否,则执行步骤407。Step 405: Determine whether the data transmission rate reaches the minimum transmission rate. If yes, go to step 406. If no, go to step 407.
步骤406,保持当前发送速率不变。In step 406, the current transmission rate is kept unchanged.
其中,若连续发送错误次数大于发送错误次数阈值,且数据发送速率达到最低发送速率,则可以进行告警,表示传输线路可能出现故障,或者干扰太强不适合传输数据。If the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate reaches the minimum transmission rate, an alarm may be generated, indicating that the transmission line may be faulty, or the interference is too strong to transmit data.
步骤407,降低发送速率一个级别,并通过带宽指示信号告知主机模块,连续发送错误次数清零。In step 407, the transmission rate is reduced by one level, and the host module is notified by the bandwidth indication signal, and the number of consecutive transmission errors is cleared.
步骤408,连续发送正确次数加一,连续发送错误次数清零。In step 408, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared.
步骤409,判断连续发送正确次数是否大于发送正确次数阈值,若是,则执行步骤410,若否,则执行步骤406。In step 409, it is determined whether the number of consecutive transmissions is greater than the number of times the transmission is correct. If yes, step 410 is performed, and if no, step 406 is performed.
步骤410,判断数据发送速率是否达到最高发送速率,若是,则执行步骤406,若否,则执行步骤411。Step 410: Determine whether the data transmission rate reaches the highest transmission rate. If yes, go to step 406. If no, go to step 411.
步骤411,提高发送速率一个级别,并通过带宽指示信号告知主机模块,连续接收正确次数清零。In step 411, the transmission rate is increased by one level, and the host module is notified by the bandwidth indication signal, and the correct number of consecutive receptions is cleared.
应用示例二Application example two
如图5所示,本发明应用示例二的串行双工通讯装置接收数据包括如下步骤:As shown in FIG. 5, the serial duplex communication device of the second application of the present invention receives data according to the following steps:
步骤501,接收对端发送的数据和校验码。Step 501: Receive data and a check code sent by the peer end.
其中,数据通常以数据包的方式发送和接收。Among them, the data is usually sent and received in the form of data packets.
步骤502,根据接收到的数据计算校验码,并与接收到的校验码进行比对,若不一致,则判断发生错误,执行步骤503,若一致,则判断接收正确,执行步骤508。Step 502: Calculate the check code according to the received data, and compare it with the received check code. If it is inconsistent, it is determined that an error has occurred, and step 503 is performed. If they are consistent, it is determined that the reception is correct, and step 508 is performed.
步骤503,丢弃接收到的数据,连续接收错误次数加一,连续接收正确次数清零。In step 503, the received data is discarded, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared to zero.
步骤504,判断连续接收错误次数是否大于当前级别的接收错误次数阈值,若是,执行步骤505,若否,执行步骤506。Step 504: Determine whether the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level. If yes, go to step 505. If no, go to step 506.
步骤505,判断数据接收速率是否达到最低接收速率,若是,执行步骤506;若否,执行步骤507。Step 505: Determine whether the data receiving rate reaches the minimum receiving rate. If yes, go to step 506; if no, go to step 507.
步骤506,保持当前接收速率不变。In step 506, the current receiving rate is kept unchanged.
其中,若连续接收错误次数大于当前级别的接收错误次数阈值,且数据接收速率达到最低接收速率,则可以进行告警,表示传输线路可能出现故障,或者干扰太强不适合传输数据。If the number of consecutive receiving errors is greater than the current number of receiving error thresholds, and the data receiving rate reaches the minimum receiving rate, an alarm may be generated, indicating that the transmission line may be faulty, or the interference is too strong to transmit data.
步骤507,降低接收速率一个级别。In step 507, the receiving rate is lowered by one level.
步骤508,等待主机模块从数据读出接口读出数据,并将接收正确指示发送给对端,连续接收正确次数加一,连续接收错误次数清零。Step 508: Wait for the host module to read data from the data readout interface, and send the correct indication to the opposite end, and continuously receive the correct number of times plus one, and the number of consecutive receive errors is cleared.
步骤509,判断连续接收正确次数是否大于当前级别的接收正确次数阈值,若是,执行步骤510,若否,执行步骤506。In step 509, it is determined whether the correct number of consecutive receptions is greater than the current correct reception threshold. If yes, go to step 510. If no, go to step 506.
步骤510,判断数据接收速率是否达到最高接收速率,若是,则执行步骤506,若否,则执行步骤511。Step 510: Determine whether the data receiving rate reaches the highest receiving rate. If yes, go to step 506. If no, go to step 511.
步骤511,提高接收速率一个级别。In step 511, the receiving rate is increased by one level.
如图6所示,本发明应用示例二的串行双工通讯装置发送数据包括如下步骤:As shown in FIG. 6, the serial duplex communication device of the second application of the present invention transmits data including the following steps:
步骤601,将主机模块写入的数据和相应的校验码发送给对端并计时。Step 601: Send the data written by the host module and the corresponding check code to the peer end and time.
步骤602,判断在超时阈值时间范围内是否未接收到对端发送的接收正确指示,若是,则执行步骤603,若否,则执行步骤608。Step 602: Determine whether the correct receiving indication sent by the peer end is not received within the timeout threshold time range. If yes, go to step 603. If no, go to step 608.
步骤603,重新发送所述数据,连续发送错误次数加一,连续发送正确次数清零。In step 603, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
步骤604,判断连续发送错误次数是否大于当前级别的发送错误次数阈值,若是,则执行步骤605,若否,则执行步骤606。In step 604, it is determined whether the number of consecutive transmission errors is greater than the current level of the number of transmission error thresholds. If yes, step 605 is performed, and if no, step 606 is performed.
步骤605,判断数据发送速率是否达到最低发送速率,若是,则执行步骤606,若否,则执行步骤607。Step 605: Determine whether the data transmission rate reaches the minimum transmission rate. If yes, go to step 606. If no, go to step 607.
步骤606,保持当前发送速率不变。In step 606, the current transmission rate is kept unchanged.
其中,若连续发送错误次数大于发送错误次数阈值,且数据发送速率达到最低发送速率,则可以进行告警,表示传输线路可能出现故障,或者干扰太强不适合传输数据。If the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate reaches the minimum transmission rate, an alarm may be generated, indicating that the transmission line may be faulty, or the interference is too strong to transmit data.
步骤607,降低发送速率一个级别,并通过带宽指示信号告知主机模块。In step 607, the transmission rate is reduced by one level, and the host module is notified by the bandwidth indication signal.
步骤608,连续发送正确次数加一,连续发送错误次数清零。In step 608, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared.
步骤609,判断连续发送正确次数是否大于当前级别的发送正确次数阈值,若是,则执行步骤610,若否,则执行步骤606。In step 609, it is determined whether the number of consecutive transmissions is greater than the current level of the correct number of transmission thresholds. If yes, step 610 is performed, and if no, step 606 is performed.
步骤610,判断数据发送速率是否达到最高发送速率,若是,则执行步骤606,若否,则执行步骤611。Step 610: Determine whether the data transmission rate reaches the highest transmission rate. If yes, go to step 606. If no, go to step 611.
步骤611,提高发送速率一个级别,并通过带宽指示信号告知主机模块。In step 611, the transmission rate is increased by one level, and the host module is notified by the bandwidth indication signal.
本发明实施例中,通过采用速率自适应的串行双工通讯方式,在无干扰或者干扰小的情况下,使用高速率通讯,提高带宽,提高无人机飞行质量,保证任务高质量进行;在中度干扰或者干扰严重的情况下,降低通讯速率,保证基本数据需求,使无人机能够保证基本的安全飞行与返航或者启动应急措施。In the embodiment of the present invention, by adopting the rate adaptive serial duplex communication mode, high-rate communication is used in the case of no interference or small interference, the bandwidth is improved, the flying quality of the drone is improved, and the high-quality task is ensured; In the case of moderate interference or severe interference, reduce the communication rate and ensure the basic data requirements, so that the drone can guarantee basic safe flight and return flight or initiate emergency measures.
需要说明是,传输质量信息用于反映传输数据时通讯干扰的情况,在上述实施例中,针对接收数据,传输质量信息包括:连续接收错误次数和连续接收正确次数;针对发送数据,传输质量信息包括连续发送错误次数和连续发送正确次数。但本发明不限于此,传输质量信息还可以用其他信息表示,例如,在其他实施例中,针对接收数据,传输质量信息可以包括:接收成功率和/或接收失败率;针对发送数据,传输质量信息可以包括发送成功率和/或发送失败率。It should be noted that the transmission quality information is used to reflect the communication interference when the data is transmitted. In the foregoing embodiment, for the received data, the transmission quality information includes: the number of consecutive reception errors and the number of consecutive receptions; and the transmission quality information for the transmission data. This includes the number of consecutive transmission errors and the number of consecutive transmissions. However, the present invention is not limited thereto, and the transmission quality information may also be represented by other information. For example, in other embodiments, for receiving data, the transmission quality information may include: a reception success rate and/or a reception failure rate; for transmitting data, transmission The quality information may include a transmission success rate and/or a transmission failure rate.
其中,接收成功率可以是当前接收速率下指定时间范围内(例如5分钟)接收正确次数除以总接收次数;接收失败率可以是当前接收速率下指定时间范围内(例如5分钟)接收错误次数除以总接收次数。发送成功率可以是当前发送速率下指定时间范围内(例如5分钟)发送正确次数除以总发送次数;发送失败率可以是当前发送速率下指定时间范围内(例如5分钟)发送错误次数除以总发送次数。The receiving success rate may be the correct number of times received within a specified time range (for example, 5 minutes) at the current receiving rate divided by the total number of received times; the receiving failure rate may be the number of receiving errors within a specified time range (for example, 5 minutes) at the current receiving rate. Divide by the total number of receptions. The transmission success rate may be the correct number of transmissions within the specified time range (for example, 5 minutes) divided by the total number of transmissions at the current transmission rate; the transmission failure rate may be the number of transmission errors within a specified time range (for example, 5 minutes) at the current transmission rate divided by The total number of times sent.
本发明实施例还提供了一种串行双工通讯装置,该装置用于实现上述实施例及实施方式,已经进行过说明的不再赘述。The embodiment of the present invention further provides a serial duplex communication device, which is used to implement the foregoing embodiments and implementation manners, and has not been described again.
本发明实施例的串行双工通讯装置,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现以下步骤:The serial duplex communication device of the embodiment of the invention comprises: a memory, a processor and a computer program stored on the memory and operable on the processor, the processor implementing the program to implement the following steps:
通过串行方式与对端传输数据,并统计传输质量信息;所述传输质量信息用于反映传输数据时通讯干扰的情况;Transmitting data through the serial mode and the opposite end, and counting the transmission quality information; the transmission quality information is used to reflect the communication interference when transmitting the data;
根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率。And adaptively adjusting a communication rate with the peer end transmission data according to the transmission quality information.
在一实施方式中,所述传输质量信息包括:连续接收错误次数和/或连续接收正确次数。In an embodiment, the transmission quality information includes: consecutively receiving the number of errors and/or continuously receiving the correct number of times.
在一实施方式中,所述处理器执行所述程序时还实现:In an embodiment, the processor further implements when executing the program:
通过串行方式接收对端发送的数据和相应的校验码,根据接收到的数据计算校验码,并与接收到的校验码进行比对,若不一致,则判断发生错误,丢弃接收到的数据,连续接收错误次数加一,连续接收正确次数清零;若一致,则判断接收正确,将接收正确指示发送给对端,连续接收正确次数加一,连续接收错误次数清零。Receiving the data sent by the opposite end and the corresponding check code in a serial manner, calculating the check code according to the received data, and comparing with the received check code, if not, determining that an error occurs, discarding the received The data, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared. If it is consistent, it is judged that the reception is correct, the correct reception indication is sent to the opposite end, the correct number of consecutive receptions is increased by one, and the number of consecutive reception errors is cleared.
在一实施方式中,所述处理器执行所述程序时还实现:当所述连续接收错误次数大于接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率,连续接收错误次数清零;当所述连续接收正确次数大于接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率,连续接收正确次数清零。In an embodiment, when the processor executes the program, when the number of consecutive reception errors is greater than the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is received. Cleared; when the correct number of consecutive receptions is greater than the threshold for receiving the correct number of times, and the data reception rate does not reach the highest reception rate, the reception rate is increased, and the correct number of consecutive receptions is cleared.
在一实施方式中,所述处理器执行所述程序时还实现:当所述连续接收错误次数大于当前级别的接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率一个级别;当所述连续接收正确次数大于当前级别的接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率一个级别。In an embodiment, when the processor executes the program, when the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, the reception rate is reduced by one level. When the consecutive number of consecutive receptions is greater than the current level of the correct number of reception thresholds, and the data reception rate does not reach the highest reception rate, the reception rate is increased by one level.
在一实施方式中,所述传输质量信息包括:连续发送错误次数和连续发送正确次数。In an embodiment, the transmission quality information includes: the number of consecutive transmission errors and the number of consecutive transmissions.
在一实施方式中,所述处理器执行所述程序时还实现:In an embodiment, the processor further implements when executing the program:
通过串行方式将数据和相应的校验码发送给对端并计时;若在超时阈值时间范围内接收到对端发送的接收正确指示,则连续发送正确次数加一,连续发送错误次数清零;若超过超时阈值还未收到对端发送的接收正确指示,则重新发送所述数据,连续发送错误次数加一,连续发送正确次数清零。The data and the corresponding check code are sent to the opposite end in a serial manner and timed; if the correct receiving indication sent by the opposite end is received within the timeout threshold time range, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared. If the timeout threshold has not received the correct indication of the reception sent by the peer, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
在一实施方式中,所述处理器执行所述程序时还实现:In an embodiment, the processor further implements when executing the program:
当所述连续发送错误次数大于发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率,连续发送错误次数清零;当所述连续发送正确次数大于发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率,连续接收正确次数清零。When the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared; when the consecutive number of consecutive transmissions is greater than the threshold for sending the correct number of times, and the data When the transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the number of consecutive receptions is cleared to zero.
在一实施方式中,所述处理器执行所述程序时还实现:In an embodiment, the processor further implements when executing the program:
当所述连续发送错误次数大于当前级别的发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率一个级别;当所述连续发送正确次数大于发送当前级别的正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率一个级别。When the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is reduced by one level; when the consecutive number of consecutive transmissions is greater than the correct number of times of sending the current level, and When the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
在本发明实施例中,可以将通讯干扰的情况作为决策依据,灵活调整通讯速率。进一步地,通过自适应调整通讯速率,在成本不增加的情况下,解决通讯链路被干扰导致失效的问题,保障了无人机的安全,保护了使用者的财产安全。In the embodiment of the present invention, the communication interference can be used as a decision basis, and the communication rate can be flexibly adjusted. Further, by adaptively adjusting the communication rate, the problem that the communication link is disturbed and causing the failure is solved without increasing the cost, the safety of the drone is guaranteed, and the property safety of the user is protected.
本发明实施例还提供了一种串行双工通讯装置,该装置用于实现上述实施例及实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置可以以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。The embodiment of the present invention further provides a serial duplex communication device, which is used to implement the foregoing embodiments and implementation manners, and has not been described again. As used below, the term "module" may implement a combination of software and/or hardware of a predetermined function. Although the devices described in the following embodiments may be implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
如图7所示,本发明实施例的串行双工通讯装置包括:As shown in FIG. 7, the serial duplex communication device of the embodiment of the present invention includes:
传输模块71,用于通过串行方式与对端传输数据,并统计传输质量信息;所述传输质量信息用于反映传输数据时通讯干扰的情况;The transmission module 71 is configured to transmit data through the serial manner and the opposite end, and collect transmission quality information; the transmission quality information is used to reflect a communication interference situation when transmitting data;
调整模块72,用于根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率。The adjusting module 72 is configured to adaptively adjust a communication rate with the peer end transmission data according to the transmission quality information.
在一实施方式中,所述传输质量信息包括:连续接收错误次数和连续接收正确次数。In an embodiment, the transmission quality information includes: the number of consecutive reception errors and the number of consecutive receptions.
在一实施方式中,所述传输模块71,进一步用于:In an embodiment, the transmission module 71 is further configured to:
通过串行方式接收对端发送的数据和相应的校验码,根据接收到的数据计算校验码,并与接收到的校验码进行比对,若不一致,则判断发生错误,丢弃接收到的数据,连续接收错误次数加一,连续接收正确次数清零;若一致,则判断接收正确,将接收正确指示发送给对端,连续接收正确次数加一,连续接收错误次数清零。Receiving the data sent by the opposite end and the corresponding check code in a serial manner, calculating the check code according to the received data, and comparing with the received check code, if not, determining that an error occurs, discarding the received The data, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared. If it is consistent, it is judged that the reception is correct, the correct reception indication is sent to the opposite end, the correct number of consecutive receptions is increased by one, and the number of consecutive reception errors is cleared.
在一实施方式中,所述调整模块72,进一步用于:In an embodiment, the adjusting module 72 is further configured to:
当所述连续接收错误次数大于接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率,连续接收错误次数清零;When the number of consecutive reception errors is greater than the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is cleared;
当所述连续接收正确次数大于接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率,连续接收正确次数清零。When the correct number of consecutive receptions is greater than the threshold for receiving the correct number of times, and the data reception rate does not reach the highest reception rate, the reception rate is increased, and the correct number of consecutive receptions is cleared.
在一实施方式中,所述调整模块72,进一步用于:In an embodiment, the adjusting module 72 is further configured to:
当所述连续接收错误次数大于当前级别的接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率一个级别;When the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, the reception rate is reduced by one level;
当所述连续接收正确次数大于当前级别的接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率一个级别。When the consecutive number of consecutive receptions is greater than the current level of the correct number of reception thresholds, and the data reception rate does not reach the highest reception rate, the reception rate is increased by one level.
在一实施方式中,所述传输质量信息包括:连续发送错误次数和连续发送正确次数。In an embodiment, the transmission quality information includes: the number of consecutive transmission errors and the number of consecutive transmissions.
在一实施方式中,所述传输模块71,进一步用于:In an embodiment, the transmission module 71 is further configured to:
通过串行方式将数据和相应的校验码发送给对端并计时;若在超时阈值时间范围内接收到对端发送的接收正确指示,则连续发送正确次数加一,连续发送错误次数清零;若超过超时阈值还未收到对端发送的接收正确指示,则重新发送所述数据,连续发送错误次数加一,连续发送正确次数清零。The data and the corresponding check code are sent to the opposite end in a serial manner and timed; if the correct receiving indication sent by the opposite end is received within the timeout threshold time range, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared. If the timeout threshold has not received the correct indication of the reception sent by the peer, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
在一实施方式中,所述调整模块72,进一步用于:In an embodiment, the adjusting module 72 is further configured to:
当所述连续发送错误次数大于发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率,连续发送错误次数清零;When the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared;
当所述连续发送正确次数大于发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率,连续接收正确次数清零。When the consecutive number of consecutive transmissions is greater than the threshold for transmitting the correct number of times, and the data transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive receptions is cleared.
在一实施方式中,所述调整模块72,进一步用于:In an embodiment, the adjusting module 72 is further configured to:
当所述连续发送错误次数大于当前级别的发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率一个级别;When the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is reduced by one level;
当所述连续发送正确次数大于当前级别的发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率一个级别。When the consecutive number of consecutive transmissions is greater than the current level of the correct number of transmission thresholds, and the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
在本发明实施例中,可以将通讯干扰的情况作为决策依据,灵活调整通讯速率。进一步地,通过自适应调整通讯速率,在成本不增加的情况下,解决通讯链路被干扰导致失效的问题,保障了无人机的安全,保护了使用者的财产安全。In the embodiment of the present invention, the communication interference can be used as a decision basis, and the communication rate can be flexibly adjusted. Further, by adaptively adjusting the communication rate, the problem that the communication link is disturbed and causing the failure is solved without increasing the cost, the safety of the drone is guaranteed, and the property safety of the user is protected.
本发明的实施例还提供了一种存储介质。在本实施例中,上述存储介质可以被设置为存储用于执行例如以下步骤的程序代码:Embodiments of the present invention also provide a storage medium. In the present embodiment, the above storage medium may be arranged to store program code for performing, for example, the following steps:
S1,通过串行方式与对端传输数据,并统计传输质量信息;所述传输质量信息用于反映传输数据时通讯干扰的情况;S1, transmitting data through the serial mode and the opposite end, and collecting transmission quality information; the transmission quality information is used to reflect the communication interference when transmitting the data;
S2,根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率。S2. adaptively adjust a communication rate with the peer end transmission data according to the transmission quality information.
在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。In this embodiment, the foregoing storage medium may include, but not limited to, a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk. A variety of media that can store program code.
本实施例中的示例可以参考上述实施例及实施方式中所描述的示例,本实施例在此不再赘述。For examples in this embodiment, reference may be made to the examples described in the foregoing embodiments and implementation manners, and details are not described herein again.
本实施例还提供了一种串行双工通讯装置,该装置包括处理器,处理器用于实现上述传输模块71和调整模块72的功能,具体的,其执行如下过程:通过串行方式与对端传输数据,并统计传输质量信息;所述传输质量信息用于反映传输数据时通讯干扰的情况;根据所述传输质量信息,自适应调整通讯速率。The embodiment further provides a serial duplex communication device, the device includes a processor, and the processor is configured to implement the functions of the foregoing transmission module 71 and the adjustment module 72. Specifically, the device performs the following process: through serial mode and pair The terminal transmits data and calculates transmission quality information; the transmission quality information is used to reflect a situation of communication interference when transmitting data; and the communication rate is adaptively adjusted according to the transmission quality information.
显然,本领域的技术人员应该明白,上述的本发明实施例的模块或步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某 些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明实施例不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that the above-described modules or steps of the embodiments of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device or distributed over a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein. The steps shown or described are performed either separately as an integrated circuit module, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
虽然本发明所揭露的实施方式如上,但所述的内容仅为便于理解本发明而采用的实施方式,并非用以限定本发明。任何本发明所属领域内的技术人员,在不脱离本发明所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本发明的专利保护范围,仍须以所附的权利要求书所界定的范围为准。While the embodiments of the present invention have been described above, the described embodiments are merely for the purpose of understanding the invention and are not intended to limit the invention. Any modification and variation in the form and details of the embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention. The scope defined by the appended claims shall prevail.

Claims (15)

  1. 一种串行双工通讯方法,包括:A serial duplex communication method includes:
    通过串行方式与对端传输数据,并统计传输质量信息;所述传输质量信息用于反映传输数据时通讯干扰的情况;Transmitting data through the serial mode and the opposite end, and counting the transmission quality information; the transmission quality information is used to reflect the communication interference when transmitting the data;
    根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率。And adaptively adjusting a communication rate with the peer end transmission data according to the transmission quality information.
  2. 根据权利要求1所述的方法,其特征在于,The method of claim 1 wherein
    所述传输质量信息包括:连续接收错误次数和/或连续接收正确次数。The transmission quality information includes: the number of consecutive reception errors and/or the number of consecutive receptions.
  3. 根据权利要求2所述的方法,其特征在于,所述通过串行方式与对端传输数据,并统计传输质量信息包括:The method according to claim 2, wherein the transmitting the data in a serial manner with the opposite end and counting the transmission quality information comprises:
    通过串行方式接收对端发送的数据和相应的校验码,根据接收到的数据计算校验码,并与接收到的校验码进行比对;Receiving the data sent by the opposite end and the corresponding check code in a serial manner, calculating a check code according to the received data, and comparing the received check code;
    若不一致,则判断发生错误,丢弃接收到的数据,连续接收错误次数加一,连续接收正确次数清零;If they are inconsistent, it is judged that an error has occurred, the received data is discarded, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared to zero;
    若一致,则判断接收正确,将接收正确指示发送给所述对端,连续接收正确次数加一,连续接收错误次数清零。If they are consistent, it is judged that the reception is correct, and the correct reception indication is sent to the opposite end, and the number of consecutive receptions is increased by one, and the number of consecutive reception errors is cleared.
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率包括:The method according to claim 3, wherein the adaptively adjusting the communication rate with the data transmitted by the peer according to the transmission quality information comprises:
    当所述连续接收错误次数大于接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率,连续接收错误次数清零;当所述连续接收正确次数大于接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率,连续接收正确次数清零;或者,When the number of consecutive reception errors is greater than the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is cleared; when the consecutive reception correct times are greater than the reception correct number threshold, and the data When the receiving rate does not reach the highest receiving rate, the receiving rate is increased, and the correct number of consecutive receiving times is cleared; or,
    当所述连续接收错误次数大于当前级别的接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率一个级别;当所述连续接收正确次数大于当前级别的接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率一个级别。When the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, the reception rate is reduced by one level; when the consecutive reception correct times are greater than the current level of the reception correct number threshold, and When the data reception rate does not reach the maximum reception rate, the reception rate is increased by one level.
  5. 根据权利要求1~4中任意一项所述的方法,其特征在于,所述传输质量信息包括:连续发送错误次数和/或连续发送正确次数。The method according to any one of claims 1 to 4, wherein the transmission quality information comprises: consecutive transmission errors and/or consecutive transmissions of the correct number of times.
  6. 根据权利要求5所述的方法,其特征在于,所述通过串行方式与对端传输数据,并统计传输质量信息包括:The method according to claim 5, wherein the transmitting the data in a serial manner with the opposite end and counting the transmission quality information comprises:
    通过串行方式将数据和相应的校验码发送给对端并计时;若在超时阈值时间范围内接收到对端发送的接收正确指示,则连续发送正确次数加一,连续发送错误次数清零;若超过超时阈值还未收到对端发送的接收正确指示,则重新发送所述数据,连续发送错误次数加一,连续发送正确次数清零。The data and the corresponding check code are sent to the opposite end in a serial manner and timed; if the correct receiving indication sent by the opposite end is received within the timeout threshold time range, the correct number of consecutive transmissions is incremented by one, and the number of consecutive transmission errors is cleared. If the timeout threshold has not received the correct indication of the reception sent by the peer, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率包括:The method according to claim 6, wherein the adaptively adjusting the communication rate with the data transmitted by the peer according to the transmission quality information comprises:
    当所述连续发送错误次数大于发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率,连续发送错误次数清零;当所述连续发送正确次数大于发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率,连续接收正确次数清零;或者,When the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared; when the consecutive number of consecutive transmissions is greater than the threshold for sending the correct number of times, and the data When the transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive receptions is cleared; or,
    当所述连续发送错误次数大于当前级别的发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率一个级别;当所述连续发送正确次数大于当前级别的发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率一个级别。When the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is reduced by one level; when the correct number of consecutive transmissions is greater than the current level of the correct number of transmission thresholds, and When the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
  8. 根据权利要求1至7任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 7, wherein the method further comprises:
    根据带宽指示信息,确定数据写入速率。The data write rate is determined according to the bandwidth indication information.
  9. 一种串行双工通讯装置,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现以下步骤:A serial duplex communication device includes: a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor executes the program to implement the following steps:
    通过串行方式与对端传输数据,并统计传输质量信息;所述传输质量信息用于反映传输数据时通讯干扰的情况;Transmitting data through the serial mode and the opposite end, and counting the transmission quality information; the transmission quality information is used to reflect the communication interference when transmitting the data;
    根据所述传输质量信息,自适应调整与所述对端传输数据的通讯速率。And adaptively adjusting a communication rate with the peer end transmission data according to the transmission quality information.
  10. 根据权利要求9所述的装置,其特征在于,所述传输质量信息包括:连续接收错误次数和/或连续接收正确次数;所述装置还包括接收端口,所述处理器执行所述计算机程序时还实现:The apparatus according to claim 9, wherein said transmission quality information comprises: a number of consecutive reception errors and/or a continuous reception of the correct number of times; said apparatus further comprising a receiving port, said processor executing said computer program Also achieved:
    控制所述接收端口以串行方式接收对端发送的数据和相应的校验码,根据接收到的数据计算校验码,并与接收到的校验码进行比对;Controlling, by the receiving port, the data sent by the opposite end and the corresponding check code in a serial manner, calculating a check code according to the received data, and comparing the received check code;
    若不一致,则判断发生错误,丢弃接收到的数据,连续接收错误次数加一,连续接收正确次数清零;If they are inconsistent, it is judged that an error has occurred, the received data is discarded, the number of consecutive reception errors is increased by one, and the number of consecutive receptions is cleared to zero;
    若一致,则判断接收正确,将接收正确指示发送给对端,连续接收正确次数加一,连续接收错误次数清零。If they are consistent, it is judged that the reception is correct, and the correct reception indication is sent to the opposite end, and the number of consecutive receptions is increased by one, and the number of consecutive reception errors is cleared.
  11. 根据权利要求10所述的装置,其特征在于,所述处理器执行所述计算机程序时还实现:The apparatus according to claim 10, wherein said processor, when said computer program is executed, further implements:
    当所述连续接收错误次数大于接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率,连续接收错误次数清零;当所述连续接收正确次数大于接收正确次数阈值,且数据接收速率未达到最高接收速率时,提高接收速率,连续接收正确次数清零;或者,When the number of consecutive reception errors is greater than the threshold of the number of reception errors, and the data reception rate does not reach the minimum reception rate, the reception rate is decreased, and the number of consecutive reception errors is cleared; when the consecutive reception correct times are greater than the reception correct number threshold, and the data When the receiving rate does not reach the highest receiving rate, the receiving rate is increased, and the correct number of consecutive receiving times is cleared; or,
    当所述连续接收错误次数大于当前级别的接收错误次数阈值,且数据接收速率未达到最低接收速率时,降低接收速率一个级别;当所述连续接收正确次数大于当前级别的接收正确次数阈值,且数据接收速率未达到最高接收速率 时,提高接收速率一个级别。When the number of consecutive reception errors is greater than a threshold of the number of reception errors of the current level, and the data reception rate does not reach the minimum reception rate, the reception rate is reduced by one level; when the consecutive reception correct times are greater than the current level of the reception correct number threshold, and When the data reception rate does not reach the maximum reception rate, the reception rate is increased by one level.
  12. 根据权利要求9~11中任一项所述的装置,其特征在于,所述传输质量信息包括:连续发送错误次数和/或连续发送正确次数;所述装置还包括发送端口,所述处理器执行所述计算机程序时还实现:The apparatus according to any one of claims 9 to 11, wherein the transmission quality information comprises: consecutive transmission errors and/or consecutive transmissions of the correct number of times; the apparatus further comprising a transmission port, the processor The implementation of the computer program also implements:
    控制所述发送端口以串行方式将数据和相应的校验码发送给对端并计时;若在超时阈值时间范围内接收到对端发送的接收正确指示,则连续发送正确次数加一,连续发送错误次数清零;若超过超时阈值还未收到对端发送的接收正确指示,则重新发送所述数据,连续发送错误次数加一,连续发送正确次数清零。Controlling the sending port to send the data and the corresponding check code to the opposite end in a serial manner and timing; if receiving the correct receiving indication sent by the opposite end within the timeout threshold time range, continuously sending the correct number of times plus one consecutive If the number of transmission errors is cleared, if the correct indication of the reception sent by the peer is not received, the data is resent, the number of consecutive transmission errors is increased by one, and the number of consecutive transmissions is cleared.
  13. 根据权利要求12所述的装置,其特征在于,所述处理器执行所述计算机程序时还实现:The apparatus according to claim 12, wherein said processor, when said computer program is executed, further implements:
    当所述连续发送错误次数大于发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率,连续发送错误次数清零;当所述连续发送正确次数大于发送正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率,连续接收正确次数清零;或者,When the number of consecutive transmission errors is greater than the threshold of the number of transmission errors, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is decreased, and the number of consecutive transmission errors is cleared; when the consecutive number of consecutive transmissions is greater than the threshold for sending the correct number of times, and the data When the transmission rate does not reach the highest transmission rate, the transmission rate is increased, and the correct number of consecutive receptions is cleared; or,
    当所述连续发送错误次数大于当前级别的发送错误次数阈值,且数据发送速率未达到最低发送速率时,降低发送速率一个级别;当所述连续发送正确次数大于发送当前级别的正确次数阈值,且数据发送速率未达到最高发送速率时,提高发送速率一个级别。When the number of consecutive transmission errors is greater than a threshold of the number of transmission errors of the current level, and the data transmission rate does not reach the minimum transmission rate, the transmission rate is reduced by one level; when the consecutive number of consecutive transmissions is greater than the correct number of times of sending the current level, and When the data transmission rate does not reach the highest transmission rate, the transmission rate is increased by one level.
  14. 根据权利要求9至13任一项所述的装置,其特征在于,所述处理器执行所述计算机程序时还实现:The apparatus according to any one of claims 9 to 13, wherein the processor further executes when the computer program is executed:
    根据带宽指示信息,确定数据写入速率。The data write rate is determined according to the bandwidth indication information.
  15. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1~8中任一项所述的串行双工通讯方法的步骤。A computer readable storage medium, wherein the computer readable storage medium stores a computer program, the computer program being executed by a processor to implement the serialization of any one of claims 1-8 The steps of the duplex communication method.
PCT/CN2018/086209 2017-09-28 2018-05-09 Serial duplex communication method and device, and computer readable storage medium WO2019062129A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710901596.6 2017-09-28
CN201710901596.6A CN107590094A (en) 2017-09-28 2017-09-28 A kind of serial duplex signaling method, apparatus and computer-readable recording medium

Publications (1)

Publication Number Publication Date
WO2019062129A1 true WO2019062129A1 (en) 2019-04-04

Family

ID=61047306

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/086209 WO2019062129A1 (en) 2017-09-28 2018-05-09 Serial duplex communication method and device, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN107590094A (en)
WO (1) WO2019062129A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107590094A (en) * 2017-09-28 2018-01-16 深圳市道通科技股份有限公司 A kind of serial duplex signaling method, apparatus and computer-readable recording medium
CN111130958A (en) * 2019-12-18 2020-05-08 广东美的厨房电器制造有限公司 Data transmission method and device, electronic equipment and storage medium
CN113204763A (en) * 2021-04-22 2021-08-03 山东英信计算机技术有限公司 Method, system, storage medium and device for receiving data by CPLD

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1402143A (en) * 2002-09-29 2003-03-12 清华大学 Flow control method based on feedback of client terminal
CN101354688A (en) * 2007-07-27 2009-01-28 佛山市顺德区顺达电脑厂有限公司 Apparatus and method for regulating data transmission velocity
CN102404097A (en) * 2010-09-14 2012-04-04 华为技术有限公司 Method and device all for sending message
US20160330099A1 (en) * 2015-05-07 2016-11-10 Samsung Electronics Co., Ltd. Apparatus and method for controlling data rate in wireless communication system
CN106375062A (en) * 2016-08-29 2017-02-01 浙江华飞智能科技有限公司 Control method of remote control system and primary device
CN107590094A (en) * 2017-09-28 2018-01-16 深圳市道通科技股份有限公司 A kind of serial duplex signaling method, apparatus and computer-readable recording medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1175034A2 (en) * 2000-07-18 2002-01-23 Eastman Kodak Company A packet data transmission system with adaptive packet size
CN1819506A (en) * 2006-03-16 2006-08-16 江苏沙钢集团有限公司 Series interface wireless communication data processing method
CN1976270A (en) * 2006-11-20 2007-06-06 中兴通讯股份有限公司 Realizing method for wireless local network group broadcasting frame transmitting rate dynamic automatic regulating
CN102630095A (en) * 2012-04-28 2012-08-08 福建星网锐捷网络有限公司 Velocity adjust method, device and network equipment
CN103929276B (en) * 2014-04-30 2017-02-15 中国科学院微电子研究所 Rate self-adaption method and system of wireless body area network
CN106533972A (en) * 2016-10-18 2017-03-22 新智数字科技有限公司 Method, device and system for adjusting data transmission rate

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1402143A (en) * 2002-09-29 2003-03-12 清华大学 Flow control method based on feedback of client terminal
CN101354688A (en) * 2007-07-27 2009-01-28 佛山市顺德区顺达电脑厂有限公司 Apparatus and method for regulating data transmission velocity
CN102404097A (en) * 2010-09-14 2012-04-04 华为技术有限公司 Method and device all for sending message
US20160330099A1 (en) * 2015-05-07 2016-11-10 Samsung Electronics Co., Ltd. Apparatus and method for controlling data rate in wireless communication system
CN106375062A (en) * 2016-08-29 2017-02-01 浙江华飞智能科技有限公司 Control method of remote control system and primary device
CN107590094A (en) * 2017-09-28 2018-01-16 深圳市道通科技股份有限公司 A kind of serial duplex signaling method, apparatus and computer-readable recording medium

Also Published As

Publication number Publication date
CN107590094A (en) 2018-01-16

Similar Documents

Publication Publication Date Title
US9661350B2 (en) Methods and apparatus for error rate estimation
WO2019062129A1 (en) Serial duplex communication method and device, and computer readable storage medium
KR101869995B1 (en) System and method for power saving modes in high speed serial interface communication systems utilizing selective byte synchronization
US9094163B2 (en) Assessment and correction of transmitted data
US7665011B2 (en) Method and circuit for reducing SATA transmission data errors by adjusting the period of sending align primitives
CN107066417A (en) A kind of method and apparatus of link parameter on-line tuning
US20210250049A1 (en) Adaptive Cross-Layer Error Control Coding for Heterogeneous Application Environments
CN103825832A (en) Packet loss sensing distinguishing type congestion control method
CN113114526B (en) Data transmission method and device based on sub-packet interference prevention
US10637509B2 (en) Methods for reducing data errors in transceiving of a flash storage interface and apparatuses using the same
CN113783662A (en) Adaptive data transmission method and device, computer equipment and readable storage medium
WO2019080546A1 (en) Method for adjusting parameters and parameter adjusting device
US20160226751A1 (en) System, information processing apparatus, and method
US10635514B2 (en) Storage device, host system, and information processing system
US10848263B2 (en) Methods for reducing data errors in transceiving of a flash storage interface and apparatuses using the same
US8990645B2 (en) Methods and apparatus for error rate estimation
WO2023038801A1 (en) Selection of processing mode for receiver circuit
WO2021212438A1 (en) Data transmission method, apparatus and system, terminal device, and storage medium
EP2811483A2 (en) Methods and apparatus for error rate estimation
KR20040020638A (en) Dynamic management method of packet segmentation threshold according to the wireless channel status.
CN108614786B (en) Channel management circuit based on message service type
US10659203B2 (en) Method and apparatus for transmitting data
CN109213623B (en) Method and apparatus for reducing errors in data transmission and reception in flash memory interface
US20220308954A1 (en) Selection of processing mode for receiver circuit
CN113094319B (en) System and method for synchronously controlling one-way data transmission between two hosts

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18861178

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18861178

Country of ref document: EP

Kind code of ref document: A1