Method and device for self-adapting serial port communication parameters and vehicle-mounted intelligent terminal

By storing configuration parameters in the on-board smart terminal, the master device matches the slave device, solving the communication interruption problem caused by changes in the slave device's communication parameters, and realizing reliable information transmission and continuous communication capabilities.

CN119441096APending Publication Date: 2025-02-14HUBEI SAN LING SPECIAL PURPOSE VEHICLE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411584186.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In power special vehicles, the serial communication parameters between the on-board smart terminal and the slave device may change, resulting in the inability to collect and transmit normal sensor information.

Method used

By storing configuration parameters in the master device, including whether it is necessary to search for serial communication parameters, serial communication parameter combination table and slave address search range, the master device matches the slave device until a normal communication connection is established.

Benefits of technology

It is realized that when the slave communication parameters change, the master device can adaptively match the slave parameters, reduce the system update workload, ensure reliable information transmission, and realize continuous communication capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119441096A_ABST
    Figure CN119441096A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of power system communication, and discloses a serial port communication parameter self-adaption method and device and a vehicle-mounted intelligent terminal.The method is used for serial port communication between a master device and a plurality of slave devices, the master device is provided with a plurality of serial ports, and part of the serial ports are connected with the slave devices in a one-to-one correspondence mode. The method comprises the steps that whether serial port communication parameters need to be searched or not is judged based on reading information of main equipment; if so, opening a communication port corresponding to the slave device and the master device according to the corresponding configuration information; and establishing communication with the slave device based on the slave station address of the slave device, and determining whether to replace the slave station address or switch serial port communication parameters according to whether the communication is successful or not until the slave device and the master device normally establish communication. According to the invention, the system updating workload caused by the change of the communication data is reduced, the reliable transmission of information is ensured, and the adaptive continuous communication capability is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system communication, and in particular to a method and device for adaptive serial port communication parameters and a vehicle-mounted intelligent terminal. Background Art

[0002] At present, electric special vehicles are usually equipped with on-board intelligent terminals. The on-board intelligent terminal (hereinafter referred to as the "terminal") is an edge computing device that can be used to collect various status information of vehicles and sensors and send it to the dispatching and command system. When the on-board intelligent terminal collects relevant information, it is necessary to communicate with the sensor (hereinafter referred to as the "slave device"), usually using CAN communication technology or serial communication technology. In serial communication, the terminal and the slave device agree on the prior communication parameters including the slave address code, baud rate, check code, data bit, stop bit, check bit, etc. However, in specific scenarios, the communication parameters and device addresses of slave devices such as sensors may be changed (not unintentionally), which results in the inability to collect and transmit normal sensor information. Summary of the invention

[0003] (I) Purpose of the invention

[0004] The purpose of the present invention is to provide a method, device and vehicle-mounted intelligent terminal for adaptive serial port communication parameters. When the communication parameters of a slave device change, the method matches the serial port combination parameters in the communication parameter combination table of the master device and the slave station address of the corresponding slave device. After the matching is completed, normal communication between the master device and the slave device is established. The present invention reduces the system update workload due to changes in the communication number and ensures reliable transmission of information.

[0005] (II) Technical solution

[0006] To solve the above problem, a first aspect of the present invention provides a method for adaptive serial port communication parameters, which is used for a master device to perform serial port communication with multiple slave devices, wherein the master device is provided with multiple serial ports, and some of the serial ports are connected to the slave devices in a one-to-one correspondence, and the method comprises:

[0007] S1, judging whether it is necessary to search for serial port communication parameters based on the read information of the master device;

[0008] S2, if necessary, open the communication port between the corresponding slave device and the master device according to the corresponding configuration information;

[0009] S3, establishing communication with the slave device based on the slave address of the slave device, and determining whether to change the slave address or switch the serial port communication parameters according to whether the communication is successful, until the slave device and the master device establish communication normally.

[0010] Furthermore, the step S1 comprises:

