Vehicle fault diagnosis method and system, main server and vehicle
Through the remote vehicle fault diagnosis system and task allocation optimization, the problem of time-consuming diagnosis of traditional vehicles is solved, and the efficiency of remote fault detection and diagnosis is improved.
Patent Information
- Application Number
- CN202311421482.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2025-05-02
AI Technical Summary
Traditional vehicle fault diagnosis methods require driving the vehicle to a professional testing center, which makes the diagnosis take a long time, especially when abnormalities occur in the vehicle in other places cannot be diagnosed in time.
By building a remote vehicle fault diagnosis system, the terminal sends a subscription message to control the vehicle for fault diagnosis and feedback the diagnosis results. At the same time, the execution time of the task to be executed is predicted, and the tasks are allocated according to the time required for the sub-server to execute the task to optimize the allocation of diagnostic tasks.
Remotely controlled vehicles for fault detection, saving fault diagnosis time, and reducing the queuing time for diagnosis through optimized task allocation, further improving diagnosis efficiency.
Smart Images

Figure CN119916770A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of automobile technology, and in particular, relates to a vehicle fault diagnosis method, system, main server and vehicle. Background Art
[0002] During the use of vehicles, it is inevitable that faults will occur. Only by timely diagnosis of vehicle faults can the faults be repaired in time to ensure driving safety.
[0003] At present, when diagnosing a vehicle, a diagnostic instrument is used to diagnose the vehicle's fault. In this process, the diagnostic instrument needs to be connected to the vehicle, and then the diagnostic operation is performed by professionals. Therefore, when diagnosing a vehicle's fault, the vehicle needs to be driven to a professional testing agency or testing center, and a professional diagnostic instrument is used to diagnose the result. When the vehicle has an abnormality in a different location and needs to be diagnosed, the result cannot be diagnosed in time, and it takes a long time. Summary of the invention
[0004] The purpose of the present application is to provide a vehicle fault diagnosis method, system, main server and vehicle, aiming to solve the problem of long diagnosis time in traditional vehicle fault diagnosis.
[0005] A first aspect of an embodiment of the present application provides a vehicle fault diagnosis method, the method comprising:
[0006] Receiving a subscription message sent by a terminal, the terminal being a terminal bound to a vehicle to be diagnosed for a fault, the subscription message including a diagnostic task to be performed on the vehicle;
[0007] Based on the subscription message, determining a diagnostic task of a vehicle to be diagnosed for a fault bound to the terminal;
[0008] Determining a predicted execution time of the diagnostic task based on a historical diagnostic time of the diagnostic task of the vehicle to be diagnosed for a fault;
[0009] Based on the predicted execution time, the diagnosis task is allocated to a sub-server.
[0010] In some embodiments, allocating the diagnostic task to the sub-server based on the predicted execution time includes:
[0011] When the number of diagnostic tasks is greater than the number of idle sub-servers, the multiple diagnostic tasks are sorted according to a preset sorting rule, wherein the sorting rule is to sort the diagnostic tasks from long to short according to the predicted execution time of the diagnostic tasks;
[0012] Get the time required for multiple sub-servers to execute the assigned tasks;
[0013] According to the time required for the multiple sub-servers to execute the assigned tasks, the multiple diagnostic tasks are sequentially assigned to the first idle sub-server according to the sorting result.
[0014] In some embodiments, the subscription message also includes an account number of the terminal;
[0015] After receiving the subscription message sent by the terminal, the method further includes:
[0016] Performing authentication verification on the terminal according to the account number of the terminal;
[0017] When the account number and password of the terminal exist in the recorded terminal account number, it is determined that the terminal authentication check has passed, and the step of determining the diagnostic task of the vehicle to be diagnosed for fault bound to the terminal based on the subscription message is executed.
[0018] A second aspect of an embodiment of the present application provides a vehicle fault diagnosis method, the method comprising:
[0019] Receive the subscription topic sent by the sub-server;
[0020] According to the subscription topic, calling the message interface of the diagnostic task;
[0021] Execute the diagnostic task according to the message interface to obtain the diagnostic result;
[0022] The diagnosis result is uploaded to the sub-server.
[0023] In some embodiments, uploading the diagnosis result to the sub-server includes:
[0024] Based on the preset abnormality code, generating a result code corresponding to the diagnosis result;
[0025] The result code is sent to the sub-server.
[0026] A third aspect of an embodiment of the present application provides a main server, wherein the main server vehicle includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the vehicle fault diagnosis method as described in the first aspect above.
[0027] A fourth aspect of an embodiment of the present application provides a vehicle, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the vehicle fault diagnosis method as described in the second aspect above.
[0028] A fifth aspect of the embodiments of the present application provides a vehicle fault diagnosis system, the system comprising: the main server as described in the third aspect, the vehicle as described in the fourth aspect, a terminal and a plurality of sub-servers;
[0029] The terminal is connected to the main server for communication, and the main server is connected to the sub-server for communication;
[0030] The terminal is used to send a subscription message to the main server, the vehicle is a vehicle to be diagnosed for a fault, the terminal is a terminal bound to the vehicle to be diagnosed for a fault, and the subscription message includes a diagnostic task to be performed for the vehicle;
[0031] The sub-server is used to receive the diagnostic task assigned by the main server, and control the target vehicle corresponding to the vehicle identification code to perform fault diagnosis based on the diagnostic task.
[0032] In some embodiments, the subscription message includes a subscription topic, and the subscription topic represents a task type of the diagnostic task;
[0033] The sub-server is used to send the subscription topic to the vehicle through a message queue telemetry transmission protocol;
[0034] The target vehicle is used to receive the subscription topic sent by the sub-server, perform the diagnosis task according to the subscription topic, obtain the diagnosis result, and feed the diagnosis result back to the sub-server;
[0035] The sub-server is also used to receive the diagnostic result fed back by the target vehicle and send the diagnostic result to the main server;
[0036] The main server is used to receive the diagnosis result sent by the sub-server, and report the diagnosis result to the terminal according to the subscription topic corresponding to the diagnosis result;
[0037] The terminal is used to receive the diagnosis result reported by the main server and display the diagnosis result.
[0038] In some embodiments, the system further comprises an authentication server;
[0039] The authentication server is communicatively connected with the main server;
[0040] The terminal is used to send an authentication request to the main server, wherein the authentication request includes the account number, password and private key of the terminal;
[0041] The main server is used to receive the authentication request sent by the terminal, and forward the authentication request to the authentication server;
[0042] The authentication server is used to receive the authentication request, generate a shared key based on the public key of the main server and the private key of the terminal, record the account and password of the terminal, and send a confirmation message to the main server, wherein the confirmation message includes the shared key, and the confirmation message is used to indicate the end of the key negotiation process.
[0043] A sixth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the vehicle fault diagnosis method as described above is implemented.
[0044] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0045] In the embodiment of the present application, by constructing a remote vehicle fault diagnosis system, it is possible to control the vehicle to perform fault diagnosis through subscription messages sent by the terminal, and to feedback the diagnosis results, so that the user can view the vehicle fault diagnosis results through the terminal, so that when the vehicle has an abnormality in a different place, there is no need to drive the vehicle to a professional inspection center, and remote control of the vehicle for fault detection is realized, saving fault diagnosis time. Furthermore, by predicting the task execution time of the task to be executed, tasks are allocated to the sub-servers based on the predicted task time and the time required for the sub-server to currently execute the task, thereby preventing the situation where the sub-servers execute tasks unevenly, reducing the queuing time for fault diagnosis, and further saving fault diagnosis time. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A schematic diagram of a vehicle fault diagnosis system provided by an exemplary embodiment is shown;
[0047] Figure 2 A schematic diagram of a vehicle fault diagnosis system provided by an exemplary embodiment is shown;
[0048] Figure 3 A schematic flow chart of a vehicle fault diagnosis method provided by an exemplary embodiment is shown;
[0049] Figure 4 A schematic flow chart of a vehicle fault diagnosis method provided by an exemplary embodiment is shown;
[0050] Figure 5 A schematic flow chart of a vehicle fault diagnosis method provided by an exemplary embodiment is shown;
[0051] Figure 6 A schematic flow chart of a vehicle fault diagnosis method provided by an exemplary embodiment is shown;
[0052] Figure 7A schematic flow chart of a vehicle fault diagnosis method provided by an exemplary embodiment is shown;
[0053] Figure 8 A schematic flow chart of a vehicle fault diagnosis method provided by an exemplary embodiment is shown;
[0054] Fig. 9 A schematic structural diagram of a vehicle fault diagnosis method and device provided by an exemplary embodiment is shown;
[0055] Fig.10 A schematic structural diagram of a vehicle fault diagnosis method and device provided by an exemplary embodiment is shown;
[0056] Fig.11 It is a schematic diagram of the structure of a device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0059] Please refer to Figure 1 , which shows a vehicle fault diagnosis system provided by an exemplary embodiment, the system includes: a terminal 10, a main server 20, a plurality of sub-servers 30 and a vehicle 40; the terminal 10 is communicatively connected to the main server 20, and the main server 20 is communicatively connected to the sub-server 30.
[0060] The terminal 10 and the main server 20 are connected in communication by means of message publishing / subscription. The terminal 10 can be any terminal 10 with message publishing / subscription function. For example, the terminal 10 can be a mobile phone, a computer, a vehicle-mounted terminal 10, a handheld computer, etc. In the embodiment of the present application, the type of the terminal 10 is not specifically limited. The main server 20 can be an independent server or a server cluster. In some embodiments, the main server 20 is an Ngix server.
[0061] The multiple sub-servers 30 are connected to the main server 20 in communication. In some embodiments, the multiple sub-servers 30 communicate with the main server 20 through the message queue telemetry transport protocol (MQTT). The number of the sub-servers 30 can be set as needed. In the embodiment of the present application, there is no specific requirement for the number of the sub-servers 30. For example, the number of the sub-servers 30 can be 3, 5 or other numbers. The sub-server 30 can be any server with a data processing function, and the sub-server 30 is an independent server or a server cluster. In the embodiment of the present application, there is no specific limitation on this. The multiple sub-servers 30 establish a communication connection with the vehicle 40, wherein the sub-server 30 and the vehicle 40 can also communicate and connect through the MQTT protocol. Each sub-server 30 can exchange data with multiple vehicles 40.
[0062] It should be noted that the vehicle 40 also performs diagnostic communication with the diagnostic device through a diagnostic communication protocol (Diagnostics over IP, DoIP) based on the Internet Protocol (IP), thereby realizing automatic diagnosis of the vehicle 40. The diagnostic device may be a simple diagnostic device provided in the vehicle 40, or may be an independent diagnostic device with communication function outside the vehicle 40.
[0063] The terminal 10 is used to send a subscription message to the main server 20, the subscription message including the vehicle 40 identification code of the target vehicle 40, and the subscription message is used to indicate to perform fault diagnosis on the target vehicle 40; the main server 20 is used to receive the subscription message sent by the terminal 10, determine the predicted execution time based on the subscription message, and assign a diagnostic task to the sub-server 30 based on the predicted execution time, and the predicted execution time is the predicted execution time of the diagnostic task to be executed in the subscription message; the sub-server 30 is used to receive the diagnostic task assigned by the main server 20, and control the target vehicle 40 corresponding to the vehicle 40 identification code to perform fault diagnosis based on the diagnostic task.
[0064] The subscription message may be a message for instructing multiple vehicles 40 to perform fault diagnosis, or a message for instructing one vehicle 40 to perform fault diagnosis. In some embodiments, when a user needs to perform fault diagnosis on a vehicle 40 bound to the terminal 10, a subscription message for the vehicle 40 is generated through the vehicle identification number (VIN) of the vehicle 40 bound to the terminal 10, and the subscription message is sent to the main server 20 to obtain the fault diagnosis result of the vehicle 40. Alternatively, the user inputs the VIN code of the vehicle 40 to be diagnosed to the terminal 10, and a subscription message is generated based on the VIN code.
[0065] In some embodiments, the user needs to obtain the fault diagnosis results of multiple vehicles 40. Accordingly, the terminal 10 receives the VIN codes of multiple vehicles 40 input by the user, and the terminal 10 generates subscription messages corresponding to the multiple vehicles 40 based on the multiple VIN codes, and sends the subscription message to the main server 20 to obtain the fault diagnosis results of the multiple vehicles 40.
[0066] It should be noted that after the terminal 10 sends the subscription message, the main server 20 can control the vehicle 40 to perform a fault diagnosis according to the subscription message. The main server 20 can also control the vehicle 40 to perform a fault diagnosis every preset time according to the subscription message, and return the diagnosis result, and send a diagnosis result message to the terminal 10 so that the user can view the diagnosis result according to the diagnosis result message. Among them, the preset time can be set as needed. In the embodiment of the present application, the preset time is not specifically limited. For example, the preset time can be 5 days, 10 days or 1 month, etc.
[0067] After receiving the subscription message sent by the terminal 10, the main server 20 allocates the diagnostic task to the sub-server 30 according to the subscription message. Accordingly, in some embodiments, the main server 20 receives the subscription message sent by the terminal 10; based on the subscription message, determines the predicted execution time, which is the predicted execution time of the diagnostic task to be executed in the subscription message; and allocates the diagnostic task to the sub-server 30 based on the predicted execution time.
[0068] Each subscription message carries the topic name of the diagnostic task to be executed. According to the subscription protocol, different diagnostic tasks can be represented by different topic names. For example, the topic name " / login" indicates that the diagnostic task is the "login" task, the topic name " / logout" indicates that the diagnostic task is the "logout" task, and the topic name " / heartbeat" indicates that the diagnostic task is the "heartbeat information" task.
[0069] The main server 20 predicts the execution duration of the diagnostic tasks to be executed according to the diagnostic tasks carried in the subscription message. In some embodiments, the main server 20 obtains the execution duration corresponding to the diagnostic task from the execution durations of the historically stored diagnostic tasks according to the diagnostic task. Correspondingly, for a diagnostic task that has not been executed historically, when the main server 20 executes the diagnostic task for the first time, it records the execution duration of the diagnostic task. When the diagnostic task to be executed is a diagnostic task that has been executed historically, it calls the recorded execution duration of the diagnostic task as the predicted execution duration of the diagnostic task.
[0070] It should be noted that the main server 20 can update the recorded execution duration according to the actual execution duration of the diagnostic task. For example, update the recorded diagnostic task through the most recent execution duration of the diagnostic task; or determine the average value of the execution durations of the diagnostic tasks in the most recent preset number of times, and update the recorded diagnostic task according to this average value.
[0071] After the main server 20 receives the subscription message, it parses the subscription message to obtain the diagnostic task carried in the subscription message. The main server 20 obtains the working state of the sub-server 30. The working state of the sub-server 30 includes an idle state and a running state, and the duration required for the sub-server 30 to execute the current task in the running state. Among them, the duration required for the sub-server 30 to execute the current task can also be determined according to the execution duration of the historically recorded tasks.
[0072] When the number of idle sub-servers 30 among the multiple sub-servers 30 is not less than the number of diagnostic tasks in the subscription message, the multiple diagnostic tasks are allocated to the idle sub-servers 30. When the number of diagnostic tasks is greater than the number of idle sub-servers 30, the multiple diagnostic tasks are allocated to the sub-servers 30 according to the predicted execution duration of the diagnostic tasks. This process can be: when the number of diagnostic tasks is greater than the number of idle sub-servers 30, sort the multiple diagnostic tasks according to a preset sorting rule, and the sorting rule is to sort the diagnostic tasks in descending order of the predicted execution duration; obtain the duration required for the multiple sub-servers 30 to execute the allocated tasks; according to the duration required for the multiple sub-servers 30 to execute the allocated tasks, allocate the multiple diagnostic tasks to the first idle sub-server 30 in turn according to the sorting result.
[0073] For example, when there are m sub-servers 30 and n diagnostic tasks, when m >= n, it is only necessary to allocate the time interval [0, ti] of the sub-server 30i to the diagnostic task i; when m < n, first sort the n diagnostic tasks in descending order of the required execution time, and then allocate the diagnostic tasks to the first idle sub-server 30 in turn through scheduling.
[0074] In this way, the diagnostic tasks can be reasonably allocated, the pressure on the server can be reduced, and the diagnostic efficiency can be greatly improved to ensure the accuracy of the diagnosis. For example, when the number of sub-servers 30 is 3, namely M1, M2 and M3, the number of diagnostic tasks is 8, and the time of each task of the 8 diagnostic tasks is 8 seconds, 7 seconds, 6 seconds, 5 seconds, 4 seconds, 3 seconds, 2 seconds and 1 second respectively. See Table 1 and Table 2, Table 1 shows the time required for allocation in sequence, and Table 2 shows the time required for allocation according to the above scheduling method.
[0075] Table 1
[0076] Subserver ID Diagnostic task execution time Master server scheduling time Total time M1 8、5、2 8+5+2 15 M2 7、4、1 7+4+1 12 M3 6、3 6+3 8
[0077] Table 2
[0078]
[0079]
[0080] Referring to Table 1 and Table 2, it can be seen that when the allocation is performed in sequence, the main server 20 takes up to 15 seconds to schedule the diagnostic task, while the maximum time required for allocation through the above-mentioned scheduling method is 13 seconds, thereby saving the total scheduling time of the main server 20, thereby greatly improving the diagnostic efficiency. In addition, since the total scheduling time of the main server 20 is saved, the pressure on the main server 20 is reduced, and diagnostic errors caused by high scheduling pressure on the main server 20 are prevented, thereby ensuring the accuracy of the diagnosis.
[0081] After the main server 20 assigns the diagnostic task to the sub-server 30, the sub-server 30 sends a subscription topic to the vehicle 40 according to the vehicle 40 identification code VIN in the assigned subscription message. The sub-server 30 establishes communication with the vehicle 40 to be diagnosed through the VIN code, and sends the subscription topic / task / {sn} to the vehicle 40 through MQTT. Accordingly, the vehicle 40 receives the subscription topic and executes the diagnostic task according to the subscription topic. The process can be: the terminal 10 receives the subscription topic issued by the sub-server 30; according to the subscription topic, the message interface of the diagnostic task is called; according to the message interface, the diagnostic task is executed to obtain the diagnostic result; and the diagnostic result is uploaded to the sub-server 30.
[0082] After receiving the issued subscription topic, the vehicle 40 parses the data of the subscription topic to obtain the diagnosis task, and then diagnoses the task and returns the execution result to the sub-server 30 by responding to the / task / response message. The vehicle 40 can parse the subscription topic according to the subscription protocol specified in advance to obtain the diagnosis task. See Table 3, which shows a subscription protocol format.
[0083] Table 3
[0084]
[0085]
[0086] After receiving the diagnostic results uploaded by the vehicle 40, the sub-server 30 sends the diagnostic results to the main server 20. The main server 20 integrates the relevant diagnostic results of the same subscription topic according to the subscription topic / task / topic, and reports the integrated results to the terminal 10, so that the terminal 10 can view the diagnostic results of the vehicles 40 in batches.
[0087] The diagnosis result can be represented by an abnormality code. Accordingly, the vehicle 40 generates a result code corresponding to the diagnosis result based on a preset abnormality code, and sends the result code to the sub-server 30. The abnormality code can be set as needed, for example, see Table 4, which shows a representation method of an abnormality code.
[0088] Table 4
[0089]
[0090]
[0091] Refer to Table 4. It can be seen from Table 4 that when the exception code is 0x01, it indicates that the vehicle data is abnormal; when the exception code is 0x02, it indicates that the drive motor data is abnormal; when the exception code is 0x03, it indicates that the fuel cell data is abnormal; when the exception code is 0x04, it indicates that the engine data is abnormal; when the exception code is 0x05, it indicates that the alarm data is abnormal; when the exception code is 0x06, it indicates that the central control screen is abnormal; when the exception code is 0x07, it indicates other abnormal ranges.
[0092] In some embodiments, see Figure 2, the system also includes an authentication server 50 (Authenticate Server), which is connected to the main server 20 in communication; the terminal 10 is used to send an authentication request to the main server 20, and the authentication request includes the account, password and private key of the terminal 10; the main server 20 is used to receive the authentication request sent by the terminal 10, and forward the authentication request to the authentication server 50; the authentication server 50 is used to receive the authentication request, generate a shared secret key according to the public key of the main server 20 and the private key of the terminal 10, record the account and password of the terminal 10, and send a confirmation message to the main server 20, the confirmation message includes the shared secret key, and the confirmation message is used to indicate the end of the key negotiation process. In some embodiments, the terminal 10 sends the account and password to the main server 20 through the username and password fields of the CONNECT message. Among them, the account can be account information such as a user name.
[0093] Correspondingly, the subscription message also includes the account of the terminal 10. After receiving the subscription message sent by the terminal 10, the main server 20 can also perform authentication verification on the terminal 10. The process can be: the main server 20 performs authentication verification on the terminal 10 according to the account of the terminal 10; when the account and password of the terminal 10 exist in the recorded terminal 10 account, it is determined that the authentication verification of the terminal 10 has passed, and the steps of determining the predicted execution time based on the subscription message and allocating the diagnostic task to the sub-server 30 based on the predicted execution time are executed.
[0094] In the embodiment of the present application, by constructing a remote vehicle fault diagnosis system, it is possible to control the vehicle to perform fault diagnosis through subscription messages sent by the terminal, and to feedback the diagnosis results, so that the user can view the vehicle fault diagnosis results through the terminal, so that when the vehicle has an abnormality in a different place, there is no need to drive the vehicle to a professional inspection center, and remote control of the vehicle for fault detection is realized, saving fault diagnosis time. Furthermore, by predicting the task execution time of the task to be executed, tasks are allocated to the sub-servers based on the predicted task time and the time required for the sub-server to currently execute the task, thereby preventing the situation where the sub-servers execute tasks unevenly, reducing the queuing time for fault diagnosis, and further saving fault diagnosis time.
[0095] See also Figure 3 , which shows a flow chart of a vehicle fault diagnosis method provided by an embodiment of the present application. As an example but not a limitation, the method is applied in a main server.
[0096] S301, the main server receives a subscription message sent by a terminal, where the terminal is a terminal bound to a vehicle to be diagnosed for a fault, and the subscription message includes a diagnostic task to be performed on the vehicle.
[0097] In some embodiments, the subscription message includes the terminal's account number. Figure 4 After this step, the main server also verifies the account of the terminal. The process may be: the main server performs authentication verification on the terminal according to the account of the terminal; when the account of the terminal exists in the recorded terminal account and password, it is determined that the terminal authentication verification has passed, and step S302 is executed.
[0098] If the authentication fails, the master server can prompt the terminal to authenticate. Figure 5 , the main server authenticates the terminal through the authentication server, and the process may be: the terminal sends an authentication request to the main server, and the authentication request includes the account, password and private key of the terminal; the main server receives the authentication request sent by the terminal, and forwards the authentication request to the authentication server; the authentication server receives the authentication request, generates a shared key according to the public key of the main server and the private key of the terminal, records the account and password of the terminal, and sends a confirmation message to the main server, and the confirmation message includes the shared key, and the confirmation message is used to indicate the end of the key negotiation process. In some embodiments, the terminal sends the account and password to the main server through the username and password fields of the CONNECT message. Among them, the account can be account information such as a user name.
[0099] S302: The main server determines the diagnosis task of the vehicle to be diagnosed for fault bound to the terminal based on the subscription message.
[0100] In some embodiments, the subscription message includes a subscription topic, and the subscription topic indicates the task type of the diagnostic task. Accordingly, in this step, the main server determines the diagnostic task according to the subscription topic of the subscription message.
[0101] The terminal is bound to the VIN code of the vehicle to be diagnosed for fault. After receiving the subscription message, the main server determines the terminal that sent the subscription message and the VIN code bound to the terminal according to the subscription message.
[0102] One point that needs to be explained is that the consent terminal can be bound to the VIN code of one vehicle or the VIN codes of multiple vehicles. In the embodiment of the present application, there is no specific limitation on this.
[0103] S303: The main server determines a predicted execution duration of the diagnostic task based on the historical diagnostic duration of the diagnostic task of the vehicle to be diagnosed for fault.
[0104] The main server predicts the execution time of the diagnostic task to be executed according to the diagnostic task carried in the subscription message. In some embodiments, the main server obtains the execution time corresponding to the diagnostic task from the execution time of the historically stored diagnostic tasks according to the diagnostic task.
[0105] One point that needs to be explained is that for diagnostic tasks that have not been executed in the past, when the main server executes the diagnostic task for the first time, it can use the preset duration as the predicted execution duration of the diagnostic task. Among them, the preset duration can be set as needed. In the embodiment of the present application, the preset duration is not specifically limited. The execution duration of the diagnostic task is recorded. When the diagnostic task that has been executed in the past is among the diagnostic tasks to be executed, the recorded execution duration of the diagnostic task is called as the predicted duration of the diagnostic task.
[0106] It should be noted that the main server can update the recorded execution time according to the actual execution time of the diagnostic task. For example, the recorded diagnostic task can be updated by the most recent execution time of the diagnostic task; or the average execution time of the most recent preset number of diagnostic tasks can be determined and the recorded diagnostic task can be updated according to the average execution time.
[0107] S304: The main server allocates the diagnosis task to the sub-server based on the predicted execution time.
[0108] In some embodiments, when the number of diagnostic tasks is greater than the number of idle sub-servers, multiple diagnostic tasks are sorted according to a preset sorting rule, and the sorting rule is to sort the diagnostic tasks from long to short according to the predicted execution time; obtain the time required for multiple sub-servers to execute the assigned tasks; and according to the time required for the multiple sub-servers to execute the assigned tasks, assign the multiple diagnostic tasks to the first idle sub-server in sequence according to the sorting results.
[0109] In the embodiment of the present application, the subscription message sent by the terminal controls the vehicle to perform fault diagnosis and feedback the diagnosis results, so that the user can view the vehicle's fault diagnosis results through the terminal. In this way, when the vehicle has an abnormality in a different place, there is no need to drive the vehicle to a professional inspection center, which realizes remote control of the vehicle for fault detection and saves fault diagnosis time. Furthermore, by predicting the task execution time of the task to be executed, the task is allocated to the sub-server based on the predicted task time and the time required for the sub-server to currently execute the task, thereby preventing the situation where the sub-servers execute tasks unevenly, reducing the queue time for fault diagnosis, and further saving fault diagnosis time.
[0110] See also Figure 6, which shows a flow chart of a vehicle fault diagnosis method provided by an embodiment of the present application. As an example but not a limitation, the method is applied in a vehicle.
[0111] S601, the vehicle receives the subscription topic sent by the sub-server.
[0112] S602: The vehicle calls the message interface of the diagnostic task according to the subscribed topic.
[0113] S603, the vehicle performs a diagnostic task according to the message interface and obtains a diagnostic result.
[0114] S604: The vehicle uploads the diagnosis result to the sub-server.
[0115] See also Figure 7 After the vehicle uploads the diagnosis result to the sub-server, the sub-server feeds back the diagnosis result to the main server through subscription information, and then the main server feeds back the diagnosis result to the terminal, so that the diagnosis result can be viewed through the terminal.
[0116] In an embodiment of the present application, after the sub-server receives the diagnostic results uploaded by the vehicle, it sends the diagnostic results to the main server. The main server integrates the relevant diagnostic results of the same subscription topic according to the subscription topic, and reports the integrated results to the terminal, thereby enabling the terminal to view the vehicle diagnostic results in batches.
[0117] See also Figure 8 , which shows a flow chart of a vehicle fault diagnosis method provided by an embodiment of the present application. As an example but not a limitation, the method is applied to a vehicle fault diagnosis system.
[0118] S801, the terminal sends a subscription message to the main server.
[0119] S802, the main server receives a subscription message sent by the terminal, determines the diagnostic task of the vehicle to be diagnosed for fault to which the terminal is bound; and determines the predicted execution time of the diagnostic task based on the historical diagnostic time of the diagnostic task of the vehicle to be diagnosed for fault.
[0120] S803, the sub-server receives the diagnostic task sent by the main server, and sends the diagnostic task to the vehicle.
[0121] S804, the vehicle receives the diagnosis task sent by the sub-server, performs fault diagnosis according to the diagnosis task, and obtains a diagnosis result.
[0122] S805: The vehicle uploads the diagnosis result to the sub-server.
[0123] S806, the sub-server receives the diagnosis result uploaded by the vehicle, and uploads the diagnosis result to the main server.
[0124] S807, the main server receives the diagnosis result uploaded by the sub-server, and uploads the diagnosis result to the terminal.
[0125] S808, the terminal receives the diagnosis result sent by the main server and displays the diagnosis result.
[0126] In the embodiment of the present application, by constructing a remote vehicle fault diagnosis system, it is possible to control the vehicle to perform fault diagnosis through subscription messages sent by the terminal, and to feedback the diagnosis results, so that the user can view the vehicle fault diagnosis results through the terminal, so that when the vehicle has an abnormality in a different place, there is no need to drive the vehicle to a professional inspection center, and remote control of the vehicle for fault detection is realized, saving fault diagnosis time. Furthermore, by predicting the task execution time of the task to be executed, tasks are allocated to the sub-servers based on the predicted task time and the time required for the sub-server to currently execute the task, thereby preventing the situation where the sub-servers execute tasks unevenly, reducing the queuing time for fault diagnosis, and further saving fault diagnosis time.
[0127] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0128] See also Fig. 9 , which shows a schematic diagram of the structure of a vehicle fault diagnosis device provided by the present application, and includes various units for executing various steps in the above embodiments, see Fig. 9 , the fault diagnosis device of the vehicle comprises:
[0129] The first receiving unit 901 is used to receive a subscription message sent by a terminal, where the terminal is a terminal bound to a vehicle to be diagnosed for a fault, and the subscription message includes a diagnostic task to be performed on the vehicle;
[0130] A first determining unit 902 is used to determine, based on the subscription message, a diagnostic task of a vehicle to be diagnosed for a fault bound to the terminal;
[0131] A second determining unit 903 is used to determine a predicted execution time of the diagnostic task based on a historical diagnostic time of the diagnostic task of the vehicle to be diagnosed for a fault;
[0132] The allocating unit 904 is configured to allocate the diagnostic task to a sub-server based on the predicted execution time.
[0133] In some embodiments, the allocation unit 904 is used to sort multiple diagnostic tasks according to a preset sorting rule when the number of diagnostic tasks is greater than the number of idle sub-servers, and the sorting rule is to sort the diagnostic tasks from long to short according to the predicted execution time; obtain the time required for multiple sub-servers to execute the assigned tasks; and according to the time required for the multiple sub-servers to execute the assigned tasks, allocate the multiple diagnostic tasks to the first idle sub-server in sequence according to the sorting results.
[0134] In some embodiments, the subscription message also includes the account number of the terminal;
[0135] The device also includes:
[0136] A verification unit, used to perform authentication verification on the terminal according to the account of the terminal;
[0137] The first determination unit 902 is used to determine that the terminal authentication verification has passed when the terminal account and password are recorded, and determine the diagnostic task of the vehicle to be diagnosed for fault bound to the terminal based on the subscription message.
[0138] In the embodiment of the present application, by constructing a remote vehicle fault diagnosis system, it is possible to control the vehicle to perform fault diagnosis through subscription messages sent by the terminal, and to feedback the diagnosis results, so that the user can view the vehicle fault diagnosis results through the terminal, so that when the vehicle has an abnormality in a different place, there is no need to drive the vehicle to a professional inspection center, and remote control of the vehicle for fault detection is realized, saving fault diagnosis time. Furthermore, by predicting the task execution time of the task to be executed, tasks are allocated to the sub-servers based on the predicted task time and the time required for the sub-server to currently execute the task, thereby preventing the situation where the sub-servers execute tasks unevenly, reducing the queuing time for fault diagnosis, and further saving fault diagnosis time.
[0139] See also Fig.10 , which shows a schematic diagram of the structure of a vehicle fault diagnosis device provided by the present application, and includes various units for executing various steps in the above embodiments, see Fig.10 , the fault diagnosis device of the vehicle comprises:
[0140] The second receiving unit 1001 is used to receive the subscription topic sent by the sub-server;
[0141] The calling unit 1002 is used to call the message interface of the diagnostic task according to the subscription topic;
[0142] The diagnosis unit 1003 is used to perform a diagnosis task according to the message interface and obtain a diagnosis result;
[0143] The sending unit 1004 is used to upload the diagnosis result to the sub-server.
[0144] In some embodiments, the sending unit 1004 is used to generate a result code corresponding to the diagnosis result based on a preset abnormality code; and send the result code to the sub-server.
[0145] In the embodiment of the present application, by constructing a remote vehicle fault diagnosis system, it is possible to control the vehicle to perform fault diagnosis through subscription messages sent by the terminal, and to feedback the diagnosis results, so that the user can view the vehicle fault diagnosis results through the terminal, so that when the vehicle has an abnormality in a different place, there is no need to drive the vehicle to a professional inspection center, and remote control of the vehicle for fault detection is realized, saving fault diagnosis time. Furthermore, by predicting the task execution time of the task to be executed, tasks are allocated to the sub-servers based on the predicted task time and the time required for the sub-server to currently execute the task, thereby preventing the situation where the sub-servers execute tasks unevenly, reducing the queuing time for fault diagnosis, and further saving fault diagnosis time.
[0146] Fig.11 Schematic diagram of a device provided by an exemplary embodiment of the present application. Fig.11 As shown, the device 11 of this embodiment includes: a processor 110, a memory 111, and a computer program 112 stored in the memory 111 and executable on the processor 110, such as a vehicle fault diagnosis program. When the processor 110 executes the computer program 112, the steps in the above-mentioned various vehicle fault diagnosis method embodiments are implemented, such as Figure 8 Alternatively, when the processor 110 executes the computer program 112, the functions of each unit in the above-mentioned device embodiments are realized, for example Fig. 9 The functions of the units 901 to 903 shown, or, as Fig.10 The functions of units 1001 to 1004 are shown.
[0147] Exemplarily, the computer program 112 may be divided into one or more units, which are stored in the memory 111 and executed by the processor 110 to complete the present application. The one or more units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 112 in the device 11. For example, the computer program 112 may be divided into a first receiving unit, a first determining unit, a second determining unit, and an allocating unit, and the specific functions of each module are as follows:
[0148] The first receiving unit 901 is used to receive a subscription message sent by a terminal, where the terminal is a terminal bound to a vehicle to be diagnosed for a fault, and the subscription message includes a diagnostic task to be performed on the vehicle;
[0149] A first determining unit 902 is used to determine, based on the subscription message, a diagnostic task of a vehicle to be diagnosed for a fault bound to the terminal;
[0150] A second determining unit 903 is used to determine a predicted execution time of the diagnostic task based on a historical diagnostic time of the diagnostic task of the vehicle to be diagnosed for a fault;
[0151] The allocating unit 904 is configured to allocate the diagnostic task to a sub-server based on the predicted execution time.
[0152] For another example, the computer program 112 may be divided into a second receiving unit, a calling unit, a diagnosis unit, and a sending unit, and the specific functions of each module are as follows:
[0153] The second receiving unit 1001 is used to receive the subscription topic sent by the sub-server;
[0154] The calling unit 1002 is used to call the message interface of the diagnostic task according to the subscription topic;
[0155] The diagnosis unit 1003 is used to perform a diagnosis task according to the message interface and obtain a diagnosis result;
[0156] The sending unit 1004 is used to upload the diagnosis result to the sub-server.
[0157] The device 11 may be any vehicle with an obstacle detection function. The device 11 may include, but is not limited to, a processor 110 and a memory 111. Those skilled in the art will appreciate that Fig.11 It is only an example of the device 11 and does not constitute a limitation of the device 11. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the device 11 may also include input and output devices, network access devices, buses, etc.
[0158] The processor 110 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0159] The memory 111 may be an internal storage unit of the device 11, such as a hard disk or memory of the device 11. The memory 111 may also be an external storage device of the device 11, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the device 11. Further, the memory 111 may also include both an internal storage unit of the device 11 and an external storage device. The memory 111 is used to store the computer program and other programs and data required by the terminal device. The memory 111 may also be used to temporarily store data that has been output or is to be output.
[0160] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0161] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0162] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0163] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0164] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0165] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0166] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0167] The embodiments of the present application further provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0168] The embodiment of the present application also provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0169] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A vehicle fault diagnosis method, characterized in that: The method comprises: Receiving a subscription message sent by a terminal, the terminal being a terminal bound to a vehicle to be diagnosed for a fault, the subscription message including a diagnostic task to be performed on the vehicle; Based on the subscription message, determining a diagnostic task of a vehicle to be diagnosed for a fault bound to the terminal; Determining a predicted execution time of the diagnostic task based on a historical diagnostic time of the diagnostic task of the vehicle to be diagnosed for a fault; Based on the predicted execution time, the diagnosis task is allocated to a sub-server.
2. The method according to claim 1, characterized in that The allocating the diagnostic task to the sub-server based on the predicted execution time includes: When the number of diagnostic tasks is greater than the number of idle sub-servers, the multiple diagnostic tasks are sorted according to a preset sorting rule, wherein the sorting rule is to sort the diagnostic tasks from long to short according to the predicted execution time of the diagnostic tasks; Get the time required for multiple sub-servers to execute the assigned tasks; According to the time required for the multiple sub-servers to execute the assigned tasks, the multiple diagnostic tasks are sequentially assigned to the first idle sub-server according to the sorting result.
3. The method according to claim 1, characterized in that The subscription message also includes the terminal account; After receiving the subscription message sent by the terminal, the method further includes: Performing authentication verification on the terminal according to the account number of the terminal; When the account number and password of the terminal exist in the recorded terminal account number, it is determined that the terminal authentication check has passed, and the step of determining the diagnostic task of the vehicle to be diagnosed for fault bound to the terminal based on the subscription message is executed.
4. A vehicle fault diagnosis method, characterized in that: The method comprises: Receive the subscription topic sent by the sub-server; According to the subscription topic, calling the message interface of the diagnostic task; Execute the diagnostic task according to the message interface to obtain the diagnostic result; The diagnosis result is uploaded to the sub-server.
5. The method according to claim 4, characterized in that The uploading of the diagnosis result to the sub-server includes: Based on the preset abnormality code, generating a result code corresponding to the diagnosis result; The result code is sent to the sub-server.
6. A main server, characterized in that: The main server vehicle includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the vehicle fault diagnosis method according to any one of claims 1 to 3.
7. A vehicle, characterized in that: The vehicle includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the vehicle fault diagnosis method as described in any one of claims 4-5.
8. A vehicle fault diagnosis system, characterized in that: The system comprises: the main server as claimed in claim 6, the vehicle as claimed in claim 7, a terminal and a plurality of sub-servers; The terminal is connected to the main server for communication, and the main server is connected to the sub-server for communication; The terminal is used to send a subscription message to the main server, the vehicle is a vehicle to be diagnosed for a fault, the terminal is a terminal bound to the vehicle to be diagnosed for a fault, and the subscription message includes a diagnostic task to be performed for the vehicle; The sub-server is used to receive the diagnostic task assigned by the main server, and control the target vehicle corresponding to the vehicle identification code to perform fault diagnosis based on the diagnostic task.
9. The system according to claim 8, characterized in that The subscription message includes a subscription topic, and the subscription topic represents the task type of the diagnostic task; The sub-server is used to send the subscription topic to the vehicle through a message queue telemetry transmission protocol; The target vehicle is used to receive the subscription topic sent by the sub-server, perform the diagnosis task according to the subscription topic, obtain the diagnosis result, and feed the diagnosis result back to the sub-server; The sub-server is also used to receive the diagnostic result fed back by the target vehicle and send the diagnostic result to the main server; The main server is used to receive the diagnosis result sent by the sub-server, and report the diagnosis result to the terminal according to the subscription topic corresponding to the diagnosis result; The terminal is used to receive the diagnosis result reported by the main server and display the diagnosis result.
10. The system according to claim 8, characterized in that The system also includes an authentication server; The authentication server is communicatively connected with the main server; The terminal is used to send an authentication request to the main server, wherein the authentication request includes the account number, password and private key of the terminal; The main server is used to receive the authentication request sent by the terminal, and forward the authentication request to the authentication server; The authentication server is used to receive the authentication request, generate a shared key based on the public key of the main server and the private key of the terminal, record the account and password of the terminal, and send a confirmation message to the main server, wherein the confirmation message includes the shared key, and the confirmation message is used to indicate the end of the key negotiation process.