Vehicle machine Ethernet diagnosis method and device, electronic equipment and storage medium
Through software-level transmission socket interaction, the problem of high cost and difficult portability of on-board Ethernet diagnostic tools is solved, and low-cost and efficient car-machine Ethernet diagnosis is achieved to meet the testing needs in complex scenarios.
Patent Information
- Application Number
- CN202411243712.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2044-09-05
AI Technical Summary
Existing automotive Ethernet diagnostic tools are expensive and not easy to carry, and cannot meet the testing needs in complex scenarios. The hardware connection method is not effective under the conditions of difficult connection.
By obtaining diagnostic transmission data, generating request messages and forming transmission sockets, interacting with the vehicle server based on the socket, recording the sending and receiving messages for diagnosis, realizing software-level Ethernet diagnosis, avoiding additional hardware devices Use of
It realizes low-cost and portable Ethernet diagnostic functions, improves work efficiency, and meets the needs of efficient and low-cost diagnostic tools.
Smart Images

Figure CN119182805A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of vehicle-mounted Ethernet, and in particular to a vehicle-mounted Ethernet diagnostic method, device, electronic device and storage medium. Background Art
[0002] With the development of intelligent vehicles, the application of in-vehicle Ethernet technology is becoming more and more extensive. It can provide higher bandwidth and lower latency to meet the growing data transmission needs inside the car. However, with the application of Ethernet in automobiles, network security issues are becoming increasingly prominent. In order to ensure the network security of vehicles, effective diagnosis and monitoring of in-vehicle Ethernet is required.
[0003] At present, there are some Ethernet diagnostic tools in the related technology. These tools usually use dedicated hardware devices, which are physically connected to the vehicle Ethernet and then perform data exchange and diagnosis through specific communication protocols. However, the existing Ethernet diagnostic tools are expensive, which is a large cost burden for automakers. Secondly, the existing hardware devices are usually large and not easy to carry, and cannot meet the testing needs of Ethernet diagnosis in various complex scenarios. In addition, the hardware connection method will not play its original role under some difficult connection conditions. Summary of the invention
[0004] In view of the shortcomings of the above-mentioned related technologies, the present application provides a vehicle Ethernet diagnostic method, device, electronic device and storage medium to solve the technical problems of high cost and poor portability caused by existing Ethernet diagnostics through hardware devices.
[0005] The present application provides a vehicle Ethernet diagnostic method, which includes: obtaining multiple diagnostic transmission data, the diagnostic transmission data including a sending address, a receiving address and data content, generating a request message based on the data content, and forming a transmission socket based on each of the sending address, the receiving address and the corresponding request message, and the header information of each transmission socket includes an identification field; sending the request message to the vehicle server based on the transmission socket, if the vehicle server successfully receives and processes the request message, the vehicle server returns a positive response message based on the transmission socket; if the vehicle server fails to successfully receive and process the request message, the vehicle server returns a negative response message based on the transmission socket, and the negative response message includes a comment field; multiple transmission sockets are screened based on the identification field, and the transmission socket containing the target identification field is used as a diagnostic socket, and the sending and receiving message information in the diagnostic socket is recorded in a diagnostic log, so as to diagnose the vehicle Ethernet based on the diagnostic log.
[0006] In one embodiment of the present application, before sending the request message to the vehicle computer server based on the transmission socket, it also includes: sending a connection request message to the vehicle computer server, the sequence number of the connection request message is the first request sequence number, and the connection request message has a synchronization flag, and the client connection state is set to waiting; if a connection response message sent from the vehicle computer server is received within a preset waiting time, the sequence number of the connection response message is the first response sequence number, and the connection response message has a first confirmation flag and the synchronization flag, the client connection state is set to ready to connect, and a connection confirmation message is sent to the vehicle computer server, the sequence number of the connection confirmation message is the second request sequence number, and the connection confirmation message has a second confirmation flag, and the client connection state is set to success; if the connection response message sent from the vehicle computer server is not received within the preset waiting time, the client connection state is set to timeout.
[0007] In one embodiment of the present application, forming a transmission socket based on each of the sending address, the receiving address and the corresponding request message includes: forming the sending address, the receiving address and the corresponding request message into the transmission socket according to a preset socket format, the preset socket format includes header information and data information, the header information includes an address family and a socket type, and the data information includes the sending address, the receiving address and the request message; selecting an information segment in the header information as an identification field of the transmission socket.
[0008] In one embodiment of the present application, before sending the request message to the vehicle computer server based on the transmission socket, it also includes: grading the security level of the request message based on the data content, if the security level of the request message is higher than the preset security level, requesting a security algorithm seed from the vehicle computer server based on the transmission socket; calculating the security algorithm seed as an unlocking key based on the decryption algorithm in the local preset security library; sending the unlocking key to the vehicle computer server, so that the vehicle computer server compares the unlocking key with the preset key, if the comparison is successful, unlocking the request message permission with a security level higher than the preset security level; sending the request message with a security level higher than the preset security level to the vehicle computer server based on the transmission socket.
[0009] In one embodiment of the present application, calculating the security algorithm seed as an unlocking key based on the decryption algorithm in the local preset security library includes: reading the decryption function in the local preset security library, and setting the parameter type and return type of the decryption function; inputting the security algorithm seed as a parameter into the decryption function, calling the decryption function to perform the unlocking calculation operation, so as to obtain the unlocking key as the return of the decryption function.
[0010] In one embodiment of the present application, diagnosing the vehicle Ethernet based on the diagnostic log includes: recording the transceiver message information in the diagnostic socket in the diagnostic log, the transceiver message information including the request message and the sending time of the request message, the affirmative response message and the receiving time of the affirmative response message, or the negative response message and the receiving time of the negative response message; if the transceiver message information includes the negative response message and the receiving time of the negative response message, extracting the annotation field in the negative response message, and obtaining the annotation meaning of the annotation field based on a preset annotation dictionary; outputting the annotation meaning as failure feedback, so that the user can diagnose the vehicle Ethernet based on the failure feedback.
[0011] In one embodiment of the present application, the vehicle Ethernet diagnostic method also includes: generating a vehicle Ethernet diagnostic window for display according to a preset graphical interface framework, so as to obtain the multiple diagnostic transmission data based on the vehicle Ethernet diagnostic window, and the vehicle Ethernet diagnostic window also displays the client connection status, and the client connection status includes waiting, ready to connect, success and timeout.
[0012] The embodiment of the present application also provides a vehicle Ethernet diagnostic device, the vehicle Ethernet diagnostic device comprising: a socket building module, used to obtain multiple diagnostic transmission data, the diagnostic transmission data including a sending address, a receiving address and data content, generating a request message based on the data content, and building a transmission socket based on each of the sending address, the receiving address and the corresponding request message, and the header information of each transmission socket includes an identification field; an affirmative response module, used to send the request message to the vehicle server based on the transmission socket, and if the vehicle server successfully receives and processes the request message, the vehicle server sends a positive response message to the vehicle server. a negative response module, for if the vehicle computer server fails to successfully receive and process the request message, the vehicle computer server returns a positive response message based on the transmission socket; and a negative response module, for if the vehicle computer server fails to successfully receive and process the request message, the vehicle computer server returns a negative response message based on the transmission socket, and the negative response message includes a comment field; and a diagnostic recording module, for filtering multiple transmission sockets based on the identification field, taking the transmission socket including the target identification field as a diagnostic socket, and recording the sending and receiving message information in the diagnostic socket in a diagnostic log, so as to diagnose the vehicle computer Ethernet based on the diagnostic log.
[0013] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the vehicle Ethernet diagnostic method as described in any of the above embodiments.
[0014] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor of a computer, the computer executes the vehicle Ethernet diagnostic method as described in any of the above embodiments.
[0015] Beneficial effects of the present application: The embodiments of the present application provide a vehicle Ethernet diagnostic method, device, electronic device and storage medium. The method obtains diagnostic transmission data and establishes a transmission socket based on the sending address, receiving address and corresponding request message in the diagnostic transmission data. The header information of the transmission socket includes an identification field. The request message is sent to the vehicle server based on the transmission socket. If the vehicle server successfully receives and processes the request message, it returns a positive response message based on the transmission socket. If the vehicle server fails to successfully receive and process the request message, the vehicle server returns a negative response message based on the transmission socket. Multiple transmission sockets are screened based on the identification field, and the transmission socket containing the target identification field is used as a diagnostic socket, and the sending and receiving message information of the diagnostic socket is recorded in the diagnostic log. The vehicle Ethernet is diagnosed based on the diagnostic log. The method realizes the message sending and receiving reply between Ethernets by establishing a socket, and realizes the diagnostic function of Ethernet according to the sending and receiving message information record, thereby realizing the Ethernet diagnostic interaction of the software, without the need for additional hardware equipment, and reducing the cost of the equipment. And realizing the diagnostic interaction function from the software level can improve work efficiency and reduce labor costs, thus meeting the demand for efficient and low-cost Ethernet diagnostic tools.
[0016] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a schematic diagram of an implementation environment of a vehicle Ethernet diagnostic method shown in an exemplary embodiment of the present application;
[0018] Figure 2 is a flow chart of a vehicle Ethernet diagnostic method shown in an exemplary embodiment of the present application;
[0019] Figure 3 is an Ethernet connection flow chart shown in an exemplary embodiment of the present application;
[0020] Figure 4 is a schematic diagram of a vehicle Ethernet diagnostic window shown in an exemplary embodiment of the present application;
[0021] Figure 5 is a schematic diagram of a decryption process shown in an exemplary embodiment of the present application;
[0022] Figure 6 is a schematic diagram of diagnostic socket screening shown in an exemplary embodiment of the present application;
[0023] Figure 7 is a block diagram of a vehicle Ethernet diagnostic device shown in an exemplary embodiment of the present application;
[0024] Figure 8 It is a structural schematic diagram of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0025] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0026] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0027] It should be noted that in this application, "first", "second", etc. are only used to distinguish similar objects, and are not used to limit the order or precedence of similar objects. The variations of "including", "having", etc. described above indicate that the scope covered by the subject of the word is not exclusive except for the examples shown by the word.
[0028] It is understood that the various numbers, step numbers, and other reference numerals recorded in this application are distinguished for the convenience of description and are not intended to limit the scope of this application. The size of the reference numerals in this application does not mean the order of execution. The execution order of each process should be determined by its function and internal logic.
[0029] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.
[0030] First of all, it should be explained that the graphical user interface (GUI) refers to a computer operation user interface that is displayed in a graphical manner. The graphical user interface is an interface display format for communication between people and computers, allowing users to use input devices such as a mouse to manipulate icons or menu options on the screen to select commands, call files, start programs, or perform other daily tasks. Compared with the character interface that completes routine tasks by entering text or character commands on the keyboard, the graphical user interface has many advantages. The graphical user interface consists of windows, drop-down menus, dialog boxes and their corresponding control mechanisms. It is standardized in various new applications, that is, the same operations are always completed in the same way. In the graphical user interface, users see and operate graphic objects, and computer graphics technology is applied. The Tkinter library is a standard graphical user interface toolkit in the python language. The DLL file is a dynamic link library that contains functions and resources that can be called by multiple programs at the same time. The socket library is a standard library for network communication in python. NRC is a negative response code, which is used to act as a comment field in a negative response message.
[0031] The embodiments of the present application respectively propose a vehicle Ethernet diagnostic method, a vehicle Ethernet diagnostic device, an electronic device, a computer-readable storage medium, and a computer program product, which will be described in detail below.
[0032] See also Figure 1 , Figure 1 It is a schematic diagram of an implementation environment of a vehicle Ethernet diagnostic method shown as an exemplary embodiment of the present application.
[0033] like Figure 1As shown, the implementation environment may include a device client 101 and a vehicle server 102, wherein the device client may be at least one of a microcomputer, an embedded computer, a neural network computer, etc. First, the device client 101 obtains multiple diagnostic transmission data input through a user graphical interface, and the diagnostic transmission data includes a sending address, a receiving address, and data content. Then, the device client 101 generates a corresponding request message based on the received data content, and then forms a transmission socket based on each sending address, a receiving address, and a corresponding request message, and selects part of the information in the header information of each transmission socket as an identification field. The device client 101 then sends the request message to the vehicle server 102 based on the transmission socket. If the vehicle server 102 successfully receives and processes the request message, the vehicle server 102 returns a positive response message based on the transmission socket corresponding to the request message. If the vehicle server 102 fails to successfully receive and process the request message, the vehicle server 102 returns a negative response message based on the transmission socket corresponding to the request message, and the negative response message contains a comment field. After the device client 101 completes the sending and receiving of multiple messages, it screens multiple transmission sockets based on the identification field, uses the transmission socket containing the target identification field as the current diagnostic socket, and records the sending and receiving message information in the diagnostic socket in the diagnostic log, so as to diagnose the vehicle Ethernet based on the diagnostic log. In this embodiment, the target identification field can be preset based on the message type to be diagnosed, and different target identification fields can be set based on the diagnosis of different messages to complete the diagnosis of different types of vehicle Ethernet messages.
[0034] See also Figure 2 , Figure 2 is a flow chart of a vehicle Ethernet diagnostic method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown is as follows. The method may also be applicable to other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.
[0035] like Figure 2 As shown, in an exemplary embodiment, the vehicle Ethernet diagnostic method includes at least steps S210 to S240, which are described in detail as follows:
[0036] Step S210, obtain multiple diagnostic transmission data, the diagnostic transmission data includes a sending address, a receiving address and data content, generate a request message based on the data content, and establish a transmission socket based on each sending address, receiving address and corresponding request message, and the information of each transmission socket includes an identification field.
[0037] In one embodiment of the present application, forming a transmission socket based on each sending address, receiving address and corresponding request message includes: forming a transmission socket with the sending address, receiving address and corresponding request message according to a preset socket format, the preset socket format includes header information and data information, the header information includes the address family and the socket type, and the data information includes the sending address, receiving address and request message; selecting an information segment in the header information as an identification field of the transmission socket.
[0038] In one embodiment of the present application, the preset socket format is shown in Table 1:
[0039] Table 1
[0040]
[0041] As shown in Table 1, the preset socket format includes header information and data information, the header information includes the address family and the socket type, and the data information includes the sending address, the receiving address, and a request message generated based on the data content.
[0042] In one embodiment of the present application, an exemplary transmission socket is shown in Table 2:
[0043] Table 2
[0044]
[0045] As shown in Table 2, the sending address of the exemplary transmission socket is 0e80, the receiving address is 0300, and the request message generated based on the data content is 10 03.
[0046] In one embodiment of the present application, the information segment selected in the header information as the identification field of the transmission socket is shown in Table 3:
[0047] Table 3
[0048]
[0049] As shown in Table 3, some fields in the header information of the transmission socket are selected as identification fields. For example, in Table 3, 8001 is used as the identification field.
[0050] In one embodiment of the present application, before sending the request message to the vehicle computer server based on the transmission socket, it also includes: sending a connection request message to the vehicle computer server, the sequence number of the connection request message is the first request sequence number, and the connection request message has a synchronization flag, and the client connection state is set to waiting; if a connection response message sent from the vehicle computer server is received within a preset waiting time, the sequence number of the connection response message is the first response sequence number, and the connection response message has a first confirmation flag and a synchronization flag, the client connection state is set to ready to connect, and a connection confirmation message is sent to the vehicle computer server, the sequence number of the connection confirmation message is the second request sequence number, and the connection confirmation message has a second confirmation flag, and the client connection state is set to success; if a connection response message sent from the vehicle computer server is not received within the preset waiting time, the client connection state is set to timeout.
[0051] See also Figure 3 , Figure 3 is an Ethernet connection flow chart shown in an exemplary embodiment of the present application, Figure 3The vehicle computer server address in is the receiving address in the above embodiment. In one embodiment of the present application, the client first sends a TCP message segment with a synchronization flag (SYN) to the vehicle computer server as a connection request message based on the input vehicle computer server address (i.e., the receiving address), and uses the first request sequence number as the sequence number of the connection request message. In this embodiment, the first request sequence number can be set to 0. The connection request message is used to notify the vehicle computer server of the client's request to establish a connection, and at the same time, the client connection state is set to wait, and the timeout period is set to 3s. If the vehicle computer server does not respond after more than 3s, the sending fails and the connection establishment fails. If within 3 seconds, the vehicle computer server agrees to establish a connection after receiving the connection request message, the vehicle computer server will respond with a TCP segment with a first confirmation flag (ACK) and a synchronization flag (SYN) as a connection response message. The sequence number of the connection response message is the first response sequence number. In this embodiment, the first response sequence number can be set to 0, and the ACK in the connection response message is set to 1 (0+1). The connection response message indicates that the vehicle computer server has received a connection request message with a request sequence number of 0, and is expecting the next message sequence number to be 1 (0+1). If the client fails to reply to the message within the preset waiting time, it is judged as a timeout and the reception fails. The connection state of the client that receives the connection response message is set to ready to connect. After the client receives the connection response message, it will send a TCP segment with only the second confirmation flag (ACK) as a connection confirmation message. The sequence number of the connection confirmation message is the second request sequence number, which is 1 (0+1) in this embodiment, and ACK is set to 1 (0+1). The connection confirmation message is sent to the vehicle server to complete the connection between the client and the vehicle server, and the client connection status is set to success. At this point, the TCP connection between the client and the vehicle server is formally established, and data transmission can be carried out between the client and the vehicle server.
[0052] In one embodiment of the present application, before sending the request message to the vehicle computer server based on the transmission socket, it also includes: grading the security level of the request message based on the data content; if the security level of the request message is higher than the preset security level, requesting a security algorithm seed from the vehicle computer server based on the transmission socket; calculating the security algorithm seed as an unlocking key based on the decryption algorithm in the local preset security library; sending the unlocking key to the vehicle computer server so that the vehicle computer server compares the unlocking key with the preset key. If the comparison is successful, the request message permission with a security level higher than the preset security level is unlocked; and sending the request message with a security level higher than the preset security level to the vehicle computer server based on the transmission socket.
[0053] In one embodiment of the present application, calculating the security algorithm seed as an unlocking key based on the decryption algorithm in the local preset security library includes: reading the decryption function in the local preset security library, and setting the parameter type and return type of the decryption function; inputting the security algorithm seed as a parameter into the decryption function, calling the decryption function to perform the unlocking calculation operation, so as to obtain the unlocking key as the return of the decryption function.
[0054] See also Figure 5 , Figure 5 is a schematic diagram of a decryption process shown in an exemplary embodiment of the present application, such as Figure 5 As shown, the decryption process includes that the client requests the security algorithm seed of the security level from the vehicle computer server (host) based on the security level of the request message. After receiving the request, the vehicle computer server sends the security algorithm seed to the client and waits for the client to return the unlocking key. After receiving the security algorithm seed, the client calculates the unlocking key based on the security algorithm seed and returns the unlocking key to the vehicle computer server, so that the vehicle computer server compares the unlocking key with the preset key. If the comparison is successful, a positive response is returned (i.e., the request message permission to unlock the message), so that the request message can be sent to the vehicle computer server based on the transmission socket.
[0055] In one embodiment of the present application, after the client receives the security algorithm seed, the unlocking key is calculated based on the security algorithm seed, including: the client loads the DLL file into the memory to access the functions and data in the DLL file, and sets the parameter type and return type of the DLL function for calling, inputs the incoming 16-byte security algorithm seed as a parameter of the DLL function, and calls the corresponding decryption function in the DLL to perform the unlocking calculation operation, thereby obtaining the unlocking key. After the client calculates the key, when the DLL file is no longer needed, the memory space occupied by the DLL file is released. In this embodiment, the DLL file is a dynamic link library that contains functions and resources that can be called by multiple programs at the same time.
[0056] Step S220, sending the request message to the vehicle computer server based on the transmission socket. If the vehicle computer server successfully receives and processes the request message, the vehicle computer server returns a positive response message based on the transmission socket.
[0057] In one embodiment of the present application, when the client's request message is successfully received and processed by the vehicle computer server, the vehicle computer server will return an affirmative response message to confirm that the request message has been successfully processed, and record the affirmative response message in the diagnostic log to diagnose the vehicle computer Ethernet.
[0058] Step S230: If the vehicle computer server fails to successfully receive and process the request message, the vehicle computer server returns a negative response message based on the transmission socket, and the negative response message includes a comment field.
[0059] In one embodiment of the present application, if the first byte of the data returned by the vehicle computer server is 7F, it means that this message is a negative response message, and the annotation field in the negative response message can be extracted for diagnostic analysis.
[0060] In one embodiment of the present application, the annotation field may be NRC, where NRC is a negative response code. Table 4 shows some exemplary NRCs and their corresponding meanings:
[0061] Table 4
[0062]
[0063]
[0064] Table 4 shows some NRC codes and their corresponding meanings, that is, the NRC code is used as the annotation field, and its corresponding meaning is used as the annotation meaning. The annotation meaning of the annotation field in the negative response message can be extracted as failure output feedback, which is used to diagnose the cause of signal processing failure.
[0065] Step S240, screening multiple transmission sockets based on the identification field, using the transmission socket containing the target identification field as the diagnostic socket, and recording the sending and receiving message information in the diagnostic socket in the diagnostic log, so as to diagnose the vehicle Ethernet based on the diagnostic log.
[0066] In one embodiment of the present application, diagnosing the vehicle Ethernet based on the diagnostic log includes: recording the transceiver message information in the diagnostic socket in the diagnostic log, the transceiver message information including the request message and the sending time of the request message, the affirmative response message and the receiving time of the affirmative response message, or the negative response message and the receiving time of the negative response message; if the transceiver message information includes the negative response message and the receiving time of the negative response message, extracting the annotation field in the negative response message, and obtaining the annotation meaning of the annotation field based on a preset annotation dictionary; outputting the annotation meaning as failure feedback, so that the user can diagnose the vehicle Ethernet based on the failure feedback.
[0067] See also Figure 6 , Figure 6 is a schematic diagram of diagnostic socket screening shown in an exemplary embodiment of the present application, such as Figure 6 As shown, the client uses the signal with the 8001 field in the transmission header information as a diagnostic signal. When filtering the transmission socket, the transmission socket containing the 8001 field in the transmission socket is used as a diagnostic socket, thereby realizing the filtering of the socket, and then filtering the data based on the identification field when recording the sent and received message information in the diagnostic log to ensure that the information recorded in the diagnostic log is the required diagnostic information.
[0068] In one embodiment of the present application, the vehicle Ethernet diagnostic method also includes: generating a vehicle Ethernet diagnostic window for display according to a preset graphical interface framework, so as to obtain multiple diagnostic transmission data based on the vehicle Ethernet diagnostic window, and the vehicle Ethernet diagnostic window also displays the client connection status, and the client connection status includes waiting, ready to connect, success and timeout.
[0069] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a vehicle Ethernet diagnostic window shown in an exemplary embodiment of the present application. Figure 4 As shown, the user can enter the receiving address, sending address and data content in the vehicle Ethernet diagnostic window, and can also configure the DLL file and view the diagnostic log. At the same time, the vehicle Ethernet diagnostic window can also display the current client connection status. In this embodiment, the GUI interface framework can be built by python, and the corresponding window program can be generated for direct use by the user. The window is created by calling the Tkinter library, and the page design divides the relevant functions into partitions, and the useless information of the package assembly and unpacking process is filtered out, and only the information required by the user is displayed on the interface. The Tkinter library is a standard graphical user interface toolkit in python.
[0070] See also Figure 7 , Figure 7 is a block diagram of a vehicle Ethernet diagnostic device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The implementation environment shown is as follows. The device may also be applicable to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applicable.
[0071] like Figure 7 As shown, the exemplary vehicle Ethernet diagnostic device includes:
[0072] The socket building module 701 is used to obtain multiple diagnostic transmission data, the diagnostic transmission data includes a sending address, a receiving address and data content, generate a request message based on the data content, and build a transmission socket based on each sending address, receiving address and corresponding request message, and the header information of each transmission socket includes an identification field;
[0073] A positive response module 702 is used to send the request message to the vehicle computer server based on the transmission socket. If the vehicle computer server successfully receives and processes the request message, the vehicle computer server returns a positive response message based on the transmission socket;
[0074] A negative response module 703 is used for returning a negative response message based on the transmission socket if the vehicle computer server fails to successfully receive and process the request message, and the negative response message includes a comment field;
[0075] The diagnostic recording module 704 is used to filter multiple transmission sockets based on the identification field, use the transmission socket containing the target identification field as the diagnostic socket, and record the sent and received message information in the diagnostic socket in the diagnostic log to diagnose the vehicle Ethernet based on the diagnostic log.
[0076] Figure 8 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 8 The computer system 800 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0077] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage part 808 to the random access memory (RAM) 803, such as executing the method described in the above embodiment. In the RAM 803, various programs and data required for system operation are also stored. The CPU 801, ROM 802 and RAM 803 are connected to each other through a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0078] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed so that a computer program read therefrom is installed into the storage section 808 as needed.
[0079] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 809, and / or installed from a removable medium 811. When the computer program is executed by a central processing unit (CPU) 801, various functions defined in the system of the present application are executed.
[0080] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0081] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0082] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0083] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the vehicle Ethernet diagnostic method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0084] Another aspect of the present application further provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the vehicle Ethernet diagnostic method provided in each of the above embodiments.
[0085] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A vehicle Ethernet diagnostic method, characterized in that: The vehicle Ethernet diagnostic method comprises: Acquire multiple diagnostic transmission data, the diagnostic transmission data including a sending address, a receiving address and data content, generate a request message based on the data content, and form a transmission socket based on each of the sending address, the receiving address and the corresponding request message, wherein the header information of each transmission socket includes an identification field; The request message is sent to the vehicle computer server based on the transmission socket. If the vehicle computer server successfully receives and processes the request message, the vehicle computer server returns a positive response message based on the transmission socket. If the vehicle computer server fails to successfully receive and process the request message, the vehicle computer server returns a negative response message based on the transmission socket, and the negative response message includes a comment field; Based on the identification field, multiple transmission sockets are screened, the transmission socket containing the target identification field is used as a diagnostic socket, and the transceiver message information in the diagnostic socket is recorded in a diagnostic log, so as to diagnose the vehicle Ethernet based on the diagnostic log.
2. The vehicle Ethernet diagnostic method according to claim 1, characterized in that: Before sending the request message to the vehicle computer server based on the transmission socket, the method further includes: Sending a connection request message to the vehicle computer server, wherein the sequence number of the connection request message is the first request sequence number, and the connection request message carries a synchronization flag, and setting the client connection state to waiting; If a connection response message is received from the vehicle computer server within the preset waiting time, the sequence number of the connection response message is the first response sequence number, and the connection response message carries the first confirmation flag and the synchronization flag, the client connection state is set to ready to connect, and a connection confirmation message is sent to the vehicle computer server, the sequence number of the connection confirmation message is the second request sequence number, and the connection confirmation message carries the second confirmation flag, and the client connection state is set to success; If the connection response message sent from the vehicle computer server is not received within the preset waiting time, the client connection status is set to timeout.
3. The vehicle Ethernet diagnostic method according to claim 1, characterized in that: Building a transmission socket based on each of the sending address, the receiving address and the corresponding request message includes: The transmission socket is composed of the sending address, the receiving address and the corresponding request message according to a preset socket format, wherein the preset socket format includes header information and data information, the header information includes an address family and a socket type, and the data information includes the sending address, the receiving address and the request message; An information segment is selected in the header information as an identification field of the transmission socket.
4. The vehicle Ethernet diagnostic method according to any one of claims 1 to 3, characterized in that: Before sending the request message to the vehicle computer server based on the transmission socket, the method further includes: Classifying the security level of the request message based on the data content, and if the security level of the request message is higher than a preset security level, requesting a security algorithm seed from the vehicle computer server based on the transmission socket; Calculate the security algorithm seed as an unlocking key based on a decryption algorithm in a locally preset security library; Sending the unlocking key to the vehicle computer server, so that the vehicle computer server compares the unlocking key with a preset key, and if the comparison is successful, unlocking the request message permission with a security level higher than the preset security level; The request message with a security level higher than a preset security level is sent to the vehicle computer service end based on the transmission socket.
5. The vehicle Ethernet diagnostic method according to any one of claims 1 to 3, characterized in that: Calculating the security algorithm seed as an unlocking key based on a decryption algorithm in a locally preset security library includes: Read the decryption function in the local preset security library, and set the parameter type and return type of the decryption function; The security algorithm seed is input as a parameter into the decryption function, and the decryption function is called to perform an unlocking calculation operation to obtain the unlocking key as a return of the decryption function.
6. The vehicle Ethernet diagnostic method according to any one of claims 1 to 3, characterized in that: Diagnosing the vehicle Ethernet based on the diagnostic log includes: Recording the message information of the diagnostic socket in the diagnostic log, wherein the message information includes the request message and the sending time of the request message, the positive response message and the receiving time of the positive response message, or the negative response message and the receiving time of the negative response message; If the sent and received message information includes the negative response message and the receiving time of the negative response message, extracting the annotation field in the negative response message, and obtaining the annotation meaning of the annotation field based on a preset annotation dictionary; The annotation meaning is output as failure feedback, so that the user can diagnose the vehicle Ethernet based on the failure feedback.
7. The vehicle Ethernet diagnostic method according to any one of claims 1 to 3, characterized in that: The vehicle Ethernet diagnostic method further includes: A vehicle Ethernet diagnostic window is generated for display according to a preset graphical interface framework, so as to obtain the multiple diagnostic transmission data based on the vehicle Ethernet diagnostic window. The vehicle Ethernet diagnostic window also displays the client connection status, and the client connection status includes waiting, ready to connect, success and timeout.
8. A vehicle Ethernet diagnostic device, characterized in that: The vehicle Ethernet diagnostic device comprises: A socket building module, used to obtain a plurality of diagnostic transmission data, wherein the diagnostic transmission data includes a sending address, a receiving address and data content, generate a request message based on the data content, and build a transmission socket based on each of the sending address, the receiving address and the corresponding request message, wherein the header information of each transmission socket includes an identification field; an affirmative response module, configured to send the request message to the vehicle computer server based on the transmission socket, and if the vehicle computer server successfully receives and processes the request message, the vehicle computer server returns an affirmative response message based on the transmission socket; A negative response module, configured to return a negative response message based on the transmission socket if the vehicle computer server fails to successfully receive and process the request message, wherein the negative response message includes a comment field; A diagnostic recording module is used to filter multiple transmission sockets based on the identification field, use the transmission socket containing the target identification field as a diagnostic socket, and record the sending and receiving message information in the diagnostic socket in a diagnostic log, so as to diagnose the vehicle Ethernet based on the diagnostic log.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the vehicle Ethernet diagnostic method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the vehicle Ethernet diagnostic method as described in any one of claims 1-7.
Citation Information
Patent Citations
Fault diagnosis method and device, vehicle-mounted terminal and medium
CN113377590A
Vehicle diagnosis method, system and device and storage medium
CN114827183A
Service response methods, devices, equipment and storage media
CN114938395A
Vehicle diagnosis method and device, electronic equipment and storage medium
CN116319499A
Remote login and diagnosis method and device, electronic equipment, vehicle and storage medium
CN117834617A
