Self-adaptive adjustment method and device for baud rate

By obtaining the target signal information of the target chip in the RS232 communication system, calculating and adaptively adjusting the baud rate, the problem that the fixed baud rate cannot adapt to different environments is solved, efficient and stable communication connection is achieved, and maintenance costs are reduced.

CN120074757APending Publication Date: 2025-05-30BEIJING URBAN CONSTR INTELLIGENT CONTROL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510318685.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In the existing RS232 communication system, the fixed baud rate cannot flexibly adapt to the communication needs of different devices and environments, resulting in inefficient data transmission or increased communication errors, and the need for additional manual intervention increases system maintenance and operation costs.

Method used

By obtaining the target signal information of the target chip within the preset time interval, the initial baud rate is calculated, and a higher reference baud rate is determined based on the initial baud rate. Data transmission is carried out based on the reference baud rate and the data transmission results are detected. If the data transmission is normal, set the reference baud rate to the initial baud rate to continue looping; if the data transmission is abnormal, determine the initial baud rate to be the target baud rate.

Benefits of technology

It realizes adaptive adjustment of baud rate, quickly responds to environmental changes, improves communication efficiency, reduces manual intervention and maintenance costs, maintains stable communication connections in different environments, and improves system reliability and compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120074757A_ABST
    Figure CN120074757A_ABST
Patent Text Reader

Abstract

The invention provides a Baud rate adaptive adjustment method and device. The Baud rate adaptive adjustment method comprises the following steps: acquiring target signal information of a target chip in a preset time interval; the initial baud rate of the target chip in the preset time interval is calculated according to the target signal information, a reference baud rate is determined based on the initial baud rate, and the reference baud rate is larger than the initial baud rate; performing data transmission based on the reference baud rate, and detecting a data transmission result; under the condition that the data transmission result is normal, setting the reference baud rate as an initial baud rate, and continuing to execute the step of determining the reference baud rate based on the initial baud rate; under the condition that the data transmission result is abnormal, the initial baud rate is determined as the target baud rate, by means of the method, the appropriate baud rate can be adjusted in a self-adaptive mode for data transmission, and the data communication efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technologies, and particularly to a method for adaptively adjusting the baud rate. This application also relates to an apparatus for adaptively adjusting the baud rate, a computing device, a computer-readable storage medium, and a computer program product. Background Art

[0002] RS232 is a traditional serial communication standard widely used in data transmission between a computer and external devices, and it supports a series of standard baud rates for transmission. When data is transmitted in a fixed baud rate system, after the RS232 chip sets the baud rate for data transmission, it will not change anymore. As a result, it cannot flexibly adapt to the communication requirements in different devices and environments. When the communication conditions between devices change (such as line length, electromagnetic interference, etc.), the fixed baud rate will lead to low data transmission efficiency or an increase in communication errors. In practical applications, if devices need to transmit data at different rates and in complex environments, it is required that the communication interface can dynamically adjust the baud rate to optimize the data transmission speed and stability. If adjustment is needed, additional manual intervention is required, thus bringing the costs of system maintenance and operation. Therefore, there is an urgent need for a method for dynamically adjusting the baud rate to solve the above problems. Summary of the Invention

[0003] In view of this, embodiments of this application provide a method for adaptively adjusting the baud rate. This application also relates to an apparatus for adaptively adjusting the baud rate, a computing device, a computer-readable storage medium, and a computer program product to solve the above problems existing in the prior art.

[0004] According to the first aspect of the embodiments of this application, a method for adaptively adjusting the baud rate is provided, including: Obtaining target signal information of a target chip within a preset time interval; Calculating an initial baud rate of the target chip within the preset time interval according to the target signal information, and determining a reference baud rate based on the initial baud rate, where the reference baud rate is greater than the initial baud rate; Performing data transmission based on the reference baud rate and detecting the data transmission result; When the data transmission result is normal, setting the reference baud rate as the initial baud rate and continuing to execute the step of determining the reference baud rate based on the initial baud rate; When the data transmission result is abnormal, determining the initial baud rate as the target baud rate.

[0005] According to the second aspect of the embodiments of this application, an apparatus for adaptively adjusting the baud rate is provided, including: An acquisition module, configured to acquire target signal information of a target chip within a preset time interval; A first determination module, configured to calculate an initial baud rate of the target chip within the preset time interval according to the target signal information, and determine a reference baud rate based on the initial baud rate, wherein the reference baud rate is greater than the initial baud rate; A detection module, configured to perform data transmission based on the reference baud rate and detect the data transmission result; An adjustment module, configured to, when the data transmission result is normal, set the reference baud rate as the initial baud rate, and continue to execute the step of determining the reference baud rate based on the initial baud rate; A second determination module, configured to, when the data transmission result is abnormal, determine the initial baud rate as the target baud rate.

