CN116015549A - Communication method and device of self-adaptive baud rate - Google Patents

Communication method and device of self-adaptive baud rate Download PDF

Info

Publication number
CN116015549A
CN116015549A CN202211632694.1A CN202211632694A CN116015549A CN 116015549 A CN116015549 A CN 116015549A CN 202211632694 A CN202211632694 A CN 202211632694A CN 116015549 A CN116015549 A CN 116015549A
Authority
CN
China
Prior art keywords
baud rate
communication device
target
communication
bit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211632694.1A
Other languages
Chinese (zh)
Inventor
李新兵
杜福建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Xinlianxin Intelligent Technology Co ltd
Original Assignee
Shanghai Xinlianxin Intelligent Technology Co ltd
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 Shanghai Xinlianxin Intelligent Technology Co ltd filed Critical Shanghai Xinlianxin Intelligent Technology Co ltd
Priority to CN202211632694.1A priority Critical patent/CN116015549A/en
Publication of CN116015549A publication Critical patent/CN116015549A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The embodiment of the application provides a communication method and device of self-adaptive baud rate, and relates to the technical field of communication, wherein the method comprises the following steps: the first communication device detects a level signal transmitted by the second communication device. If the level signal is the start bit, detecting a target waveform corresponding to a plurality of data bits received after the start bit, and recording the time width occupied by each data bit. If the target waveform is a preset fixed waveform, determining a target baud rate based on the time width occupied by each of the recorded data bits, and then adopting the target baud rate to perform data transmission with the second communication equipment. The second communication device sends the character string of the fixed waveform to the first communication device, the first communication device calculates the target baud rate based on the character string of the fixed waveform, and the baud rate self-adaption between the first communication device and the second communication device is realized, and the first communication device and the second communication device do not need to agree with the baud rate in advance, so that the convenience and the timeliness of setting the baud rate are improved.

Description

