A processing method for calibrating time parameters of a master and a slave

By sending clock signals from the host to the slave and calibrating the slave's time parameters using a counter ratio, the communication anomaly caused by clock frequency deviation in the master-slave network is resolved, thereby achieving stability and reducing maintenance costs.

CN116743301BActive Publication Date: 2026-05-29YIMOON(SHANGHAI) TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
YIMOON(SHANGHAI) TECH CO LTD
Filing Date
2023-07-26
Publication Date
2026-05-29

Smart Images

  • Figure CN116743301B_ABST
    Figure CN116743301B_ABST
Patent Text Reader

Abstract

The embodiment of the present application relates to a kind of master-slave time parameter calibration processing method of host, the method comprises: host carries out time parameter calibration to all network slaves when master-slave network is powered on;Host carries out time parameter calibration to all network slaves based on preset calibration period periodically in the process of master-slave network operation;Host identifies whether each slave is in abnormal communication state in the process of communication with each slave, and if confirming that slave is in abnormal communication state, then carries out time parameter calibration to slave. Through the present application, the maintenance cost and maintenance difficulty of master-slave network can be reduced, and the working stability of master-slave network can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a method for calibrating slave time parameters by a host. Background Technology

[0002] A master-slave network typically consists of one master and multiple slaves. Each communication is initiated by the master and responded to by the slaves. On the master / slave side, a fixed program usually handles the data communication process between the master and slaves. This data communication program uses a series of time parameters in units of clock cycles when processing the communication. For example, the specific parameter value N used to characterize the bit width of a specified duration of x microseconds is equal to the number of local clock cycles corresponding to x microseconds, N = x * H. c *10 -6 H c This is a preset clock frequency constant, measured in Hertz. To ensure error-free communication between the master and slave devices, it is essential to guarantee that the actual time lengths calculated from these time parameters on both the master and slave sides are equal. For example, the actual clock frequency on the master / slave sides and the clock frequency constant H... c If they are consistent, then the actual time length corresponding to the bit width time parameter on both sides is N / H. c = x milliseconds.

[0003] However, in practical applications, we have found that network operators often use low-cost devices as slaves to reduce network costs during network construction. After a period of use, the local clock frequency of these low-cost slaves shifts, causing a significant deviation in clock frequencies between the master and slave. Once this clock frequency deviation becomes too large, the actual time lengths corresponding to the time parameters (such as bit width, byte width, wait time, and delay time) used in the master / slave side data communication processing programs will no longer be equal or approximately equal. This inevitably leads to many data transmission and reception anomalies, such as transmission / reception timeouts and errors. For example, the actual clock frequency on the master side also differs from the clock frequency constant H. c The clock frequency is consistent, but the actual clock frequency on the slave side has been increased to H. ’ =2H c At this point, the actual time length corresponding to the bit width time parameter on the host side is still N / H. c = x milliseconds, while the actual time length corresponding to the bit width time parameter on the slave side becomes N / H. ’= x / 2 milliseconds. At this time, the bit signal received by the slave on the master side is only half the length recognized by the master, while the bit signal received by the slave on the slave side becomes twice the length recognized by the slave. This will naturally lead to the bit signals sent between the master and slave being unable to be correctly recognized by the other party, resulting in timeout and communication interruption.

[0004] In normal circumstances, whenever such an anomaly occurs, the master-slave network operator can only restore the slave device to normal operation by replacing the internal clock source (such as an RC crystal oscillator). This undoubtedly increases the maintenance cost and difficulty of the master-slave network. In particular, in some specific application scenarios, not every slave device is installed in a location that is easy to remove, nor is the internal clock source of each slave device a removable independent device. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for calibrating slave time parameters from a master device. This method pre-constantly stores the various slave time parameters used for data communication on the slave device for later updates. The slave device's time parameter calibration process is activated by the master continuously sending a specified number of master clock signals to the slave device. During slave time parameter calibration, two counters are set to count the master and slave clock signals within the same time period. When counting stops, each slave time parameter is proportionally scaled based on the ratio of the slave clock signal count to the master clock signal count. This allows the slave device to process data based on the adjusted slave time parameters the next time it performs data communication. Furthermore, this invention provides three master-side time parameter calibration activation methods: activation once when the master-slave network is powered on, periodic activation based on a preset calibration cycle during master-slave network operation, and activation based on the slave communication status during master-slave communication. This invention utilizes a three-time-parameter calibration activation mechanism on the host side to promptly detect and calibrate slave devices with communication anomalies. Slave device calibration can be completed without replacing any components. This invention not only reduces the maintenance cost and difficulty of master-slave networks but also improves the operational stability of master-slave networks.

[0006] To achieve the above objectives, embodiments of the present invention provide a method for a host to calibrate slave time parameters, the method comprising:

[0007] When the host power-on on the master-slave network, it performs a time parameter calibration on all slaves in the network; the master-slave network includes one host and multiple slaves; the host is connected to each of the slaves.

[0008] During the operation of the master-slave network, the host periodically performs time parameter calibration on all slaves in the network based on a preset calibration cycle.

[0009] During communication with each of the slave devices, the host identifies whether each slave device is in a communication abnormal state; if it is confirmed that a slave device is in a communication abnormal state, the host performs a time parameter calibration on the slave device.

[0010] Preferably, the host performs a time parameter calibration on all slave devices in the network when the host-slave network is powered on, specifically including:

[0011] When the host is powered on in the master-slave network, it continuously sends a first specified number of first host clock signals to each of the slaves; the signal frequency of the first host clock signals is the host clock frequency.

[0012] The slave device performs time parameter calibration locally based on the first specified number of first host clock signals sent by the host.

[0013] Preferably, during the operation of the master-slave network, the host periodically performs time parameter calibration on all slave devices in the network based on a preset calibration cycle, specifically including:

[0014] During the operation of the master-slave network, the host periodically and continuously sends a first specified number of first host clock signals to each slave device based on the preset calibration cycle; the signal frequency of the first host clock signal is the host clock frequency.

[0015] The slave device performs time parameter calibration locally based on the first specified number of first host clock signals sent by the host.

[0016] Preferably, the host identifies whether each of the slave devices is in a communication abnormality state during communication with each of the slave devices, specifically including:

[0017] Step 41: The host sends a first data frame to the slave; and waits to receive the second data frame sent back by the slave.

[0018] Step 42: If the second data frame is not received within the specified waiting time, the corresponding first abnormal state is set to timeout abnormal, and the count value of the preset first retransmission counter is incremented by 1.

[0019] Step 43: If the second data frame is received within the specified waiting time, perform frame format verification on the second data frame to generate a corresponding verification result; and identify whether the verification result is successful; if yes, set the corresponding first abnormal state to no abnormality and clear the count value of the first retransmission counter; if no, set the corresponding first abnormal state to frame format abnormality and increment the count value of the first retransmission counter by 1.

[0020] Step 44: Identify the count value of the first retransmission counter; if the count value of the first retransmission counter is greater than 0 but does not exceed the preset retransmission counter threshold, return to step 41 to retransmit the data; if the count value of the first retransmission counter exceeds the retransmission counter threshold, confirm that the slave device is in a communication abnormal state; if the count value of the first retransmission counter is equal to 0, confirm that the slave device is in a communication normal state.

[0021] Preferably, the step of performing a time parameter calibration on the slave device if it is confirmed that the slave device is in a communication abnormality state specifically includes:

[0022] When the host confirms that the slave is in a communication abnormal state, it continuously sends a first specified number of first host clock signals to the slave; the signal frequency of the first host clock signal is the host clock frequency.

[0023] The slave device performs time parameter calibration locally based on the first specified number of first host clock signals sent by the host.

[0024] Preferably, the slave device performs time parameter calibration locally based on the first specified number of first host clock signals sent by the host, specifically including:

[0025] When the slave device receives the first master clock signal sent by the master device, it initializes two counters, which are denoted as the first and second counters respectively; and starts counting the number of received first master clock signals through the first counter and counting the number of first slave clock signals generated by the internal clock source through the second counter; the signal frequency of the first slave clock signal is the slave clock frequency;

[0026] When the count value of the first counter reaches the first specified number, the counting of the first and second counters is stopped; when the counting of the first and second counters stops, the count values ​​of the first and second counters are extracted as the corresponding first and second count values; and the ratio of the second count value to the first count value is used as the corresponding slave calibration coefficient; slave calibration coefficient = second count value / first count value;

[0027] When the slave calibration coefficient is greater than 1, the local preset slave time parameters are proportionally amplified according to the slave calibration coefficient; the amplified slave time parameter = int(the slave time parameter before amplification * the slave calibration coefficient); int() is the floor function; the slave time parameter is any time parameter used by the slave when processing data communication;

[0028] When the slave calibration coefficient is less than 1, the local preset slave time parameters are proportionally reduced according to the slave calibration coefficient; the reduced slave time parameter = int(the slave time parameter before reduction * the slave calibration coefficient).

[0029] The method further includes: the slave device pre-stores each slave time parameter as a modifiable constant locally; and obtains the value of each slave time parameter locally by reading the stored data during data communication.

[0030] This invention provides a method for a master to calibrate slave time parameters. The method pre-constantly stores the slave time parameters used for data communication on the slave for later updates. The master then activates the slave's time parameter calibration process by continuously sending a specified number of master clock signals to the slave. During slave time parameter calibration, two counters are set to count the master and slave clock signals within the same time period. When counting stops, each slave time parameter is proportionally scaled based on the ratio of the slave clock signal count to the master clock signal count. This allows the slave to process data communication based on the adjusted slave time parameters the next time. Furthermore, this invention provides three master-side time parameter calibration activation methods: activation once when the master-slave network is powered on, periodic activation based on a preset calibration cycle during master-slave network operation, and activation based on the slave communication status during master-slave communication. This invention utilizes a three-time-parameter calibration activation mechanism on the host side to promptly detect and calibrate slave devices with communication anomalies. Slave device calibration can be completed without replacing any components. This invention not only reduces the maintenance cost and difficulty of master-slave networks but also improves the operational stability of master-slave networks. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of a method for calibrating slave time parameters by a host, provided in an embodiment of the present invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0033] This invention provides a method for a host to calibrate slave time parameters, such as... Figure 1 The schematic diagram shows a method for calibrating slave time parameters by a host according to an embodiment of the present invention. The method mainly includes the following steps:

[0034] Step 1: When the host machine powers on the master-slave network, it performs a time parameter calibration on all slave machines in the network.

[0035] In a master-slave network, there is one master and multiple slaves; the master is connected to each slave.

[0036] Specifically, it includes: Step 11, when the host is powered on on the master-slave network, it continuously sends a first specified number of first host clock signals to each slave;

[0037] Wherein, the signal frequency of the first host clock signal is the host clock frequency;

[0038] Here, the first specified quantity is a preset constant that is stored on both the master and slave devices in the master-slave network. To achieve better calibration results, the value of the first specified quantity should preferably be set to a relatively large value, such as 256, 512, or 1024.

[0039] Step 12: The slave device performs time parameter calibration locally based on the first specified number of first master clock signals sent by the master device;

[0040] Specifically, it includes: Step 121, when the slave device receives the first master clock signal sent by the master device, it initializes two counters, which are recorded as the corresponding first and second counters; and starts to count the number of received first master clock signals through the first counter and the number of first slave clock signals generated by the internal clock source through the second counter;

[0041] Wherein, the signal frequency of the first slave clock signal is the slave clock frequency;

[0042] Here, in this embodiment of the invention, the internal clock source of the slave device refers to the component or device that provides the clock signal to the slave device locally, such as a common RC crystal oscillator. The clock frequency of the internal clock source is the actual clock frequency of the slave device. After the slave device is powered on, the internal clock source will continuously output the internal clock signal, which is the first slave clock signal, according to its own clock frequency. If there is no clock frequency offset between the master and slave devices at this time, the two count values ​​obtained by the first and second counters should be equal, and even if there is an error, it should be a very small error. However, if the counting frequency of the second counter is significantly greater than the counting frequency of the first counter, it indicates that there is a significant clock frequency offset between the master and slave devices, and the local clock frequency of the slave device is faster than the clock frequency of the master device. However, if the counting frequency of the second counter is significantly less than the counting frequency of the first counter, it indicates that there is a significant clock frequency offset between the master and slave devices, and the local clock frequency of the slave device is slower than the clock frequency of the master device.

[0043] Step 122: When the count value of the first counter reaches the first specified number, stop counting for the first and second counters; when the first and second counters stop counting, extract the count values ​​of the first and second counters as the corresponding first and second count values; and use the ratio of the second count value to the first count value as the corresponding slave calibration coefficient.

