Vehicle data query method, electronic device and computer program product
The query information of the diagnostic equipment is processed through the vehicle gateway and the query result data is passed to the target ECU, which solves the problem of data redundancy of the diagnostic equipment when querying vehicle data, improves query efficiency and saves resources.
Patent Information
- Application Number
- CN202411979355.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-29
AI Technical Summary
In the prior art, when the diagnostic equipment querys vehicle data, the data obtained is redundant, resulting in low query efficiency.
The query information of the diagnostic device is received through the vehicle gateway, a request message is generated, and sent to the target ECU according to the preset period, and the query result data is received, and only data that meets the query conditions are sent to the diagnostic device.
It improves the efficiency of diagnostic equipment in querying actual vehicle data, saves the storage and computing resources of diagnostic equipment, and meets the diverse query needs of users.
Smart Images

Figure CN119903069A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of vehicle networking technology, and in particular to a vehicle data query method, an electronic device, and a computer program product. Background Art
[0002] With the rapid development of modern automobile technology, the amount of data generated by vehicles has exploded. These vehicle data cover multiple aspects such as vehicle driving data, status data, fault data, etc. In today's automotive field, whether it is for vehicle repair, maintenance, management or other work, it is usually necessary to query vehicle data first.
[0003] In the related art, since vehicle data is of various types and huge in quantity, when querying vehicle data, the vehicle data obtained by the diagnostic equipment is often redundant, resulting in low efficiency in querying the vehicle data actually needed. Summary of the invention
[0004] In view of this, embodiments of the present application provide a vehicle data query method, an electronic device, and a computer program product to solve the problem of low efficiency of diagnostic equipment in querying the vehicle data actually required in the related art.
[0005] A first aspect of an embodiment of the present application provides a vehicle data query method, the method comprising:
[0006] Receiving query information sent by the diagnostic device, the query information includes a query object, a query index of the query object and a query condition, the query object includes a structural part in the target vehicle, the query index is a parameter of the queried structural part, and the format of the query information is a structured query language SQL statement format;
[0007] Generate a request message based on the query information, and the request message is used to query the query index of the query object;
[0008] Sending a request message to a target electronic control unit ECU according to a preset period, and receiving query result data fed back by the target ECU, where the target ECU is the ECU corresponding to the query object;
[0009] The query result data that meets the query conditions is sent to the diagnostic device.
[0010] In some embodiments, generating a request message according to the query information includes:
[0011] Determine a first identifier corresponding to the query object according to the first mapping relationship, and determine a second identifier corresponding to the query index according to the second mapping relationship, wherein the first mapping relationship is used to describe the correspondence between the query object and the identifier, and the second mapping relationship is used to describe the correspondence between the query index and the identifier;
[0012] The first identifier is combined with the second identifier to generate a request message.
[0013] In some embodiments, sending the query result data satisfying the query condition to the diagnostic device includes: in response to satisfying a preset stop condition, sending the query result data satisfying the query condition to the diagnostic device.
[0014] In some embodiments, the preset stop condition includes: receiving a stop query instruction from the diagnostic device, or receiving query result data that meets the query condition.
[0015] In some embodiments, before generating the request message, it includes: searching for a target keyword in the query information, and extracting a query object and a query index of the query object from the query information based on the target keyword.
[0016] In some embodiments, sending a request message to a target electronic control unit ECU includes:
[0017] If the format of the request message is a first encapsulation format, the request message is sent to the target ECU via the vehicle internal bus, and the first encapsulation format is a controller area network (CAN) message format;
[0018] If the format of the request message is the second encapsulation format, the request message is sent to the target ECU via the diagnostic communication DoIP protocol based on the IP network, and the second encapsulation format is the DoIP message format.
[0019] Compared with the prior art, the embodiment of the present application has the following beneficial effects: in the embodiment of the present application, the vehicle gateway generates a request message according to the query information sent by the received diagnostic device, and sends the request message to the target ECU according to a preset period to receive the query result data fed back by the target ECU, so that the vehicle gateway only sends the query result data that meets the query conditions to the diagnostic device. On the one hand, since the diagnostic device only needs to send the query information to the vehicle gateway and wait for the vehicle gateway to return the query result data that meets the query conditions, compared with the related art in which the diagnostic device needs to further determine whether the query result data belongs to the vehicle data actually needed by the user after receiving a large amount of query result data directly from the ECU, it can not only save the storage resources and computing resources of the diagnostic device, but also allow the diagnostic device to quickly and accurately query the query result data that meets the query conditions, thereby helping to improve the efficiency of the diagnostic device in querying the vehicle data actually needed. On the other hand, since the format of the query information is the SQL statement format, and the SQL selection statement supports query operations according to various conditions, the user can write the query information according to their own needs, so that the user's diverse query needs can be met.
[0020] A second aspect of an embodiment of the present application provides another vehicle data query method, which is applied to a diagnostic device and includes:
[0021] Receiving query information sent by the terminal device;
[0022] In response to the query information being in a SQL statement format, sending the query information to the vehicle gateway to trigger the vehicle gateway to execute any one of the methods in the first aspect above;
[0023] In response to receiving the query result data that meets the query condition sent by the vehicle gateway, the query result data that meets the query condition is sent to the terminal device.
[0024] A third aspect of the embodiments of the present application provides another vehicle data query method, the method comprising:
[0025] Receiving query information and query conditions sent by the diagnostic device, the query information includes a query object and a query index of the query object; the query object includes a structural part in the target vehicle, and the query index is a parameter of the queried structural part;
[0026] In response to the query information being in a message format, the query information is sent to a target ECU, and query result data fed back by the target ECU is received, the target ECU being the ECU corresponding to the query object;
[0027] The query result data that meets the query conditions is sent to the diagnostic device.
[0028] A fourth aspect of an embodiment of the present application provides an electronic device, which includes a memory and a processor. The memory stores a computer program that can be run on the processor. When the processor executes the computer program, the electronic device implements the steps of any vehicle data query method in the first aspect above.
[0029] A fifth aspect of an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is run, any vehicle data query method in the first aspect is executed.
[0030] A sixth aspect of an embodiment of the present application provides a computer-readable storage medium, comprising: a computer program stored therein, which, when executed by a processor, enables an electronic device to implement the steps of any vehicle data query method in the first aspect above.
[0031] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 This is a system architecture diagram of a vehicle data query method application provided by an embodiment of the present application;
[0034] Figure 2 It is a flowchart of a vehicle data query method provided by an embodiment of the present application;
[0035] Figure 3 It is a flowchart of another vehicle data query method provided by an embodiment of the present application;
[0036] Figure 4 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0037] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0038] Here are some concepts involved in this application:
[0039] Structured Query Language (SQL): In the embodiments of the present application, SQL is a standard language for relational databases. It is mainly used to communicate with relational databases and perform tasks such as data update and data retrieval. SQL provides a SELECT statement for data query, which has flexible usage and rich functions.
[0040] SQL selection statement (SELECT statement): In the embodiment of the present application, the SELECT statement is an important part of the SQL language and is used to select data from the database.
[0041] Electronic Control Unit (ECU): A large number of ECUs are integrated into the vehicle. The ECU can receive vehicle data (such as data from sensors on the vehicle) and process and utilize the vehicle data to achieve precise control of the vehicle's driving status and various functions.
[0042] Vehicle Gateway: In the embodiment of the present application, the vehicle gateway is a gateway on the vehicle, which is a key component of the internal network communication of the vehicle. It is responsible for coordinating data exchange, protocol conversion, fault diagnosis, etc. between different networks. The vehicle gateway can ensure that the entire internal network of the vehicle can operate efficiently by receiving, processing and forwarding data from different ECUs.
[0043] Domain Control Unit (DCU): In the embodiments of the present application, DCU is a key component in the modern automotive electronic architecture. The domain controller centrally manages the vehicle's ECU by integrating multiple sensors and controllers, thereby realizing intelligent control and management of the vehicle.
[0044] Diagnostic communication over Internet Protocol (DoIP) based on IP network: In the embodiment of the present application, the DoIP protocol is a communication protocol used in the automotive field, mainly used for vehicle diagnosis and transmission of related data. Through the DoIP protocol, efficient and reliable data interaction between the vehicle ECU and other devices can be achieved to perform operations such as fault diagnosis and software updates. DoIP connects to the ECU through a standard IP network for operations such as diagnosis, programming and configuration.
[0045] DoIP message: In the embodiment of the present application, the DoIP message is a data message used to implement the DoIP protocol. The external device or DoIP entity can send and receive DoIP messages, and the entity that receives the DoIP message will perform corresponding processing or response according to the content of the message.
[0046] Controller Area Network (CAN): In the present application, CAN is a serial communication protocol bus for real-time applications. The CAN protocol is the rules and standards for CAN bus communication, and the CAN protocol can be used as a communication protocol between various components in a car.
[0047] CAN message: In the embodiment of the present application, the CAN message is a data message transmitted on the CAN bus, which carries the information to be transmitted.
[0048] Unified Diagnostic Services (UDS): In the embodiment of the present application, the UDS protocol is an application layer protocol for vehicle diagnosis, which is oriented to all ECUs in the vehicle. The UDS protocol defines the diagnostic request, the message format of the diagnostic response, how the ECU handles the diagnostic request message, and the application of the diagnostic service. The UDS protocol can be applied on various automotive buses, for example, it can be applied on the CAN bus.
[0049] UDS message: In the embodiment of the present application, the UDS message is a specific implementation form of the UDS protocol in the actual communication process. The UDS message can be implemented based on the CAN message or the DoIP message.
[0050] Diagnostic request of UDS: In an embodiment of the present application, the diagnostic request of UDS may include a service identifier (Service ID, SID), a sub-function (Sub-function) and actual data. In practice, the diagnostic request of UDS varies according to the type of service. Among them, the sub-function is used to further refine the operation type of the service (such as start, stop, etc.). The diagnostic request of UDS must include SID, but not necessarily sub-services and actual data. Whether the diagnostic request of UDS contains sub-services and actual data depends on the specific required services and the request content.
[0051] SID: In the embodiment of the present application, SID is used to identify the requested service type. In the UDS protocol, each service has a unique service ID.
[0052] Actual data: In the embodiments of the present application, actual data is used to define the specific content or parameters of the service execution, and its specific content depends on the type of service requested and the parameters required by the service. For example, in some services, the actual data may include the data identifier (DID) to be read or written, the value of the data, or the parameters of the operation. Each DID corresponds to a specific data item of the vehicle, such as the engine speed, vehicle speed, oil temperature, voltage and other data items.
[0053] With the rapid development of technology, vehicles have become more intelligent and complex, and vehicle data has also increased dramatically. Among them, a large number of ECUs integrated in vehicles can collect various vehicle data, such as data from various sensors on the vehicle. Whether it is for vehicle repair, maintenance, management or other work, it is usually necessary to query vehicle data first.
[0054] In the related art, the vehicle data query is often completed by sending a request message for querying vehicle data to the ECU integrated in the vehicle through the diagnostic device, and then the ECU returns the vehicle data to the diagnostic device. However, in this method, the vehicle data obtained by the diagnostic device is often redundant. The vehicle data obtained by the diagnostic device not only covers the vehicle data actually required to be queried, but also contains a large amount of other vehicle data, which leads to low query efficiency for the vehicle data actually required.
[0055] In order to solve the above-mentioned technical problems existing in the related technologies, the vehicle gateway in the present application generates a request message based on the query information sent by the received diagnostic device, and sends the request message to the target ECU according to a preset period to receive the query result data fed back by the target ECU, so that the vehicle gateway only sends the query result data that meets the query conditions to the diagnostic device, wherein the format of the query information can be the structured query language SQL statement format.
[0056] On the one hand, since the diagnostic device only needs to send the query information to the vehicle gateway and wait for the vehicle gateway to return the query result data that meets the query conditions, compared with the related technology in which the diagnostic device needs to further determine whether the query result data belongs to the vehicle data actually needed by the user after receiving a large amount of query result data directly from the ECU, it can not only save the storage resources and computing resources of the diagnostic device, but also allow the diagnostic device to quickly and accurately query the query result data that meets the query conditions, thereby helping to improve the efficiency of the diagnostic device in querying the vehicle data actually needed.
[0057] On the other hand, since the query information is in the format of an SQL statement, and the SQL selection statement supports query operations based on various conditions, users can write query information based on their own needs, thus meeting the user's diverse query needs.
[0058] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0059] refer to Figure 1 , which is a system architecture diagram of a vehicle data query method application provided in an embodiment of the present application.
[0060] like Figure 1 As shown, the system architecture may include: a terminal device 101 , a diagnostic device 102 and a target vehicle 103 , and the target vehicle 103 may include: a vehicle gateway 1001 and a target ECU 1002 .
[0061] The diagnostic device 102 is connected to the terminal device 101 and the target vehicle 103 respectively through a network. The network may include various connection types, such as wired or wireless communication links or optical fiber cables.
[0062] The terminal device 101 may include, but is not limited to, a tablet computer, a smart phone, a laptop computer, a desktop computer, and other terminal devices that can be used to access the diagnostic device, and this embodiment does not specifically limit this. The user of the terminal device 101 may be a professional technician or other person, such as a car owner.
[0063] The diagnostic device 102 is a device that can be used to diagnose the target vehicle 103. The diagnostic device can receive the query information sent by the terminal device 101; in response to the query information being in the SQL statement format, send the query information to the vehicle gateway 1001; and in response to receiving the query result data sent by the vehicle gateway 1001, send the query result data to the terminal device 101.
[0064] The target vehicle 103 may be any vehicle, such as an unmanned vehicle, a car, a truck, etc. The target vehicle 101 may also be any other means of transportation, such as an airplane or a ship.
[0065] The vehicle gateway 1001 is a network device configured in the target vehicle 103 that can directly communicate with each ECU on the vehicle. The vehicle gateway 1001 can also be replaced by a domain controller. The vehicle gateway 1001 can receive query information sent by the diagnostic device, the query information includes the query object, the query index of the query object and the query condition, and the query information is in the format of the structured query language SQL statement format; generate a request message according to the query information; send a request message to the target electronic control unit ECU according to a preset period, and receive the query result data fed back by the target ECU; and send the query result data that meets the query condition to the diagnostic device. In this way, it is possible to quickly and accurately query the vehicle data actually needed.
[0066] The target ECU 1002 is the ECU corresponding to the query object. The target ECU 1002 can receive the request message sent from the vehicle gateway, and in response to receiving the request message, feed back the query result data to the vehicle gateway.
[0067] Understandably, Figure 1 This is just an example. In actual application, the system architecture of the vehicle data query method may include: Figure 1 The embodiments of the present application are not limited to more or fewer components shown.
[0068] See also Figure 2 , Figure 2 A flow chart of a vehicle data query method according to an embodiment of the present application is shown. Figure 2 The vehicle data query method shown includes the following steps 201 to 204:
[0069] It should be noted that in this embodiment, the execution subject of the vehicle data query method can be a vehicle gateway, a domain controller or other devices that can communicate with the ECU. In this embodiment, the execution subject of the vehicle data query method is a vehicle gateway as an example to illustrate the vehicle data query method.
[0070] Step 201 : The vehicle gateway receives query information sent by the diagnostic device.
[0071] The query information may include a query object, a query index of the query object, and a query condition. The query object may include a structural component in the target vehicle. The query index may be a parameter of the queried structural component. For example, the query object may include an engine, a transmission, etc. The query index may include voltage, speed, temperature, etc.
[0072] The format of the query information may be a structured query language SQL statement format.
[0073] When it is necessary to query a vehicle data that meets certain conditions, the user can send query information to the diagnostic device through the terminal device. After receiving the query information, the diagnostic device sends the query information to the vehicle gateway.
[0074] As an example, if you want to query the voltage data when the vehicle engine speed is greater than 3000, the query information can be: select voltage from engine where engine.rpm>3000. Among them, engine is the query object, voltage and engine.rpm are the query indicators of the query object, and engine.rpm>3000 is the query condition.
[0075] Step 202: The vehicle gateway generates a request message according to the query information.
[0076] The request message is used to request to query the query index of the above query object.
[0077] The request message may include a message ID and a diagnostic request of UDS. Among them, the message ID is used to indicate the ECU that receives the request message. The diagnostic request of UDS is used to instruct the ECU to perform specific diagnostic services. The diagnostic request of UDS may include SID, sub-functions and actual data. In practice, the diagnostic request of UDS varies according to the service type. Among them, the diagnostic request of UDS must include SID, but sub-services and actual data are optional. Whether the diagnostic request of UDS contains sub-services and actual data depends on the specific services required and the request content.
[0078] In a possible embodiment, the vehicle gateway can request the ECU to provide a "read data by ID" service to query the vehicle data. In this case, the SID in the request message can be determined as the SID corresponding to the "read data by ID" service: 0x22. At this time, the UDS diagnostic request can include the SID and actual data, and the actual data part includes: the DID corresponding to the data to be read. In other words, the UDS diagnostic request can include the SID corresponding to the "read data by ID" service: 0x22, and the DID corresponding to the data to be read. The following will always take the SID in the UDS diagnostic request as 0x22 as an example to illustrate the UDS diagnostic request.
[0079] Optionally, before the vehicle gateway generates the request message, the process may further include: the vehicle gateway searches for a target keyword in the query information, and extracts a query object and a query index of the query object from the query information based on the target keyword.
[0080] The target keyword is usually a pre-set keyword. As an example, the target keyword may be select, from, where, etc. The target keyword is usually set according to the syntax of the SQL selection statement, and the target keyword is related to the keyword in the SQL selection statement.
[0081] Each keyword in the SQL selection statement (i.e., SELECT statement) plays a different role, and each keyword corresponds to a clause. Among them, the clause corresponding to the keyword select in the SELECT statement can be called the select clause; the clause corresponding to the keyword from can be called the from clause; the clause corresponding to the keyword where can be called the where clause. Among them, the select clause is used to select data, the from clause is used to specify the data source of the query, the where clause is used to set the query conditions, and the field immediately following the where clause is the conditional expression. Therefore, the target keywords can include but are not limited to: select, from, and where.
[0082] In practice, the vehicle gateway may pre-store target keywords.
[0083] In some implementations, the vehicle gateway may extract the field immediately following from in the query information and determine it as the query object. The vehicle gateway may extract the field immediately following select and before from in the query information, and the entity in the conditional expression corresponding to where, and determine it as the query index of the query object. The vehicle gateway may extract the conditional expression corresponding to where in the query information and determine it as the query condition.
[0084] For example, if the query information is: select voltage from engine where engine.rpm>3000, then engine is the query object, voltage and engine.rpm are query indicators of the query object, and engine.rpm>3000 is the query condition.
[0085] In some optional implementations of this embodiment, the vehicle gateway may generate a request message according to the query information through the following steps 1 and 2:
[0086] In step one, the vehicle gateway determines a first identifier corresponding to the query object according to a first mapping relationship, and determines a second identifier corresponding to the query index according to a second mapping relationship.
[0087] The first mapping relationship is used to describe the corresponding relationship between the query object and the identifier (ID), and the second mapping relationship is used to describe the corresponding relationship between the query index and the identifier. The identifier is a symbol used to identify each ECU and each data item, and the identifier is usually pre-set.
[0088] The first identifier is a symbol that can be used to uniquely identify the query object, and the second identifier is a symbol that can be used to uniquely identify the query indicator.
[0089] In practice, the first mapping relationship and the second mapping relationship may be pre-stored in the vehicle gateway.
[0090] In a possible specific embodiment, after obtaining the query information, the vehicle gateway can determine the query object and the query index in the query information. Then the vehicle gateway can compare the query object with the first mapping relationship to determine the first identifier corresponding to the query object; and compare the query index with the second mapping relationship to determine the second identifier corresponding to the query index.
[0091] Step 2: The vehicle gateway combines the first identifier with the second identifier to generate a request message.
[0092] Here, when the SID in the UDS diagnostic request is determined as the SID (0x22) corresponding to the service of "read data through ID", the vehicle gateway only needs to determine the message ID and DID to determine the request message.
[0093] After determining the first identifier and the second identifier, the vehicle gateway may determine the first identifier as the message ID of the request message and the second identifier as the DID in the diagnostic request of the UDS. The vehicle gateway may then combine the first identifier and the second identifier to obtain the request message.
[0094] As an example, if you want to query the voltage data when the vehicle engine speed is greater than 3000, the query information is select voltage from engine where engine.rpm>3000, then the first identifier can be the ID of the ECU corresponding to the engine (engine), and the second identifier can include the ID corresponding to the speed (engine.rpm) and the ID corresponding to the voltage (voltage). In this case, the message ID of the request message can be the ID of the ECU corresponding to the engine, indicating that data is to be obtained from the ECU corresponding to the vehicle engine. The DID of the request message can be the ID corresponding to the speed and the ID corresponding to the voltage, indicating that data on the speed and voltage are to be obtained.
[0095] The vehicle gateway may combine the first identifier and the second identifier according to a preset encapsulation format.
[0096] Optionally, the request message can be implemented based on a CAN message or a DoIP message. When the request message is implemented based on a CAN message, the request message can be encapsulated in a CAN message and transmitted through the vehicle's internal bus (CAN bus). At this time, the format of the request message can be referred to as a first encapsulation format, and the first encapsulation format is a CAN message format. When the request message is implemented based on a DoIP message, the request message can be encapsulated in a DoIP message for transmission. At this time, the format of the request message can be referred to as a second encapsulation format, and the second encapsulation format is a DoIP message format.
[0097] Therefore, the preset encapsulation format may be the first encapsulation format or the second encapsulation format, that is, the vehicle gateway may combine the first identifier and the second identifier according to the first encapsulation format or the second encapsulation format to generate a request message. In practical applications, the vehicle gateway may select a more appropriate encapsulation format to combine the first identifier and the second identifier to generate a request message in combination with the current network environment. In this way, the vehicle gateway can respond to different scenario requirements more flexibly.
[0098] Step 203: The vehicle gateway sends a request message to the target ECU according to a preset period, and receives query result data fed back by the target ECU.
[0099] Among them, the target ECU is the ECU corresponding to the query object.
[0100] Here, the preset period is usually a period pre-set according to actual needs. The query result data is data generated by the target ECU in response to the request message. The query result data may include a specific value of the query indicator corresponding to the query object.
[0101] In some possible implementations, the vehicle gateway sending a request message to the target ECU may include:
[0102] If the format of the request message is the first encapsulation format, the vehicle gateway sends the request message to the target ECU through the vehicle internal bus, and the first encapsulation format is the CAN message format;
[0103] If the format of the request message is the second encapsulation format, the vehicle gateway sends the request message to the target ECU through the DoIP protocol, and the second encapsulation format is the DoIP message format.
[0104] Here, the vehicle gateway can send the request message to the target ECU in different ways according to the format of the request message, so that the target ECU can respond to the request message after receiving the request message and feed back the query result data to the vehicle gateway. In this way, it can respond to different situations more flexibly.
[0105] In step 204 , the vehicle gateway sends the query result data satisfying the query condition to the diagnostic device.
[0106] Here, the vehicle gateway may determine whether the currently received query result data meets the query condition according to the query condition each time after receiving the query result data fed back by the target ECU.
[0107] For example, when the voltage data when the vehicle engine speed is greater than 3000 is to be queried, and the query information is selectvoltage from engine where engine.rpm>3000, if the query result data received by the vehicle gateway includes a speed of 2500 revolutions per minute and a voltage of 13 volts, then it can be considered that the query result data currently received by the vehicle gateway does not meet the query condition. If the query result data received by the vehicle gateway includes a speed of 3000 revolutions per minute and a voltage of 14 volts, then it can be considered that the query result data currently received by the vehicle gateway meets the query condition.
[0108] In some embodiments, the vehicle gateway sends the query result data satisfying the query condition to the diagnostic device, which may include: the vehicle gateway sends the query result data satisfying the query condition to the diagnostic device in response to satisfying a preset stop condition.
[0109] Optionally, the above-mentioned preset stop condition may include: the vehicle gateway receives a stop query instruction from the diagnostic device.
[0110] Among them, the stop query instruction is used to instruct the vehicle gateway to stop sending request messages to the target ECU.
[0111] In practice, the stop query instruction can be input by the user on the terminal device, sent to the diagnostic device through the terminal device, and then sent to the vehicle gateway by the diagnostic device.
[0112] In a possible scenario, the vehicle gateway may store the query result data that meets the query condition before receiving the stop query instruction in the memory. Until the vehicle gateway receives the stop query instruction from the diagnostic device, the vehicle gateway responds to the stop query instruction and sends all the query result data that meets the query condition to the diagnostic device.
[0113] In this embodiment, when the vehicle gateway receives the stop query instruction from the diagnostic device, it sends the query result data that meets the query conditions to the diagnostic device. In this way, the network resource loss caused by frequent data transmission between the vehicle gateway and the diagnostic device can be saved.
[0114] Optionally, the above-mentioned preset stop condition may also include: the vehicle gateway receives query result data that meets the query condition.
[0115] Here, whenever the vehicle gateway receives query result data that meets the query condition, the vehicle gateway can send the query result data that meets the query condition to the diagnostic device. In this way, the vehicle gateway can return the query result data that meets the query condition to the diagnostic device in a timely manner.
[0116] In the embodiment of the present application, the vehicle gateway generates a request message according to the query information sent by the received diagnostic device, and sends the request message to the target ECU according to the preset period to receive the query result data fed back by the target ECU, so that the vehicle gateway only sends the query result data that meets the query conditions to the diagnostic device. On the one hand, since the diagnostic device only needs to send the query information to the vehicle gateway and wait for the vehicle gateway to return the query result data that meets the query conditions, compared with the related art that the diagnostic device needs to further determine whether the query result data belongs to the vehicle data actually needed by the user after receiving a large amount of query result data directly from the ECU, it can not only save the storage resources and computing resources of the diagnostic device, but also allow the diagnostic device to quickly and accurately query the query result data that meets the query conditions, thereby helping to improve the efficiency of the diagnostic device to query the vehicle data actually needed. On the other hand, since the format of the query information is the SQL statement format, and the SQL selection statement supports query operations according to various conditions, the user can write the query information according to their own needs, so as to meet the diverse query needs of the user.
[0117] Please continue reading Figure 3 , Figure 3The implementation flow chart of another vehicle data query method provided by an embodiment of the present application is shown. The vehicle data query method in this embodiment is applied to a diagnostic device and may include the following steps 301 to 302:
[0118] It should be pointed out that, in this embodiment, the execution subject of the vehicle data query method is a diagnostic device, that is, in this embodiment, the vehicle data query method is explained from the perspective of the diagnostic device.
[0119] Step 301: The diagnostic device receives query information sent by the terminal device.
[0120] The query information may be in the form of a SQL statement.
[0121] At this time, the query information may include a query object, a query index of the query object, and a query condition. The query object may include a structural component in the target vehicle. The query index may be a parameter of the queried structural component.
[0122] In practice, when a certain vehicle data needs to be queried, the user can input the query information on the terminal device, and then the terminal device sends the query information to the diagnostic device.
[0123] Step 302 : In response to the query information being in the SQL statement format, the diagnostic device sends the query information to the vehicle gateway.
[0124] Here, the diagnostic device sends query information to the vehicle gateway to trigger the vehicle gateway to execute the various vehicle data query methods with the vehicle gateway as the execution subject. Then the diagnostic device can wait to receive the query result data sent by the vehicle gateway that meets the query conditions.
[0125] It should be noted that the execution steps, relevant principles and beneficial effects of various vehicle data methods with the vehicle gateway as the execution subject can be referred to the previous description of the relevant content and will not be repeated here.
[0126] Step 303 , in response to receiving the query result data satisfying the query condition sent by the vehicle gateway, the diagnostic device sends the query result data satisfying the query condition to the terminal device.
[0127] In this embodiment, the user can send query information to the diagnostic device through the terminal device, and then the diagnostic device sends the query information to the vehicle gateway, triggering the vehicle gateway to execute the aforementioned various vehicle data query methods with the vehicle gateway as the execution subject, and then the diagnostic device can send the query result data that meets the query conditions to the terminal device, so that the user can view the query result data that meets the query conditions on the terminal device. In this embodiment, the diagnostic device can break the limitation of the physical distance between the user and the target vehicle, so that the user can accurately query the vehicle data actually needed.
[0128] As another optional embodiment of the present application, the vehicle data query method can also be implemented through the following first to third steps:
[0129] In the first step, the vehicle gateway receives the query information and query conditions sent by the diagnostic device.
[0130] Here, the query information may include: a query object and a query index of the query object. The query object may include a structural component in the target vehicle, and the query index may be a parameter of the queried structural component.
[0131] The format of the query information may be a preset message format. It is understandable that the preset message format refers to a message format that can be recognized and processed by the ECU. The preset message format usually follows a specific communication protocol or standard so that effective communication can be performed between ECUs and between ECU and other devices. Exemplarily, the preset message format may be a CAN message format, a DoIP format, or other message formats.
[0132] In the second step, the vehicle gateway responds to the query information in a preset message format, sends the query information to the target ECU, and receives the query result data fed back by the target ECU.
[0133] Among them, the target ECU is the ECU corresponding to the query object.
[0134] In the third step, the vehicle gateway sends the query result data that meets the query conditions to the diagnostic device.
[0135] After receiving the query result data fed back by the target ECU, the vehicle gateway can determine whether the query result data meets the query condition according to the query condition. Then, the vehicle gateway can send the query result data that meets the query condition to the diagnostic device.
[0136] It should be noted that this embodiment has Figure 2 The corresponding parts of the corresponding embodiments, and the relevant description of some steps can refer to the above Figure 2 The corresponding embodiment part will not be described in detail here.
[0137] In this embodiment, when the query information format is a preset message format, the vehicle gateway can directly send the query information to the target ECU and receive the query result data fed back by the target ECU, and then the vehicle gateway sends the query result data that meets the query conditions to the diagnostic device. In this way, the data that the user actually needs to query can also be accurately sent to the diagnostic device.
[0138] An embodiment of the present application provides a computer program product. When the computer program product runs on a vehicle gateway or a domain controller, the vehicle gateway or the domain controller can implement the steps in the above-mentioned various method embodiments.
[0139] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0140] 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.
[0141] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0142] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0143] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0144] In addition, in the description of the present specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish descriptions, and cannot be understood as indicating or implying relative importance. It should also be understood that although the terms "first", "second", etc. are used to describe various elements in some embodiments of the present application in the text, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, the first table can be named as the second table, and similarly, the second table can be named as the first table without departing from the scope of the various described embodiments. The first table and the second table are both tables, but they are not the same table.
[0145] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0146] The vehicle data query method provided in the embodiment of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, laptops, industrial computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.
[0147] Figure 4 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 4 As shown, the electronic device 400 of this embodiment includes: at least one processor 402 ( Figure 4 Only one is shown in the figure), a memory 401, in which a computer program 403 that can be run on a processor 402 is stored. When the processor 402 executes the computer program 403, the steps in the above-mentioned vehicle data query method embodiments are implemented, such as Figure 2 Or Figure 3 Alternatively, when the processor 402 executes the computer program 403, the functions of each module / unit in the above-mentioned device embodiments are implemented.
[0148] The electronic device 400 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a memory 401 and a processor 402. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 400 and does not constitute a limitation of the electronic device 400. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include an input sending device, a network access device, a bus, etc.
[0149] The processor 402 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.
[0150] In some embodiments, the processor 402 may be an internal storage unit of the electronic device 400, such as a hard disk or memory of the electronic device 400. The processor 402 may also be an external storage device of the electronic device 400, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 400. Further, the processor 402 may also include both an internal storage unit of the electronic device 400 and an external storage device. The processor 402 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program, etc. The processor 402 may also be used to temporarily store data that has been sent or is to be sent.
[0151] In addition, those skilled in the art 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. In actual applications, the above-mentioned functions can be assigned to 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 in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0152] An embodiment of the present application also provides an electronic device, which includes at least one memory, at least one processor, and a computer program stored in the at least one memory and executable on the at least one processor. When the processor executes the computer program, the electronic device implements the steps of any of the above-mentioned method embodiments.
[0153] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0154] An embodiment of the present application provides another computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments.
[0155] An embodiment of the present application also provides a chip system, which includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps in the above-mentioned method embodiments.
[0156] 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. Computer-readable storage media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0157] 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.
[0158] 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.
[0159] 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.
[0160] The above embodiments 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, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These 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 data query method, characterized in that: include: Receive query information sent by the diagnostic device, the query information including a query object, a query index of the query object and a query condition, the query object including a structural part in a target vehicle, the query index being a parameter of the queried structural part, and the format of the query information being a structured query language SQL statement format; Generate a request message according to the query information, where the request message is used to query the query index of the query object; Sending the request message to a target electronic control unit ECU according to a preset period, and receiving query result data fed back by the target ECU, the target ECU being the ECU corresponding to the query object; The query result data satisfying the query condition is sent to the diagnostic device.
2. The vehicle data query method according to claim 1, characterized in that: The step of generating a request message according to the query information includes: Determine a first identifier corresponding to the query object according to a first mapping relationship, and determine a second identifier corresponding to the query index according to a second mapping relationship, wherein the first mapping relationship is used to describe the correspondence between the query object and the identifier, and the second mapping relationship is used to describe the correspondence between the query index and the identifier; The first identifier and the second identifier are combined to generate the request message.
3. The vehicle data query method according to claim 1, characterized in that: The sending the query result data satisfying the query condition to the diagnostic device includes: In response to satisfying a preset stop condition, query result data satisfying the query condition is sent to the diagnostic device.
4. The vehicle data query method according to claim 3, characterized in that: The preset stop condition includes: receiving a stop query instruction of the diagnostic device, or receiving query result data that meets the query condition.
5. The vehicle data query method according to claim 1, characterized in that: Before generating the request message, the method includes: The target keyword in the query information is searched, and the query object and the query index of the query object are extracted from the query information based on the target keyword.
6. The vehicle data query method according to any one of claims 1 to 5, characterized in that: The sending of a request message to a target electronic control unit ECU comprises: If the format of the request message is a first encapsulation format, sending the request message to the target ECU via the vehicle internal bus, wherein the first encapsulation format is a controller area network (CAN) message format; If the format of the request message is the second encapsulation format, the request message is sent to the target ECU via the diagnostic communication DoIP protocol based on the IP network, and the second encapsulation format is the DoIP message format.
7. A vehicle data query method, characterized in that: Applied to diagnostic equipment, the method comprises: Receiving query information sent by the terminal device; In response to the query information being in a SQL statement format, sending the query information to a vehicle gateway to trigger the vehicle gateway to execute the method as described in any one of claims 1 to N; In response to receiving the query result data that meets the query condition and is sent by the vehicle gateway, the query result data that meets the query condition is sent to the terminal device.
8. A vehicle data query method, characterized in that: The method comprises: Receiving query information and query conditions sent by the diagnostic device, wherein the query information includes a query object and a query index of the query object; the query object includes a structural part in the target vehicle, and the query index is a parameter of the queried structural part; In response to the query information being in a message format, sending the query information to a target ECU, and receiving query result data fed back by the target ECU, the target ECU being the ECU corresponding to the query object; The query result data satisfying the query condition is sent to the diagnostic device.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented, or the steps of the method according to claim 7 or 8 are implemented.
10. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the method according to any one of claims 1 to 6 to be executed, or enables the method according to claim 7 or 8 to be executed.
Citation Information
Cited By
JSON-based vehicle diagnosis method and related device
CN120686773A