CN112104708B - Communication method and device of diagnostic equipment, electronic equipment and storage medium - Google Patents

Communication method and device of diagnostic equipment, electronic equipment and storage medium Download PDF

Info

Publication number
CN112104708B
CN112104708B CN202010878807.0A CN202010878807A CN112104708B CN 112104708 B CN112104708 B CN 112104708B CN 202010878807 A CN202010878807 A CN 202010878807A CN 112104708 B CN112104708 B CN 112104708B
Authority
CN
China
Prior art keywords
communication
communication mode
equipment
serial port
historical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010878807.0A
Other languages
Chinese (zh)
Other versions
CN112104708A (en
Inventor
刘均
李河金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202010878807.0A priority Critical patent/CN112104708B/en
Publication of CN112104708A publication Critical patent/CN112104708A/en
Application granted granted Critical
Publication of CN112104708B publication Critical patent/CN112104708B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/40Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application is suitable for the field of automobile communication, and provides a communication method and device of diagnostic equipment, electronic equipment and a storage medium. The method comprises the following steps: when the diagnosis equipment triggers communication operation, acquiring a historical communication mode recorded in a configuration file of the diagnosis equipment; adopting the history communication mode to communicate with external equipment; if the communication between the historical communication mode and the external equipment fails, the target communication mode is adopted to communicate with the external equipment, and the target communication mode is other communication modes supported by the diagnosis equipment except the historical communication mode. According to the embodiment of the application, the communication mode of the diagnosis equipment is automatically selected for communication, so that the use convenience of the diagnosis equipment is high.

Description

Communication method and device of diagnostic equipment, electronic equipment and storage medium
Technical Field
The application belongs to the field of automobile communication, and particularly relates to a communication method and device of diagnostic equipment, electronic equipment and a storage medium.
Background
The automobile diagnosis equipment can detect the performance of the automobile to monitor and carry out fault diagnosis on the automobile, and can communicate with the automobile through a diagnosis box or a diagnosis interface to acquire the data of the automobile to carry out automobile diagnosis.
The diagnostic equipment can support various communication modes, such as the diagnostic equipment is a diagnostic instrument, the diagnostic instrument can support various communication modes such as USB, bluetooth, WIFI and the like, before diagnosis by using the diagnostic equipment, the communication modes of the diagnostic equipment are required to be set manually, and then the diagnostic equipment is communicated with a vehicle through a diagnostic box or a diagnostic interface, and the communication modes of the current diagnostic equipment are required to be selected manually, so that the use convenience of the diagnostic equipment is low.
Disclosure of Invention
The embodiment of the application provides a communication method, a device, electronic equipment and a storage medium of diagnostic equipment, and aims to solve the problem that the communication mode of the existing diagnostic equipment needs to be manually selected, so that the use convenience of the diagnostic equipment is low.
In a first aspect, an embodiment of the present application provides a communication method of a diagnostic device, including:
when the diagnosis equipment triggers communication operation, acquiring a historical communication mode recorded in a configuration file of the diagnosis equipment;
adopting the history communication mode to communicate with external equipment;
if the communication between the historical communication mode and the external equipment fails, the target communication mode is adopted to communicate with the external equipment, and the target communication mode is other communication modes supported by the diagnosis equipment except the historical communication mode.
In one embodiment, the communicating with the external device using the historical communication method includes:
when the history communication mode is a USB communication mode, detecting whether first external equipment connected with the diagnosis equipment through a USB interface exists or not;
if the first external equipment exists, acquiring a first product identification code and a first provider identification code of the first external equipment;
after the first product identification code and the first provider identification code are acquired, detecting whether a first serial port corresponding to the first product identification code and the first provider identification code exists in the diagnosis equipment or not; the first serial port is used for indicating a serial port corresponding to the USB interface;
and if the first serial port exists, communicating with the first external equipment through the first serial port.
In one embodiment, the communicating with the external device using the historical communication method includes:
when the historical communication mode is a Bluetooth communication mode, acquiring second serial port information used by the historical communication mode;
communicating with the external device through a second serial port corresponding to the second serial port information;
if communication with the external equipment fails according to the second serial port, acquiring an available third serial port in the diagnostic equipment;
and communicating with the external equipment through a third serial port.
In one embodiment, the communicating with the external device using the historical communication method includes:
detecting and connecting WIFI when the historical communication mode is a WIFI communication mode;
after being connected to the WIFI, the wireless communication system communicates with external equipment through the WIFI communication mode.
In one embodiment, the communicating with the external device by using the target communication mode includes:
if the target communication modes comprise at least two target communication modes, acquiring prestored priority ranking sequences of the at least two target communication modes;
and selecting a corresponding target communication mode from high to low according to the priority ranking order to communicate with the external equipment until any one of the at least two target communication modes is successfully communicated with the external equipment.
In one embodiment, after the communication with the external device in the target communication manner, the method further includes:
and if the target communication mode is adopted to successfully communicate with the external equipment, updating the historical communication mode recorded in the configuration file by using the target communication mode.
In one embodiment, when the diagnostic device triggers a communication operation, after acquiring the historical communication mode recorded in the configuration file of the diagnostic device, the method further includes:
if the historical communication mode is a preset unusual communication mode, the target communication mode is adopted to communicate with the external equipment, and the target communication mode is other communication modes except the historical communication mode supported by the diagnosis equipment.
In a second aspect, an embodiment of the present application provides a communication device of a diagnostic apparatus, including:
the detection module is used for acquiring a historical communication mode recorded in a configuration file of the diagnostic equipment when the diagnostic equipment triggers communication operation;
the first communication module is used for communicating with external equipment by adopting the history communication mode;
and the second communication module is used for communicating with the external equipment by adopting a target communication mode if the communication between the historical communication mode and the external equipment fails, wherein the target communication mode is other communication modes supported by the diagnosis equipment except the historical communication mode.
In one embodiment, the first communication module includes:
the first detection unit is used for detecting whether first external equipment connected with the diagnostic equipment through a USB interface exists or not when the historical communication mode is a USB communication mode;
a first obtaining unit, configured to obtain a first product identifier and a first vendor identifier of the first external device if the first external device exists;
the second detection unit is used for detecting whether the first serial ports corresponding to the first product identification code and the first provider identification code exist in the diagnosis equipment after the first product identification code and the first provider identification code are acquired; the first serial port is used for indicating a serial port corresponding to the USB interface;
and the first communication unit is used for communicating with the first external equipment through the first serial port if the first serial port exists.
In one embodiment, the first communication module includes:
the second acquisition unit is used for acquiring second serial port information used by the historical communication mode when the historical communication mode is a Bluetooth communication mode;
the second communication unit is used for communicating with the external equipment through a second serial port corresponding to the second serial port information;
a third obtaining unit, configured to obtain an available third serial port in the diagnostic device if communication with the external device fails according to the second serial port;
and the third communication unit is used for communicating with the external equipment through a third serial port.
In one embodiment, the first communication module includes:
the third detection unit is used for detecting and connecting WIFI when the historical communication mode is a WIFI communication mode;
and the fourth communication unit is communicated with the external equipment in the WIFI communication mode after being connected to the WIFI.
In one embodiment, the second communication module includes:
a fourth obtaining unit, configured to obtain a pre-stored priority ranking order of the at least two target communication modes if the target communication modes include at least two target communication modes;
and the fifth communication unit is used for selecting a corresponding target communication mode from high to low according to the priority ranking order and communicating with the external equipment until any one of the at least two target communication modes is successfully communicated with the external equipment.
In one embodiment, the communication device includes:
and the updating module is used for updating the historical communication mode recorded in the configuration file by using the target communication mode if the target communication mode is adopted to successfully communicate with the external equipment.
In one embodiment, the communication device includes:
and the third communication module is used for adopting the target communication mode to communicate with the external equipment if the history communication mode is a preset unusual communication mode after the detection module is triggered, wherein the target communication mode is other communication modes supported by the diagnosis equipment except the history communication mode.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the communication method of the diagnostic device when the processor executes the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program, where the computer program when executed by a processor implements the steps of the communication method of the diagnostic device.
In a fifth aspect, embodiments of the present application provide a computer program product for causing an electronic device to perform the steps of the communication method of the diagnostic device described above when the computer program product is run on the electronic device.
Compared with the prior art, the embodiment of the application has the beneficial effects that: when the diagnostic equipment triggers communication operation, the embodiment of the application acquires a historical communication mode recorded in a configuration file of the diagnostic equipment; adopting the history communication mode to communicate with external equipment; if the communication between the historical communication mode and the external equipment fails, the target communication mode is adopted to communicate with the external equipment, and the target communication mode is other communication modes supported by the diagnosis equipment except the historical communication mode. The communication mode of the diagnosis equipment is automatically selected for communication, so that the use convenience of the diagnosis equipment is high.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a communication method of a diagnostic device according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of step S2 according to an embodiment of the present application;
FIG. 3 is another flow chart of step S2 according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of step S3 according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a communication device of a diagnostic device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The communication method of the diagnostic device provided by the embodiment of the application can be applied to the vehicle diagnostic device, and the vehicle diagnostic device can be a diagnostic instrument or an electronic device capable of processing vehicle data.
In order to illustrate the technical solutions described in the present application, the following description is made by means of specific examples.
Referring to fig. 1, a schematic flowchart of a communication method of a diagnostic device provided in an embodiment of the present application is shown, where the method includes:
step S1, when the diagnosis equipment triggers communication operation, a historical communication mode recorded in a configuration file of the diagnosis equipment is obtained.
In application, when the diagnostic equipment triggers a communication operation, the historical communication mode recorded in a pre-stored configuration file in the diagnostic equipment can be obtained when the startup of the diagnostic equipment is detected or when the startup of diagnostic software in the diagnostic equipment is detected; even if the diagnostic software is still standing and then receives the operation of the user, the communication is needed. The historical communication mode recorded in the pre-configuration file may be a mode for indicating that the diagnostic device is communicating with the external device last time.
For example, in a specific application scenario, when it is detected that the diagnostic device is turned on or the diagnostic software in the diagnostic device is turned on, the communication mode of the diagnostic device is automatically selected to perform communication, and the process of automatically selecting the communication mode of the diagnostic device is to first acquire the historical communication mode recorded in the configuration file of the diagnostic device.
And S2, communicating with external equipment by adopting the historical communication mode.
In the application, after the history communication mode is obtained in step S101, the communication is performed with the external device through the history communication mode. The historical communication mode can be a communication mode which can be supported by diagnostic equipment based on USB communication, bluetooth communication, WIFI communication and the like.
In one embodiment, referring to fig. 2, the communication with the external device using the history communication method includes steps S211 to S214:
step S211, when the history communication mode is a USB communication mode, detecting whether there is a first external device connected to the diagnostic device through a USB interface.
Specifically, when the acquired history communication mode is a USB communication mode, it is detected whether an external device connected through a USB interface exists in a device manager of the diagnostic device, and if the external device is connected through the USB interface, the external device is used as the first external device.
Step S212, if the first external device exists, acquiring a first product identification code and a first vendor identification code of the first external device.
Specifically, if the first external device exists, the product identification code PID and the vendor identification code VID of the first external device are obtained, and are referred to as a first product identification code and a first vendor identification code, respectively. If a plurality of first external devices exist, the first product identification codes and the first provider identification codes of the plurality of first external devices are respectively acquired.
Step S213, after the first product identifier and the first vendor identifier are obtained, detecting whether the diagnostic device has a first serial port corresponding to the first product identifier and the first vendor identifier; the first serial port is used for indicating a serial port corresponding to a USB interface for connecting the first external device.
Specifically, the product identifier and the vendor identifier may be used to distinguish the types of devices, and the devices of different types may have different corresponding first serial ports, so that it may be detected whether the diagnostic device has the first serial port corresponding to the first product identifier and the first product vendor. The first serial port is a serial port corresponding to a USB interface for connecting the first external device.
Step S214, if the first serial port exists, communicating with the first external device through the first serial port.
Specifically, if the first serial port exists, it indicates that the first external device and the diagnostic device can communicate through a USB communication mode, the first serial port can be adopted to communicate with the first external device at this time, and if information returned through the first serial port is received within a first preset time, it is determined that the communication between the first serial port and the external device is successful, and at this time, the first serial port and the diagnostic device can communicate with the external device through the USB communication mode to perform data interaction. If the information returned by the first serial port is not received within the first preset time, the communication failure between the USB communication mode and the external equipment is judged.
In one embodiment, referring to fig. 3, the communicating with the external device by using the historical communication method includes:
step S221, when the history communication mode is a Bluetooth communication mode, obtaining second serial port information used by the history communication mode.
Specifically, when the historical communication mode is a bluetooth communication mode, the configuration file stores information such as the serial number and the baud rate of the last bluetooth communication mode, and the serial number and the baud rate of the bluetooth communication mode of the historical record can be obtained from the configuration file. The second serial port information includes, but is not limited to, serial port number and baud rate information of bluetooth communication.
Step S222, communicating with the external device through a second serial port corresponding to the second serial port information.
Specifically, an instruction is sent to an external device according to a serial port (called a second serial port) of bluetooth communication and a baud rate used in the history. And sending a preset Bluetooth communication instruction to external equipment within a preset effective range through the serial port and the corresponding baud rate of the last Bluetooth communication record. If the information returned by the corresponding external equipment is received within the second preset time, the Bluetooth communication based on the second serial port is judged to be successful, and meanwhile, the communication with the corresponding external equipment based on the Bluetooth communication mode is also judged to be successful.
Step S223, if communication with the external device fails according to the second serial port, acquiring an available third serial port in the diagnostic device.
Specifically, after the bluetooth communication according to the second serial port fails, the device manager obtains an available serial port, which is called a third serial port; the device manager is a management tool, and can display serial port information which can work normally, and the third serial port does not comprise the second serial port.
In step S224, communication is performed with the external device through a third serial port.
Specifically, when a plurality of available third serial ports are obtained through the device manager, an instruction is sent to the external device through each third serial port and the corresponding baud rate in sequence until one of the third serial ports is successful in communication, communication is performed with the external device through the successful third serial port, and namely the serial port corresponding to Bluetooth communication is determined. If the communication corresponding to all the third serial ports fails, judging that no serial port suitable for Bluetooth communication exists, and judging that the Bluetooth communication fails. And judging that the serial communication is successful can be that after the corresponding serial and baud rate send the instruction to the external equipment, and receiving the information returned by the external equipment within the second preset time, judging that the corresponding serial communication is successful.
In one embodiment, the communicating with the external device using the historical communication method includes: detecting and connecting WIFI when the historical communication mode is a WIFI communication mode; after being connected to the WIFI, the wireless communication system communicates with external equipment through the WIFI communication mode.
Specifically, when the history communication mode of acquireing is the WIFI communication mode, detect the WIFI signal, after detecting the WIFI signal, be connected with the WIFI equipment that sends the WIFI signal, when detecting a plurality of WIFI signals, can be connected with the WIFI equipment that corresponds to send the WIFI signal according to the sign of prestored WIFI equipment, the external equipment that said here is the WIFI equipment that sends the WIFI signal. The communication with the external device through WIFI may be performed by sending a PING command to the external device. If the information returned based on the PING command is received within the third preset time, judging that the communication with the external equipment through the WIFI is successful; if the information returned based on the PING command is not received within the third preset time, the communication failure between the external equipment and the WIFI is judged.
In application, for example, when the diagnostic device is a diagnostic box, the diagnostic box can send a WIFI signal when the external device is the diagnostic box, the diagnostic device is in communication connection with the diagnostic box through the WIFI sent by the diagnostic box, and the diagnostic box can be connected with an automobile through an OBD interface of the automobile.
And step S3, if the communication between the historical communication mode and the external equipment fails, communicating with the external equipment by adopting a target communication mode, wherein the target communication mode is other communication modes supported by the diagnosis equipment except the historical communication mode.
Specifically, if the communication between the historical communication mode and the external equipment fails, other communication modes supported by the diagnosis equipment are used for communicating with the external equipment until one communication mode is successful, and the current successful communication mode is used for communicating with the external equipment.
In one embodiment, referring to fig. 4, the communication with the external device using the target communication method includes steps S311 to S312:
step S311, if the target communication manner includes at least two target communication manners, acquiring a pre-stored priority ranking order of the at least two target communication manners.
Specifically, the priority ranking sequence of the communication modes supported by the diagnostic equipment can be prestored, after the diagnostic equipment and the external equipment establish communication failure through the historical communication modes, the priority ranking sequence of all the target communication modes supported in the diagnostic equipment is obtained according to the prestored priority ranking sequence, and the target communication modes are other communication modes except the historical communication modes with the communication failure.
Step S312, according to the priority ranking order, selecting a corresponding target communication mode from high to low according to the priority to communicate with the external device until any one of the at least two target communication modes is successfully communicated with the external device.
Specifically, according to the priority ranking sequence, the corresponding target communication modes are sequentially selected from high to low according to the priority ranking sequence to communicate with the external equipment until any one of all the target communication modes is successful in communicating with the external equipment, and then the data interaction is carried out with the external equipment by adopting the successful communication mode.
In application, the communication modes supported by the diagnostic device include USB communication, bluetooth communication and WIFI communication, when the prestored communication mode is the highest level USB communication, the second highest level communication mode is the WIFI communication mode, and the third highest level communication mode is the bluetooth communication mode. When the determined historical communication mode is a USB communication mode, the communication is carried out with the external equipment according to the WIFI communication mode and the Bluetooth communication mode in sequence. When one of the communication modes is successful, the communication mode is adopted to carry out data interaction with the external equipment.
In one embodiment, after the communication with the external device in the target communication manner, the method further includes: and if the target communication mode is adopted to successfully communicate with the external equipment, updating the historical communication mode recorded in the configuration file by using the target communication mode.
Specifically, the configuration file records a historical communication mode and communication information corresponding to the historical communication mode, for example, the communication information corresponding to the Bluetooth communication can be information such as a Bluetooth communication serial port and a corresponding baud rate, the USB communication can be a USB communication serial port, and the WIFI communication mode can be an identification of diagnostic equipment and an identification of external equipment. If the target communication mode is successful in communication with the external equipment, replacing the historical communication mode and the corresponding communication information recorded in the configuration file with the target communication mode and the corresponding communication information. If the historical communication mode is successful in communication with the external equipment, the communication mode is consistent with the last communication mode, and only the communication information of the historical communication mode is replaced.
In one embodiment, after the historical communication mode recorded in the configuration file of the diagnostic device is obtained when the diagnostic device triggers a communication operation, the method further comprises: if the historical communication mode is a preset unusual communication mode, the target communication mode is adopted to communicate with the external equipment, and the target communication mode is other communication modes except the historical communication mode supported by the diagnosis equipment.
Specifically, the unusual communication mode may be preset, if the historical communication mode is the preset unusual communication mode, the other communication modes except the historical communication mode are adopted to communicate with the external device, and after the other communication modes except the historical communication mode are used to communicate with the external device for identification, the preset unusual communication mode is adopted.
In application, if bluetooth is set as a preset mode which is not commonly used in the preset, when the historical communication mode is a bluetooth communication mode, a USB communication mode except bluetooth and a WIFI communication mode are adopted first, and after the USB communication mode and the WIFI communication mode fail, the bluetooth communication mode is adopted.
In one embodiment, when the communication between the history communication mode and the target communication mode and the external device fails, the communication failure is prompted, and specifically, the communication failure can be prompted by preset voice, text and/or pictures.
When the diagnostic equipment triggers communication operation, the embodiment of the application acquires a historical communication mode recorded in a configuration file of the diagnostic equipment; adopting the history communication mode to communicate with external equipment; if the communication between the historical communication mode and the external equipment fails, the target communication mode is adopted to communicate with the external equipment, and the target communication mode is other communication modes supported by the diagnosis equipment except the historical communication mode. The communication mode of the diagnosis equipment is automatically selected for communication, so that the use convenience of the diagnosis equipment is high.
Corresponding to the communication method of the diagnostic device described in the above embodiments, fig. 5 shows a block diagram of the communication apparatus of the diagnostic device provided in the embodiment of the present application, and for convenience of explanation, only the portion related to the embodiment of the present application is shown.
Referring to fig. 5, the communication apparatus 500 includes:
the detection module 501 is configured to obtain a historical communication mode recorded in a configuration file of the diagnostic device when the diagnostic device triggers a communication operation;
the first communication module 502 is configured to communicate with an external device by adopting the historical communication manner;
and the second communication module 503 is configured to communicate with the external device by using a target communication mode if the communication between the diagnostic device and the external device fails, where the target communication mode is other communication modes supported by the diagnostic device except the history communication mode.
In one embodiment, the first communication module includes:
the first detection unit is used for detecting whether first external equipment connected with the diagnostic equipment through a USB interface exists or not when the historical communication mode is a USB communication mode;
a first obtaining unit, configured to obtain a first product identifier and a first vendor identifier of the first external device if the first external device exists;
the second detection unit is used for detecting whether the first serial ports corresponding to the first product identification code and the first provider identification code exist in the diagnosis equipment after the first product identification code and the first provider identification code are acquired; the first serial port is used for indicating a serial port corresponding to the USB interface;
and the first communication unit is used for communicating with the first external equipment through the first serial port if the first serial port exists.
In one embodiment, the first communication module includes:
the second acquisition unit is used for acquiring second serial port information used by the historical communication mode when the historical communication mode is a Bluetooth communication mode;
the second communication unit is used for communicating with the external equipment through a second serial port corresponding to the second serial port information;
a third obtaining unit, configured to obtain an available third serial port in the diagnostic device if communication with the external device fails according to the second serial port;
and the third communication unit is used for communicating with the external equipment through a third serial port.
In one embodiment, the first communication module includes:
the third detection unit is used for detecting and connecting WIFI when the historical communication mode is a WIFI communication mode;
and the fourth communication unit is communicated with the external equipment in the WIFI communication mode after being connected to the WIFI.
In one embodiment, the second communication module includes:
a fourth obtaining unit, configured to obtain a pre-stored priority ranking order of the at least two target communication modes if the target communication modes include at least two target communication modes;
and the fifth communication unit is used for selecting a corresponding target communication mode from high to low according to the priority ranking order and communicating with the external equipment until any one of the at least two target communication modes is successfully communicated with the external equipment.
In one embodiment, the communication device includes:
and the updating module is used for updating the historical communication mode recorded in the configuration file by using the target communication mode if the target communication mode is adopted to successfully communicate with the external equipment.
In one embodiment, the communication device includes:
and the third communication module is used for adopting the target communication mode to communicate with the external equipment if the history communication mode is a preset unusual communication mode after the detection module is triggered, wherein the target communication mode is other communication modes supported by the diagnosis equipment except the history communication mode.
When the diagnostic equipment triggers communication operation, the embodiment of the application acquires a historical communication mode recorded in a configuration file of the diagnostic equipment; adopting the history communication mode to communicate with external equipment; if the communication between the historical communication mode and the external equipment fails, the target communication mode is adopted to communicate with the external equipment, and the target communication mode is other communication modes supported by the diagnosis equipment except the historical communication mode. The communication mode of the diagnosis equipment is automatically selected for communication, so that the use convenience of the diagnosis equipment is high.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 600 includes: a processor 601, a memory 602, and a computer program 603 stored in the memory 602 and executable on the processor 601. The processor 601, when executing the computer program 603, performs the steps of the communication method embodiment of the diagnostic device.
Illustratively, the computer program 603 may be partitioned into one or more units/modules, which are stored in the memory 602 and executed by the processor 601 to complete the present application. The one or more units/modules may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program 603 in the electronic device 600. For example, the computer program 603 may be divided into a detection module, a first communication module and a second communication module, where specific functions of each module are described in the above embodiments, and are not described herein.
The electronic device 600 may be various electronic devices capable of processing vehicle data, such as a diagnostic instrument and an automobile box. The electronic device 600 may include, but is not limited to, a processor 601, a memory 602. It will be appreciated by those skilled in the art that fig. 6 is merely an example of an electronic device 600 and is not intended to limit the electronic device 600, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the electronic device 600 may further include input-output devices, network access devices, buses, etc.
The processor 601 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 602 may be an internal storage unit of the electronic device 600, such as a hard disk or a memory of the electronic device 600. The memory 602 may be an external storage device of the electronic device 600, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided in the electronic device 600. Further, the memory 602 may also include both internal storage units and external storage devices of the electronic device 600. The memory 602 is used to store the computer programs and other programs and data required by the electronic device 600. The memory 602 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the vehicle diagnostic device may refer to the corresponding process in the foregoing method embodiment, which is not described herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purposes of the embodiments of the present application.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the above computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each method embodiment described above. The computer program comprises computer program code, and the computer program code can be in a source code form, an object code form, an executable file or some intermediate form and the like. The computer readable medium may include: any entity or device capable of carrying the computer program code described above, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium described above can be appropriately increased or decreased according to the requirements of the jurisdiction's legislation and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the legislation and the patent practice. The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (8)

1. A method of communication for a diagnostic device, comprising:
when the diagnosis equipment triggers communication operation, acquiring a historical communication mode recorded in a configuration file of the diagnosis equipment;
adopting the history communication mode to communicate with external equipment;
if the communication between the historical communication mode and the external equipment fails, the communication between the historical communication mode and the external equipment is carried out by adopting a target communication mode, wherein the target communication mode is other communication modes supported by the diagnosis equipment except the historical communication mode;
after the historical communication mode recorded in the configuration file of the diagnostic equipment is obtained when the diagnostic equipment triggers the communication operation, the method further comprises the following steps:
if the history communication mode is a preset unusual communication mode, adopting the target communication mode to communicate with the external equipment, and adopting the preset unusual communication mode after the target communication mode fails;
the communication with the external device by adopting the history communication mode comprises the following steps:
when the historical communication mode is a Bluetooth communication mode, acquiring second serial port information used by the historical communication mode; when the historical communication mode is a Bluetooth communication mode, the configuration file stores the serial number and the baud rate information of the last Bluetooth communication mode, and the serial number and the baud rate of the Bluetooth communication mode of the historical record can be obtained from the configuration file;
according to the serial number and the baud rate of the Bluetooth communication mode of the history record, the communication is carried out with the external equipment through a second serial port corresponding to the second serial port information;
if communication with the external equipment fails according to the second serial port, acquiring an available third serial port in the diagnostic equipment;
communication is carried out with the external equipment through a third serial port; when a plurality of available third serial ports are obtained, an instruction is sent to the external device through each third serial port and the corresponding baud rate in sequence until one of the third serial ports is successful in communication, communication is carried out with the external device through the successful third serial port, and if all the third serial ports are failed in communication, bluetooth communication failure is judged.
2. The communication method according to claim 1, wherein the communicating with the external device using the history communication method includes:
when the history communication mode is a USB communication mode, detecting whether first external equipment connected with the diagnosis equipment through a USB interface exists or not;
if the first external equipment exists, acquiring a first product identification code and a first provider identification code of the first external equipment;
after the first product identification code and the first provider identification code are acquired, detecting whether a first serial port corresponding to the first product identification code and the first provider identification code exists in the diagnosis equipment or not; the first serial port is used for indicating a serial port corresponding to the USB interface;
and if the first serial port exists, communicating with the first external equipment through the first serial port.
3. The communication method according to claim 1, wherein the communicating with the external device using the history communication method includes:
detecting and connecting WIFI when the historical communication mode is a WIFI communication mode;
after being connected to the WIFI, the wireless communication system communicates with external equipment through the WIFI communication mode.
4. The communication method according to claim 1, wherein the communication with the external device using the target communication method includes:
if the target communication modes comprise at least two target communication modes, acquiring prestored priority ranking sequences of the at least two target communication modes;
and selecting a corresponding target communication mode from high to low according to the priority ranking order to communicate with the external equipment until any one of the at least two target communication modes is successfully communicated with the external equipment.
5. The communication method according to claim 1, further comprising, after communicating with the external device by a target communication method:
and if the target communication mode is adopted to successfully communicate with the external equipment, updating the historical communication mode recorded in the configuration file by using the target communication mode.
6. A communication device of a diagnostic apparatus, comprising:
the detection module is used for acquiring a historical communication mode recorded in a configuration file of the diagnostic equipment when the diagnostic equipment triggers communication operation;
the first communication module is used for communicating with external equipment by adopting the history communication mode;
the second communication module is used for communicating with the external equipment by adopting a target communication mode if the communication between the historical communication mode and the external equipment fails, wherein the target communication mode is other communication modes supported by the diagnostic equipment except the historical communication mode;
the third communication module is used for communicating with the external equipment by adopting the target communication mode if the history communication mode is a preset unusual communication mode after the detection module is triggered, and adopting the preset unusual communication mode after the target communication mode fails;
the first communication module includes:
the second acquisition unit is used for acquiring second serial port information used by the historical communication mode when the historical communication mode is a Bluetooth communication mode; when the historical communication mode is a Bluetooth communication mode, the configuration file stores the serial number and the baud rate information of the last Bluetooth communication mode, and the serial number and the baud rate of the Bluetooth communication mode of the historical record can be obtained from the configuration file;
the second communication unit is used for communicating with the external equipment through a second serial port corresponding to the second serial port information according to the serial port number and the baud rate of the Bluetooth communication mode of the history record;
a third obtaining unit, configured to obtain an available third serial port in the diagnostic device if communication with the external device fails according to the second serial port;
the three-way communication unit is used for communicating with the external equipment through a third serial port; when a plurality of available third serial ports are obtained, an instruction is sent to the external device through each third serial port and the corresponding baud rate in sequence until one of the third serial ports is successful in communication, communication is carried out with the external device through the successful third serial port, and if all the third serial ports are failed in communication, bluetooth communication failure is judged.
7. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 5 when executing the computer program.
8. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 5.
CN202010878807.0A 2020-08-27 2020-08-27 Communication method and device of diagnostic equipment, electronic equipment and storage medium Active CN112104708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010878807.0A CN112104708B (en) 2020-08-27 2020-08-27 Communication method and device of diagnostic equipment, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010878807.0A CN112104708B (en) 2020-08-27 2020-08-27 Communication method and device of diagnostic equipment, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112104708A CN112104708A (en) 2020-12-18
CN112104708B true CN112104708B (en) 2023-08-08

Family

ID=73758076

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010878807.0A Active CN112104708B (en) 2020-08-27 2020-08-27 Communication method and device of diagnostic equipment, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112104708B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103592936A (en) * 2013-11-08 2014-02-19 深圳市道通科技有限公司 Method and device for automatic connection between automobile diagnostic device and VCI equipment
CN108111974A (en) * 2017-12-13 2018-06-01 广东欧珀移动通信有限公司 Control method, device, storage medium and the terminal of locating module
CN108227675A (en) * 2017-12-27 2018-06-29 深圳市元征软件开发有限公司 Vehicular diagnostic method, device, terminal and computer readable storage medium
CN109725921A (en) * 2019-01-07 2019-05-07 深圳市道通科技股份有限公司 A kind of method, apparatus and automobile fault diagnostic apparatus of the update of VCI equipment firmware

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103592936A (en) * 2013-11-08 2014-02-19 深圳市道通科技有限公司 Method and device for automatic connection between automobile diagnostic device and VCI equipment
CN108111974A (en) * 2017-12-13 2018-06-01 广东欧珀移动通信有限公司 Control method, device, storage medium and the terminal of locating module
CN108227675A (en) * 2017-12-27 2018-06-29 深圳市元征软件开发有限公司 Vehicular diagnostic method, device, terminal and computer readable storage medium
CN109725921A (en) * 2019-01-07 2019-05-07 深圳市道通科技股份有限公司 A kind of method, apparatus and automobile fault diagnostic apparatus of the update of VCI equipment firmware

Also Published As

Publication number Publication date
CN112104708A (en) 2020-12-18

Similar Documents

Publication Publication Date Title
CN108227675B (en) Vehicle diagnosis method, device, terminal and computer-readable storage medium
CN111208800B (en) Automobile diagnosis method and device and vehicle communication interface
CN110191018B (en) Abnormity monitoring method and device for vehicle CAN bus and computer equipment
CN109656172B (en) Method and device for obtaining baud rate
CN109814524B (en) Vehicle diagnosis method, device and system
US20200342690A1 (en) Method for establishing communicable connection with tire pressure monitoring system, apparatus thereof and electronic device
CN109933051A (en) A kind of automobile diagnostic software configuration method, system, equipment and computer media
CN111198815B (en) Compatibility testing method and device for user interface
CN112579356B (en) Fault processing method and server
EP4206002A1 (en) Method and apparatus for displaying function menu interface of automobile tyre pressure monitoring system
CN113848851B (en) Vehicle detection method, device, electronic equipment and storage medium
CN113721584B (en) Visual vehicle diagnosis method and device, equipment and storage medium
CN113406944B (en) Vehicle diagnosis method, device, equipment and computer readable storage medium
CN112104708B (en) Communication method and device of diagnostic equipment, electronic equipment and storage medium
CN113272785B (en) Method for mounting file system, terminal equipment and storage medium
CN112306041A (en) Vehicle configuration information writing method and device and electronic equipment
CN111966391A (en) System configuration method and device of vehicle, terminal equipment and storage medium
CN114407585B (en) Tire pressure sensor address writing method and device, electronic equipment and storage medium
CN112187937B (en) Unpairing method and device, terminal equipment and storage medium
CN111049717A (en) Variable acquisition method and equipment
CN112147987B (en) Vehicle diagnosis method, vehicle diagnosis device and terminal equipment
CN114356769A (en) Software learning method, device, equipment and storage medium
CN114281065A (en) Electronic control unit flashing method and device for vehicle and diagnostic equipment
CN114572005A (en) Vehicle mileage backup method and terminal equipment
CN112306040A (en) Vehicle detection method, device, equipment and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant