Baud rate adjusting method and related device
By adjusting the baud rate in serial communication in real time and adjusting the baud rate dynamically according to the operating status of the equipment, the problem that the fixed baud rate cannot adapt to the data acquisition requirements is solved, the reliability and efficiency of communication is improved, and resource consumption and interference are reduced.
Patent Information
- Application Number
- CN202510534647.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-08-08
AI Technical Summary
In serial communication, both parties of the communication cannot adapt to the actual data acquisition requirements using a fixed baud rate, resulting in poor communication reliability, especially when the equipment's operating state changes, which affects the real-time and efficiency of data transmission.
By obtaining the equipment operation information of the controlled device, judging the abnormal state, the required baud rate is calculated, and adjusted to the second target baud rate. After normalization is restored, the third target baud rate is determined through the baud rate prediction model to adapt to the data acquisition requirements under different device states.
It realizes dynamic adjustment of baud rate, improves communication reliability and adaptability, meets the data transmission needs in different equipment operating states, and reduces hardware resource consumption and electromagnetic interference impact.
Smart Images

Figure CN120454933A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and more specifically, to a baud rate adjustment method and related devices. Background Art
[0002] Serial communication uses a serial communication protocol to transmit data bit by bit over a signal line. It is widely used in scenarios such as online debugging and actual operation. During serial communication, the baud rate of both communicating parties must be consistent. Otherwise, communication anomalies will occur, making it impossible for either party to interpret the other party's data.
[0003] In real-world scenarios, when configuring the baud rate, the programs running on both communicating parties have already set the same fixed baud rate, and this baud rate is used throughout subsequent communication operations. This communication method may result in the baud rate not being able to adapt to actual data collection requirements, reducing communication reliability. Summary of the Invention
[0004] In view of this, the present application provides a baud rate adjustment method and related devices to solve the problem that the baud rate cannot adapt to the actual data collection requirements when the communicating parties use a communication method with a fixed baud rate.
[0005] To solve the above technical problems, this application adopts the following technical solutions:
[0006] A baud rate adjustment method, comprising:
[0007] During communication based on the first target baud rate, obtaining device operation information of the controlled device;
[0008] If it is determined based on the device operation information that the operating state of the controlled device is abnormal, the required baud rate is calculated using the device abnormality information corresponding to the device operation information;
[0009] determining a second target baud rate corresponding to the required baud rate, and performing a communication operation using the second target baud rate; the second target baud rate being greater than the first target baud rate;
[0010] When it is determined that the operating state of the controlled device returns to normal, a baud rate prediction operation is performed to obtain a third target baud rate, so as to perform a communication operation using the third target baud rate; the third target baud rate is lower than the second target baud rate.
[0011] Optionally, the device operation information includes multiple parameter values of different device parameters in the current communication cycle;
[0012] Determining that the operating state of the controlled device is abnormal based on the device operating information includes:
[0013] Determining, based on the multiple parameter values of the device parameter, an average value and a variance of the device parameter in a current communication cycle;
[0014] Calculating a difference between an average value of the device parameter in a current communication cycle and an average value in a previous communication cycle, and using the difference as a first difference;
[0015] Calculating a difference between a variance of the device parameter in a current communication cycle and a variance in a previous communication cycle, and using the difference as a second difference;
[0016] Determining whether a target device parameter exists; wherein a first difference value of the target device parameter is greater than a first threshold value and a second difference value is greater than a second threshold value;
[0017] If so, determining that the operating state of the controlled device is abnormal;
[0018] If not, it is determined that the operating status of the controlled device is normal.
[0019] Optionally, the device abnormality information corresponding to the device operation information includes the sampling rate after the value is increased and the parameter type value of the target device parameter;
[0020] Calculating the required baud rate using the device abnormality information corresponding to the device operation information, including:
[0021] Performing a sum operation on the parameter type values of the target device parameters to obtain a single sampling data size;
[0022] The required baud rate is calculated according to the single sampling data size and the sampling rate.
[0023] Optionally, calculating the required baud rate according to the single sampling data size and the sampling rate includes:
[0024] Calculating the ratio of the single sampling data size to a preset value;
[0025] Calculating the sum of the ratio, the number of start bits, and the number of stop bits in the communication message to obtain an intermediate value;
[0026] Calculating the product of the intermediate value, the preset value, and the sampling rate;
[0027] The product is taken as the required baud rate.
[0028] Optionally, determining a second target baud rate corresponding to the required baud rate includes:
[0029] If the required baud rate is not greater than the initial baud rate, using the initial baud rate as the second target baud rate;
[0030] When the required baud rate is greater than the initial baud rate, obtaining multiple reference baud rates; the reference baud rates are greater than the initial baud rate;
[0031] Determining a reference baud rate that is greater than the required baud rate and has a minimum numerical difference with the required baud rate;
[0032] The determined reference baud rate is used as the second target baud rate.
[0033] Optionally, performing a baud rate prediction operation to obtain a third target baud rate includes:
[0034] Get multiple historical baud rates used in history;
[0035] Performing a normalization operation and a feature extraction operation on the historical baud rate to obtain a target feature;
[0036] A baud rate prediction operation is performed based on the target feature to obtain a third target baud rate.
[0037] Optionally, performing a baud rate prediction operation based on the target feature to obtain a third target baud rate includes:
[0038] Inputting the target feature into a baud rate prediction model to obtain a third target baud rate output by the baud rate prediction model;
[0039] Among them, the baud rate prediction model is constructed based on a kernel function, and the types of the kernel function include linear kernel, polynomial kernel or Gaussian kernel; the model parameters in the baud rate prediction model are determined based on the distribution characteristics of the historical baud rate and the prediction target; the parameter values of the model parameters are obtained by using an optimization algorithm.
[0040] A baud rate adjustment device, comprising:
[0041] An information acquisition module, configured to acquire device operation information of a controlled device during communication based on the first target baud rate;
[0042] a baud rate calculation module configured to calculate a required baud rate using device abnormality information corresponding to the device operation information if it is determined based on the device operation information that the operation state of the controlled device is abnormal;
[0043] a baud rate determination module, configured to determine a second target baud rate corresponding to the required baud rate, so as to perform a communication operation using the second target baud rate; the second target baud rate being greater than the first target baud rate;
[0044] The baud rate prediction module is used to perform a baud rate prediction operation to obtain a third target baud rate when it is determined that the operating state of the controlled device has returned to normal, so as to use the third target baud rate for communication operations; the third target baud rate is smaller than the second target baud rate.
[0045] An electronic device comprising at least one processor and a memory connected to the processor, wherein:
[0046] The memory is used to store computer programs;
[0047] The processor is used to execute the computer program so that the electronic device can implement the above-mentioned baud rate adjustment method.
[0048] A computer storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the above-mentioned baud rate adjustment method.
[0049] The present application provides a baud rate adjustment method and related devices. In the present application, in the process of communication based on a first target baud rate, the device operation information of the controlled device is obtained. If it is determined that the operating state of the controlled device is abnormal based on the device operation information, the device abnormality information corresponding to the device operation information is used to calculate the required baud rate, and a second target baud rate corresponding to the required baud rate is determined, so that the second target baud rate is used for communication operations. When it is determined that the operating state of the controlled device has returned to normal, a baud rate prediction operation is performed to obtain a third target baud rate, so that the third target baud rate is used for communication operations. That is, the present application can adjust the baud rate value in real time according to the device operating state, so that the baud rate value can match the device operating state, thereby being able to adapt to the actual data collection needs under different device operating states and improve communication reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0051] Figure 1 A flow chart of a baud rate adjustment method provided in an embodiment of the present application;
[0052] Figure 2 A flow chart of a baud rate prediction operation provided in an embodiment of the present application;
[0053] Figure 3 A flow chart of device abnormality determination provided in an embodiment of the present application;
[0054] Figure 4 A baud rate calculation flow chart provided in an embodiment of the present application;
[0055] Figure 5 A flowchart of a method for determining a baud rate provided in an embodiment of the present application;
[0056] Figure 6 A schematic diagram of the structure of a baud rate adjustment device provided in an embodiment of the present application;
[0057] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0059] In the industrial control field, serial communication is widely used due to its advantages such as simple hardware implementation and easy debugging. As a simple and reliable communication method, serial communication uses a serial communication protocol to transmit data bit by bit on a signal line. It is widely used in scenarios such as online debugging and actual operation. Online debugging is the process of monitoring and controlling the operating status of a device in real time during operation, so as to promptly identify and resolve operational issues.
[0060] In serial communication, the baud rate is a measure of the data transmission rate. The baud rate represents the number of code elements (symbols) transmitted per second, measured in baud (symbol / s). In serial communication, the transmitted code elements are typically bits. Therefore, the baud rate can also be understood as the number of binary bits transmitted per second, typically expressed in bps (bits per second).
[0061] When monitoring the operating status of equipment, the upper computer typically sends query frames to the lower computer. These query frames strictly adhere to established frame protocol specifications, with a structure consisting of key components such as a header, a trailer, and the data being queried. The lower computer then parses and processes these query frames according to the same protocol standards and responds accordingly.
[0062] The communication process between the host and slave computers requires that the baud rate on both sides must be consistent. Otherwise, communication anomalies will occur, resulting in neither side being able to parse the other's data. In actual scenarios, when configuring the baud rate, the programs running on both communicating parties have already set the same fixed baud rate, and subsequent communication operations will use this baud rate.
[0063] If the fixed baud rate is a low baud rate, such as 9600, it may not meet the data transmission rate, resulting in data loss and other problems, which in turn affects the real-time performance and efficiency of the entire system. If the fixed baud rate is a high baud rate, such as 921600, although it can increase data transmission speed, if it is always running at this baud rate, it will increase hardware resource consumption, that is, increase device power consumption and heat generation. At the same time, high baud rate signals are more susceptible to electromagnetic interference and transmission medium attenuation, resulting in reduced communication quality.
[0064] As can be seen from the above, using a single, fixed baud rate can lead to poor communication reliability. Therefore, both communicating parties need to support dynamic baud rate adjustment. In real-world scenarios, other scenarios also require dynamic baud rate adjustment. For example, given the diversity of monitoring scenarios, when monitoring specific status information during device operation at different frequencies and parameter types is required, the current baud rate may not match the required data transmission rate. For example, when higher-frequency sampling and debugging of certain variable parameters on the slave computer is required, the sampling frequency in such scenarios can often exceed 1 kHz, necessitating adjustment of the baud rate. Furthermore, as the number of parameters used in the communication process increases, the amount of data processed increases exponentially, also requiring adjustment of the baud rate.
[0065] When dynamically adjusting the baud rate, you need to manually adjust the baud rate setting in the program to increase it to a level that meets the data transmission requirements, and then recompile and download the updated program to both communicating parties to ensure smooth monitoring.
[0066] This baud rate adjustment method is time-consuming and labor-intensive and cannot meet the real-time requirements of data transmission.
[0067] To this end, in an embodiment of the present application, during communication based on a first target baud rate, device operation information of the controlled device is obtained. If it is determined based on the device operation information that the operating state of the controlled device is abnormal, the device abnormality information corresponding to the device operation information is used to calculate the required baud rate, determine a second target baud rate corresponding to the required baud rate, and use the second target baud rate for communication operations. When it is determined that the operating state of the controlled device has returned to normal, a baud rate prediction operation is performed to obtain a third target baud rate, and use the third target baud rate for communication operations. That is, the present application can adjust the baud rate value in real time according to the device operating state, so that the baud rate value can match the device operating state, thereby being able to adapt to the actual data collection needs under different device operating states and improve communication reliability.
[0068] An embodiment of the present application provides a baud rate adjustment method, which can be executed by a control device, such as a host computer, or by a controlled device, such as a slave computer, or can be implemented collaboratively by the control device and the controlled device.
[0069] Reference Figure 1 , a baud rate adjustment method may include:
[0070] S11. During communication based on the first target baud rate, obtain device operation information of the controlled device.
[0071] In actual scenarios, the communication baud rate between the control device and the controlled device adopts the first target baud rate. The first target baud rate is generally the baud rate used when low-frequency sampling. If it is the first communication between the control device and the controlled device, the first target baud rate is the initial baud rate BaudRate configured in the programs of the two devices. init .BaudRate init is a baud rate at a low frequency sampling. If it is not the first communication between the control device and the controlled device, the first target baud rate is a lower baud rate predicted by the baud rate prediction model.
[0072] The baud rate prediction model may be a neural network model, a machine learning model, etc. In this embodiment, a baud rate prediction model machine learning model, such as an SVM (Support Vector Machine) regression model, is used as an example for introduction. SVM is a generalized linear classifier that performs binary classification on data using a supervised learning method.
[0073] In an actual scenario, a suitable kernel function is selected to construct an SVM regression model. Among them, the types of kernel functions include linear kernel, polynomial kernel, Gaussian kernel, etc. In one embodiment, according to the distribution characteristics of the baud rate historical data and the model parameters used in the predicted SVM regression model, the model parameters can be, for example, the penalty parameter C, the specific parameters of the kernel function, etc. In another embodiment, the optimal parameter values of the model parameters are solved through an optimization algorithm, so that the model can accurately fit the law existing in the historical baud rate data.
[0074] In one implementation, the SVM regression model is trained using training samples. Among them, the training samples can be called baud rate samples, and the construction process of the baud rate samples includes:
[0075] 1. Record the historical baud rate value t i .
[0076] where i is the serial number of the historical baud rate value, which is a positive integer, 1 ≤ i ≤ n, and the historical baud rate value t i forms a one-dimensional time series T = {t1, t2,..., t n}, and the sequence length is n.
[0077] Then, perform normalization processing on T item by item to obtain the normalized sequence Norm, where where i is the i-th item of the normalized sequence, 1 ≤ i ≤ n. norm i is the value after normalization of t i , BaudRate min is the minimum value in t i , and BaudRate max is the maximum value in t i .
[0078] 2. Construct the baud rate sample.
[0079] Adopt the sliding window technique to extract the features related to the baud rate change from norm i . The window length of the feature is w, and the feature value f i of Norm i = {norm i-w , norm i-w+1 ,..., norm i-1}, w < i ≤ n. Therefore, the feature set F constructed by the feature f is F = {f w+1 , f w+2 ,..., f n}, and the label data corresponding to the feature set F is: Tar = {norm w+1 , norm w+2 ,..., norm n}. Among them, F corresponds to the data in Tar one by one, and each element in Tar represents the i Execute the normalized sequence norm i .
[0080] The combination of F and Tar in this embodiment is the baud rate sample in the embodiment of the present application.
[0081] 3. Model training.
[0082] After obtaining the baud rate samples, the baud rate samples are divided into a training set and a test set. The training set is used to train the SVM regression model, and the test set is used to evaluate the trained SVM regression model. During the evaluation, indicators such as mean square error and mean absolute error are used to measure the model prediction performance. At the same time, the model is optimized and adjusted according to the evaluation results, such as adjusting the kernel function parameters.
[0083] After the model training is completed, it can be put into use online. When it is put into use online, the historical baud rate data saved during the actual debugging or operation process is input into the SVM regression model, and the SVM regression model outputs the prediction result BaudRate next .BaudRate next It can be used as the first target baud rate in the embodiment of the present application.
[0084] In one implementation, the controlled device in the embodiment of the present application can be a motor, a vehicle, or other device that needs to be controlled by the control device. During the operation of the controlled device, there will be device operation information. Taking the controlled device as a motor as an example, the device operation information of the motor can be current, voltage, load size, etc.
[0085] In this embodiment, if the baud rate adjustment method is executed by a controlling device, the controlling device can communicate with the controlled device at the first target baud rate to obtain device operation information uploaded by the controlled device. If the baud rate adjustment method is executed by a controlled device, the controlled device can obtain its own device operation information and, in addition, upload the device operation information to the controlling device at the first target baud rate, enabling the controlling device to monitor the operating status of the controlled device.
[0086] S12: If it is determined based on the device operation information that the operation state of the controlled device is abnormal, the required baud rate is calculated using the device abnormality information corresponding to the device operation information.
[0087] In this embodiment, the controlled device may experience abnormal operating conditions during operation. For example, if the controlled device is a motor, the abnormal operating conditions may include overcurrent, overvoltage, overload, drive abnormality, etc. If the controlled device is a vehicle, the abnormal operating conditions may include failure to accelerate or decelerate, etc.
[0088] In one implementation, when determining whether the operating status of the controlled device is abnormal based on the device operating information, a numerical analysis can be performed on each device parameter corresponding to the device operating information to determine whether the value of the device parameter is abnormal. If it is abnormal, it indicates that there is an abnormality in the operating status of the controlled device.
[0089] After determining that the operating status of the controlled device is abnormal, in order to better analyze the cause of the abnormal operating status of the controlled device, the communication baud rate can be increased to collect more device operating information of the controlled device, and the cause of the abnormality of the controlled device can be analyzed based on the collected device operating information.
[0090] In this embodiment, the controlled device may determine that the operating state of the controlled device is abnormal based on the device operating information, and then calculate the required baud rate using the device abnormality information corresponding to the device operating information.
[0091] Alternatively, the control device determines that the operating state of the controlled device is abnormal based on the device operating information, and then calculates the required baud rate using device abnormality information corresponding to the device operating information.
[0092] Alternatively, after the control device determines that the operating state of the controlled device is abnormal based on the device operating information, the controlled device calculates the required baud rate using device abnormality information corresponding to the device operating information.
[0093] The required baud rate in this embodiment refers to the baud rate expected by the control device when communicating with the controlled device when the controlled device is abnormal.
[0094] S13: Determine a second target baud rate corresponding to the required baud rate, and use the second target baud rate to perform communication operations.
[0095] In actual scenarios, after obtaining the desired baud rate, in one implementation, the desired baud rate can be directly used as the second target baud rate. In another implementation, the desired baud rate may be inappropriate, such as when the desired baud rate is too small or when the desired baud rate is not one of the multiple baud rates agreed upon between the control device and the controlled device. Therefore, it is necessary to derive the second target baud rate based on the desired baud rate. The second target baud rate is the actual communication baud rate used by the control device and the controlled device.
[0096] In one embodiment, the second target baud rate is greater than the first target baud rate. This is because, when a controlled device is abnormal, more device operation information of the controlled device needs to be collected, that is, high-frequency sampling or relatively high-frequency sampling is required. Therefore, in this embodiment, the communication baud rate between the control device and the controlled device needs to be adjusted from the first target baud rate to the second target baud rate to increase the sampling frequency and sampled data volume of the device operation information of the controlled device, so as to analyze the cause of the abnormality of the controlled device.
[0097] After obtaining the second target baud rate, if step S13 is performed by the control device, the control device may send a baud rate adjustment instruction and the second target baud rate to the controlled device, so that the controlled device and the control device adjust their own baud rates to the second target baud rate.
[0098] If step S13 is performed by the controlled device, the controlled device may send a baud rate adjustment instruction and the second target baud rate to the control device, so that the controlled device and the control device adjust their own baud rates to the second target baud rate.
[0099] After the baud rate adjustment is completed, the controlled device collects device operation information at the configured sampling rate, packages the data according to the specified communication protocol (such as the second target baud rate), and then sends it to the controlling device. In this embodiment, in order to collect device operation information of the controlled device, the sampling rate can be increased, that is, the configured sampling rate can be greater than the originally used baud rate, so as to sample more data and increase the amount of data for abnormality analysis.
[0100] On the control device side, the control device can analyze the device operation information sent by the controlled device using an internally configured device anomaly analysis algorithm to determine the cause of the controlled device's abnormal operation. Alternatively, manual anomaly analysis can be performed based on the device operation information sent by the controlled device to determine the cause of the controlled device's abnormal operation.
[0101] S14. When it is determined that the operating state of the controlled device has returned to normal, perform a baud rate prediction operation to obtain a third target baud rate, and use the third target baud rate for communication operation; the third target baud rate is lower than the second target baud rate.
[0102] In this embodiment, after determining the cause of the abnormality of the controlled device, maintenance operations are performed on the controlled device or the operating environment of the controlled device is adjusted to restore the operating state of the controlled device to normal. Whether the operating state of the controlled device has returned to normal can be determined by analyzing whether the device operating information recently uploaded by the controlled device is normal. If normal, it indicates that the operating state of the controlled device has returned to normal. If abnormal, it indicates that the operating state of the controlled device has not yet returned to normal. In this case, the above operations are continued until the operating state of the controlled device returns to normal.
[0103] In another implementation method, the controlled device may be affected by factors such as the external environment, causing the operating status of the controlled device to be temporarily abnormal. If the controlled device returns to normal thereafter, there is no need to perform the above-mentioned maintenance operations on the controlled device or adjust the operating environment of the controlled device. After waiting for the latest device operating information uploaded by the controlled device to be normal, it means that the operating status of the controlled device has returned to normal.
[0104] In another implementation method, the device operation information continuously uploaded by the controlled device can be manually analyzed. After manually determining that the operating status of the controlled device has returned to normal, an instruction to restore the operating status of the controlled device to normal is output through buttons, voice, etc. to confirm that the operating status of the controlled device has returned to normal.
[0105] After the controlled device returns to normal operation, the higher baud rate is no longer required for communication. The second target baud rate is reduced to a third target baud rate. The third target baud rate is the baud rate used during low-frequency sampling. In one implementation, the third target baud rate in this embodiment can be achieved using the aforementioned baud rate prediction model. Specifically, the baud rate prediction operation is performed using the baud rate prediction model to obtain the third target baud rate.
[0106] In one implementation, referring to Figure 2 , performing a baud rate prediction operation to obtain a third target baud rate may include:
[0107] S21. Acquire multiple historical baud rates used in the past.
[0108] The multiple historical baud rates in this embodiment may be multiple baud rates that have been used recently in history, such as baud rates used within a period of time, such as baud rates used within the last week, baud rates used within the last month, etc.
[0109] In addition, a specified number of baud rates among the most recently used baud rates may be used as historical baud rates, such as a set number of the five or ten most recently used baud rates as historical baud rates.
[0110] It should be noted that, in this embodiment, the historical baud rates should be arranged in order of usage time, with the historical baud rates with earlier usage time being arranged at the front and the historical baud rates with later usage time being arranged at the back.
[0111] In one embodiment, when adjusting the baud rate, communication is first performed using a low-frequency sampling baud rate. If a device is found to be operating abnormally, communication can be performed using a high-frequency sampling baud rate to quickly analyze the cause of the abnormality. Subsequently, after the device returns to normal operation, communication can be performed using a low-frequency sampling baud rate to continuously monitor the device's operating status. Therefore, if the historical baud rate includes both the baud rate at high-frequency sampling and the baud rate at low-frequency sampling, baud rate changes can be better reflected, allowing for more accurate baud rate prediction.
[0112] S22. Perform normalization and feature extraction operations on the historical baud rates to obtain target features.
[0113] For the normalization operation and feature extraction operation in this embodiment, please refer to the corresponding description above.
[0114] S23: Perform a baud rate prediction operation based on the target feature to obtain a third target baud rate.
[0115] In specific implementations, after obtaining the target features, the target features are input into the baud rate prediction model to obtain a third target baud rate output by the baud rate prediction model. Generally, since the device's operating status has returned to normal, low-frequency sampling can be used to observe the device's operation. In this case, the third target baud rate is the baud rate used during low-frequency sampling.
[0116] In one implementation, the baud rate prediction model is constructed based on a kernel function, which can be a linear kernel, a polynomial kernel, or a Gaussian kernel. The model parameters in the baud rate prediction model are determined based on the distribution characteristics of historical baud rates and the prediction target. The values of the model parameters are calculated using an optimization algorithm. For the specific implementation process, refer to the corresponding description above.
[0117] After obtaining the third target baud rate for low-frequency sampling, communication is performed using the third target baud rate. The third target baud rate can serve as the new first target baud rate in the embodiment of the present application. During communication using the new first target baud rate, if a device operation abnormality is detected, a new second target baud rate is determined again. After the device operation returns to normal, a new third target baud rate is determined again, and the above steps are repeated.
[0118] In this embodiment, during communication based on the first target baud rate, device operation information of the controlled device is obtained. If it is determined based on the device operation information that the operating state of the controlled device is abnormal, the device abnormality information corresponding to the device operation information is used to calculate the required baud rate, and a second target baud rate corresponding to the required baud rate is determined, so that the second target baud rate is used for communication operations. When it is determined that the operating state of the controlled device has returned to normal, a baud rate prediction operation is performed to obtain a third target baud rate, so that the third target baud rate is used for communication operations. That is, the present application can adjust the baud rate value in real time according to the device operating state, so that the baud rate value can match the device operating state, thereby being able to adapt to the actual data collection needs under different device operating states and improve communication reliability.
[0119] In addition, in this application, when adjusting from high-frequency sampling to low-frequency sampling, the baud rate prediction model is used to determine the baud rate of low-frequency sampling. Since the model is trained with a large amount of training data, the baud rate predicted by the model is more accurate, which can improve the reliability of communication baud rate determination.
[0120] In addition, using the SVM regression model to predict baud rate values can more accurately capture the complex changes in the data, achieving higher prediction accuracy than traditional methods. In addition to using the SVM regression model for baud rate prediction, data fitting methods such as the least squares method can also be used to achieve the effect of predicting baud rate values.
[0121] Based on any of the above embodiments, in one implementation, the device operation information includes multiple parameter values of different device parameters in the current communication cycle.
[0122] During implementation, the device parameters of different controlled devices can be configured based on actual needs. For example, if the controlled device is a motor (such as a Field-Oriented Control (FOC) motor), device parameters may include, but are not limited to, alpha current, beta current, q current, d current, alpha voltage, beta voltage, q voltage, and d voltage.
[0123] In addition, the present application may configure a communication cycle. In one implementation, the communication cycle may be a fixed time period. For example, each time a fixed time period passes, it is considered that a communication cycle has passed. The specific length of the communication cycle can be configured based on actual conditions. In particular, u samples can be performed within a communication cycle.
[0124] Therefore, in the embodiment of the present application, when obtaining device operation information, multiple parameter values of different device parameters in the current communication cycle can be obtained. In one embodiment, the number of device parameters is k. Among them, the device parameters can also be called device variables.
[0125] In a communication cycle, the parameter value of each device parameter is collected according to the sampling rate. The parameter value of each parameter of the k device parameters is stored in the two-dimensional buffer pool array Buf k,u Each subsequent sampling will store the collected data in Buf k,u In. Buf k,u A maximum of u parameter values of each device parameter can be stored, where k and u are positive integers.
[0126] In one implementation, referring to Figure 3 , determining that the operating status of the controlled device is abnormal based on the device operating information may include:
[0127] S31. Determine an average value and a variance of the device parameters in a current communication cycle according to multiple parameter values of the device parameters.
[0128] In this embodiment, after continuous sampling u times, in Buf k,u After storing u parameter values of each device parameter, the parameter values fill up the Buf k,u At this time, the equipment operation status analysis operation is performed to determine whether the equipment operation status is normal or abnormal.
[0129] For each device parameter, calculate the average value of each device parameter Array Mean [s], the specific calculation formula is:
[0130] Where s represents the sth device parameter, 1≤s≤k, and Buf[s][b] is the bth parameter value of the sth device parameter. The average value of each device parameter is Array Mean [s] constitutes the average value array Array Mean .
[0131] In addition, for each device parameter, calculate the variance Array of each device parameter Var [s], the specific calculation formula is:
[0132] Where s represents the sth device parameter, 1≤s≤k, and Buf[s][b] is the bth parameter value of the sth device parameter. The average value of each device parameter is Array Var [s] Array of variance Var .
[0133] S32: Calculate the difference between the average value of the device parameter in the current communication cycle and the average value in the previous communication cycle, and use the difference as the first difference.
[0134] In this embodiment, for the average value array ArrayMean The average value of the device parameters in Array Mean [s], get the average value array Array′ in the previous communication cycle Mean The average value of the corresponding device parameters in Array′ Mean [s], calculate Array Mean [s] and Array′ Mean The first-order difference of [s], that is, the first difference Array MeanDiff [s], the specific calculation formula is:
[0135] Array MeanDiff [s]=|Array Mean [s]-Array′ Mean [s]|.
[0136] Array of various device parameters MeanDiff [s] can form an array MeanDiff .
[0137] S33: Calculate the difference between the variance of the device parameter in the current communication cycle and the variance in the previous communication cycle, and use the difference as the second difference.
[0138] In this embodiment, for the variance array Array Var The variance of the device parameters in Array Var [s], get the variance array Array′ in the previous communication cycle Var The variance of the corresponding device parameters in Array′ Var [s], calculate Array Var [s] and Array′ Var The first-order difference of [s], that is, the second difference Array MeanDiff [s], the specific calculation formula is:
[0139] Array MeanDiff [s]=|Array Var [s]-Array′ Var [s]|.
[0140] Array of various device parameters VarDiff [s] can form an array VarDiff .
[0141] S34. Determine whether the target device parameters exist; if so, execute step S35; if not, execute step S36.
[0142] S35. Determine that the operating status of the controlled device is abnormal.
[0143] S36. Determine whether the operating status of the controlled device is normal.
[0144] The first difference of the target device parameter is greater than a first threshold and the second difference is greater than a second threshold. The first threshold refers to an abnormal fluctuation threshold of an average value, and the second threshold refers to an abnormal fluctuation threshold of a variance.
[0145] If the first difference of a device parameter is greater than the first threshold and the second difference is greater than the second threshold, it means that the difference between the device parameter value of the device parameter in the current communication cycle and the device parameter value in the previous communication cycle is too large, which also means that there is abnormal fluctuation in the parameter value of the device parameter, and it can be inferred that the operating status of the controlled device is abnormal.
[0146] In one embodiment, Array MeanDiff and Array VarDiff Each data item in the Array is judged to be out of limit, that is, for a device parameter, MeanDiff Whether the first difference of the device parameter in Array is greater than the first threshold, and VarDiff Whether the second difference of the device parameter in the data is greater than the second threshold. If the first difference of a device parameter is greater than the first threshold and the second difference is greater than the second threshold, the device parameter is used as the target device parameter, and the parameter ID (Identity) of the target device parameter and the parameter type value of the target device parameter are recorded. The parameter type is used to distinguish the data category of the device parameter. The parameter type value includes 8 bits, 16 bits, 32 bits, and 64 bits, a total of 4 types, and is represented by 8, 16, 32, and 64 respectively, that is, the parameter type value is 8, 16, 32, and 64. For a target device parameter, its parameter type value is one of 8, 16, 32, and 64.
[0147] If there is no device parameter whose first difference is greater than the first threshold and whose second difference is greater than the second threshold, it means that the device parameter value in the current communication cycle is not much different from the device parameter value in the previous communication cycle, which also means that there is no abnormal fluctuation in the parameter value of the device parameter. It can be deduced that the operating status of the controlled device is normal and the buffer can be cleared. k,u , continuing the device operating status monitoring operation for the next communication cycle. If neither the first difference value of any device parameter is greater than the first threshold nor the second difference value is greater than the second threshold value, then the first difference value of at least one device parameter may be greater than the first threshold value but the second difference value may not be greater than the second threshold value; or the first difference value of at least one device parameter may be less than the first threshold value but the second difference value may be greater than the second threshold value; or the first difference value of at least one device parameter may be less than the first threshold value and the second difference value may be less than the second threshold value.
[0148] In this embodiment, by analyzing whether the device operating status is abnormal based on the changes in the device parameters of the controlled device in different communication cycles, the abnormal operating status of the device can be monitored in time for subsequent device abnormality cause analysis operations.
[0149] Based on the above embodiment, the device abnormality information corresponding to the device operation information includes the sampling rate after the value is increased and the parameter type value of the target device parameter.
[0150] In one implementation, if the control device determines that the controlled device's operating status is abnormal and determines target device parameters based on the device operating information, the controlled device may determine an increased sampling rate when calculating the required baud rate based on the device abnormality information corresponding to the device operating information. In this embodiment, the increased sampling rate is intended to increase the sampling frequency, thereby sampling more device abnormality data and facilitating subsequent abnormality cause analysis.
[0151] When the control device determines the sampling rate after the numerical value is increased (the sampling rate after the numerical value is increased is represented by fs), the preset multiple of the sampling rate originally used can be used as the sampling rate after the numerical value is increased, wherein the preset multiple is greater than one. Or the sum of the sampling rate originally used and a sampling rate value is used as the sampling rate after the increase. Alternatively, based on the number of parameters of the target device parameters, the sampling rate after the numerical value is increased corresponding to it is determined. In this embodiment, the specific process of determining the sampling rate after the numerical value is increased is not limited. As long as the scheme of increasing the sampling rate is in an abnormal operating state of the device, the scheme of increasing the sampling rate is within the scope of protection of this application.
[0152] The control device then encapsulates the increased sampling rate, the parameter ID of the target device parameter, and the parameter type value into a communication frame and sends it to the controlled device. The controlled device then enters the high-speed sampling scenario. Among them, the parameter type value of the target device parameter can form a parameter type list Array type .
[0153] If the controlling device determines that the operating state of the controlled device is abnormal and determines the target device parameters based on the device operating information, and calculates the required baud rate based on the device abnormality information corresponding to the device operating information, or if the controlled device determines that the operating state of the controlled device is abnormal and determines the target device parameters based on the device operating information, and calculates the required baud rate based on the device abnormality information corresponding to the device operating information, then since the entire process is executed by a certain device, the above-mentioned process of encapsulating the increased sampling rate and the parameter type value of the target device parameter into a communication frame and transmitting it does not exist.
[0154] In one implementation, referring to Figure 4 , using the device abnormality information corresponding to the device operation information to calculate the required baud rate, including:
[0155] S41. Perform a sum operation on the parameter type values of the target device parameters to obtain a single sampling data size.
[0156] In this embodiment, when the operating state of the controlled device is abnormal, the parameter values of the non-target device parameters are normal, while the parameter values of the target device parameters are abnormal. To improve the efficiency of analyzing the cause of the device abnormality, only the parameter values of the abnormal target device parameters can be collected at a high frequency and transmitted to the control device. The parameter values of the non-target device parameters can be temporarily not transmitted.
[0157] Each time data is collected, the accumulated Array type The element value in gets the single sampling data size Size cnt , Size cnt The calculation formula is:
[0158]
[0159] Among them, Size cnt The unit is bits, Array type [d] refers to the parameter type value of the dth target device parameter. v is the parameter type list Array type The number of parameter type values in , that is, the number of target device parameters.
[0160] S42. Calculate the required baud rate based on the single sampling data size and the sampling rate.
[0161] In this embodiment, when calculating the required baud rate ComRate needed When , the ratio of the single sampling data size to the preset value is first calculated. The preset value can be the number of data bits. In order to maintain communication consistency between the control device and the controlled device, the number of data bits can be uniformly set to 8, and the preset value is 8.
[0162] Since the unit of single sampling data size is bit, and the unit of other values when calculating the required baud rate is byte, it is necessary to convert the single sampling data size from bit to byte. cnt Divide the size by 8 to get the ratio. cnt Refers to the data size of the data bits of a single sampling.
[0163] Then, the ratio, the number of start bits in the communication message, and the sum of the number of stop bits are calculated to obtain an intermediate value.
[0164] In general, in addition to the data bit part, the serial communication protocol also has a start bit, a stop bit, and a possible check bit. In order to maintain the communication consistency between the control device and the controlled device, the data bit is uniformly set to 8 bits, the start and stop bits are both 1 bit, and the check bit is not included. The sum of the ratio, the number of start bits in the communication message, and the number of stop bits is the size. cnt / 8+1+1, the sum is the middle value.
[0165] The product of the intermediate value, the preset value and the sampling rate is then calculated, where the preset value is the upper The total amount of data that needs to be transmitted after sampling the data at the increased sampling rate.
[0166] The calculation result is the required baud rate, that is:
[0167] The unit is bits / s.
[0168] In this embodiment, the required baud rate is determined according to the actually required sampling rate and the abnormal target device parameters to be transmitted, so that the baud rate required for communication of the controlled device when the device operating parameters are abnormal can be determined.
[0169] Based on the previous embodiment, refer to Figure 5 , determining the second target baud rate corresponding to the required baud rate may include:
[0170] S51. Determine whether the required baud rate is not greater than the initial baud rate; if so, execute step S52; if not, execute step S53.
[0171] Among them, the initial baud rate BaudRate init Refers to the minimum baud rate agreed upon by the controlling device and the controlled device.
[0172] S52: Use the initial baud rate as the second target baud rate.
[0173] In this embodiment, if the required baud rate is not greater than BaudRate init , it means that the required baud rate is too small, but the minimum baud rate agreed upon by the control device and the controlled device is BaudRate init , in ConRate needed ≤BaudRate init When the initial baud rate is used as the second target baud rate, a response confirmation frame can be sent between the control device and the controlled device, and then parameter collection and transmission are performed. In one embodiment, when the required baud rate is not greater than BaudRate init When the command is executed, the content of the response confirmation frame may be that the communication limit is exceeded and the instruction cannot be executed.
[0174] S53: Acquire multiple reference baud rates.
[0175] The reference baud rate is greater than the initial baud rate.
[0176] If ComRate needed >BaudRate init , then the baud rate needs to be adjusted. At this time, the second target baud rate can be selected according to the table lookup method. The minimum value of the baud rate value table used in the table lookup method is BaudRate min , maximum value BaudRate max The minimum and maximum values are usually obtained based on the chip data sheet. Then in BaudRate min and BaudRate max Add some commonly used baud rates at even intervals to complete the baud rate value table Array baud Array baud The baud rate in the embodiment of the present application can be referred to as the reference baud rate, and the baud rate value table Array baud The number of values in is recorded as Size ba The specific quantity depends on the actual configuration.
[0177] S54: Determine a reference baud rate that is greater than the required baud rate and has the smallest numerical difference with the required baud rate.
[0178] S55: Use the determined reference baud rate as the second target baud rate.
[0179] Specifically, ComRate needed Array of baud rate value tables baud Judge item by item, when Array is satisfied baud [z]<ComRate needed ≤Array baud [z+1], where z represents the zth item in the baud rate value table, 1≤z≤Size ba , select Array baud [z+1] as the second target baud rate BaudRate sample .
[0180] If the control device subsequently determines the second target baud rate, the control device may send a baud rate adjustment instruction and the second target baud rate to the controlled device, so that the controlled device and the control device adjust their own baud rates to the second target baud rate.
[0181] If the controlled device determines the second target baud rate, the controlled device can send a baud rate adjustment instruction and the second target baud rate to the control device using the baud rate just used for communication, so that the controlled device and the control device adjust their own baud rates to the second target baud rate.
[0182] After the baud rate adjustment is completed, the controlled device collects device operation information at the configured sampling rate, packages the data according to the specified communication protocol (such as the second target baud rate), and then sends it to the controlling device. In this embodiment, in order to collect device operation information of the controlled device, the sampling rate can be increased, that is, the configured sampling rate can be greater than the originally used baud rate, so as to sample more data and increase the amount of data for abnormality analysis.
[0183] During the process of data collection and transmission of the controlled device, it is necessary to monitor the stop sampling instruction from the control device in real time. If the stop collection instruction is not received, continue to collect and send data; if the stop collection instruction is received, it means that the device operation status of the controlled device has returned to normal, stop collecting, and enter the next step of adjusting the second target baud rate to the third target baud rate, and still collect data in the same way as collecting all device parameters.
[0184] In this embodiment, a baud rate value table is pre-configured, so that when determining the second target baud rate, the second target baud rate can be quickly determined by using a table lookup method, thereby improving efficiency.
[0185] In summary, in the present application, in scenarios such as online debugging and online operation, data is first collected through low-frequency sampling and a lower baud rate. When it is determined that the device operation of the controlled device is abnormal, it is necessary to enter the parameter high-frequency sampling scenario. At this time, the sampling rate is increased, and the required data transmission rate is calculated through parameters such as the sampling rate and the amount of data sampled per single time, and the required baud rate is obtained. The baud rate is adjusted synchronously, so as to collect the parameter values of the abnormal device parameters at high frequency, so as to analyze the cause of the device abnormality and repair it in time. After the device returns to normal, it is adjusted back to low-frequency sampling and a lower baud rate for data collection, and the above steps are repeated. Once the current baud rate cannot meet the communication transmission rate requirements, the baud rate can be automatically adjusted and adapted, and the online debugging and online operation processes will not be interrupted.
[0186] Based on the above embodiment of the baud rate adjustment method, another embodiment of the present application provides a baud rate adjustment device, referring to Figure 6 , which may include:
[0187] The information acquisition module 11 is used to acquire device operation information of the controlled device during the communication process based on the first target baud rate;
[0188] The baud rate calculation module 12 is configured to calculate the required baud rate using the device abnormality information corresponding to the device operation information if it is determined based on the device operation information that the operation status of the controlled device is abnormal;
[0189] a baud rate determination module 13, configured to determine a second target baud rate corresponding to the required baud rate, so as to perform communication operations using the second target baud rate; the second target baud rate being greater than the first target baud rate;
[0190] The baud rate prediction module 14 is configured to, when it is determined that the operating state of the controlled device has returned to normal, perform a baud rate prediction operation to obtain a third target baud rate so as to perform communication operations at the third target baud rate which is lower than the second target baud rate.
[0191] In one implementation, the device operation information includes multiple parameter values of different device parameters in the current communication cycle;
[0192] The baud rate calculation module 12 includes:
[0193] A first calculation submodule is configured to determine an average value and a variance of the device parameter in a current communication cycle based on multiple parameter values of the device parameter;
[0194] A second calculation submodule is used to calculate the difference between the average value of the device parameter in the current communication cycle and the average value in the previous communication cycle, and use it as the first difference;
[0195] A third calculation submodule is used to calculate the difference between the variance of the device parameter in the current communication cycle and the variance in the previous communication cycle, and use it as the second difference;
[0196] A judgment submodule, configured to judge whether a target device parameter exists; a first difference value of the target device parameter is greater than a first threshold value and a second difference value is greater than a second threshold value;
[0197] The abnormality determination submodule is used to determine that the operating status of the controlled device is abnormal if the abnormality exists; if the abnormality does not exist, determine that the operating status of the controlled device is normal.
[0198] In one implementation, the device abnormality information corresponding to the device operation information includes the sampling rate after the value is increased and the parameter type value of the target device parameter.
[0199] The baud rate calculation module 12 includes:
[0200] A fourth calculation submodule is used to perform a sum operation on the parameter type values of the target device parameters to obtain the size of single sampling data;
[0201] The fifth calculation submodule is used to calculate the required baud rate according to the single sampling data size and the sampling rate.
[0202] In one implementation, the fifth calculation submodule includes:
[0203] A first calculation unit, configured to calculate a ratio of a single sampling data size to a preset value;
[0204] A second calculation unit is used to calculate the ratio, the sum of the number of start bits and the number of stop bits in the communication message to obtain an intermediate value;
[0205] The third calculation unit is used to calculate the product of the intermediate value, the preset value and the sampling rate, and use the product as the required baud rate.
[0206] In one implementation, the baud rate determination module 13 includes:
[0207] A first determining submodule is configured to use the initial baud rate as the second target baud rate when the required baud rate is not greater than the initial baud rate;
[0208] The first data acquisition submodule is used to acquire multiple reference baud rates when the required baud rate is greater than the initial baud rate; the reference baud rate is greater than the initial baud rate;
[0209] The second determining submodule is configured to determine a reference baud rate that is greater than the required baud rate and has a minimum numerical difference with the required baud rate, and use the determined reference baud rate as the second target baud rate.
[0210] In one implementation, the baud rate prediction module 14 includes:
[0211] The second data acquisition submodule is used to obtain a plurality of historical baud rates used in history;
[0212] The processing submodule is used to perform normalization and feature extraction operations on the historical baud rate to obtain the target features;
[0213] The prediction submodule is used to perform a baud rate prediction operation based on the target feature to obtain a third target baud rate.
[0214] In one implementation, the prediction submodule is specifically used to:
[0215] Inputting the target feature into the baud rate prediction model to obtain a third target baud rate output by the baud rate prediction model;
[0216] Among them, the baud rate prediction model is constructed based on the kernel function, and the types of kernel functions include linear kernel, polynomial kernel or Gaussian kernel; the model parameters in the baud rate prediction model are determined based on the distribution characteristics of historical baud rates and the prediction target; the parameter values of the model parameters are obtained by using an optimization algorithm.
[0217] In this embodiment, during communication based on the first target baud rate, device operation information of the controlled device is obtained. If it is determined based on the device operation information that the operating state of the controlled device is abnormal, the device abnormality information corresponding to the device operation information is used to calculate the required baud rate, and a second target baud rate corresponding to the required baud rate is determined, so that the second target baud rate is used for communication operations. When it is determined that the operating state of the controlled device has returned to normal, a baud rate prediction operation is performed to obtain a third target baud rate, so that the third target baud rate is used for communication operations. That is, the present application can adjust the baud rate value in real time according to the device operating state, so that the baud rate value can match the device operating state, thereby being able to adapt to the actual data collection needs under different device operating states and improve communication reliability.
[0218] It should be noted that, for the working process of each module and sub-module in this embodiment, please refer to the corresponding description in the above embodiment, which will not be repeated here.
[0219] An embodiment of the present application further provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0220] Memory is used to store computer programs;
[0221] The processor is used to execute the computer program so that the electronic device can implement the above baud rate adjustment method.
[0222] refer to Figure 7 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include, but is not limited to, fixed terminals such as mobile phones, laptops, PDAs (personal digital assistants), PADs (tablet computers), desktop computers, control devices, controlled devices, etc. Figure 7 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0223] like Figure 7 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. When the electronic device is powered on, the RAM 603 also stores various programs and data required for the operation of the electronic device. The processing device 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0224] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0225] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any baud rate adjustment method provided in the embodiment of the present application.
[0226] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any baud rate adjustment method provided in the embodiment of the present application.
[0227] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A baud rate adjustment method, characterized in that: include: During communication based on the first target baud rate, obtaining device operation information of the controlled device; If it is determined based on the device operation information that the operating state of the controlled device is abnormal, the required baud rate is calculated using the device abnormality information corresponding to the device operation information; determining a second target baud rate corresponding to the required baud rate, and performing a communication operation using the second target baud rate; the second target baud rate being greater than the first target baud rate; When it is determined that the operating state of the controlled device returns to normal, a baud rate prediction operation is performed to obtain a third target baud rate, so as to perform a communication operation using the third target baud rate; the third target baud rate is lower than the second target baud rate.
2. The baud rate adjustment method according to claim 1, wherein: The device operation information includes multiple parameter values of different device parameters in the current communication cycle; Determining that the operating state of the controlled device is abnormal based on the device operating information includes: Determining, based on the multiple parameter values of the device parameter, an average value and a variance of the device parameter in a current communication cycle; Calculating a difference between an average value of the device parameter in a current communication cycle and an average value in a previous communication cycle, and using the difference as a first difference; Calculating a difference between a variance of the device parameter in a current communication cycle and a variance in a previous communication cycle, and using the difference as a second difference; Determining whether a target device parameter exists; wherein a first difference value of the target device parameter is greater than a first threshold value and a second difference value is greater than a second threshold value; If so, determining that the operating state of the controlled device is abnormal; If not, it is determined that the operating status of the controlled device is normal.
3. The baud rate adjustment method according to claim 2, wherein: The device abnormality information corresponding to the device operation information includes the sampling rate after the value is increased and the parameter type value of the target device parameter; Calculating the required baud rate using the device abnormality information corresponding to the device operation information, including: Performing a sum operation on the parameter type values of the target device parameters to obtain a single sampling data size; The required baud rate is calculated according to the single sampling data size and the sampling rate.
4. The baud rate adjustment method according to claim 3, wherein: Calculating the required baud rate according to the single sampling data size and the sampling rate includes: Calculating the ratio of the single sampling data size to a preset value; Calculating the sum of the ratio, the number of start bits, and the number of stop bits in the communication message to obtain an intermediate value; Calculating the product of the intermediate value, the preset value, and the sampling rate; The product is taken as the required baud rate.
5. The baud rate adjustment method according to claim 1, wherein: Determining a second target baud rate corresponding to the required baud rate includes: If the required baud rate is not greater than the initial baud rate, using the initial baud rate as the second target baud rate; When the required baud rate is greater than the initial baud rate, obtaining multiple reference baud rates; the reference baud rates are greater than the initial baud rate; Determining a reference baud rate that is greater than the required baud rate and has a minimum numerical difference with the required baud rate; The determined reference baud rate is used as the second target baud rate.
6. The baud rate adjustment method according to claim 1, wherein: Performing a baud rate prediction operation to obtain a third target baud rate includes: Get multiple historical baud rates used in history; Performing a normalization operation and a feature extraction operation on the historical baud rate to obtain a target feature; A baud rate prediction operation is performed based on the target feature to obtain a third target baud rate.
7. The baud rate adjustment method according to claim 6, wherein: Performing a baud rate prediction operation based on the target feature to obtain a third target baud rate includes: Inputting the target feature into a baud rate prediction model to obtain a third target baud rate output by the baud rate prediction model; Among them, the baud rate prediction model is constructed based on a kernel function, and the types of the kernel function include linear kernel, polynomial kernel or Gaussian kernel; the model parameters in the baud rate prediction model are determined based on the distribution characteristics of the historical baud rate and the prediction target; the parameter values of the model parameters are obtained by using an optimization algorithm.
8. A baud rate adjustment device, characterized in that: include: An information acquisition module, configured to acquire device operation information of a controlled device during communication based on the first target baud rate; a baud rate calculation module configured to calculate a required baud rate using device abnormality information corresponding to the device operation information if it is determined based on the device operation information that the operation state of the controlled device is abnormal; a baud rate determination module, configured to determine a second target baud rate corresponding to the required baud rate, so as to perform a communication operation using the second target baud rate; the second target baud rate being greater than the first target baud rate; The baud rate prediction module is used to perform a baud rate prediction operation to obtain a third target baud rate when it is determined that the operating state of the controlled device has returned to normal, so as to use the third target baud rate for communication operations; the third target baud rate is smaller than the second target baud rate.
9. An electronic device, characterized in that: comprising at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is configured to execute the computer program so that the electronic device can implement the baud rate adjustment method according to any one of claims 1 to 7.
10. A computer storage medium, characterized in that The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the baud rate adjustment method according to any one of claims 1 to 7.