Multi-system data stream selection method and device, equipment and storage medium
Through multi-threaded scanning and mutual exclusion list management, the mutual exclusion problem in the selection of multi-system data streams on multiple CAN buses is solved, the user experience and data refresh stability is improved, and the normal selection of multi-system data streams is ensured.
Patent Information
- Application Number
- CN202411422901.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-10-11
AI Technical Summary
When using diagnostic equipment to diagnose a car, there may be mutually exclusive conditions for multi-system data flow selection of multiple CAN buses, resulting in abnormal communication of CAN buses, failed refreshing or untimely data. There is a problem that cannot be accessed simultaneously when users need to select the system. .
By scanning the vehicle electronic controllers on the local area network bus of all controllers of the target vehicle through multi-threading, reading system information and data flow information, determining whether there is a mutually exclusive, if there is a system ID, add the system ID to the mutually exclusive list, based on the system information and data flow Information sets the total number of data streams, the maximum number of optional systems and the maximum number of optional data streams of each system, determines the bus mutual exclusion value of the vehicle electronic controller, and after receiving the user's data stream selection instruction, the target data stream and mutual selection are determined by the user. Exclusion list determines the currently optional data stream to avoid selecting a mutex system.
It effectively avoids the risk of choosing a mutually exclusive system when viewing multiple system data streams, improves user experience, and ensures timely data refresh and communication stability.
Smart Images

Figure CN119225344A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle technology, and in particular to a multi-system data stream selection method, device, equipment and storage medium. Background Art
[0002] The OBD (On-Board Diagnostics) interface is an important diagnostic interface on the car, which is used to connect diagnostic tools to read the vehicle's data stream and fault codes. At present, when using diagnostic equipment to diagnose a car, it may be necessary to view the data streams of multiple systems. If the vehicle has multiple CAN (Controller Area Network) buses, there may be mutual exclusion, so the selection of multiple system data streams on multiple CAN buses is usually restricted. As a result, when refreshing multiple system data streams, different ECU (Electronic Control Unit) data streams refresh and simultaneously select the system ECU refresh on two mutually exclusive CAN buses, which will cause CAN bus communication abnormalities, refresh failure, or switching systems back and forth, resulting in untimely refresh data, and then prompting the user that the selected system cannot be accessed at the same time.
[0003] In summary, how to avoid selecting mutually exclusive systems when viewing data streams of multiple systems and improve user experience is an issue that needs to be addressed urgently. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a multi-system data stream selection method, device, equipment and storage medium, which can avoid selecting mutually exclusive systems when viewing data streams of multiple systems and improve the user experience. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a multi-system data stream selection method, comprising:
[0006] Scanning all vehicle electronic controllers on the controller area network bus of the target vehicle by using multithreading, and reading system information and data flow information corresponding to the vehicle electronic controllers;
[0007] Determine whether the vehicle electronic controller on the same CAN bus of the target vehicle is mutually exclusive, and if so, add the system ID of the target system whose system is mutually exclusive with the vehicle electronic controller on the same CAN bus to the target mutual exclusion list;
[0008] Setting the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams for each system based on the system information and the data stream information, and determining a bus mutual exclusion value of the vehicle electronic controller;
[0009] When receiving a data stream selection instruction from the user, the mutually exclusive system is determined according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller and the target mutual exclusion list, and the currently selectable data stream is determined based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams for each system, so that the user can select multi-system data streams through the currently selectable data streams.
[0010] Optionally, the system information includes a system name, a system abbreviation, and a system ID; the data flow information includes a name of the data flow and a unit of the data flow.
[0011] Optionally, determining the bus mutual exclusion value of the vehicle electronic controller includes:
[0012] The bus mutual exclusion value of the vehicle electronic controller is determined according to the number of the controller area network buses of the target vehicle and the mutual exclusion relationship between the controller area network buses.
[0013] Optionally, determining the bus mutual exclusion value of the vehicle electronic controller according to the number of the controller area network buses of the target vehicle and the mutual exclusion relationship between the controller area network buses includes:
[0014] Determining the number of mutually exclusive relationships of the controller area network bus supported by the communication link of the target vehicle;
[0015] The bus mutual exclusion value of the vehicle electronic controller is determined according to the number of routes and the number of the controller area network buses of the target vehicle.
[0016] Optionally, determining the mutual exclusion system according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller and the target mutual exclusion list includes:
[0017] Determine a user selected system corresponding to the target data stream, determine an unselected system based on the user selected system, and determine a bus mutex value of the user selected system based on a bus mutex value of the vehicle electronic controller;
[0018] Determining whether the bus mutual exclusion value of the unselected system is equal to the bus mutual exclusion value of the user selected system;
[0019] If they are not equal, and the AND value of the bus mutual exclusion value of the unselected system and the bus mutual exclusion value of the user selected system is equal to 0, then the unselected system is determined as the mutually exclusive system of the user selected system;
[0020] If they are equal, determining whether there is a system ID corresponding to the unselected system in the target mutually exclusive list;
[0021] The mutually exclusive system is determined according to a result of judging whether there is a system ID corresponding to the unselected system in the target mutually exclusive list.
[0022] Optionally, determining the mutually exclusive system according to a result of judging whether there is a system ID corresponding to the unselected system in the target mutually exclusive list includes:
[0023] If the system ID corresponding to the unselected system exists in the target mutually exclusive list, the unselected system is determined as a mutually exclusive system of the user selected system;
[0024] If the system ID corresponding to the unselected system does not exist in the target mutually exclusive list, it is determined that the unselected system is not a mutually exclusive system of the user-selected system.
[0025] Optionally, the determining the currently selectable data stream based on the mutually exclusive systems, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams of each system includes:
[0026] Setting the mutually exclusive system corresponding to the target data stream to a first system enable;
[0027] Determine the second system enablement and data stream enablement corresponding to the target data stream according to the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams of each system;
[0028] The currently unselectable data stream is page-marked through the first system enable, the second system enable and the data stream enable, so that the user can determine the currently selectable data stream based on the corresponding page mark.
[0029] In a second aspect, the present application discloses a multi-system data stream selection device, comprising:
[0030] An information reading module, used to scan the vehicle electronic controllers on all controller area network buses of the target vehicle using multithreading, and read the system information and data stream information corresponding to the vehicle electronic controllers;
[0031] a mutual exclusion judgment module, used for judging whether there is mutual exclusion between the vehicle electronic controller on the same controller area network bus of the target vehicle, and if there is mutual exclusion, adding the system ID of the target system whose system is mutually exclusive with the vehicle electronic controller on the same controller area network bus to the target mutual exclusion list;
[0032] a setting module, configured to set the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams of each system based on the system information and the data stream information, and determine a bus mutual exclusion value of the vehicle electronic controller;
[0033] A data stream selection module is used to determine a mutually exclusive system based on the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller and the target mutual exclusion list when receiving a data stream selection instruction from the user, and determine the current selectable data stream based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams for each system, so that the user can select multiple system data streams through the current selectable data streams.
[0034] In a third aspect, the present application discloses an electronic device, comprising:
[0035] Memory, used to store computer programs;
[0036] The processor is used to execute the computer program to implement the aforementioned multi-system data stream selection method.
[0037] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned multi-system data stream selection method is implemented.
[0038] When performing multi-system data stream selection, the present application first uses multi-threading to scan the vehicle electronic controllers on all controller area network buses of the target vehicle, and reads the system information and data stream information corresponding to the vehicle electronic controllers; then determines whether there is mutual exclusion among the vehicle electronic controllers on the same controller area network bus of the target vehicle, and if there is mutual exclusion, adds the system ID of the target system whose system is mutually exclusive with the vehicle electronic controller on the same controller area network bus to the target mutual exclusion list; sets the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system based on the system information and data stream information, and determines the bus mutual exclusion value of the vehicle electronic controller; upon receiving a data stream selection instruction from a user, determines the mutually exclusive system according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller, and the target mutual exclusion list, and determines the currently selectable data stream based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system, so that the user can select multiple system data streams through the currently selectable data streams. It can be seen that when the present application performs multi-system data stream selection, it first uses multi-threading to scan the vehicle electronic controllers on all controller area network buses of the target vehicle, and reads the system information and data stream information corresponding to the vehicle electronic controllers, so as to determine the system controlled by each vehicle electronic controller and the data stream corresponding to the system; then it is determined whether there is mutual exclusion among the vehicle electronic controllers on the same controller area network bus of the target vehicle; if there is mutual exclusion, the system ID of the target system whose system is mutually exclusive with the corresponding vehicle electronic controller on the same controller area network bus is added to the target mutual exclusion list, so as to obtain the mutual exclusion relationship among the systems controlled by each vehicle electronic controller on the same controller area network bus; based on the system information and The data stream information sets the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system, so as to avoid the user selecting too many data streams or systems when selecting multi-system data streams, and then determines the bus mutual exclusion value of the vehicle electronic controller, so that when the user's data stream selection instruction is received, the mutually exclusive system is determined according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller, and the target mutual exclusion list, and the currently selectable data stream is determined based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system, so that the user can select multi-system data streams through the currently selectable data streams, avoiding the user from selecting mutually exclusive systems when viewing the data streams of multiple systems, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0040] Figure 1 A flow chart of a multi-system data stream selection method disclosed in this application;
[0041] Figure 2 This is a schematic diagram of the structure of a multi-system data stream selection device disclosed in this application;
[0042] Figure 3 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0043] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0044] At present, when using diagnostic equipment to diagnose a car, it may be necessary to view the data streams of multiple systems. If the vehicle has multiple CAN buses, there may be mutual exclusion. Therefore, the selection of multiple system data streams of multiple CAN buses is usually restricted, resulting in different ECU data streams refreshing when refreshing multiple system data streams. The system ECU refresh on two mutually exclusive CAN buses will be selected at the same time, which will cause CAN bus communication abnormalities, refresh failure, or switching systems back and forth, resulting in untimely refresh data, and then prompting the user that the selected system cannot be accessed at the same time. In order to solve the above technical problems, the present application discloses a multi-system data stream selection method, which can avoid selecting mutually exclusive systems when viewing the data streams of multiple systems, thereby improving the user experience.
[0045] See also Figure 1 As shown, an embodiment of the present invention discloses a multi-system data stream selection method, including:
[0046] Step S11, using multithreading to scan all vehicle electronic controllers on the controller area network bus of the target vehicle, and reading the system information and data flow information corresponding to the vehicle electronic controllers.
[0047] In this embodiment, the vehicle OBD interface usually has 16 pins, and most modern cars adopt the OBD II standard, which specifies the definition and use of 16 pins. These pins are used to transmit data, provide power, and perform vehicle diagnosis. For example, pins 2, 3, 6, 8, 10, 11, 12, 13, and 14 are used for CAN bus communication, including CAN-H (high voltage signal in the dominant state) and CAN-L (low voltage signal in the dominant state), and SAE (Society of Automotive Engineers) J1850 (an automotive communication protocol standard) bus communication. Before selecting multiple system data streams, first use multi-threading to scan the vehicle electronic controllers on all controller area network buses of the target vehicle, that is, use multi-threading to scan the system ECUs on all CAN buses of the vehicle to be diagnosed, so as to determine which system ECUs are on each CAN bus, and then read the system information and data stream information corresponding to the vehicle electronic controller, that is, to determine which data streams are controlled by each system ECU. The system information includes the system name, system abbreviation, and system ID (Identity document), and the data flow information includes the name of the data flow and the unit of the data flow.
[0048] Step S12, determining whether there is mutual exclusion between the vehicle electronic controllers on the same CAN bus of the target vehicle; if there is mutual exclusion, adding the system ID of the target system on the same CAN bus that is mutually exclusive with the vehicle electronic controller to the target mutual exclusion list.
[0049] In this embodiment, there may be multiple vehicle electronic controllers on the same CAN bus, and there may be mutually exclusive relationships between the systems corresponding to different vehicle electronic controllers. When the data stream of a certain system is selected, the data stream of its mutually exclusive system is not allowed to be selected. Therefore, it is necessary to determine whether there is mutual exclusion between the vehicle electronic controllers on the same controller LAN bus of the target vehicle. If there is mutual exclusion between different vehicle electronic controllers on the same CAN bus, the system ID of the target system that is mutually exclusive with the system corresponding to each ECU on the same CAN bus is added to the target mutual exclusion list of the system. That is, if there are four ECUs on a certain CAN bus, corresponding to systems A, B, C, and D respectively, and A is mutually exclusive with C and D, A is not mutually exclusive with B, B is mutually exclusive with C and D, A is not mutually exclusive with B, and C is not mutually exclusive with D, then C and D are called target systems mutually exclusive with A, C and D are called target systems mutually exclusive with B, A and B are called target systems mutually exclusive with C, and A and B are called target systems mutually exclusive with D, and the system ID of C and the system ID of D are added to the target mutually exclusive list of A. Similarly, the target mutually exclusive list corresponding to B, C, and D can be determined, wherein the target mutually exclusive list of B includes the system ID of C and the system ID of D, the target mutually exclusive list of C includes the system ID of A and the system ID of B, and the target mutually exclusive list of D includes the system ID of A and the system ID of B.
[0050] Step S13: setting the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams for each system based on the system information and the data stream information, and determining the bus mutual exclusion value of the vehicle electronic controller.
[0051] In this embodiment, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams of each system are set based on system information and data stream information to avoid the user from selecting too many data streams or systems when selecting multi-system data streams. Then, the bus mutual exclusion value of the vehicle electronic controller is determined. Among them, the bus mutual exclusion value of the vehicle electronic controller is determined based on the number of controller area network buses of the target vehicle and the mutual exclusion relationship of each controller area network bus. The mutual exclusion value is represented by a 32-bit integer, that is, the mutual exclusion relationship of a maximum of 32 CAN buses is supported.
[0052] In this embodiment, the specific process of determining the bus mutual exclusion value of the ECU according to the number of CAN buses of the target vehicle and the mutual exclusion relationship of each CAN bus may include: determining the number of channels that the communication link of the target vehicle supports the mutual exclusion relationship of the CAN buses; determining the bus mutual exclusion value of the vehicle electronic controller according to the number of channels and the number of CAN buses of the target vehicle. If the communication link of the target vehicle only supports one CAN bus for communication, the bus mutual exclusion value of each CAN bus is set to 1 with 1 bit and the other bits are 0, such as 0x01. When the communication link of the target vehicle supports multiple channels of the mutual exclusion relationship of the CAN bus, if the CAN bus is a parallel physical line, its bus mutual exclusion value is at least all lines in position 1, and more parallel physical lines are n more than the bit value. For example, pin 6 and pin 14 support parallel communication with other lines, and their bus mutual exclusion value is set to 0x0F (all systems are less than or equal to 4 channels, and if more than 4 channels can start from 0xFF). If there are more independent physical CANs, it can be increased according to the increase of parallel physical lines, such as 0xFF for maximum support of 8 channels, 0xFFF for maximum support of 12 channels, and 0xFFFF for maximum support of 16 parallel communication. At the same time, the bus mutual exclusion value of other CAN buses that do not support multi-channel communication only allows one position 1, and the set 1 bits of different lines are in different positions. For example, the bus mutual exclusion value of pin 3 and pin 11 is 0x01, and pin 1 and pin 9 are 0x02. See the example below for details.
[0053] Line 1 pin 6 and pin 14 have system S1, S2, S3, among which S2 and S3 are mutually exclusive. When supporting multi-channel communication, ml_mutex=0x0F, and when supporting single channel, ml_mutex=0x04. In the following example, line 1 takes multi-channel support as an example; line 2 pin 3 and pin 11 have system S4, S5, S6, S7, S8, S9, among which S4, S5, S6 are mutually exclusive, S7, S8, S9 are mutually exclusive but not mutually exclusive with S4, S5, S6, ml_mutex=0x01; line 3 pin 1 and pin 9 have system S10 and S11, which are not mutually exclusive, ml_mutex=0x02. The specific configuration is as follows:
[0054] "{ sys_id":"S1_ID"", sys_name":"S1","sys_abbr":"","sys_type":X,"ml_mutex":15,...};
[0055] {"sys_id":"S2_ID","sys_name":"S2","sys_abbr":"","sys_type":X,";
[0056] ml_mutex”:15,"sys_mutex":["S3_ID"],...};
[0057] {“sys_id”:”S3_ID”,“sys_name”:”S3”,”sys_abbr”:””,”sys_type”:X,”;
[0058] ml_mutex”:15,"sys_mutex":["S2_ID"],...};
[0059] “{ sys_id”:”S4_ID”“, sys_name”:”S4”,”sys_abbr”:””,”sys_type”:X,”ml_mutex”:1,”;
[0060] sys_mutex”:["S5_ID","S6_ID"],...};
[0061] “{ sys_id”:”S5_ID”“, sys_name”:”S5”,”sys_abbr”:””,”sys_type”:X,”ml_mutex”:1,”;
[0062] sys_mutex”:["S4_ID","S6_ID"],...};
[0063] “{ sys_id”:”S6_ID”“, sys_name”:”S6”,”sys_abbr”:””,”sys_type”:X,”ml_mutex”:1,”;
[0064] sys_mutex”:["S4_ID","S5_ID"],...};
[0065] “{ sys_id”:”S7_ID”“, sys_name”:”S7”,”sys_abbr”:””,”sys_type”:X,”ml_mutex”:1,”;
[0066] sys_mutex”:["S8_ID","S9_ID"],...};
[0067] “{ sys_id”:”S8_ID”“, sys_name”:”S8”,”sys_abbr”:””,”sys_type”:X,”ml_mutex”:1,”;
[0068] sys_mutex":["S7_ID","S9_ID"],...};
[0069] "{ sys_id":"S9_ID"", sys_name":"S9","sys_abbr":"","sys_type":X,"ml_mutex":1,";
[0070] sys_mutex":["S7_ID","S8_ID"],...};
[0071] {"sys_id":"S10_ID","sys_name":"S10","sys_abbr":"","sys_type":X,";
[0072] ml_mutex":2,...};
[0073] {"sys_id":"S11_ID","sys_name":"S11","sys_abbr":"","sys_type":X,";
[0074] ml_mutex':2,...}.
[0075] The above code is the specific configuration process for line 1, line 2, and line 3.
[0076] Step S14: upon receiving a data stream selection instruction from the user, determining a mutually exclusive system according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller, and the target mutual exclusion list; determining a currently selectable data stream based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system, so that the user can select a multi-system data stream through the currently selectable data stream.
[0077] In this embodiment, when receiving the data stream selection instruction of the user, the mutually exclusive system will be determined according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller and the target mutual exclusion list. In the process of determining the mutually exclusive system, the target data stream selected by the user is first determined based on the data stream selection instruction, and then the user selected system corresponding to the target data stream is determined, and the unselected system is determined according to the user selected system, and then the bus mutual exclusion value of the user selected system and the bus mutual exclusion value of the unselected system are determined based on the bus mutual exclusion value of each ECU; it is judged whether the bus mutual exclusion value of the unselected system is equal to the bus mutual exclusion value of the user selected system; if the bus mutual exclusion value of the unselected system is not equal to the bus mutual exclusion value of the user selected system, and the sum of the bus mutual exclusion value of the unselected system and the bus mutual exclusion value of the user selected system is equal to 0, then the unselected system is determined as the mutually exclusive system of the user selected system; if the bus mutual exclusion value of the unselected system is not equal to the bus mutual exclusion value of the user selected system, and the sum of the bus mutual exclusion value of the unselected system and the bus mutual exclusion value of the user selected system is greater than 0, it means that the unselected system and the user selected system are located on two non-mutually exclusive CAN buses and can be selected at the same time.
[0078] At the same time, if the bus mutual exclusion value of the unselected system is equal to the bus mutual exclusion value of the user-selected system, it means that the unselected system and the user-selected system are located on the same CAN bus, and then it is necessary to determine whether there is a system ID corresponding to the unselected system in the target mutual exclusion list; if the system ID corresponding to the unselected system exists in the target mutual exclusion list corresponding to the user-selected system, the unselected system is determined to be a mutually exclusive system of the user-selected system; if the system ID corresponding to the unselected system does not exist in the target mutual exclusion list, it is determined that the unselected system is not a mutually exclusive system of the user-selected system.
[0079] In this embodiment, after determining all mutually exclusive systems corresponding to the user-selected system, if a data stream of a certain system is selected, its mutually exclusive system is not allowed to select a data stream. Therefore, based on the mutually exclusive systems, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams of each system, the currently selectable data stream is determined. The specific process may include: setting the first system enable for the mutually exclusive system corresponding to the target data stream; determining the second system enable and data stream enable corresponding to the target data stream according to the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams of each system; and marking the current unselectable data stream on a page through the first system enable, the second system enable, and the data stream enable, so that the user can determine the currently selectable data stream based on the corresponding page identifier. In a specific implementation, after setting the first system enable for a mutually exclusive system, the user cannot click on the mutually exclusive system and cannot select the data stream under the mutually exclusive system. After setting the second system enable, the user cannot click on the data stream under other unselected systems after the number of systems corresponding to the currently selected data stream reaches the maximum number of selectable systems. After setting the data stream enable, the user cannot select data streams that exceed the total number of data streams, nor can the user select data streams that exceed the maximum number of selectable data streams of each system under the same system. For example, if the total number of data streams is set to 10 and the maximum number of selectable data streams of each system is 5, the user can only select a maximum of 10 data streams, and a maximum of 5 data streams under the same system can only be selected. After selecting 10 data streams, other data streams cannot be selected, and after selecting 5 data streams under the same system, other data streams under the system cannot be selected.
[0080] In addition, if the user selects a data stream in the currently selectable data stream to add a target data stream, a new mutually exclusive system is determined based on the added target data stream, the bus mutual exclusion value of the vehicle electronic controller and the added target mutual exclusion list, and the current selectable data stream is re-determined based on the new mutually exclusive system, the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams of each system, so that the user can select a multi-system data stream through the currently selectable data stream, and the selected multi-system data is recorded according to the category of the last selected multi-system data stream. At the same time, if the user cancels the currently selected target data stream, the previously unselectable data stream corresponding to the canceled data stream will be restored to an selectable state, and the user can click to select. For example, the current user has only selected one data stream, and the data stream of the mutually exclusive system corresponding to the selected data stream in the current page becomes an unclickable state, and the user cannot select it, and can only select other clickable data streams. However, after canceling the selection of this data stream, that is, the current page does not select a data stream, all data streams become selectable, and the user can click on any data stream at will. Finally, a multi-system data stream without mutual exclusion is selected.
[0081] In summary, when performing multi-system data stream selection, the present application first uses multi-threading to scan the vehicle electronic controllers on all controller area network buses of the target vehicle, and reads the system information and data stream information corresponding to the vehicle electronic controllers, so as to determine the system controlled by each vehicle electronic controller and the data stream corresponding to the system; then, it is determined whether there is mutual exclusion among the vehicle electronic controllers on the same controller area network bus of the target vehicle; if there is mutual exclusion, the system ID of the target system whose system is mutually exclusive with the corresponding vehicle electronic controller on the same controller area network bus is added to the target mutual exclusion list, so as to obtain the mutual exclusion relationship among the systems controlled by each vehicle electronic controller on the same controller area network bus; based on the system information The total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system are set according to the information and data stream information, so as to avoid the user selecting too many data streams or systems when selecting multi-system data streams, and then determine the bus mutual exclusion value of the vehicle electronic controller, so that when the user's data stream selection instruction is received, the mutually exclusive system is determined according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller, and the target mutual exclusion list, and the currently selectable data stream is determined based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system, so that the user can select multi-system data streams through the currently selectable data streams, avoid selecting mutually exclusive systems when viewing the data streams of multiple systems, and improve the user experience.
[0082] Based on the above embodiment, the present application discloses a multi-system data stream selection method, which can avoid selecting mutually exclusive systems when viewing data streams of multiple systems, thereby improving user experience. Next, a specific multi-system data stream selection process will be described in detail.
[0083] When selecting multi-system data streams, first use multi-threading to scan all ECUs on the target vehicle's CAN bus and read the system information and data stream information corresponding to the ECU. The system information includes the system name, system abbreviation, and system ID, and the data stream information includes the name of the data stream and the unit of the data stream. Then determine whether the ECUs on the same CAN bus of the target vehicle are mutually exclusive. If the ECUs on the same CAN bus are mutually exclusive, add the system ID of the target system on the same CAN bus that is mutually exclusive with the ECU to the target mutual exclusion list.
[0084] After obtaining the target mutual exclusion list corresponding to each ECU, the total number of data streams, the maximum number of optional systems and the maximum number of optional data streams for each system are set based on the system information and data stream information, and the bus mutual exclusion value of the ECU is determined, wherein the bus mutual exclusion value of the ECU is determined according to the number of CAN buses of the target vehicle and the mutual exclusion relationship of each CAN bus. The specific process of determining the bus mutual exclusion value may include: according to the number of CAN buses of the vehicle and the mutual exclusion relationship of each CAN bus, the bus mutual exclusion value of the ECU is set, and the mutual exclusion value is represented by a 32-bit integer, that is, the mutual exclusion relationship of a maximum of 32 CAN buses is supported. If only one line is supported, the bus mutual exclusion value of any line is only allowed to be 1 in one position, such as 0x01; if multiple lines are supported, the bus mutual exclusion value of physically independent lines is at least 1 for all lines, and more parallel physical lines must be 1 in n more positions than the bit value. For example, pins 6 and 14 support parallelism with other lines, and their values are set to 0x0F (all systems are within 4 or less), and if there are more independent physical CAN buses, they are set to 0xFF (all systems are within 8 or less), etc. The bus mutual exclusion value set for other CAN buses is only allowed to be 1 in one position, and the 1 bits of different lines are in different positions. For example, the bus mutual exclusion value of pins 3 and 11 is 0x01, and the bus mutual exclusion value of pins 1 and 9 is 0x02.
[0085] When receiving the data stream selection instruction from the user, the mutually exclusive system is determined according to the target data stream selected by the user, the bus mutual exclusion value of the ECU and the target mutual exclusion list. The determined mutually exclusive system includes two categories. One category is the mutually exclusive system of CAN bus mutual exclusion determined based on the bus mutual exclusion value. The bus mutual exclusion value of this type of system and the bus mutual exclusion value of the ECU corresponding to the target data stream are 0, that is, none of the binary digits corresponding to the positions of the two bus mutual exclusion values integers are 1 at the same time; the other category is the mutually exclusive system located on the same CAN bus. The system ID of this type of system can be found from the target mutual exclusion list corresponding to the system where the target data stream is located. After determining the mutually exclusive system corresponding to the target data stream, the mutually exclusive system corresponding to the target data stream is set to the first system enable, and then the second system enable and data stream enable corresponding to the target data stream are determined according to the total number of data streams, the maximum number of optional systems and the maximum number of optional data streams of each system, and the current non-selectable data stream is page-marked by the first system enable, the second system enable and the data stream enable, so that the user can determine the current selectable data stream based on the corresponding page identifier and select multiple system data streams from the current selectable data stream.
[0086] It can be seen that when the present application performs multi-system data stream selection, it first uses multi-threading to scan the vehicle electronic controllers on all controller area network buses of the target vehicle, and reads the system information and data stream information corresponding to the vehicle electronic controllers, so as to determine the system controlled by each vehicle electronic controller and the data stream corresponding to the system; then it is determined whether there is mutual exclusion among the vehicle electronic controllers on the same controller area network bus of the target vehicle; if there is mutual exclusion, the system ID of the target system whose system is mutually exclusive with the vehicle electronic controller on the same controller area network bus is added to the target mutual exclusion list, so as to obtain the mutual exclusion relationship among the systems controlled by each vehicle electronic controller on the same controller area network bus; based on the system information The total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system are set according to the data stream information, so as to avoid the user selecting too many data streams or systems when selecting multi-system data streams, and then determine the bus mutual exclusion value of the vehicle electronic controller, so that when the user's data stream selection instruction is received, the mutually exclusive system is determined according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller, and the target mutual exclusion list, and the currently selectable data stream is determined based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system, so that the user can select multi-system data streams through the currently selectable data streams, avoid selecting mutually exclusive systems when viewing the data streams of multiple systems, and improve the user experience.
[0087] See also Figure 2 As shown, the embodiment of the present application discloses a multi-system data stream selection device, including:
[0088] An information reading module 11 is used to scan the vehicle electronic controllers on all controller area network buses of the target vehicle by using multithreading, and read the system information and data flow information corresponding to the vehicle electronic controllers;
[0089] The mutual exclusion judgment module 12 is used to judge whether the vehicle electronic controller on the same controller area network bus of the target vehicle is mutually exclusive. If there is mutual exclusion, the system ID of the target system whose system is mutually exclusive with the vehicle electronic controller on the same controller area network bus is added to the target mutual exclusion list;
[0090] A setting module 13, used for setting the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams of each system based on the system information and the data stream information, and determining the bus mutual exclusion value of the vehicle electronic controller;
[0091] The data stream selection module 14 is used to determine the mutually exclusive system according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller and the target mutual exclusion list when receiving the user's data stream selection instruction, and determine the current selectable data stream based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams for each system, so that the user can select multiple system data streams through the currently selectable data streams.
[0092] It can be seen that when the present application performs multi-system data stream selection, it first uses multi-threading to scan the vehicle electronic controllers on all controller area network buses of the target vehicle, and reads the system information and data stream information corresponding to the vehicle electronic controllers, so as to determine the system controlled by each vehicle electronic controller and the data stream corresponding to the system; then it is determined whether there is mutual exclusion among the vehicle electronic controllers on the same controller area network bus of the target vehicle; if there is mutual exclusion, the system ID of the target system whose system is mutually exclusive with the vehicle electronic controller on the same controller area network bus is added to the target mutual exclusion list, so as to obtain the mutual exclusion relationship among the systems controlled by each vehicle electronic controller on the same controller area network bus; based on the system information The total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system are set according to the data stream information, so as to avoid the user selecting too many data streams or systems when selecting multi-system data streams, and then determine the bus mutual exclusion value of the vehicle electronic controller, so that when the user's data stream selection instruction is received, the mutually exclusive system is determined according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller, and the target mutual exclusion list, and the currently selectable data stream is determined based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams for each system, so that the user can select multi-system data streams through the currently selectable data streams, avoid selecting mutually exclusive systems when viewing the data streams of multiple systems, and improve the user experience.
[0093] In a specific embodiment, the setting module 13 may specifically include:
[0094] The first mutual exclusion value determination submodule is used to determine the bus mutual exclusion value of the vehicle electronic controller according to the number of the controller area network buses of the target vehicle and the mutual exclusion relationship between the controller area network buses.
[0095] In a specific embodiment, the mutually exclusive value determination submodule may specifically include:
[0096] A link support determination unit, used to determine the number of paths of the communication link of the target vehicle supporting the mutually exclusive relationship of the controller area network bus;
[0097] The first mutual exclusion value determination unit is used to determine the bus mutual exclusion value of the vehicle electronic controller according to the number of the roads and the number of the controller area network buses of the target vehicle.
[0098] In a specific embodiment, the data stream selection module 14 may specifically include:
[0099] A second mutual exclusion value determination submodule, configured to determine a user selected system corresponding to the target data stream, determine an unselected system according to the user selected system, and determine a bus mutual exclusion value of the user selected system based on a bus mutual exclusion value of the vehicle electronic controller;
[0100] A mutual exclusion value judgment submodule, used to judge whether the bus mutual exclusion value of the unselected system is equal to the bus mutual exclusion value of the user selected system;
[0101] A first mutually exclusive system determination submodule, configured to determine the unselected system as a mutually exclusive system of the user selected system if they are not equal and the AND value of the bus mutual exclusive value of the unselected system and the bus mutual exclusive value of the user selected system is equal to 0;
[0102] A system ID judgment submodule, used for judging whether the system ID corresponding to the unselected system exists in the target mutually exclusive list if they are equal;
[0103] The second mutually exclusive system determination submodule is used to determine a mutually exclusive system according to a judgment result of whether there is a system ID corresponding to the unselected system in the target mutually exclusive list.
[0104] In a specific embodiment, the second mutually exclusive system determination submodule may specifically include:
[0105] a second mutually exclusive system determining unit, configured to determine the unselected system as a mutually exclusive system of the user selected system if a system ID corresponding to the unselected system exists in the target mutually exclusive list;
[0106] The non-mutually exclusive system determination unit is configured to determine that the unselected system is not a mutually exclusive system of the user-selected system if the system ID corresponding to the unselected system does not exist in the target mutually exclusive list.
[0107] In a specific embodiment, the data stream selection module may specifically include:
[0108] A first enabling setting unit, configured to set a first system enabling for the mutually exclusive system corresponding to the target data stream;
[0109] A second enabling setting unit, configured to determine a second system enabling and a data stream enabling corresponding to the target data stream according to the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams of each system;
[0110] The page identification unit is used to perform page identification on the currently unselectable data stream through the first system enable, the second system enable and the data stream enable, so that the user can determine the currently selectable data stream based on the corresponding page identification.
[0111] Furthermore, the present application also discloses an electronic device. Figure 3 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0112] Figure 3 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the multi-system data stream selection method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0113] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0114] In addition, the memory 22 as a carrier for resource storage may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222, etc., and the storage method may be temporary storage or permanent storage.
[0115] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the multi-system data stream selection method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0116] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed multi-system data stream selection method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0117] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0118] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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.
[0119] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0120] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0121] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A multi-system data stream selection method, characterized in that: include: Scanning all vehicle electronic controllers on the controller area network bus of the target vehicle by using multithreading, and reading system information and data flow information corresponding to the vehicle electronic controllers; Determine whether the vehicle electronic controller on the same CAN bus of the target vehicle is mutually exclusive, and if so, add the system ID of the target system whose system is mutually exclusive with the vehicle electronic controller on the same CAN bus to the target mutual exclusion list; Setting the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams for each system based on the system information and the data stream information, and determining a bus mutual exclusion value of the vehicle electronic controller; When receiving a data stream selection instruction from the user, the mutually exclusive system is determined according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller and the target mutual exclusion list, and the currently selectable data stream is determined based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams for each system, so that the user can select multi-system data streams through the currently selectable data streams.
2. The multi-system data stream selection method according to claim 1, characterized in that: The system information includes a system name, a system abbreviation, and a system ID; the data flow information includes a data flow name and a data flow unit.
3. The multi-system data stream selection method according to claim 1, characterized in that: Determining the bus mutual exclusion value of the vehicle electronic controller includes: The bus mutual exclusion value of the vehicle electronic controller is determined according to the number of the controller area network buses of the target vehicle and the mutual exclusion relationship between the controller area network buses.
4. The multi-system data stream selection method according to claim 3, characterized in that: The determining of the bus mutual exclusion value of the vehicle electronic controller according to the number of the controller area network buses of the target vehicle and the mutual exclusion relationship between the controller area network buses comprises: Determining the number of mutually exclusive relationships of the controller area network bus supported by the communication link of the target vehicle; The bus mutual exclusion value of the vehicle electronic controller is determined according to the number of routes and the number of the controller area network buses of the target vehicle.
5. The multi-system data stream selection method according to claim 1, characterized in that: The determining of the mutual exclusion system according to the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller and the target mutual exclusion list comprises: Determine a user selected system corresponding to the target data stream, determine an unselected system based on the user selected system, and determine a bus mutex value of the user selected system based on a bus mutex value of the vehicle electronic controller; Determining whether the bus mutual exclusion value of the unselected system is equal to the bus mutual exclusion value of the user selected system; If they are not equal, and the AND value of the bus mutual exclusion value of the unselected system and the bus mutual exclusion value of the user selected system is equal to 0, then the unselected system is determined as the mutually exclusive system of the user selected system; If they are equal, determining whether there is a system ID corresponding to the unselected system in the target mutually exclusive list; The mutually exclusive system is determined according to a result of judging whether there is a system ID corresponding to the unselected system in the target mutually exclusive list.
6. The multi-system data stream selection method according to claim 5, characterized in that: The determining of the mutually exclusive system according to the result of judging whether the system ID corresponding to the unselected system exists in the target mutually exclusive list includes: If the system ID corresponding to the unselected system exists in the target mutually exclusive list, the unselected system is determined as a mutually exclusive system of the user selected system; If the system ID corresponding to the unselected system does not exist in the target mutually exclusive list, it is determined that the unselected system is not a mutually exclusive system of the user-selected system.
7. The multi-system data stream selection method according to any one of claims 1 to 6, characterized in that: The determining of the currently selectable data stream based on the mutually exclusive systems, the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams of each system comprises: Setting the mutually exclusive system corresponding to the target data stream to a first system enable; Determine the second system enablement and data stream enablement corresponding to the target data stream according to the total number of data streams, the maximum number of selectable systems, and the maximum number of selectable data streams of each system; The currently unselectable data stream is page-marked through the first system enable, the second system enable and the data stream enable, so that the user can determine the currently selectable data stream based on the corresponding page mark.
8. A multi-system data stream selection device, characterized in that: include: An information reading module, used to scan the vehicle electronic controllers on all controller area network buses of the target vehicle using multithreading, and read the system information and data stream information corresponding to the vehicle electronic controllers; a mutual exclusion judgment module, used for judging whether there is mutual exclusion between the vehicle electronic controller on the same controller area network bus of the target vehicle, and if there is mutual exclusion, adding the system ID of the target system whose system is mutually exclusive with the vehicle electronic controller on the same controller area network bus to the target mutual exclusion list; a setting module, configured to set the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams of each system based on the system information and the data stream information, and determine a bus mutual exclusion value of the vehicle electronic controller; A data stream selection module is used to determine a mutually exclusive system based on the target data stream selected by the user, the bus mutual exclusion value of the vehicle electronic controller and the target mutual exclusion list when receiving a data stream selection instruction from the user, and determine the current selectable data stream based on the mutually exclusive system, the total number of data streams, the maximum number of selectable systems and the maximum number of selectable data streams for each system, so that the user can select multiple system data streams through the current selectable data streams.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the multi-system data stream selection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the multi-system data stream selection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
ECU identifier and identification method, system, device and medium thereof
CN111417908A
Multi-terminal diagnosis method and device, terminal equipment and storage medium
CN115808916A
Interface multi-implementation method and device, equipment and storage medium
CN117170911A
Data transmission method, device, equipment and medium
CN118540179A
Scanning method for electronic control unit in vehicle and vehicle diagnostic device
US20210241549A1