[0044] Wherein, slave calibration coefficient = second count value / first count value;

[0045] Step 123, and when the slave calibration coefficient is greater than 1, proportionally amplify each preset slave time parameter according to the slave calibration coefficient;

[0046] Wherein, the amplified slave time parameter = int(the slave time parameter before amplification * the slave calibration coefficient); int() is the rounding function;

[0047] Here, the slave time parameter in this embodiment of the invention is any time parameter used by the slave when processing data communication; such as bit time width, byte time width, waiting time, etc. It should be noted that the slave in this embodiment of the invention will store each slave time parameter as a modifiable constant locally in advance; and obtain the value of each slave time parameter from the local storage through the stored data reading method when processing data communication.

[0048] At this point, a slave calibration coefficient greater than 1 indicates that the slave clock frequency is faster than the master clock frequency. In other words, the actual time length corresponding to each slave time parameter is reduced compared to the actual time length corresponding to the same time parameter on the master side. If each slave time parameter needs to be calibrated, it needs to be amplified. The amplification ratio is the ratio of the slave clock frequency to the master clock frequency, which is the slave calibration coefficient.

[0049] Step 124, and when the slave calibration coefficient is less than 1, proportionally reduce each preset slave time parameter according to the slave calibration coefficient;

[0050] Wherein, the reduced slave time parameter = int(the original slave time parameter * slave calibration coefficient);

[0051] Here, a slave calibration coefficient less than 1 indicates that the slave clock frequency is faster than the master clock frequency. In other words, the actual time length corresponding to each slave time parameter is magnified compared to the actual time length corresponding to the same time parameter on the master side. To calibrate each slave time parameter, it needs to be reduced. The reduction ratio is the ratio of the slave clock frequency to the master clock frequency, which is the slave calibration coefficient.

[0052] Step 2: During the operation of the master-slave network, the host periodically performs time parameter calibration on all slaves in the network based on a preset calibration cycle;

[0053] Specifically, it includes: Step 21, during the operation of the master-slave network, the master periodically sends a first specified number of first master clock signals to each slave based on a preset calibration cycle;

[0054] Wherein, the signal frequency of the first host clock signal is the host clock frequency;

[0055] Here, the calibration period in this embodiment of the invention can be one or more specified time points in a year / month / day / every day, or it can be a fixed-length time period; if it is a specified time point, the host will continuously send a first specified number of first host clock signals to each slave at each specified time point; if it is a time period, the host will continuously send a first specified number of first host clock signals to each slave every specified time length.

[0056] Step 22: The slave device performs time parameter calibration locally based on the first specified number of first master clock signals sent by the master device;

[0057] Here, step 22 is similar to step 12 mentioned above;

[0058] Specifically, this includes: Step 221, when the slave device receives the first master clock signal sent by the master device, it initializes two counters, which are recorded as the corresponding first and second counters; and starts counting the number of received first master clock signals through the first counter and counting the number of first slave clock signals generated by the internal clock source through the second counter;

[0059] Wherein, the signal frequency of the first slave clock signal is the slave clock frequency;

[0060] Step 222: When the count value of the first counter reaches the first specified number, stop counting for the first and second counters; when the first and second counters stop counting, extract the count values ​​of the first and second counters as the corresponding first and second count values; and use the ratio of the second count value to the first count value as the corresponding slave calibration coefficient.

[0061] Wherein, slave calibration coefficient = second count value / first count value;

[0062] Step 223, and when the slave calibration coefficient is greater than 1, proportionally amplify each preset slave time parameter according to the slave calibration coefficient;

[0063] Where, the amplified slave time parameter = int(the slave time parameter before amplification * the slave calibration coefficient);

[0064] Step 224, and when the slave calibration coefficient is less than 1, proportionally reduce each preset slave time parameter according to the slave calibration coefficient;

[0065] Wherein, the reduced slave time parameter = int(the original slave time parameter * slave calibration coefficient).

[0066] Step 3: During the communication process between the host and each slave device, the host identifies whether each slave device is in a communication abnormal state; if it is confirmed that a slave device is in a communication abnormal state, the host performs a time parameter calibration on the slave device.

[0067] Specifically, this includes: Step 31, during the communication process between the host and each slave device, identifying whether each slave device is in a communication abnormal state;