[0006] According to a third aspect of the embodiments of the present application, there is provided a computing device, including: A memory and a processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above-mentioned adaptive adjustment method of the baud rate are implemented.

[0007] According to a fourth aspect of the embodiments of the present application, there is provided a computer-readable storage medium, which stores computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the above-mentioned adaptive adjustment method of the baud rate are implemented.

[0008] According to a fifth aspect of the embodiments of the present application, there is provided a computer program product, including computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the above-mentioned adaptive adjustment method of the baud rate are implemented.

[0009] The method provided by the embodiments of the present application includes acquiring target signal information of a target chip within a preset time interval; calculating an initial baud rate of the target chip within the preset time interval according to the target signal information, and determining a reference baud rate based on the initial baud rate, wherein the reference baud rate is greater than the initial baud rate; performing data transmission based on the reference baud rate and detecting the data transmission result; when the data transmission result is normal, setting the reference baud rate as the initial baud rate, and continuing to execute the step of determining the reference baud rate based on the initial baud rate; when the data transmission result is abnormal, determining the initial baud rate as the target baud rate.

[0010] Through this method, it is possible to quickly respond to environmental changes, achieve real-time optimal baud rate adaptive adjustment, and improve communication efficiency. During this process, the baud rate is adaptively adjusted through detection means, reducing additional manual intervention and settings, simplifying maintenance costs, and maintaining a stable communication connection in different environments, thereby enhancing the reliability and compatibility of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 is a flowchart of a method for adaptive adjustment of baud rate provided by an embodiment of the present application; Figure 2 is a schematic diagram of the monitoring structure of the target chip provided by an embodiment of the present application; Figure 3 is a schematic diagram of the structure of an apparatus for adaptive adjustment of baud rate provided by an embodiment of the present application; Figure 4 is a block diagram of the structure of a computing device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0012] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of the present application. Therefore, the present application is not limited by the specific embodiments disclosed below.

[0013] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the", and "said" used in one or more embodiments of the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more of the associated listed items.

[0014] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to a determination".

[0015] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards in the relevant regions, and corresponding operation entrances are provided for users to choose to authorize or reject.

[0016] First, explain the noun terms involved in one or more embodiments of this application.

[0017] The RS232 protocol is a standard protocol for serial communication, aiming to solve the standardization problem of communication between a computer and external devices (such as modems, printers, etc.).

[0018] Baud rate: It is an important parameter in serial communication, indicating the number of bits transmitted per second, with the unit of bits per second (bps). The baud rate determines the communication rate between the computer and external devices. The baud rate range of the RS232 protocol usually ranges from 110 bps to 115200 bps, and in some cases, it can even support higher non-standard baud rates. A higher baud rate can improve the data transmission speed.

[0019] RS232 is a standard protocol for traditional serial communication, widely used in data transmission between a computer and external devices, and it supports a series of standard baud rates for data transmission. The following inconveniences exist in the past fixed baud rate system of RS232: 1. Poor adaptability: The fixed baud rate system cannot flexibly adapt to the communication requirements in different devices and environments. For example, when the communication conditions between devices change (such as line length, electromagnetic interference, etc.), the fixed baud rate may lead to low data transmission efficiency or an increase in communication errors.

[0020] 2. Efficiency issue: In some applications, data transmission needs to be carried out at different rates and in complex environments, which requires the communication interface to be able to dynamically adjust the baud rate and optimize the stability of the data transmission speed.

[0021] 3. Cost and complexity: The traditional fixed baud rate system may require additional manual intervention or equipment to adapt to new communication requirements, increasing the cost and complexity of system maintenance and operation.

[0022] In order to overcome the above problems, optimizing the RS232 communication protocol has become an important development trend. Based on this, in the present application, a method for adaptively adjusting the baud rate is provided. The present application also relates to an adaptive baud rate adjustment device, a computing device, a computer-readable storage medium and a computer program product, which are described in detail one by one in the following embodiments.

[0023] Figure 1 A flow chart of a baud rate adaptive adjustment method provided according to an embodiment of the present application is shown, which specifically includes the following steps: Step 102: Obtain target signal information of a target chip within a preset time interval.

[0024] Among them, the target chip can be understood as the RS232 chip, which is an important component of implementing the RS232 protocol. It is widely used in computers, communication equipment, industrial control and other fields for serial communication transmission between devices. The RS232 chip uses serial communication to transmit data. The sender converts parallel data into serial data and transmits it to the receiver through the connected transmission line. The receiver then converts the serial data into parallel data. This process involves digital signal processing and analog signal processing technology in electronics. The RS232 chip uses a series of regulations to represent a frame of data, including start bit, data bit, check bit and stop bit. The combination of these bits determines the format of the data and the accuracy of the communication.