Communication method and device of self-adaptive baud rate
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a communication method and device of self-adaptive baud rate.
Background
In the field of industrial control, most electronic devices use serial communication to perform data interaction. Before serial communication is carried out, two communication devices need to agree on the baud rate between the two communication devices in advance, namely agree on the same baud rate, so that communication success can be ensured.
However, the baud rates adopted between different communication devices are not necessarily the same, so that any two communication devices need to agree on the baud rate before communication, resulting in poor convenience and timeliness.
Disclosure of Invention
The embodiment of the application provides a communication method and device of self-adaptive baud rate, which are used for improving convenience and effectiveness of baud rate setting.
In one aspect, an embodiment of the present application provides a communication method of adaptive baud rate, which is applied to a first communication device, and includes:
detecting a level signal transmitted by the second communication device;
if the level signal is a start bit, detecting a target waveform corresponding to a plurality of data bits received after the start bit, and recording the time width occupied by each data bit;
if the target waveform is a preset fixed waveform, determining a target baud rate based on the time width occupied by each of the recorded data bits;
and adopting the target baud rate to perform data transmission with the second communication equipment.
Optionally, the fixed fluctuation includes at least three sets of high and low level combinations.
Optionally, the determining the target baud rate based on the time width occupied by each of the recorded plurality of data bits includes:
and determining an average value of the time widths occupied by the data bits respectively, and taking the reciprocal of the average value as the target baud rate.
Optionally, the method further comprises:
and recording the time width occupied by the start bit and the time width occupied by each of the check bit and the stop bit received after the plurality of data bits.
Optionally, the determining the target baud rate based on the time width occupied by the recorded plurality of data bits includes:
and determining a target baud rate based on the time widths occupied by the data bits, the start bit, the check bit and the stop bit.
Optionally, the method further comprises:
and if the target waveform is not the fixed waveform, sending an alarm character to second communication equipment, wherein the alarm character is used for informing the second communication equipment that the baud rate configuration fails.
In one aspect, an embodiment of the present application provides a communication apparatus for adaptive baud rate, which is applied to a first communication device, including:
a detection unit for detecting a level signal transmitted by the second communication device; if the level signal is a start bit, detecting a target waveform corresponding to a plurality of data bits received after the start bit, and recording the time width occupied by each data bit;
the processing unit is used for determining a target baud rate based on the time width occupied by each of the recorded data bits if the target waveform is a preset fixed waveform;
and the communication unit is used for adopting the target baud rate to carry out data transmission with the second communication equipment.
Optionally, the fixed fluctuation includes at least three sets of high and low level combinations.
Optionally, the processing module is specifically configured to:
and determining an average value of the time widths occupied by the data bits respectively, and taking the reciprocal of the average value as the target baud rate.
Optionally, the processing module is further configured to:
and recording the time width occupied by the start bit and the time width occupied by each of the check bit and the stop bit received after the plurality of data bits.
Optionally, the processing module is specifically configured to:
and determining a target baud rate based on the time widths occupied by the data bits, the start bit, the check bit and the stop bit.
Optionally, the processing module is further configured to:
and if the target waveform is not the fixed waveform, sending an alarm character to second communication equipment, wherein the alarm character is used for informing the second communication equipment that the baud rate configuration fails.
In one aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the adaptive baud rate communication method described above when the processor executes the program.
In one aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program executable by an electronic device, which when run on the electronic device, causes the electronic device to perform the steps of the adaptive baud rate communication method described above.
In the embodiment of the invention, the second communication device sends the character string with the fixed waveform to the first communication device, so that the first communication device calculates the target baud rate based on the time width of the bit in the character string with the fixed waveform, and the baud rate self-adaption between the first communication device and the second communication device is realized without the need of the first communication device and the second communication device to pre-contract the baud rate, thereby improving the convenience and the timeliness of setting the baud rate. Secondly, the baud rate setting method in the application supports baud rate setting in a full-range scene, and the application range is wide.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a system architecture according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a system architecture according to an embodiment of the present application;
fig. 3 is a flow chart of a communication method of adaptive baud rate according to an embodiment of the present application;
fig. 4 is a schematic diagram of a character string according to an embodiment of the present application;
fig. 5 is a flow chart of a communication method of adaptive baud rate according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a communication device with adaptive baud rate according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantageous effects of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
For ease of understanding, the terms involved in the embodiments of the present invention are explained below.
Serial port communication: the serial port transmits and receives the communication mode of the byte according to the bit.
Serial interface: a device for converting parallel data characters received from a CPU into a continuous serial data stream for transmission, and converting the received serial data stream into parallel data characters for the CPU. Circuits that perform this function are commonly referred to as serial interface circuits.
Baud rate: the modulation rate of the data signal to the carrier wave can be understood as the rate of serial communication, i.e. binary bits (bits) sent or received per second in serial communication. For example, for serial communication with a contracted baud rate of 9600, the host computer will send a signal once every 1/9600=104 us, and the serial module will receive a signal once every 104us, i.e. the time width occupied by each bit should be 104us, so as to ensure that the data transmission is complete and correct.
Referring to fig. 1, a system architecture diagram applicable to the embodiments of the present application is shown, where the system architecture at least includes a first communication device 101 and a second communication device 102, the first communication device 101 and the second communication device 102 are connected by a serial communication line 103, the serial communication line 103 is a UART (RS-232, RS-422, RS-423, RS-485) line conforming to an industrial serial interface standard, or a serial interface standard conforming to a custom specification, and the present application is not limited to the type of the serial interface standard. The serial communication line 103 includes at least a data line and a reference line, with the difference in level between the two being used to transfer one or more digital bits. In some embodiments, a digital bit 1 may be considered when the data line and the reference line have a certain level difference; conversely, a digital bit 0 may be considered. The communication method of the adaptive baud rate in the embodiment of the application can be applied to any communication scene.
With the FPGA (Field programmable gate array, FPGA) test scenario developed, as shown in fig. 2, the first communication device 101 is a test device, and the second communication device 102 is an FPGA chip.
The first communication device 101 may be a calculator with a human-machine interface, such as a desktop calculator, a laptop calculator, a portable calculator, a tablet calculator, a smart phone, a smart personal digital assistant, etc. The first communication device 101 comprises a central processor module 201 comprising at least one central processor chip for executing an Operating System (Operating System) and an Application running on the Operating System for controlling the first communication device 101. The operating system may be, for example, a UNIX-series operating system (LINUX, harmony, macOS, HP-UX, AIX), a Window-series operating system or other type of real-time operating system. The present application is not limited to the type of central processor and operating system of the first communication device 101.
The first communication device 101 also includes a graphics processor module 202, a display 203, an input output module 204, an input output means 205, and a first serial interface module 206. The graphics processor module 202 and the display 203 are used to display the content of the operating system and applications. The input output module 204 uses an industry standard bus or interface to connect the various input output devices 205. For example, the input/output module 204 may be a PCI, PCI-Express, SCSI, serial SCSI, or USB bus controller. The input output device 205 may include a keyboard, mouse, touchpad, trackball, touch screen, microphone, camera, wired or wireless network connection device, and the like. The first serial interface module 206 may be UART (RS-232, RS-422, RS-423, RS-485) interfaces conforming to industrial serial interface standards, or may be a serial (serial) interface of custom specification.
The second communication device 102 includes a second serial interface module 207 and a serial communication protocol processing module 208. The first serial interface module 206 of the first communication device 101 is connected to the second serial interface module 207 of the second communication device 102, and the first serial interface module 206 and the second serial interface module 207 must coordinate the baud rate first to perform serial communication smoothly.
When the logic circuit in the second communication device 102 is to transmit data to the first communication device 101, the data is transmitted to the serial communication protocol processing module 208 for serial communication protocol analysis, then modulated by the second serial interface module 207, and then transmitted to the first communication device 101 through the serial communication line 103. The serial communication protocol processing module 208 may be a combination of logic units programmed into the second communication device 102, and may be used to schedule buffering, timing and scheduling of data transfers. The second serial interface module 207 sequentially modulates data according to the set baud rate and transmits the modulated data to the serial communication line 103. Conversely, the second serial interface module 207 also receives the modulated signal from the serial communication line 103 according to the baud rate set by it and forwards it to the serial communication protocol processing module 208 for processing.
Based on the system architecture diagram shown in fig. 1, the embodiment of the present application provides a flow of a communication method of adaptive baud rate, as shown in fig. 3, where the flow of the method is executed by a first communication device, and includes the following steps:
step S301 detects a level signal transmitted by the second communication device.
In step S302, if the level signal is the start bit, the target waveforms corresponding to the data bits received after the start bit are detected, and the time width occupied by each data bit is recorded.
Specifically, when the second communication device is not transmitting data to the first communication device, the default level signal is in a low level state or a high level state. If the default level signal is in a low level state, when the level signal is detected to be in a high level state, the detection of the start bit is determined. If the default level signal is in a high level state, when the level signal is detected to be in a low level state, the detection of the start bit is determined.
When the start bit is detected, this means that the data bit will be detected later, wherein the specific number of bits of the data bit can be flexibly selected, typically 5 bits or 8 bits. After all the data bits are detected, parity bits and stop bits are detected. Of course, the second communication apparatus may not transmit the parity bit, but may transmit only the stop bit, which is not particularly limited in this application.
After a plurality of data bits are detected, a target waveform composed of the plurality of data bits is determined. When the start bit is detected, recording the time width occupied by the start bit; the time width occupied by each data bit is recorded as each data bit is detected. When the parity bit and the stop bit are detected, the time widths occupied by the parity bit and the stop bit are also recorded respectively. In addition, the timing may be started when the start position is detected; when the stop bit is detected, the timer is ended. The timing may also be started when the first data bit is detected; when the last data bit is detected, the timer is ended.
In step S303, if the target waveform is a preset fixed waveform, the target baud rate is determined based on the time width occupied by each of the recorded plurality of data bits.
Specifically, the fixed waveform is a specific waveform agreed in advance. In some embodiments, to ensure that the first communication device correctly learns the baud rate, the fixed fluctuation includes at least three sets of high and low level combinations, wherein the high and low level combinations may be a 01 combination or a 10 combination.
When the high-low level combination is a 01 combination, a 01 combination is obtained by detecting the rising edge and the falling edge, and then by counting the detected 01 combination, it is judged whether or not the target waveform is a fixed waveform. When the high-low level combination is 10 combinations, one 10 combination is obtained by detecting the falling edge and the rising edge, and then by counting the detected 10 combinations, it is judged whether or not the target waveform is a fixed waveform.
For example, referring to fig. 4, a schematic diagram of a character string provided in the embodiment of the present application is set to be in a high state when no data is transmitted, and the fixed waveform is 10101010. When the detected level signal is in a low level state (0), the detection of the start bit is indicated, and the time width occupied by the start bit is recorded. And then, continuously detecting a plurality of data bits received after the start bit, and recording the time width occupied by each data bit. And then detecting the parity check bit and the stop bit, and recording the time width occupied by each of the parity check bit and the stop bit, wherein the stop bit is in a high level state.
As can be seen from fig. 4, when the target waveform formed by a plurality of data bits is 10101010, the target baud rate is determined based on the time width occupied by each of the plurality of data bits recorded, as with the fixed waveform.
In some embodiments, an average of the time widths each occupied by the plurality of data bits is determined, and the inverse of the average is taken as the target baud rate.
Specifically, the average value of the time widths occupied by each of the plurality of data bits can be calculated; or the ratio of the total time width of the plurality of data bits to the number of bits of the plurality of data bits is used as the average value of the time widths occupied by the plurality of data bits.
For example, when the average value of the time widths occupied by each of the plurality of data bits is 104us, the target baud rate is 1/104 us=9600.
In some embodiments, the target baud rate is determined based on the time width occupied by each of the plurality of data bits, a start bit, a check bit, and a stop bit.
Specifically, an average value of time widths occupied by each of a plurality of data bits, a start bit, a check bit, and a stop bit is calculated, and the inverse of the average value is taken as a target baud rate.
In the embodiment of the application, the time width occupied by each bit in the character string is recorded, the average value of each obtained time width is calculated, and then the reciprocal of the average value is used as the target baud rate, and only the calculation of the average value and the reciprocal is involved in the whole process, so that the calculation amount is small, and the error rate is low.
In some embodiments, if the target waveform is not a fixed waveform, an alert character is sent to the second communication device, the alert character being used to notify the second communication device that the baud rate configuration fails.
Specifically, if the target waveform is not a fixed waveform, it is indicated that the baud rate configuration fails. For the case of failure of baud rate configuration, the embodiment of the application provides a feedback mechanism, namely, sends an alarm character to the second communication device, wherein the alarm character is agreed in advance. When the second communication device receives the alarm character, and knows that the baud rate configuration fails, the second communication device resends the character string containing the fixed waveform to the first communication device, wherein the fixed waveform of the resent character string can keep the fixed waveform sent in the previous time, but the time width occupied by each bit in the character string is changed, so that the success rate of the baud rate configuration is improved.
Step S304, data transmission is carried out by adopting the target baud rate and the second communication equipment.
After the target baud rate is set, the first serial interface module of the first communication device transmits data to the second communication device based on the set target baud rate, the second serial interface module of the second communication device receives the data based on the set target baud rate and transmits the data to the serial port communication protocol processing module of the second communication device, and the serial port communication protocol processing module processes the data and generates a response message and transmits the response message to the second serial interface module. The second serial interface module adjusts the response message based on the target baud rate and sends the response message to the first serial interface module of the first communication device.
In the embodiment of the invention, the second communication device sends the character string with the fixed waveform to the first communication device, so that the first communication device calculates the target baud rate based on the time width of the bit in the character string with the fixed waveform, and the baud rate self-adaption between the first communication device and the second communication device is realized without the need of the first communication device and the second communication device to pre-contract the baud rate, thereby improving the convenience and the timeliness of setting the baud rate. Secondly, the baud rate setting method in the application supports baud rate setting in a full-range scene, and the application range is wide.
In order to better explain the embodiments of the present application, a communication method for adaptive baud rate provided by the embodiments of the present application is described below in conjunction with a specific implementation scenario, where a flow of the method may be interactively performed by a first communication device and a second communication device, and the method includes the following steps, as shown in fig. 5:
in step S501, the second communication device transmits a character string containing a fixed waveform to the first communication device.
In step S502, when the first communication device detects a start bit in the character string, a target waveform corresponding to a plurality of data bits received after the start bit is detected.
In step S503, the first communication device records the time width occupied by each data bit.
Step S504, the first communication device determines whether the target waveform is a fixed waveform, if so, executes step S505, otherwise executes step S507.
In step S505, the first communication device calculates an average value of time widths occupied by the plurality of data bits, respectively, and takes the inverse of the average value as a target baud rate.
In step S506, the first communication device performs data transmission with the second communication device using the target baud rate.
In step S507, the first communication device sends an alert character to the second communication device, where the alert character is used to notify the second communication device that the baud rate configuration fails.
After receiving the alert character, the second communication device re-executes the above step S501, and performs baud rate adaptation.
In the embodiment of the invention, the second communication device sends the character string with the fixed waveform to the first communication device, so that the first communication device calculates the target baud rate based on the time width of the bit in the character string with the fixed waveform, and the baud rate self-adaption between the first communication device and the second communication device is realized without the need of the first communication device and the second communication device to pre-contract the baud rate, thereby improving the convenience and the timeliness of setting the baud rate. Secondly, the baud rate setting method in the application supports baud rate setting in a full-range scene, and the application range is wide.
Based on the same technical concept, the embodiment of the present application provides a schematic structural diagram of a communication device with adaptive baud rate, as shown in fig. 6, the communication device 600 with adaptive baud rate includes:
a detection unit 601, configured to detect a level signal sent by the second communication device; if the level signal is a start bit, detecting a target waveform corresponding to a plurality of data bits received after the start bit, and recording the time width occupied by each data bit;
a processing unit 602, configured to determine a target baud rate based on a time width occupied by each of the recorded plurality of data bits if the target waveform is a preset fixed waveform;
and a communication unit 603, configured to perform data transmission with the second communication device by using the target baud rate.
Optionally, the fixed fluctuation includes at least three sets of high and low level combinations.
Optionally, the processing module 602 is specifically configured to:
and determining an average value of the time widths occupied by the data bits respectively, and taking the reciprocal of the average value as the target baud rate.
Optionally, the processing module 602 is further configured to:
and recording the time width occupied by the start bit and the time width occupied by each of the check bit and the stop bit received after the plurality of data bits.
Optionally, the processing module 602 is specifically configured to:
and determining a target baud rate based on the time widths occupied by the data bits, the start bit, the check bit and the stop bit.
Optionally, the processing module 602 is further configured to:
and if the target waveform is not the fixed waveform, sending an alarm character to second communication equipment, wherein the alarm character is used for informing the second communication equipment that the baud rate configuration fails.
In the embodiment of the invention, the second communication device sends the character string with the fixed waveform to the first communication device, so that the first communication device calculates the target baud rate based on the time width of the bit in the character string with the fixed waveform, and the baud rate self-adaption between the first communication device and the second communication device is realized without the need of the first communication device and the second communication device to pre-contract the baud rate, thereby improving the convenience and the timeliness of setting the baud rate. Secondly, the baud rate setting method in the application supports baud rate setting in a full-range scene, and the application range is wide. The time width occupied by each bit in the character string is recorded, the average value of each obtained time width is calculated, the reciprocal of the average value is taken as the target baud rate, and the calculation of the average value and the reciprocal is only involved in the whole process, so that the calculation amount is small, and the error rate is low.
Based on the same technical concept, the embodiment of the present application provides an electronic device, which may be the first communication device shown in fig. 1, as shown in fig. 7, including at least one processor 701, and a memory 702 connected to the at least one processor, where a specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present application, and in fig. 7, the processor 701 and the memory 702 are connected by a bus, for example. The buses may be divided into address buses, data buses, control buses, etc.
In the embodiment of the present application, the memory 702 stores instructions executable by the at least one processor 701, and the at least one processor 701 can perform the steps of the adaptive baud rate communication method by executing the instructions stored in the memory 702.
The processor 701 is a control center of the electronic device, and various interfaces and lines can be used to connect various parts of the electronic device, and the baud rate setting can be achieved by executing or executing instructions stored in the memory 702 and calling data stored in the memory 702. Alternatively, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor primarily processes an operating system, a user interface, and application programs, etc., and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 701. In some embodiments, processor 701 and memory 702 may be implemented on the same chip, or they may be implemented separately on separate chips in some embodiments.
The processor 701 may be a general purpose processor such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, and may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 702 may include at least one type of storage medium, and may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory), magnetic Memory, magnetic disk, optical disk, and the like. Memory 702 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by an electronic device, but is not limited to such. The memory 702 in the embodiments of the present application may also be circuitry or any other device capable of implementing a memory function for storing program instructions and/or data.
Based on the same inventive concept, embodiments of the present application provide a computer-readable storage medium storing a computer program executable by an electronic device, which when run on the electronic device, causes the electronic device to perform the steps of the above-described adaptive baud rate communication method.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, or as a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer device or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer device or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer device or other programmable apparatus to produce a computer device implemented process such that the instructions which execute on the computer device or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A communication method of adaptive baud rate, applied to a first communication device, comprising:
detecting a level signal transmitted by the second communication device;
if the level signal is a start bit, detecting a target waveform corresponding to a plurality of data bits received after the start bit, and recording the time width occupied by each data bit;
if the target waveform is a preset fixed waveform, determining a target baud rate based on the time width occupied by each of the recorded data bits;
and adopting the target baud rate to perform data transmission with the second communication equipment.
2. The method of claim 1, wherein the fixed ripple comprises at least three sets of high and low level combinations.
3. The method of claim 1, wherein the determining the target baud rate based on the time width occupied by each of the recorded plurality of data bits comprises:
and determining an average value of the time widths occupied by the data bits respectively, and taking the reciprocal of the average value as the target baud rate.
4. The method as recited in claim 1, further comprising:
and recording the time width occupied by the start bit and the time width occupied by each of the check bit and the stop bit received after the plurality of data bits.
5. The method of claim 4, wherein determining the target baud rate based on the time width occupied by the recorded plurality of data bits comprises:
and determining a target baud rate based on the time widths occupied by the data bits, the start bit, the check bit and the stop bit.
6. The method as recited in claim 4, further comprising:
and if the target waveform is not the fixed waveform, sending an alarm character to second communication equipment, wherein the alarm character is used for informing the second communication equipment that the baud rate configuration fails.
7. A communication apparatus for adaptive baud rate, for use in a first communication device, comprising:
a detection unit for detecting a level signal transmitted by the second communication device; if the level signal is a start bit, detecting a target waveform corresponding to a plurality of data bits received after the start bit, and recording the time width occupied by each data bit;
the processing unit is used for determining a target baud rate based on the time width occupied by each of the recorded data bits if the target waveform is a preset fixed waveform;
and the communication unit is used for adopting the target baud rate to carry out data transmission with the second communication equipment.
8. The apparatus of claim 7, wherein the processing module is further to:
and if the target waveform is not the fixed waveform, sending an alarm character to second communication equipment, wherein the alarm character is used for informing the second communication equipment that the baud rate configuration fails.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any of claims 1-6 when the program is executed by the processor.
10. A computer readable storage medium, characterized in that it stores a computer program executable by an electronic device, which when run on the electronic device causes the electronic device to perform the steps of the method according to any one of claims 1-6.
CN202211632694.1A 2022-12-19 2022-12-19 Communication method and device of self-adaptive baud rate Pending CN116015549A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211632694.1A CN116015549A (en) 2022-12-19 2022-12-19 Communication method and device of self-adaptive baud rate

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211632694.1A CN116015549A (en) 2022-12-19 2022-12-19 Communication method and device of self-adaptive baud rate