[0068] Specifically, this includes: step 311, where the host sends a first data frame to the slave; and waits to receive the second data frame sent back by the slave.

[0069] Step 312: If the second data frame is not received within the specified waiting time, the corresponding first abnormal state is set to timeout abnormal, and the count value of the preset first retransmission counter is incremented by 1.

[0070] Step 313: If a second data frame is received within the specified waiting time, the frame format of the second data frame is checked to generate a corresponding check result; and the check result is identified as successful. If it is, the corresponding first abnormal state is set to no abnormality, and the count value of the first retransmission counter is cleared to zero. If not, the corresponding first abnormal state is set to frame format abnormality, and the count value of the first retransmission counter is incremented by 1.

[0071] Step 314: Identify the count value of the first retransmission counter; if the count value of the first retransmission counter is greater than 0 but does not exceed the preset retransmission counter threshold, return to step 311 to retransmit the data; if the count value of the first retransmission counter exceeds the retransmission counter threshold, confirm that the slave device is in a communication abnormal state; if the count value of the first retransmission counter is equal to 0, confirm that the slave device is in a communication normal state.

[0072] Step 32: If it is confirmed that the slave device is in a communication abnormal state, perform a time parameter calibration on the slave device.

[0073] Specifically, it includes: step 321, when the host confirms that the slave is in a communication abnormal state, the host continuously sends a first specified number of first host clock signals to the slave;

[0074] Wherein, the signal frequency of the first host clock signal is the host clock frequency;

[0075] Step 322: The slave device performs time parameter calibration locally based on the first specified number of first master clock signals sent by the master device;

[0076] Here, step 322 is similar to step 12 mentioned above;

[0077] Specifically, this includes: Step 3221, when the slave device receives the first master clock signal sent by the master device, it initializes two counters, which are recorded as the corresponding first and second counters; and starts counting the number of received first master clock signals through the first counter and counting the number of first slave clock signals generated by the internal clock source through the second counter;

[0078] Wherein, the signal frequency of the first slave clock signal is the slave clock frequency;

[0079] Step 3222: When the count value of the first counter reaches the first specified number, stop counting for the first and second counters; when the first and second counters stop counting, extract the count values ​​of the first and second counters as the corresponding first and second count values; and use the ratio of the second count value to the first count value as the corresponding slave calibration coefficient.

[0080] Wherein, slave calibration coefficient = second count value / first count value;

[0081] Step 3223, and when the slave calibration coefficient is greater than 1, proportionally amplify each preset slave time parameter according to the slave calibration coefficient;

[0082] Where, the amplified slave time parameter = int(the slave time parameter before amplification * the slave calibration coefficient);

[0083] Step 3224, and when the slave calibration coefficient is less than 1, proportionally reduce each preset slave time parameter according to the slave calibration coefficient;

[0084] Wherein, the reduced slave time parameter = int(the original slave time parameter * slave calibration coefficient).

[0085] In summary, this invention provides a method for a master to calibrate slave time parameters. The method pre-constantly stores the slave time parameters used for data communication on the slave for later updates. The master then activates the slave's time parameter calibration process by continuously sending a specified number of master clock signals to the slave. During slave time parameter calibration, two counters are set to count the master and slave clock signals within the same time period. When counting stops, each slave time parameter is proportionally scaled based on the ratio of the slave clock signal count to the master clock signal count. This allows the slave to process data communication based on the adjusted slave time parameters the next time. Furthermore, this invention provides three master-side time parameter calibration activation methods: activation once when the master-slave network is powered on, periodic activation based on a preset calibration cycle during master-slave network operation, and activation based on the slave communication status during master-slave communication. This invention utilizes a three-time-parameter calibration activation mechanism on the host side to promptly detect and calibrate slave devices with communication anomalies. Slave device calibration can be completed without replacing any components. This invention not only reduces the maintenance cost and difficulty of master-slave networks but also improves the operational stability of master-slave networks.

[0086] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0087] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0088] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for calibrating slave time parameters by a host machine, characterized in that, The method includes: When the host power-on on the master-slave network, it performs a time parameter calibration on all slaves in the network; the master-slave network includes one host and multiple slaves; the host is connected to each of the slaves. During the operation of the master-slave network, the host periodically performs time parameter calibration on all slaves in the network based on a preset calibration cycle. During communication with each of the slave devices, the host identifies whether each slave device is in a communication abnormal state; if it is confirmed that a slave device is in a communication abnormal state, the host performs a time parameter calibration on the slave device. Specifically, the host identifies whether each slave device is in a communication abnormality state during communication with each slave device, including: Step 41: The host sends a first data frame to the slave; and waits to receive the second data frame sent back by the slave. Step 42: If the second data frame is not received within the specified waiting time, the corresponding first abnormal state is set to timeout abnormal, and the count value of the preset first retransmission counter is incremented by 1. Step 43: If the second data frame is received within the specified waiting time, perform frame format verification on the second data frame to generate a corresponding verification result; and identify whether the verification result is successful; if yes, set the corresponding first abnormal state to no abnormality and clear the count value of the first retransmission counter; if no, set the corresponding first abnormal state to frame format abnormality and increment the count value of the first retransmission counter by 1. Step 44: Identify the count value of the first retransmission counter; if the count value of the first retransmission counter is greater than 0 but does not exceed the preset retransmission counter threshold, return to step 41 to retransmit the data; if the count value of the first retransmission counter exceeds the retransmission counter threshold, confirm that the slave device is in a communication abnormal state; if the count value of the first retransmission counter is equal to 0, confirm that the slave device is in a communication normal state.

2. The method for calibrating slave time parameters by the host according to claim 1, characterized in that, When the host computer powers on the master-slave network, it performs a time parameter calibration on all slave computers in the network, specifically including: When the host is powered on in the master-slave network, it continuously sends a first specified number of first host clock signals to each of the slaves; the signal frequency of the first host clock signals is the host clock frequency. The slave device performs time parameter calibration locally based on the first specified number of first host clock signals sent by the host.

3. The method for calibrating slave time parameters by the host according to claim 1, characterized in that, During the operation of the master-slave network, the host periodically performs time parameter calibration on all slave devices in the network based on a preset calibration cycle, specifically including: During the operation of the master-slave network, the host periodically and continuously sends a first specified number of first host clock signals to each slave device based on the preset calibration cycle; the signal frequency of the first host clock signal is the host clock frequency. The slave device performs time parameter calibration locally based on the first specified number of first host clock signals sent by the host.

4. The method for calibrating slave time parameters by the host according to claim 1, characterized in that, If it is confirmed that the slave device is in a communication abnormal state, a time parameter calibration is performed on the slave device, specifically including: When the host confirms that the slave is in a communication abnormal state, it continuously sends a first specified number of first host clock signals to the slave; the signal frequency of the first host clock signal is the host clock frequency. The slave device performs time parameter calibration locally based on the first specified number of first host clock signals sent by the host.

5. The method for calibrating slave time parameters by a host according to any one of claims 2, 3, and 4, characterized in that, The slave device performs time parameter calibration locally based on the first specified number of first host clock signals sent by the host, specifically including: When the slave device receives the first master clock signal sent by the master device, it initializes two counters, which are denoted as the first and second counters respectively; and starts counting the number of received first master clock signals through the first counter and counting the number of first slave clock signals generated by the internal clock source through the second counter; the signal frequency of the first slave clock signal is the slave clock frequency; When the count value of the first counter reaches the first specified quantity, the counting of the first and second counters is stopped; when the counting of the first and second counters stops, the count values ​​of the first and second counters are extracted as the corresponding first and second count values; and the ratio of the second count value to the first count value is used as the corresponding slave calibration coefficient; slave calibration coefficient = second count value / first count value; When the slave calibration coefficient is greater than 1, the local preset slave time parameters are proportionally amplified according to the slave calibration coefficient; the amplified slave time parameter = int(the slave time parameter before amplification * the slave calibration coefficient); int() is the floor function; the slave time parameter is any time parameter used by the slave when processing data communication; When the slave calibration coefficient is less than 1, the local preset slave time parameters are proportionally reduced according to the slave calibration coefficient; the reduced slave time parameter = int(the slave time parameter before reduction * the slave calibration coefficient).

6. The method for calibrating slave time parameters by the host according to claim 5, characterized in that, The method further includes: The slave device stores each slave time parameter locally as a modifiable constant in advance; and obtains the value of each slave time parameter locally by reading the stored data during data communication.