[0025] The preset time interval can be understood as the time when the target chip performs data transmission. For example, the target chip performs data transmission in the past 10 minutes, and the target signal information of the target chip in the past 10 minutes is obtained.

[0026] The target signal information can be understood as the real signal information generated by the target chip during business data communication within a preset time. In the method provided in the embodiment of the present application, the target signal information can be specifically understood as signal information from which signal noise has been removed.

[0027] In a specific implementation provided in the present application, obtaining target signal information of a target chip within a preset time interval includes: Obtaining reference signal information of the target chip within a preset time interval; Determining whether there is signal noise in the reference signal information; If yes, removing the signal noise from the reference signal information to obtain the target signal information; If not, the reference signal information is determined to be the target signal information.

[0028] In practical applications, during the data transmission process of the target chip, the first information obtained is the reference signal information, which can be understood as the signal information actually collected by the target chip. There may be signal noise in the collected signal information. After removing the signal noise, the collected reference signal information can be converted into the real target signal information. If there is no signal noise in the collected reference signal information, the reference signal information can be directly determined as the target signal information.

[0029] In a specific embodiment provided by the present application, determining whether there is signal noise in the reference signal information includes: Obtaining the reference signal level in the reference signal information; Determining whether the reference signal level is within a preset signal level range; If so, it is determined that there is no signal noise in the reference signal information; If not, it is determined that there is signal noise in the reference signal information.

[0030] In the embodiment provided by the present application, to determine whether there is signal noise in the reference signal information, it is usually necessary to determine based on the level of the reference signal information. Based on this, after obtaining the reference signal information, the reference signal information is converted into its corresponding reference signal level. Then, the reference signal level is compared with the preset signal level range. If the reference signal level is within the preset signal level range, it is determined that there is no signal noise in the reference signal information, otherwise there is signal noise.

[0031] For example, in a specific embodiment provided by the present application, taking the preset signal level range as (-5V, 5V) as an example for explanation. After processing the received reference signal information, its corresponding reference signal level is obtained. If the reference signal level is 3V, it means that the reference signal level is within the preset signal level range, and it is determined that there is no signal noise in the reference signal information. If the reference signal level is 8V, it means that the reference signal level is not within the preset signal level range, and thus it is determined that there is signal noise in the reference signal information.

[0032] In another specific embodiment provided by the present application, obtaining the reference signal information of the target chip within a preset time interval includes: Based on the signal monitoring circuit, obtaining the reference signal information when the target chip obtains the service data sent by the external device.

[0033] In this embodiment, a corresponding signal monitoring circuit is provided to monitor the target chip. Specifically, the reference signal information of the target chip during the transceiver of service data with external devices is monitored. When an external device initiates a session and conducts data transmission with the target chip, the signal monitoring circuit will acquire the signal during the service data transmission process, convert the signal into an available level, and transmit it to the CPU. In the method provided in the embodiments of the present application, the target signal information can be understood as the available level.

[0034] See the following Figure 2 , Figure 2 shows a schematic diagram of the monitoring structure of the target chip provided by an embodiment of the present application. As Figure 2 shown, the signal detection circuit monitors the information during the process of the target chip and the external device performing service data transceiver processing through the RS232 protocol, acquires the target signal information, and feeds back the target signal information to the CPU for corresponding subsequent data processing in the CPU.

[0035] Step 104: Calculate the initial baud rate of the target chip within the preset time interval according to the target signal information, and determine the reference baud rate based on the initial baud rate, where the reference baud rate is greater than the initial baud rate.

[0036] After the above steps are processed, the CPU will obtain the target signal information, and the initial baud rate of the target chip within the preset time interval can be calculated through the target signal information. The initial baud rate is the baud rate within the preset time interval and may not be the most suitable baud rate for the target chip during data transmission. Therefore, in the method provided in the embodiments of the present application, it can also be adjusted according to the initial baud rate to determine its corresponding reference baud rate, and the reference baud rate is greater than the initial baud rate.

[0037] In practical applications, the larger the baud rate, the higher the transmission efficiency. In this embodiment, in order to obtain better transmission efficiency, after calculating the current initial baud rate, it is adjusted to a higher-level reference baud rate. Specifically, in the RS232 transceiver manual, the baud rate range supported by the target chip is defined, and the corresponding reference baud rate can be determined through this transceiver manual and the initial baud rate.

[0038] In a specific embodiment provided by the present application, calculating the initial baud rate of the target chip within the preset time interval according to the target signal information includes: Fitting the waveform information of the target chip within the preset time interval according to the target signal information; Calculating the initial baud rate according to the waveform information.

[0039] After being processed through the above steps, the CPU will obtain the target signal information. By analyzing the received target signal information (level information) in real time, the corresponding waveform can be fitted, and the initial baud rate corresponding to the preset time interval can be calculated through this waveform.

[0040] For example, if there is a high level in the received target signal information, the SAR ADC inside the CPU will convert the analog quantity into a digital quantity. For example, the level between 2.7V and 3.6V is digital 1, and the level between -0.5V and 1V is digital 0. After converting the target signal information within the preset time interval into a digital signal, the CPU will record and fit the waveform diagram, and then calculate the current initial baud rate of the target chip using the RS232 protocol.

[0041] In practical applications, the abscissa of the waveform diagram is the time scale, and the time scale can be in units such as milliseconds, microseconds, nanoseconds, etc. Determine the time length occupied by a complete symbol (or bit) on the waveform diagram. Calculate the initial baud rate through the reciprocal of the time occupied by one symbol. For example, assume that the waveform diagram shows the transmission process of one byte (8 data bits), and it includes 1 start bit and 1 stop bit, that is, a total of 10 bits. If it is counted that these 10 bits occupy 100 microseconds, then its baud rate is 1 / 0.0001, that is, 10000bps.

[0042] After calculating the initial baud rate, combined with the available baud rate range defined in the RS232 transceiver manual, determine the reference baud rate corresponding to the initial baud rate.

[0043] Step 106: Perform data transmission based on the reference baud rate and detect the data transmission result.

[0044] After determining the reference baud rate, the reference baud rate can be set for the target chip, and data transmission is performed with an external device based on this reference baud rate. The external device will perform corresponding processing after receiving the service data. In this embodiment, it is necessary to monitor the data transmission result during this transmission process in real time. Specifically, monitor whether the data transmission result during this data transmission process is abnormal.

[0045] In practical applications, there are two situations for external communication devices. One is an external device that uses a fixed baud rate for data transmission, and the other is an external device that uses the baud rate adaptive adjustment method provided in the embodiments of the present application. The following will further explain these two types of external communication devices respectively.

[0046] For the case where an external device uses a fixed baud rate for data transmission, the target chip determines a reference baud rate based on the initial baud rate and performs data transmission based on the reference baud rate. Since the external device uses a fixed baud rate and cannot accept a higher-level baud rate for communication, it will cause the software to wait for a response. Thus, it can be determined that the data transmission result is abnormal.

[0047] For an external device that also uses the baud rate adaptive adjustment method provided in the embodiments of the present application, during the process of the target chip performing data transmission based on the reference baud rate, if it can accept the service data of the reference baud rate, the external device can communicate normally, that is, the data transmission result is normal. If it cannot accept the service data of the reference baud rate, it will also cause the software to wait for a response, thereby determining that the data transmission result is abnormal.

[0048] In another specific implementation manner provided by the present application, performing data transmission based on the reference baud rate includes: Determining an initial transmission delay according to the reference baud rate; Performing data transmission according to the reference baud rate and the initial transmission delay.

[0049] In the implementation manner provided by the present application, during the transmission process of service data, transmission delay is also involved. As a serial communication protocol, the RS232 protocol transmits data bit by bit. When sending data, there needs to be a certain delay between each bit to ensure that the receiving end can correctly distinguish and receive each bit of data. Here, the transmission delay may be affected by factors such as communication distance, signal quality, and device performance. For example, when the communication distance is long, the signal may attenuate during transmission, and it takes longer to ensure the integrity and accuracy of the signal. In addition, the ability of the device to process data also affects the delay. If the device processing speed is slow, it may lead to an increase in the overall communication delay.

[0050] In the method provided by the embodiments of the present application, control information of the baud rate and the delay will be preset. For example, in this control information, the commonly used transmission delays of each baud rate are recorded. Through this control information, the corresponding initial transmission delay can be determined according to the reference baud rate. And during the data transmission process, data transmission is performed according to the reference baud rate and the initial transmission delay. And the corresponding data transmission result is detected.

[0051] Step 108: When the data transmission result is normal, set the reference baud rate as the initial baud rate, and continue to execute the step of determining the reference baud rate based on the initial baud rate.

[0052] In the above embodiments, the data transmission results are divided into two cases: normal and abnormal. In this step, the case where the data transmission result is normal is taken as an example for explanation.

[0053] If it is determined that the data transmission result during data transmission based on the reference baud rate is normal, it indicates that the data transmission between the external device and the target chip based on this reference baud rate is feasible. In this case, the baud rate can be further increased, and continue to try to use a higher-level baud rate for transmission.

[0054] Specifically, in this case, set the reference baud rate as the initial baud rate. Based on this, continue to execute the step of setting a higher-level reference baud rate, perform data transmission according to the reference baud rate, and detect the data transmission result.

[0055] In a specific embodiment provided by the present application, in addition to considering the reference baud rate, the transmission delay is further considered. Based on this, when the data transmission result is normal, set the reference baud rate as the initial baud rate, and continue to execute the step of determining the reference baud rate based on the initial baud rate, including: Determine the first reference transmission delay according to the initial transmission delay, where the first reference transmission delay is less than the initial transmission delay; Set the reference baud rate as the initial baud rate, and determine the reference baud rate based on the initial baud rate, where the reference baud rate is greater than the initial baud rate; Perform data transmission according to the reference baud rate and the first reference transmission delay, and detect the data transmission result.

[0056] In a specific embodiment provided by the present application, in order to further improve the data transmission efficiency, the first reference transmission delay can also be further determined according to the initial transmission delay, and the first reference transmission delay is less than the initial transmission delay, so as to try with a smaller delay.

[0057] In this case, set the reference baud rate as the initial baud rate, and determine a higher-level reference baud rate based on the initial baud rate, so as to use a higher-level reference baud rate and a shorter first reference transmission delay for data transmission, and detect the data transmission result.

[0058] Step 110: When the data transmission result is abnormal, determine the initial baud rate as the target baud rate.

[0059] In practical applications, there may also be a situation where the data transmission result is abnormal. In this case, it indicates that the transmission between the external device and the target chip based on the reference baud rate fails and communication cannot be carried out normally. Thus, it shows that the reference baud rate is not suitable for the external device and the target chip, and determine the initial baud rate as the target baud rate.

[0060] In a specific embodiment provided by the present application, in addition to considering the reference baud rate, the transmission delay is further considered. When the data transmission result is abnormal, determining the initial baud rate as the target baud rate includes: Determining a second reference transmission delay according to the initial transmission delay, where the second reference transmission delay is greater than the initial transmission delay; Performing data transmission according to the reference baud rate and the second reference transmission delay, and detecting the data transmission result; When the data transmission result is normal, determining the reference baud rate as the target baud rate; When the data transmission result is abnormal, determining the initial baud rate as the target baud rate.

[0061] In the embodiment provided by the present application, if the transmission delay is considered, the transmission delay is preferably adjusted first. Specifically, when data transmission is performed using the reference baud rate and the initial transmission delay, if the data transmission result is abnormal, it indicates that the reference baud rate and the initial transmission delay do not match. Then, the transmission delay can be adjusted first. The corresponding second reference transmission delay is determined according to the initial transmission delay. At this time, the second reference transmission delay is greater than the initial transmission delay, that is, the same baud rate and a larger transmission delay are used to try again, and the data transmission result is detected.

[0062] When the transmission delay is adjusted, if the data transmission result becomes normal, the reference baud rate can be determined as the target baud rate. If the data transmission result is still abnormal after the transmission delay is adjusted, it indicates that the reference baud rate is not suitable. Thus, the initial baud rate is determined as the target baud rate.

[0063] In a specific embodiment provided by the present application, the method further includes: Performing data transmission based on the target baud rate, and detecting the data transmission result; When the data transmission result is abnormal, taking the target baud rate as the baud rate to be adjusted, and determining a second reference baud rate based on the baud rate to be adjusted, where the second reference baud rate is less than the baud rate to be adjusted; Performing data transmission based on the second reference baud rate, and detecting the data transmission result; When the data transmission result is normal, determining the second reference baud rate as the target baud rate; When the data transmission result is abnormal, setting the second reference baud rate as the baud rate to be adjusted, and continuing to execute the step of determining the second reference baud rate based on the baud rate to be adjusted.

[0064] In practical applications, after determining the target baud rate, data transmission can be carried out according to the target baud rate. At this time, the target baud rate is not fixed. If the external device makes adjustments, data transmission anomalies may still occur.

[0065] Based on this, in this embodiment, during the process of data transmission based on the target baud rate, it is also necessary to detect the data transmission result in real time. If the data transmission result is abnormal, it means that the target baud rate no longer suits the current transmission conditions. At this time, the target baud rate is used as the baud rate to be adjusted, and a second reference baud rate is determined based on the baud rate to be adjusted. At this time, the second reference baud rate is less than the baud rate to be adjusted, that is, the current baud rate is adjusted downward to better adapt to data transmission.

[0066] After determining the second reference baud rate, data transmission can be carried out based on the second reference baud rate, and the data transmission result is detected. If the data transmission result is normal, the second reference baud rate can be used as the new target baud rate. If the data transmission result is still abnormal, the second reference baud rate can be used as the baud rate to be adjusted, and the above adjustment steps are continued until the data transmission result is normal.

[0067] The method provided by the embodiment of the present application includes obtaining target signal information of a target chip within a preset time interval; calculating an initial baud rate of the target chip within the preset time interval according to the target signal information, and determining a reference baud rate based on the initial baud rate, where the reference baud rate is greater than the initial baud rate; performing data transmission based on the reference baud rate, and detecting the data transmission result; in the case where the data transmission result is normal, setting the reference baud rate as the initial baud rate, and continuing to execute the step of determining the reference baud rate based on the initial baud rate; in the case where the data transmission result is abnormal, determining the initial baud rate as the target baud rate.

[0068] Through this method, it is possible to quickly respond to environmental changes, achieve real-time optimal baud rate adaptive adjustment, and improve communication efficiency. During this process, the baud rate is adaptively adjusted through detection means, reducing additional manual intervention and setting, simplifying the maintenance cost, and maintaining a stable communication connection in different environments, improving the reliability and compatibility of the system.

[0069] Embodiment 1 In this embodiment, the external device is taken as a non - adaptive external device A for explanation. The external device A communicates with the target chip through the RS232 protocol. The signal monitoring circuit acquires the target signal information during the information transmission process and inputs the target signal information into the CPU. The CPU fits the signal waveform based on the target signal information and calculates the initial baud rate 1 according to the signal waveform. A higher - level reference baud rate 2 is determined based on the initial baud rate, and data transmission is performed according to the higher - level reference baud rate 2. Since the external device A cannot respond in a timely manner according to the reference baud rate 2, after exceeding the preset waiting duration, the initial baud rate 1 is used as the target baud rate for subsequent data transmission.

[0070] Embodiment 2 In this embodiment, the external device is taken as an adaptive external device B for explanation. The external device B applies the adaptive adjustment method of the baud rate provided in the embodiment of the present application. The external device B communicates with the target chip through the RS232 protocol. The signal monitoring circuit acquires the target signal information during the information transmission process and inputs the target signal information into the CPU. The CPU fits the signal waveform based on the target signal information and calculates the initial baud rate 1 according to the signal waveform. A higher - level reference baud rate 2 is determined based on the initial baud rate, and data transmission is performed according to the higher - level reference baud rate 2.

[0071] The external device B can process according to the reference baud rate 2, set a higher - level reference baud rate 3 according to the reference baud rate 2, and use the reference baud rate 3 for communication. The two increase alternately until a certain device cannot respond to the service communication. Thus, the last reference baud rate that can communicate is used as the target baud rate.

[0072] Corresponding to the above - mentioned method embodiment, the present application also provides an embodiment of an adaptive adjustment device for the baud rate. Figure 3 The structural schematic diagram of an adaptive adjustment device for the baud rate provided by an embodiment of the present application is shown. As Figure 3 shown, the device includes: An acquisition module 302, configured to acquire the target signal information of the target chip within a preset time interval; A first determination module 304, configured to calculate the initial baud rate of the target chip within the preset time interval according to the target signal information, and determine a reference baud rate based on the initial baud rate, where the reference baud rate is greater than the initial baud rate; A detection module 306, configured to perform data transmission based on the reference baud rate and detect the data transmission result; An adjustment module 308, configured to set the reference baud rate to the initial baud rate when the data transmission result is normal, and continue to execute the step of determining the reference baud rate based on the initial baud rate; A second determination module 310, configured to determine the initial baud rate as the target baud rate when the data transmission result is abnormal.

[0073] Optionally, the first determination module 304 is further configured to: Fit the waveform information of the target chip within the preset time interval according to the target signal information; Calculate the initial baud rate according to the waveform information.

[0074] Optionally, the detection module 306 is further configured to: Determine the initial transmission delay according to the reference baud rate; Perform data transmission according to the reference baud rate and the initial transmission delay.

[0075] Optionally, the adjustment module 308 is further configured to: Determine a first reference transmission delay according to the initial transmission delay, where the first reference transmission delay is less than the initial transmission delay; Set the reference baud rate to the initial baud rate, and determine the reference baud rate based on the initial baud rate, where the reference baud rate is greater than the initial baud rate; Perform data transmission according to the reference baud rate and the first reference transmission delay, and detect the data transmission result.

[0076] Optionally, the second determination module 310 is further configured to: Determine a second reference transmission delay according to the initial transmission delay, where the second reference transmission delay is greater than the initial transmission delay; Perform data transmission according to the reference baud rate and the second reference transmission delay, and detect the data transmission result; When the data transmission result is normal, determine the reference baud rate as the target baud rate; When the data transmission result is abnormal, determine the initial baud rate as the target baud rate.

[0077] Optionally, the acquisition module 302 is further configured to: Acquire the reference signal information of the target chip within the preset time interval; Judge whether there is signal noise in the reference signal information; If so, remove the signal noise from the reference signal information to obtain the target signal information; If not, determine that the reference signal information is the target signal information.

[0078] Optionally, the obtaining module 302 is further configured to: Obtain the reference signal level in the reference signal information; Determine whether the reference signal level is within a preset signal level range; If so, determine that there is no signal noise in the reference signal information; If not, determine that there is signal noise in the reference signal information.

[0079] Optionally, the obtaining module 302 is further configured to: Obtain the reference signal information when the target chip obtains service data sent by an external device based on a signal monitoring circuit.

[0080] Optionally, the signal monitoring circuit includes a differential receiver, an operational amplifier, and an analog-to-digital converter; The obtaining module 302 is further configured to: Receive an initial signal for the target chip to receive service data through the differential receiver, and convert the initial signal into a reference voltage signal; Perform arithmetic amplification on the reference voltage signal through the operational amplifier to obtain an operational amplifier output signal; Convert the operational amplifier output signal into reference signal information through the analog-to-digital converter.

[0081] Optionally, the adjustment module 308 is further configured to: Perform data transmission based on the target baud rate and detect the data transmission result; In the case where the data transmission result is abnormal, use the target baud rate as the baud rate to be adjusted, and determine a second reference baud rate based on the baud rate to be adjusted, where the second reference baud rate is less than the baud rate to be adjusted; Perform data transmission based on the second reference baud rate and detect the data transmission result; In the case where the data transmission result is normal, determine the second reference baud rate as the target baud rate; In the case where the data transmission result is abnormal, set the second reference baud rate as the baud rate to be adjusted, and continue to execute the step of determining the second reference baud rate based on the baud rate to be adjusted.

[0082] With this device, it is possible to quickly respond to environmental changes, achieve real-time optimal baud rate adaptive adjustment, and improve communication efficiency. In this process, through detection means, the baud rate is adaptively adjusted, reducing additional manual intervention and settings, simplifying maintenance costs, and maintaining a stable communication connection in different environments, enhancing the reliability and compatibility of the system.

[0083] The above is a schematic solution of an adaptive adjustment device for baud rate in this embodiment. It should be noted that the technical solution of the adaptive adjustment device for baud rate and the technical solution of the above-mentioned adaptive adjustment method for baud rate belong to the same concept. For the details not described in detail in the technical solution of the adaptive adjustment device for baud rate, reference can be made to the description of the technical solution of the above-mentioned adaptive adjustment method for baud rate.

[0084] Figure 4 The structural block diagram of a computing device 400 provided according to an embodiment of the present application is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 through a bus 430, and a database 450 is used to store data.

[0085] The computing device 400 further includes an access device 440, and the access device 440 enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of wired or wireless network interfaces (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0086] In an embodiment of the present application, the above components of the computing device 400 and Figure 4Other components not shown may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of the present application. Those skilled in the art can add or replace other components as needed.

[0087] The computing device 400 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.) or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC, Personal Computer). The computing device 400 can also be a mobile or stationary server.

[0088] Wherein, the processor 420 is used to execute the following computer program / instructions, and when the computer program / instructions are executed by the processor, the steps of the above-mentioned adaptive adjustment method of the baud rate are implemented.

[0089] The above is a schematic solution of a computing device according to this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above-mentioned adaptive adjustment method of the baud rate belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above-mentioned adaptive adjustment method of the baud rate.

[0090] An embodiment of this specification also provides a computer-readable storage medium, which stores computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the above-mentioned adaptive adjustment method of the baud rate are implemented.

[0091] The above is a schematic solution of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of the storage medium and the technical solution of the above-mentioned adaptive adjustment method of the baud rate belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above-mentioned adaptive adjustment method of the baud rate.

[0092] An embodiment of this specification also provides a computer program product, including computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the above-mentioned adaptive adjustment method of the baud rate are implemented.

[0093] The above is a schematic solution of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above-mentioned baud rate adaptive adjustment method belong to the same concept. For the details not described in the technical solution of the computer program product, reference can be made to the description of the technical solution of the above-mentioned baud rate adaptive adjustment method.

[0094] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the figures do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0095] The computer instructions include computer program code, which may be in the form of source code, object code, an executable file, or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0096] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0097] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0098] The preferred embodiments of the present application disclosed above are only used to help illustrate the present application. The alternative embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of the present application. These embodiments are selected and specifically described in the present application to better explain the principles and practical applications of the present application, so that those skilled in the art can well understand and utilize the present application. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A baud rate adaptive adjustment method, characterized in that: include: Obtain target signal information of the target chip within a preset time interval; Calculating an initial baud rate of the target chip within the preset time interval according to the target signal information, and determining a reference baud rate based on the initial baud rate, wherein the reference baud rate is greater than the initial baud rate; Perform data transmission based on the reference baud rate and detect the data transmission result; If the data transmission result is normal, setting the reference baud rate to an initial baud rate, and continuing to perform the step of determining the reference baud rate based on the initial baud rate; In the case where the data transmission result is abnormal, the initial baud rate is determined to be the target baud rate.

2. The method according to claim 1, characterized in that Calculating the initial baud rate of the target chip within the preset time interval according to the target signal information includes: Fitting the waveform information of the target chip within the preset time interval according to the target signal information; An initial baud rate is calculated according to the waveform information.

3. The method according to claim 1, characterized in that Performing data transmission based on the reference baud rate includes: determining an initial transmission delay according to the reference baud rate; Data transmission is performed according to the reference baud rate and the initial transmission delay.

4. The method according to claim 3, characterized in that When the data transmission result is normal, the reference baud rate is set to the initial baud rate, and the step of determining the reference baud rate based on the initial baud rate is continued, including: Determine a first reference transmission delay according to the initial transmission delay, wherein the first reference transmission delay is less than the initial transmission delay; Setting the reference baud rate as an initial baud rate, and determining a reference baud rate based on the initial baud rate, wherein the reference baud rate is greater than the initial baud rate; Data transmission is performed according to the reference baud rate and the first reference transmission delay, and a data transmission result is detected.

5. The method according to claim 3, characterized in that In the case where the data transmission result is abnormal, determining the initial baud rate as the target baud rate includes: Determine a second reference transmission delay according to the initial transmission delay, wherein the second reference transmission delay is greater than the initial transmission delay; Perform data transmission according to the reference baud rate and the second reference transmission delay, and detect a data transmission result; When the data transmission result is normal, determining the reference baud rate as a target baud rate; In a case where the data transmission result is abnormal, the initial baud rate is determined to be a target baud rate.

6. The method according to claim 1, characterized in that Obtain target signal information of the target chip within a preset time interval, including: Obtaining reference signal information of the target chip within a preset time interval; Determining whether there is signal noise in the reference signal information; If yes, removing the signal noise from the reference signal information to obtain the target signal information; If not, the reference signal information is determined to be the target signal information.

7. The method according to claim 6, characterized in that Determining whether there is signal noise in the reference signal information includes: Acquiring a reference signal level in the reference signal information; Determining whether the reference signal level is within a preset signal level interval; If yes, it is determined that there is no signal noise in the reference signal information; If not, it is determined that signal noise exists in the reference signal information.

8. The method according to claim 6, characterized in that Obtain reference signal information of the target chip within a preset time interval, including: The reference signal information when the target chip acquires the service data sent by the external device is obtained based on the signal monitoring circuit.

9. The method according to claim 1, characterized in that The method further comprises: Perform data transmission based on the target baud rate and detect the data transmission result; In the case where the data transmission result is abnormal, taking the target baud rate as the baud rate to be adjusted, and determining a second reference baud rate based on the baud rate to be adjusted, wherein the second reference baud rate is less than the baud rate to be adjusted; Performing data transmission based on the second reference baud rate, and detecting a data transmission result; When the data transmission result is normal, determining the second reference baud rate as a target baud rate; In the case where the data transmission result is abnormal, the second reference baud rate is set as the baud rate to be adjusted, and the step of determining the second reference baud rate based on the baud rate to be adjusted is continued.

10. A baud rate adaptive adjustment device, characterized in that: include: An acquisition module is configured to acquire target signal information of a target chip within a preset time interval; A first determination module is configured to calculate an initial baud rate of the target chip within the preset time interval according to the target signal information, and determine a reference baud rate based on the initial baud rate, wherein the reference baud rate is greater than the initial baud rate; a detection module, configured to perform data transmission based on the reference baud rate and detect a data transmission result; an adjustment module, configured to, when the data transmission result is normal, set the reference baud rate to an initial baud rate, and continue to perform the step of determining the reference baud rate based on the initial baud rate; The second determination module is configured to determine the initial baud rate as a target baud rate when the data transmission result is abnormal.

11. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method described in any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium storing a computer program / instruction, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Cited By

  • Serial port communication baud rate self-adaptive data recording unit and implementation method

    CN122309433A