[0011] The master device reads the configuration parameters of each serial port;

[0012] Based on the configuration parameters, it is determined whether it is necessary to search for serial port communication parameters, wherein the configuration parameters include: whether it is necessary to search for serial port communication parameters, a serial port communication parameter combination table, a slave address search, and a slave address search range, and the serial port communication parameter combination table includes several serial port combination parameters sorted by priority.

[0013] Furthermore, the step S2 includes: if necessary, setting parameters of the slave device corresponding to the serial port according to the first priority serial port combination parameter, and opening the communication port between the slave device and the master device with the combination parameter.

[0014] Furthermore, the step S3 comprises:

[0015] Acquire an initial slave address of the slave device, establish a communication connection with the slave device based on the initial slave address, and determine whether the slave device has a communication response;

[0016] If there is a response, recording and using the first priority serial port combination parameter and the slave station address to maintain communication;

[0017] If there is no response, the initial slave address is increased by 1 to establish a communication connection, and the cycle is repeated until the slave address of the slave device is traversed. If both the master device and the slave device cannot establish communication normally, the process returns to step S2 and switches the first priority serial port combination parameters to the second priority serial port combination parameters until the best priority serial port combination parameters are obtained.

[0018] Furthermore, the method further comprises:

[0019] S4: If a communication abnormality occurs during the communication process, return to step S1.

[0020] Further, the serial communication parameters include: baud rate, check mode, data bit and stop bit. Further, the slave address search range includes the full range from the initial slave address of the corresponding slave device to the maximum slave address.

[0021] A second aspect of the present invention provides a device for adaptive serial port communication parameters, in which a master device performs serial port communication with multiple slave devices, the master device is provided with multiple serial ports, some of the serial ports are connected to the slave devices in a one-to-one correspondence, and the device comprises:

[0022] The information reading module is used to determine whether it is necessary to search for serial port communication parameters based on the information read by the master device;

[0023] The communication port opening module is used to open the communication port between the corresponding slave device and the master device according to the corresponding configuration information if necessary;

[0024] A communication module is established, which is used to establish communication with the slave device based on the slave address of the slave device, and determine whether to change the slave address or switch the serial port communication parameters according to whether the communication is successful, until the slave device and the master device establish communication normally.

[0025] Furthermore, the establishing communication module includes:

[0026] A first communication submodule is used to obtain an initial slave station address of the slave device, establish a communication connection with the slave device based on the initial slave station address, and determine whether the slave device has a communication response;

[0027] A second communication submodule, for recording and using the first priority serial port combination parameter and the slave station address to maintain communication if there is a response;

[0028] If there is no response, the initial slave address is increased by 1 to establish a communication connection, and the cycle is repeated until the slave address of the slave device is traversed. If both the master device and the slave device cannot establish communication normally, the process returns to step S2 and switches the first priority serial port combination parameters to the second priority serial port combination parameters until the best priority serial port combination parameters are obtained.

[0029] A third aspect of the present invention provides an in-vehicle intelligent terminal, which is provided with multiple serial ports. When some of the serial ports are connected one-to-one with slave devices, any one of the methods for adaptive serial port communication parameters described above is used to achieve communication connection.

[0030] (III) Beneficial effects