Publications (1)

Publication Number Publication Date
CN116015549A true CN116015549A (en) 2023-04-25

Family

ID=86032704

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211632694.1A Pending CN116015549A (en) 2022-12-19 2022-12-19 Communication method and device of self-adaptive baud rate

Country Status (1)

Country Link
CN (1) CN116015549A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116760508A (en) * 2023-08-18 2023-09-15 荣耀终端有限公司 Baud rate setting method and system
CN116980294A (en) * 2023-06-28 2023-10-31 深圳精控集成半导体有限公司 Communication data receiving method and device, electronic equipment and storage medium
CN117155782A (en) * 2023-09-15 2023-12-01 江苏舒茨测控设备股份有限公司 Method for automatically analyzing communication parameters
CN117675113A (en) * 2024-02-01 2024-03-08 北京智芯微电子科技有限公司 Baud rate dynamic adjustment method and device based on communication terminal connection state detection

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116980294A (en) * 2023-06-28 2023-10-31 深圳精控集成半导体有限公司 Communication data receiving method and device, electronic equipment and storage medium
CN116760508A (en) * 2023-08-18 2023-09-15 荣耀终端有限公司 Baud rate setting method and system
CN116760508B (en) * 2023-08-18 2023-11-07 荣耀终端有限公司 Baud rate setting method and system
CN117155782A (en) * 2023-09-15 2023-12-01 江苏舒茨测控设备股份有限公司 Method for automatically analyzing communication parameters
CN117675113A (en) * 2024-02-01 2024-03-08 北京智芯微电子科技有限公司 Baud rate dynamic adjustment method and device based on communication terminal connection state detection

Similar Documents

Publication Publication Date Title
CN116015549A (en) Communication method and device of self-adaptive baud rate
CN108223415B (en) Method for adjusting rotating speed of fan and docking station
US11144330B2 (en) Algorithm program loading method and related apparatus
US20170104607A1 (en) Methods to avoid i2c void message in i3c
US20160147596A1 (en) Error detection constants of symbol transition clocking transcoding
EP3816924B1 (en) Method for accepting blockchain evidence storage transaction and system
CN107590099A (en) A kind of more main frames access method, expanding unit and the storage medium of slave
US20190171609A1 (en) Non-destructive outside device alerts for multi-lane i3c
CN113138801B (en) Command distribution device, method, chip, computer device and storage medium
CN105224802A (en) A kind of based reminding method and mobile terminal
WO2008007931A1 (en) Memory device having data processing function
CN114510446A (en) Serial port baud rate self-adaption method, device, equipment and medium
US5742502A (en) Method and apparatus for generating synchronous data transmissions in a device having a universal asynchronous receiver/transmitter
CN112035066A (en) Method and device for calculating log retention time
US6820145B2 (en) Circuit arrangement and method for improving data management in a data communications circuit
US20160239448A1 (en) Adaptive speed single-wire communications
CN110247815A (en) A kind of data transmission method, device, system and computer readable storage medium
WO2020103080A1 (en) Method for reducing power consumption, terminal device, and storage medium
EP2351304A1 (en) Bit inversion for communication interface
CN109992225B (en) Data output method and related device
CN111444129B (en) Method for transmitting MDB data and terminal equipment
CN111966521B (en) Hardware error processing method, processor, controller, electronic device and storage medium
CN106161750B (en) Information processing method and electronic equipment
US10832132B2 (en) Data transmission method and calculation apparatus for neural network, electronic apparatus, computer-readable storage medium and computer program product
CN110995530A (en) Method and equipment for solving data one-way arrival problem in short period

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination