Baud rate matching method and device, equipment and storage medium

By collecting a fixed number of interrupt trigger flags and calculating the minimum time interval using a system timer in 4G smart meters, and combining this with a threshold set for bit error rate, the system achieves high-efficiency compatibility of smart meters in multi-baud-rate device communication, solves the problem of low baud-rate matching efficiency, and reduces hardware costs and management complexity.

CN121333486APending Publication Date: 2026-01-13SHENZHEN NEOWAY TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511345931.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-19
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

In the field of 4G smart meters, the existing technology has low baud rate matching efficiency, which leads to increased version management costs and product incompatibility. The hardware adaptive solution does not support all microprocessor controllers, and the software adaptive solution has the problem of incomplete character acquisition.

Method used

By collecting a fixed number of interrupt trigger flags from the character data sent by the target device, marking the collection time, calculating the minimum time interval using the system timer, and setting a threshold based on the bit error rate, baud rate matching is achieved.

Benefits of technology

It achieves low-cost, high-reliability baud rate adaptation, solves the compatibility problem of smart meters in multi-baud rate device communication, and improves the stability and reliability of data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121333486A_ABST
    Figure CN121333486A_ABST
Patent Text Reader

Abstract

The invention discloses a baud rate matching method and device, equipment and a storage medium. The baud rate matching method comprises the following steps: acquiring a target number of interrupt trigger marks in character data sent by target equipment, and marking acquisition moments of the interrupt trigger marks, the interrupt trigger marks included in the character data sent by the target equipment each time being the target number; and calculating the minimum time interval between the acquisition moments to obtain the baud rate of the target equipment. Through the above mode, the Baud rate matching efficiency of the intelligent instrument in one-to-many communication can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of intelligent meters, in particular to a baud rate matching method and device, equipment and a storage medium. BACKGROUND

[0002] In the field of 4G intelligent meters, serial ports are often used for data interaction. Different baud rates are often used on devices of the same type of meter. In this case, the traditional approach is to control through multiple software versions with different baud rates, resulting in increased version management costs and incompatible products.

[0003] The hardware baud rate adaptive scheme adopted in the prior art is not supported by all microprocessor controllers, and configuring hardware devices requires additional hardware costs. The special character matching software adaptive scheme adopted in the prior art often cannot completely collect the agreed characters due to the uncertainty of the device boot-up time and the timing of sending special characters by the opposite end, resulting in baud rate recognition errors or repeated attempts. SUMMARY

[0004] The present application mainly provides a baud rate matching method and device, equipment and a storage medium to solve the problem of low baud rate matching efficiency in one-to-many communication of intelligent meters.

[0005] To solve the above technical problems, one technical solution adopted by the present application is to provide a baud rate matching method, comprising: collecting a target number of interrupt trigger flags in character data sent by a target device, and marking the collection time of each interrupt trigger flag, the interrupt trigger flag contained in the character data sent by the target device each time being a target number; calculating the minimum time interval between each collection time to obtain the baud rate of the target device.

[0006] In some embodiments, the marking of the collection time of each interrupt trigger flag comprises recording the collection time of each interrupt trigger flag by a system timer.

[0007] In some embodiments, the calculation of the minimum time interval between each collection time to obtain the baud rate of the target device further comprises: calculating the minimum time interval between the collection times recorded by the system timer; converting the minimum time interval under different baud rates into a timing number, and setting an effective threshold for the timing number according to a preset bit error rate; and matching the corresponding baud rate as the baud rate of the target device according to the minimum time interval based on a preset baud rate matching table.

[0008] In some embodiments, the bit error rate is 20%.

[0009] In some embodiments, the minimum time interval between each of the collection time points is calculated to obtain the baud rate of the target device, including: calculating the minimum time interval between each of the collection time points, and calculating the baud rate of the target device according to a baud rate calculation formula.

[0010] In some embodiments, the interrupt trigger flag is a signal falling edge or a signal rising edge of the AT string.

[0011] In some embodiments, the minimum time interval is a collection time interval of data with a length of two bits in the AT string.

[0012] To solve the above technical problems, another technical solution adopted by the present application is to provide a baud rate matching device, characterized by comprising: a collection module, configured to collect a target number of interrupt trigger flags in character data sent by a target device, and mark collection time points of each of the interrupt trigger flags, the interrupt trigger flags contained in the character data sent by the target device each time including a target number; a calculation module, configured to calculate a minimum time interval between each of the collection time points to obtain the baud rate of the target device.

[0013] The present application further provides a computer device, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invoking the instructions in the memory to cause the computer device to perform the baud rate matching method as described above.

[0014] The present application further provides a computer readable storage medium, having instructions stored thereon, the instructions being executed by a processor to implement the baud rate matching method as described above.

[0015] The beneficial effects of the present application are: different from the prior art, the present application discloses a baud rate matching method, device and storage medium. The target number of interrupt trigger flags is collected in the character data sent by the target device, and the collection time of each interrupt trigger flag is marked. The interrupt trigger flag contained in the character data sent by the target device each time is the target number. The level change of the corresponding character data is collected for a fixed number of times, so as to ensure that enough time interval samples are obtained, and the problem of incomplete collection caused by uncertain transmission opportunity of the opposite end is avoided. Compared with the scheme in the prior art that special character matching depends on complete character reception, the design does not need to wait for complete character transmission, but can start matching only through a fixed number of interrupt triggers, so that the stability and reliability of data collection are improved. The minimum time interval between each collection time is calculated to obtain the baud rate of the target device. By using the characteristics that the minimum interval corresponds to a fixed byte length, abnormal values caused by interrupt loss or noise are excluded, and errors are reduced. Through the combination of fixed interrupt number collection and high-precision calculation of the minimum interval, the pain points of the prior art are solved from two dimensions of data integrity and calculation accuracy, and finally the low-cost, high-reliable and non-inductive software baud rate self-adaption is realized, which provides a flexible and compatible solution for intelligent instrument communication in multi-baud rate equipment. BRIEF DESCRIPTION OF DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor. Figure 1 is a flowchart of an embodiment of the baud rate matching method provided by the present application; Figure 2 is a flowchart of an embodiment of the method step 20 shown in Figure 1 ; Figure 3 is a schematic diagram of an embodiment of character data in the method shown in Figure 1 ; Figure 4 is a structural schematic diagram of an embodiment of the baud rate matching device provided by the present application; Figure 5 is a structural schematic diagram of an embodiment of the computer device in the embodiment of the present application. DETAILED DESCRIPTION

[0017] With reference to the drawings, the technical solutions in the embodiments of the present application will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of the present application.

[0018] The terms "first", "second", "third" in the embodiments of the present application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second", "third" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality of" is at least two, for example, two, three, etc., unless otherwise explicitly and specifically limited. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.

[0019] In this document, the term "embodiment" means that the specific features, structures or characteristics described in connection with the embodiment can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor is it independent or alternative to other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0020] Referring to Figure 1 , Figure 1 is a flowchart of an embodiment of the baud rate matching method provided by the present application, which includes the following steps: 10: Collect a target number of interrupt trigger flags in the character data sent by the target device, and mark the collection time of each interrupt trigger flag. The character data sent by the target device each time contains a target number of interrupt trigger flags.

[0021] The character data sent by the target device each time will generate a fixed number of falling edge interrupts, which is called the target number. The instrument end needs to collect interrupts up to the target number before entering the baud rate matching stage.

[0022] The interrupt trigger flag refers to triggering an interrupt request when the signal is detected to change at the serial port receiving end, which is used to capture the starting time of data transmission.

[0023] Character data refers to a fixed character string sent by the target device before formal data interaction, used to trigger baud rate self-adaptation identification. Its role is to generate an interrupt signal through the level jump of the character string, which is collected and calculated by the instrument end for baud rate.

[0024] The collection time is the current time point recorded by the system when the serial port receiving end of the intelligent instrument detects the interrupt trigger flag. This time is used to calculate the time interval between adjacent interrupts, which is the core data source for baud rate matching.

[0025] For example, the serial port receiving end of the 4G intelligent instrument is configured as a falling edge triggered input interrupt mode, that is, when the RX pin detects a level jump from high to low, an interrupt is triggered and the current time is recorded. The opposite end device sends a fixed "AT" character string before formal data interaction. Since the binary encoding of the "AT" character string contains multiple level jumps, each jump will generate a falling edge interrupt, and the instrument end will continuously record the trigger time of these interrupts. After collecting 7 falling edge interrupts, stop collecting and enter the baud rate matching stage.

[0026] The software scheme replaces the hardware self-adaptation, without additional hardware support, solving the problem that some microcontrollers do not support hardware self-adaptation; through the interrupt trigger design of the interrupt trigger flag, the problem of incomplete character collection in the traditional special character matching scheme is avoided, and the opposite end does not need to pay attention to the instrument startup time; through the above process and design, the present application realizes the non-inductive baud rate self-adaptation, which is significantly better than the traditional hardware scheme and the software special character matching scheme.

[0027] Further, the collection time of each interrupt trigger flag is marked, including: recording the collection time of each interrupt trigger flag by a system timer.

[0028] The system timer is SysTick in the microcontroller, which is a high-precision timing hardware integrated in the chip, used to provide timing service with minimum time granularity, and provides accurate time reference for recording the interrupt trigger time.

[0029] Compared with the traditional timer, the time granularity of the system timer is smaller, which can accurately measure the time difference between adjacent interrupt trigger times; in the environment of microcontroller with low CPU frequency, the system timer can reduce the influence of interrupt response delay on timing, ensuring the accuracy of time interval calculation.

[0030] 20: Calculate the minimum time interval between each collection time to obtain the baud rate of the target device.

[0031] The difference between the two adjacent interrupt collection time points is calculated to obtain a plurality of time intervals (Δt1=t2-t1, Δt2=t3-t2, …, Δt6=t7-t6, …) between the collection time points. These intervals correspond to the transmission time between different bits in the character data, and the baud rate is defined as the number of bits transmitted per second.

[0032] By calculating the minimum time interval of the collection time points, the application realizes high-precision baud rate adaptation at the software level. The core advantage is low cost, high robustness, and no-sense adaptation, which solves the compatibility problem of multi-baud rate devices in the field of intelligent instruments and improves the market competitiveness of products.

[0033] Referring to Figure 2 , step 20 further comprises the following steps: 21: Calculate the minimum time interval between the collection time points recorded by the system timer.

[0034] The difference between the two adjacent interrupt collection time points is calculated to obtain a plurality of time intervals. Whether there is interrupt loss or not, the minimum interval in the time interval of a preset number of interrupt collections is the double-bit interval, i.e. the transmission time of two consecutive bits. The smallest interval time is selected from the calculated intervals as the reference for subsequent baud rate calculation.

[0035] 22: Convert the minimum time interval under different baud rates into a timing number, and set an effective threshold value for the timing number according to a preset bit error rate.

[0036] The system timer is a high-precision timer built into the microcontroller, and its timing unit is Tick. The double-bit transmission time under different baud rates is converted into a timing number, and the high time granularity of the system timer improves the measurement accuracy.

[0037] The bit error rate is a fault tolerance parameter for setting the baud rate matching threshold. For different baud rates, the timing number corresponding to the theoretical double-bit interval is calculated in advance, and the upper and lower threshold values are set according to the preset bit error rate.

[0038] Optionally, the bit error rate is 20%.

[0039] The bit error rate is a fault tolerance parameter for setting the baud rate matching threshold. By allowing a ±20% deviation between the actual measurement value and the theoretical value, the hardware limitations of the microcontroller and environmental interference are adapted, ensuring that the algorithm can still achieve high-precision, high-robustness baud rate adaptation under low-cost, low-resource conditions, ultimately solving the compatibility problem in one-to-many communication of intelligent instruments.

[0040] 23: Based on the preset baud rate matching table, the corresponding baud rate is matched according to the minimum time interval as the baud rate of the target device.

[0041] According to the application scene of the 4G smart meter, common communication baud rates such as 4800bps, 9600bps, 19200bps, etc. are selected as target baud rates to cover the actual possible baud rate requirements of the opposite end device. The timing number corresponding to the minimum time interval actually measured is compared with the preset baud rate timing number threshold table. If it falls within the threshold range of a certain baud rate, it is determined that the baud rate matching is successful. After matching to the target baud rate, the 4G smart meter replies to the opposite end with an "OK" string, completing the baud rate adaptive process.

[0042] The low-cost and high-precision baud rate adaptation is realized through a software algorithm, the compatibility problem in one-to-many communication of the 4G smart meter is solved, and the flexibility of the device is improved.

[0043] Optionally, step 20 can further include calculating the minimum time interval between each collection time, and calculating the baud rate of the target device according to the baud rate calculation formula.

[0044] The baud rate (Baud Rate) is defined as the number of bits transmitted per second, and the minimum time interval is the transmission time of two consecutive bits. According to the baud rate calculation formula: The baud rate of the target device is calculated.

[0045] Optionally, the interrupt trigger flag is the signal falling edge or signal rising edge of the AT string.

[0046] The "AT" string consists of two characters, and its ASCII code and binary code are as follows: "A": ASCII code 0x41 corresponds to binary 01000001, which contains 1 start bit, 8 data bits, and 1 stop bit, a total of 10 bits; "T": ASCII code 0x54 corresponds to binary 01010100, also 10 bits.

[0047] The level jump in each character's start bit and data bit will generate a falling edge interrupt, such as from high to low. If the AT string is completely collected, there will be 7 records, i.e. 7 falling edge interrupts, corresponding to 7 level jump points.

[0048] For example, refer to Figure 3 . Figure 3 The level signal containing a complete AT character in the middle, from left to right, the first start bit to the first end bit is the "A" character, and the second start bit to the second end bit is the "T" character.

[0049] Among them, the labels 1-7 are the falling edges of the AT character that trigger the interrupt, i.e. the interrupt trigger flag, and the corresponding time is the collection time of the interrupt trigger flag.

[0050] Optionally, the minimum time interval is the acquisition time interval of the two-bit length data in the AT string.

[0051] In the binary coding of the "AT" string, level jumps between adjacent bits form multiple time intervals, and the transmission time of two-bit length, that is, two consecutive bits in the string, is the most stable reference. For example: If both of the two consecutive bits are "0" or "1", the level remains unchanged without jump; if it is "0→1" or "1→0", a jump occurs, and the time interval between adjacent jumps is the double-bit interval.

[0052] According to the 2-bit time interval matching, increasing the sampling width can better cope with the error in the microcontroller scene, that is, by using the "transmission time of two-bit data" as the interval unit, the measurement error of single-bit transmission time can be reduced.

[0053] As shown in Figure 3 , the 4G intelligent instrument end configures RX as a falling edge triggered input interrupt mode before sending the "AT" string before formal data interaction, and records the falling edge time. The red dashed line in the figure represents the interrupt acquisition time, and there will be 7 records if the AT string is completely acquired. The design starts to do baud rate matching after 7 falling edge interrupts are acquired. This scheme is to match according to the 2-bit time interval, and increasing the sampling width can better cope with the error in the microcontroller scene.

[0054] For the case of random start acquisition, there are three kinds of assumption analysis under ideal conditions: Assumption 1: The interrupt is acquired at the first edge, and 7 edges contain 3 double-bit time intervals; assumption 2: the interrupt is acquired at the arrow between labels 2 and 3, and 2 AT strings need to be sent, and 7 edges contain 3 double-bit time intervals; assumption 3: the interrupt is acquired between labels 6 and 7, and 2 AT strings need to be sent, and 7 edges contain 2 double-bit time intervals.

[0055] Through the above assumption analysis, the following conclusions can be obtained: 1. 2-3 double-bit intervals can be obtained after 7 edges; 2. The smallest interval must be a double-bit interval.

[0056] However, in the microprocessor control scene, due to the low CPU frequency, it is easy to lose interrupts in the frequent interrupt trigger scene, especially the higher the baud rate, the easier the interrupt loss. For example, at labels 5, 6, and 7, the interrupt at label 6 has a high probability of loss.

[0057] Considering the loss of interrupt 6, there are the following four kinds of assumption analysis: Assumption 1, collect from No. 1, No. 6 is not lost, 7 times of collection contain 3 times of double bit interval; Assumption 2, collect from No. 1, No. 6 is lost, 2 times of AT strings need to be sent, 7 times of collection contain only 1 time of double bit interval; Assumption 3, collect from between No. 1 and No. 2, No. 6 is not lost, 2 times of AT strings need to be sent, 7 times of collection contain 2 times of double bit interval; Assumption 4, collect from between No. 1 and No. 2, No. 6 is lost, 2 times of AT strings need to be sent, 7 times of collection contain 1 time of double bit interval; Assumption 5, collect from after No. 2, whether No. 6 is lost or not, 2 times of AT strings need to be sent.

[0058] Through the above assumption analysis, it can be concluded that 7 times of collection contain 1-3 times of double bit interval. The smallest recording data double bit interval in 7 times of collection can be used to calculate the baud rate.

[0059] The microcontroller CPU frequency is low, is easily affected by interruption delay and clock drift, and the transmission time measurement error of a single bit is large. The double bit interval can reduce the relative error by increasing the sampling width. In the binary coding of the "AT" string, the minimum value of the double bit interval is unique, avoiding multi-interval interference. The smallest interval is certainly a double bit interval, and the double bit interval can be uniquely determined through this characteristic, and the accurate baud rate is calculated.

[0060] The baud rate matching method in the embodiment of the application is described above, and the baud rate matching device in the embodiment of the application is described below. Please refer to Figure 4 The baud rate matching device in the embodiment of the application includes one embodiment: The collection module 410 is used for collecting target number of interruption trigger marks in the character data sent by the target device, and marking the collection time of each interruption trigger mark. The interruption trigger mark contained in the character data sent by the target device each time is the target number.

[0061] The calculation module 420 is used for calculating the minimum time interval between each collection time to obtain the baud rate of the target device.

[0062] The above Figure 4 The characteristic feature extraction device in the embodiment of the application is described in detail from the perspective of modular functional entities, and the computer device in the embodiment of the application is described in detail from the perspective of hardware processing.

[0063] Figure 5is a structural schematic diagram of a computer device provided by an embodiment of the present application. The computer device 500 can have great differences due to different configurations and performances, and can include one or more processors (central processing units, CPUs) 510 (for example, one or more processors) and a memory 520, one or more storage media 530 (for example, one or more mass storage devices) storing application programs 533 or data 532. The memory 520 and the storage media 530 can be temporary storage or persistent storage. The programs stored in the storage media 530 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the computer device 500. Furthermore, the processor 510 can be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the computer device 500.

[0064] The computer device 500 can also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input and output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art can understand that the computer device 500 can include more or fewer components than those shown in the figure, or some components can be combined, or different components can be arranged. Figure 5 The computer device structure shown does not constitute a limitation on the computer device, and the computer device can include more or fewer components than those shown in the figure, or some components can be combined, or different components can be arranged.

[0065] The present application also provides a computer device including a memory and a processor, the memory storing computer readable instructions, and the computer readable instructions being executed by the processor to cause the processor to perform the steps of the baud rate matching method in each of the embodiments.

[0066] The present application also provides a computer readable storage medium, which can be a non-volatile computer readable storage medium or a volatile computer readable storage medium, and the computer readable storage medium stores instructions, and the instructions, when executed on a computer, cause the computer to perform the steps of the baud rate matching method.

[0067] Different from the prior art, the application adopts an interrupt trigger design based on character data, ensures that the number of interrupt triggers is fixed and can be repeatedly collected, and at the same time, in combination with a falling edge trigger input interrupt mode configuration, the serial port receiving end of the intelligent instrument is configured as a flag trigger input interrupt mode, and an interrupt is triggered and a time is recorded only when the interrupt trigger flag is detected. By collecting the time interval of adjacent interrupt trigger times, the minimum time interval is selected as the reference for baud rate calculation, and by increasing the sampling width, the microcontroller timing error is reduced. The application also provides a high-precision timing method based on a system timer, uses the system timer built-in the microcontroller to record the interrupt trigger time, converts the minimum time interval into a high-precision timing number, solves the problem of insufficient timing precision of the traditional timer, and ensures that the interval measurement error is less than 1%. In other embodiments, the application also constructs a code table matching mechanism based on the bit error rate, presets the theoretical timing number of the minimum time interval for each target baud rate, and sets the upper and lower threshold values according to the preset bit error rate; the actual collected minimum double-bit interval timing number is compared with the code table threshold value, and the target device baud rate is quickly and accurately matched.

[0068] The baud rate self-adaption is realized by a pure software algorithm, without additional hardware support, solves the problem of increasing hardware cost in the traditional hardware scheme and the problem that some microcontrollers do not support, and in the scene of low CPU frequency and easy interrupt loss of the microcontroller, high-precision recognition can still be realized, and the problems of low recognition rate and repeated attempts in the traditional software special character matching scheme are solved. The opposite end does not need to pay attention to the instrument startup time or the special character sending time, and the self-adaption can be completed by repeatedly sending character data, and the problem of collection failure caused by uncertain sending time of the opposite end in the traditional scheme is solved. Through the combination of the above technical means, the application realizes low-cost, high-precision and non-sensing software baud rate self-adaption, effectively solves the problem of multi-baud rate device compatibility in the field of 4G intelligent instruments, reduces the hardware and management cost, and improves the flexibility and market competitiveness of the device.

[0069] Each of the embodiments in the specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment mainly describes the difference from other embodiments. Especially, for the storage medium embodiment and the computer device embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.

[0070] The application can be used in many general or special vehicle-mounted computing system environments or configurations. For example: personal computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, network PCs, small computers, distributed computing environments including any of the above systems or devices, and the like.

[0071] In several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other manners. For example, the embodiments of the device described above are merely illustrative, and for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed.

[0072] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.

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

[0074] The above is merely an embodiment of the present application, and does not limit the patent scope of the present application, and any equivalent structure or equivalent process transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method of baud rate matching, the method comprising: The method comprises the following steps: Collecting a target number of interrupt trigger flags in character data sent by a target device, and marking the collection time of each of the interrupt trigger flags, wherein the interrupt trigger flags contained in the character data sent by the target device each time are of a target number; Calculating the minimum time interval between each of the collection times to obtain the baud rate of the target device.

2. The baud rate matching method of claim 1, wherein, The marking of the collection time of each of the interrupt trigger flags comprises: Recording the collection time of each of the interrupt trigger flags by a system timer.

3. The baud rate matching method of claim 2, wherein, The calculation of the minimum time interval between each of the collection times to obtain the baud rate of the target device further comprises: Calculating the minimum time interval between the collection times recorded by the system timer; Converting the minimum time interval under different baud rates into a timing number, and setting an effective threshold of the timing number according to a preset bit error rate; Based on a preset baud rate matching table, matching a corresponding baud rate as the baud rate of the target device according to the minimum time interval.

4. The baud rate matching method of claim 3, wherein, The bit error rate is 20%.

5. The baud rate matching method of claim 1, wherein, The calculation of the minimum time interval between each of the collection times to obtain the baud rate of the target device comprises: Calculating the minimum time interval between each of the collection times, and calculating the baud rate of the target device according to a baud rate calculation formula.

6. The baud rate matching method of claim 1, wherein, The interrupt trigger flag is a signal falling edge or a signal rising edge of an AT string.

7. The baud rate matching method of claim 6, wherein, The minimum time interval is the collection time interval of data with a length of two bits in the AT string.

8. A baud rate matching apparatus characterized by comprising: The method comprises the following steps: A collecting module is configured to collect a target number of interrupt trigger flags in character data sent by a target device, and mark the collection time of each of the interrupt trigger flags, wherein the interrupt trigger flags contained in the character data sent by the target device each time are of a target number; A calculating module is configured to calculate the minimum time interval between each of the collection times to obtain the baud rate of the target device.

9. A computer device, comprising: The computer device comprises a memory and at least one processor, and the memory stores instructions; The at least one processor invokes the instructions in the memory, so that the computer device performs the baud rate matching method according to any one of claims 1-7.

10. A computer-readable storage medium having stored thereon instructions, the instructions comprising, The instructions are executed by the processor to implement the baud rate matching method according to any one of claims 1-7.