[0031] The above-mentioned technical scheme of the present invention has the following beneficial technical effects: the present invention provides a method, device and vehicle-mounted intelligent terminal for adaptive serial port communication parameters, the method is applied to slave device communication in which communication parameters may change, and is only applicable to the situation where the serial port and the slave device are connected one-to-one, and the working principle is as follows: configuration parameters are stored in the master device, and the configuration parameters include: whether to search for serial port communication parameters, a serial port communication parameter combination table, a slave address search and a slave address search range, and the serial port communication parameter combination table includes several serial port combination parameters sorted by priority. After the program is started, it is first determined based on the configuration parameters whether it is necessary to search for serial port communication parameters. If necessary, the parameters of the slave device are set according to the priority ranking of the serial port combination parameters, and the communication port is opened, and then the slave address of the slave device is obtained. According to the judgment result of whether the slave device has a communication response, the above verification steps are executed cyclically to determine the communication parameters and slave address parameters of the corresponding slave device. The present invention matches the serial port combination parameters in the communication parameter combination table of the master device and the slave address of the corresponding slave device, and establishes normal communication between the master device and the slave device after the matching is completed. The present invention reduces the workload of system updates when the communication number changes, ensures reliable information transmission, and realizes adaptive continuous communication capabilities. The present invention solves the problem of maintaining the terminal's ability to adaptively match the slave device parameters when the slave device communication parameters are changed, realizing continuous information collection, and applies the method to the vehicle-mounted intelligent terminal. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flow chart of a method for adaptive serial port communication parameters of the present invention;

[0033] Figure 2 is a flow chart of a specific embodiment of the method for adaptive serial port communication parameters of the present invention;

[0034] Figure 3 It is a schematic diagram of a device for adaptive serial port communication parameters of the present invention;

[0035] Figure 4 It is a schematic diagram of a vehicle-mounted intelligent terminal of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.

[0037] like Figure 1As shown, a first aspect of the present invention provides a method for adaptive serial port communication parameters, the method is used for a master device to communicate with multiple slave devices via serial ports, the master device is provided with multiple serial ports, some of the serial ports are connected to the slave devices in a one-to-one correspondence, the method comprising:

[0038] S1, judging whether it is necessary to search for serial port communication parameters based on the read information of the master device;

[0039] S2, if necessary, open the communication port between the corresponding slave device and the master device according to the corresponding configuration information;

[0040] S3, establishing communication with the slave device based on the slave address of the slave device, and determining whether to change the slave address or switch the serial port communication parameters according to whether the communication is successful, until the slave device and the master device establish communication normally.

[0041] Combine the following Figure 2 Detailed description of the above steps:

[0042] The step S1 comprises:

[0043] Step A, the master device reads the configuration parameters of each serial port. In this step, the master device stores the configuration parameters of multiple slave devices. The master device is turned on and the configuration parameters of each serial port are read.

[0044] Step B, based on the configuration parameters, determines whether it is necessary to search for serial port communication parameters, wherein the configuration parameters include: whether it is necessary to search for serial port communication parameters, a serial port communication parameter combination table, a slave address search, and a slave address search range. Whether it is necessary to search for serial port communication parameters is determined based on whether the serial port is connected one-to-one with the slave device. This method is applied to slave device communications where communication parameters may change, and is only applicable to situations where the serial port and the slave device are connected one-to-one. It cannot be applied if the serial port is connected to multiple slave devices. Serial port communication parameters include: baud rate, check mode, data bit, and stop bit. The serial port communication parameter combination table includes several serial port combination parameters sorted by priority, with the first priority being higher than the second priority, and so on; the slave address search and the slave address search range are generally set according to business needs. For example, the slave address is generally set not to exceed 8, that is, the search range is from 1-8.

[0045] The step S2 comprises:

[0046] Step C: if necessary, set the parameters of the slave device corresponding to the serial port according to the first priority serial port combination parameter, and open the communication port between the slave device and the master device with the combination parameter. In this step, the first priority serial port combination parameter is the highest priority in the serial port communication parameter combination table, and the serial port is opened with the highest priority.

[0047] The step S3 comprises:

[0048] Step D, obtaining the initial slave address of the slave device, establishing a communication connection with the slave device based on the initial slave address, and determining whether the slave device has a communication response; in this step, the program starts to attempt communication with the slave address as 1, and the initial slave address is the slave address 1 of each slave device by default;

[0049] Step E, if there is a response, record and use the first priority serial port combination parameter and the slave address to maintain communication; if there is no response, increase the initial slave address by 1 to establish a communication connection, and loop until the slave address of the slave device is traversed. If the master device and the slave device cannot establish communication normally, return to step C and switch the first priority serial port combination parameter to the second priority serial port combination parameter until the best priority serial port combination parameter is obtained. In this step, if there is no response, change the slave address +1 and continue to try. If normal communication cannot be achieved until the maximum slave address, select the second communication parameter (second priority serial port combination parameter) in the communication parameter combination table, open the serial port with this parameter, and enter the step D process until the serial port combination parameter (best priority serial port combination parameter) suitable for the device is matched; the slave address search range includes the full range from the initial slave address of the corresponding slave device to the maximum slave address. For example, the slave address is set to 6, that is, the search range is from 1-6.

[0050] The method further includes: S4, during the communication process, if a communication abnormality occurs (for example, an abnormality occurs in the communication terminal), returning to step B,

[0051] In addition, when the serial port parameters change, if the slave device of the present invention has the function of supporting active notification, in order to speed up the above steps S1-S3, communication can also be carried out according to the following process, but if the slave device does not have the function of supporting active notification, the following steps are not required:

[0052] When modifying the communication parameters in the slave device, if a master device (terminal) is already connected to the slave device, the slave device first sends the new communication parameters to the terminal with the original communication parameters before executing the communication parameter modification instruction, and then executes the communication parameter switching instruction.

[0053] When the master device (terminal) receives the communication parameter change notification, it also executes the communication parameter change instruction and communicates with the slave station (slave device) according to the parameters received in the notification. This mechanism shortens the parameter search time.

[0054] like Figure 3As shown, another aspect of the present invention provides a device for adaptive serial port communication parameters, in which a master device performs serial port communication with multiple slave devices, the master device is provided with multiple serial ports, some of the serial ports are connected to the slave devices in a one-to-one correspondence, and the device comprises:

[0055] An information reading module 21 is used to determine whether it is necessary to search for serial port communication parameters based on the information read by the master device;

[0056] The communication port opening module 22 is used to open the communication port between the corresponding slave device and the master device according to the corresponding configuration information if necessary;

[0057] The communication establishment module 23 is used to establish communication with the slave device based on the slave address of the slave device, and determine whether to change the slave address or switch the serial port communication parameters according to whether the communication is successful, until the slave device and the master device establish communication normally.

[0058] Furthermore, the information reading module includes:

[0059] The configuration parameter reading module is used by the master device to read the configuration parameters of each serial port;

[0060] A serial communication parameter search judgment module is used to judge whether it is necessary to search for serial communication parameters based on the configuration parameters, wherein the configuration parameters include: whether it is necessary to search for serial communication parameters, a serial communication parameter combination table, a slave address search, and a slave address search range, and the serial communication parameter combination table includes a number of serial port combination parameters sorted by priority.

[0061] Furthermore, the communication port opening module is specifically used to set parameters of the slave device corresponding to the serial port according to the first priority serial port combination parameter if necessary, and open the communication port between the slave device and the master device with the combination parameter.

[0062] Furthermore, the establishing communication module includes:

[0063] A first communication submodule is used to obtain an initial slave station address of the slave device, establish a communication connection with the slave device based on the initial slave station address, and determine whether the slave device has a communication response;

[0064] A second communication submodule, for recording and using the first priority serial port combination parameter and the slave station address to maintain communication if there is a response;

[0065] If there is no response, the initial slave address is increased by 1 to establish a communication connection, and the cycle is repeated until the slave address of the slave device is traversed. If both the master device and the slave device cannot establish communication normally, the process returns to step S2 and switches the first priority serial port combination parameters to the second priority serial port combination parameters until the best priority serial port combination parameters are obtained.

[0066] Furthermore, the device further comprises: a communication abnormality judging module 24, which is used to return to the information reading module if a communication abnormality occurs during the communication process.

[0067] like Figure 4 As shown, the third aspect of the present invention provides a vehicle-mounted intelligent terminal, which is provided with multiple serial ports. When some of the serial ports are connected one-to-one with the slave device, any one of the methods for adaptive serial port communication parameters in the above description is used to achieve communication connection. Usually, the vehicle-mounted intelligent terminal has multiple serial ports, each of which can be connected to one or more slave devices, but in specific scenarios, the communication parameters and device addresses of slave devices such as sensors may be changed (not unintentionally), which causes the normal sensor information to be unable to be collected and transmitted, and the address parameters of the slave device need to be modified to meet the functional requirements. However, this causes the communication between the vehicle-mounted intelligent terminal and the slave device to be interrupted. The present invention solves the problem that when the communication parameters of the slave device are changed, the serial port combination parameters in the communication parameter combination table of the master device and the slave address of the corresponding slave device are matched, and after the matching is completed, normal communication between the master device and the slave device is established to achieve continuous collection of information, and the method is applied to the vehicle-mounted intelligent terminal.

[0068] The present invention provides a method, device and vehicle-mounted intelligent terminal for adaptive serial port communication parameters. The method is applied to the communication of slave devices whose communication parameters may change. If the communication parameters of the slave devices do not change frequently, the communication method is not needed, and the present invention is only applicable to the situation where the serial port and the slave devices are connected one-to-one. The method mainly matches the serial port combination parameters in the communication parameter combination table of the master device and the slave address of the corresponding slave device, and establishes normal communication between the master device and the slave device after the matching is completed. The configuration parameters of each slave device are stored in the master device, and each configuration parameter includes: whether to search for serial port communication parameters, the serial port communication parameter combination table, the slave address search and the slave address search range. The serial port communication parameter combination table includes a number of serial port combination parameters sorted by priority. After the program is started, it is first determined based on the configuration parameters whether it is necessary to search for serial port communication parameters. If necessary, the parameters of the slave device are set according to the priority ranking of the serial port combination parameters, and the communication port is opened, and then the slave address of the slave device is obtained. According to the judgment result of whether the slave device has a communication response, the above verification steps are executed cyclically to determine the communication parameters and slave address parameters of the corresponding slave device. The present invention matches the serial port combination parameters in the communication parameter combination table of the master device and the slave address of the corresponding slave device, and establishes normal communication between the master device and the slave device after the matching is completed. The present invention reduces the workload of system updates when the communication number changes, ensures reliable information transmission, and realizes adaptive continuous communication capabilities. The present invention also provides a vehicle-mounted intelligent terminal. When the sensor parameters change, the adaptive serial port communication parameter method of the present invention is adopted, and the vehicle-mounted intelligent terminal collects sensor data to ensure the effectiveness, continuity and convenience of the serial port communication transmission parameter type.

[0069] In the above description, the technical details such as the patterning and etching of each layer are not described in detail. However, it should be understood by those skilled in the art that layers, regions, etc. of the desired shape can be formed by various means in the prior art. In addition, in order to form the same structure, those skilled in the art can also design methods that are not completely the same as the methods described above. The present invention has been described above with reference to the embodiments of the present invention. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present invention. The scope of the present invention is defined by the attached claims and their equivalents. Without departing from the scope of the present invention, those skilled in the art can make various substitutions and modifications, and these substitutions and modifications should all fall within the scope of the present invention.

[0070] Obviously, the above embodiments are merely examples for clear explanation, and are not intended to limit the implementation methods. For ordinary technicians in the relevant field, other different forms of changes or variations can be made on the basis of the above description. It is not necessary and impossible to list all the implementation methods here. And the obvious changes or variations derived from this are still within the scope of protection created by the present invention. It should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0071] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0072] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes the following process of the above-mentioned embodiment of each method. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

Claims

1. A method for adaptive serial port communication parameters, characterized in that: The method is used for serial port communication between a master device and a plurality of slave devices, wherein the master device is provided with a plurality of serial ports, and some of the serial ports are connected to the slave devices in a one-to-one correspondence, and the method comprises: S1, judging whether it is necessary to search for serial port communication parameters based on the read information of the master device; S2, if necessary, open the communication port between the corresponding slave device and the master device according to the corresponding configuration information; S3, establishing communication with the slave device based on the slave address of the slave device, and determining whether to change the slave address or switch the serial port communication parameters according to whether the communication is successful, until the slave device and the master device establish communication normally.

2. The method for adaptive serial port communication parameters according to claim 1, characterized in that: The step S1 comprises: The master device reads the configuration parameters of each serial port; Based on the configuration parameters, it is determined whether it is necessary to search for serial port communication parameters, wherein the configuration parameters include: whether it is necessary to search for serial port communication parameters, a serial port communication parameter combination table, a slave address search, and a slave address search range, and the serial port communication parameter combination table includes several serial port combination parameters sorted by priority.

3. The method for adaptive serial port communication parameters according to claim 1, characterized in that: The step S2 includes: if necessary, setting parameters for the slave device corresponding to the serial port according to the first priority serial port combination parameter, and opening the communication port between the slave device and the master device with the combination parameter.

4. The method for adaptive serial port communication parameters according to claim 1, characterized in that: The step S3 comprises: Acquire an initial slave address of the slave device, establish a communication connection with the slave device based on the initial slave address, and determine whether the slave device has a communication response; If there is a response, recording and using the first priority serial port combination parameter and the slave station address to maintain communication; If there is no response, the initial slave address is increased by 1 to establish a communication connection, and the cycle is repeated until the slave address of the slave device is traversed. If both the master device and the slave device cannot establish communication normally, the process returns to step S2 and switches the first priority serial port combination parameters to the second priority serial port combination parameters until the best priority serial port combination parameters are obtained.

5. The method for adaptive serial port communication parameters according to claim 1, characterized in that: The method further comprises: S4: If a communication abnormality occurs during the communication process, return to step S1.

6. The method for adaptive serial port communication parameters according to claim 2, characterized in that: The serial communication parameters include: baud rate, check mode, data bits and stop bits.

7. The method for adaptive serial communication parameters according to claim 2, characterized in that: The slave address search range includes a full range from an initial slave address of a corresponding slave device to a maximum slave address.

8. A device for adaptive serial communication parameters, characterized in that: In the device, a master device communicates with multiple slave devices via serial ports. The master device is provided with multiple serial ports, and some of the serial ports are connected to the slave devices in a one-to-one correspondence. The device comprises: The information reading module is used to determine whether it is necessary to search for serial port communication parameters based on the information read by the master device; The communication port opening module is used to open the communication port between the corresponding slave device and the master device according to the corresponding configuration information if necessary; A communication module is established, which is used to establish communication with the slave device based on the slave address of the slave device, and determine whether to change the slave address or switch the serial port communication parameters according to whether the communication is successful, until the slave device and the master device establish communication normally.

9. The device for adaptive serial port communication parameters according to claim 8, characterized in that: The communication module establishment comprises: A first communication submodule is used to obtain an initial slave station address of the slave device, establish a communication connection with the slave device based on the initial slave station address, and determine whether the slave device has a communication response; A second communication submodule, for recording and using the first priority serial port combination parameter and the slave station address to maintain communication if there is a response; If there is no response, the initial slave address is increased by 1 to establish a communication connection, and the cycle is repeated until the slave address of the slave device is traversed. If both the master device and the slave device cannot establish communication normally, the process returns to step S2 and switches the first priority serial port combination parameters to the second priority serial port combination parameters until the best priority serial port combination parameters are obtained.

10. A vehicle-mounted intelligent terminal, characterized in that: The vehicle-mounted intelligent terminal is provided with a plurality of serial ports. When some of the serial ports are connected one-to-one with the slave device, the communication connection is realized by using any one of the methods of adaptive serial port communication parameters of claims 1-7.