Project file generation method for data collection, electronic equipment and storage medium
By automatically matching hardware channels and signal description files, the problems of low efficiency and low accuracy of hardware channels in vehicle testing environments are solved, and efficient and accurate channel matching is achieved, saving time and cost.
Patent Information
- Application Number
- CN202510034978.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, hardware channel matching efficiency and low accuracy in vehicle testing environments are low, and it is necessary to manually find the interface for data acquisition from multiple data interfaces, which is time-consuming and error-prone.
By determining the hardware channel and signal description file to be matched in the data acquisition system, a matching group is established based on the signal identification received by the hardware channel and the signal identification in the signal description file, and the final engineering file is generated to achieve automatic matching between the hardware channel and the signal description file.
It improves the efficiency and accuracy of hardware channel matching, reduces manual intervention, saves a lot of time and cost, and achieves matching through signal identification, avoids specific signal analysis steps, and further improves matching efficiency.
Smart Images

Figure CN119884784A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle testing technology, and in particular to a method for generating engineering files for data acquisition, an electronic device and a storage medium. Background Art
[0002] At present, due to the different channel definitions of data acquisition systems of various models, there are also differences in the communication setup of different test environments, and when replaying and analyzing data, the input often only has BLF files (Binary Logging Files), etc. Therefore, before analysis, it is necessary to trace back related information or perform multiple configurations to analyze and determine the signal type of each channel and the corresponding DBC (Database CAN, controller area network data) file.
[0003] In addition, in the process of online analysis and bench test environment construction, we will also face the same problem as data playback analysis, that is, it takes a lot of time to match the hardware channels. This situation is particularly difficult when building a bench environment. The distance between the data acquisition end and the acquisition object is far and they are usually not in the same room. In addition, there are a large number of other devices and wiring harnesses in the bench test environment. In a complex test environment, manually searching for the data acquisition interface from multiple data interfaces is inefficient and prone to errors. Summary of the invention
[0004] In view of the above-mentioned defects or deficiencies in the prior art, the present application aims to provide a method for generating engineering files for data acquisition, an electronic device and a storage medium, so as to solve the problems of low efficiency and low accuracy in matching hardware channels by manually searching for interfaces in the prior art.
[0005] The present application provides a method for generating a data acquisition engineering file, the method comprising: Determine each hardware channel to be matched in the data acquisition system, and obtain each signal description file to be matched; Determine the protocol type of each of the hardware channels and the protocol type of each of the signal description files, and determine the hardware channels and signal description files with the same protocol type as a matching group; For each hardware channel in the matching group, based on the signal identifiers of each signal received by the hardware channel within a set time and the signal identifiers included in each signal description file in the matching group, determining a signal description file matching the hardware channel in the matching group; According to the matching relationship between each of the hardware channels and each of the signal description files, a final engineering file of the data acquisition system is generated, so as to analyze the signals received by each of the hardware channels based on the final engineering file.
[0006] Optionally, for each hardware channel in the matching group, based on the signal identifiers of each signal received by the hardware channel within a set time and the signal identifiers included in each signal description file in the matching group, determining a signal description file matching the hardware channel in the matching group includes: For each matching group, a relationship between any hardware channel in the matching group and any signal description file is established to obtain various candidate relationships under the matching group, and an initial engineering file corresponding to the matching group is generated according to all candidate relationships; Get all signals received by all hardware channels within the set time; For each candidate relationship in the initial engineering file, based on the signal identifiers of the signals received by the hardware channel in the candidate relationship within a set time and the signal identifiers included in the signal description file in the candidate relationship, determine the signal coincidence degree between the hardware channel in the candidate relationship and the signal description file; Based on the signal coincidence degree between the hardware channel and the signal description file in each of the candidate relationships, a signal description file that matches each of the hardware channels is determined in the matching group.
[0007] Optionally, determining the signal coincidence between the hardware channel in the candidate relationship and the signal description file based on the signal identifier of each signal received by the hardware channel in the candidate relationship within a set time and the signal identifier included in the signal description file in the candidate relationship includes: Obtain a first identification set according to the signal identification of each signal received by the hardware channel in the candidate relationship within a set time, and obtain a second identification set according to the signal identification included in the signal description file in the candidate relationship; An intersection between the first identification set and the second identification set is determined, and the number of identifications in the intersection is determined as the signal overlap between the hardware channel in the candidate relationship and the signal description file.
[0008] Optionally, based on the signal coincidence between the hardware channel and the signal description file in each of the candidate relationships, determining the signal description file that matches each of the hardware channels in the matching group includes: Determine a candidate file set for each of the hardware channels based on the signal overlap between the hardware channels and the signal description files in each of the candidate relationships; Determine whether there is a hardware channel with a unique signal description file in the candidate file set among all hardware channels; If so, for the hardware channel with the only signal description file in the candidate file set, determine the signal description file in the candidate file set as the signal description file matching the hardware channel; For a hardware channel whose signal description file is not unique in the candidate file set, a signal description file matching the hardware channel is determined from the remaining unmatched signal description files based on the matched signal description files.
[0009] Optionally, for a hardware channel whose signal description file is not unique in the candidate file set, determining a signal description file that matches the hardware channel from remaining unmatched signal description files based on matched signal description files includes: For a hardware channel whose signal description file is not unique in the candidate file set, determine whether there is a matched signal description file in the candidate file set of the hardware channel, and if so, remove the matched signal description file from the candidate file set; If the signal description file in the set of candidate files after elimination is unique, the signal description file in the set of candidate files after elimination is determined as the signal description file matching the hardware channel.
[0010] Optionally, the method further includes: If there is no hardware channel with a unique signal description file in the candidate file set among all hardware channels, or if the signal description file in the candidate file set is not unique after elimination, the matched hardware channel is eliminated from all hardware channels, and the matched signal description file is eliminated from all signal description files; Return to the step of obtaining each signal received by all hardware channels within a set time, and for each candidate relationship in the initial engineering file, determining the signal coincidence between the hardware channel in the candidate relationship and the signal description file based on the signal identifier of each signal received by the hardware channel in the candidate relationship within the set time and the signal identifier contained in the signal description file in the candidate relationship.
[0011] Optionally, before returning to execute obtaining each signal received by all hardware channels within the set time, it also includes: Determine the number of signal acquisition times, and judge whether the number of signal acquisition times is greater than a preset number threshold; If so, for the hardware channel whose signal description file is not unique in the alternative file set, filter valid signals from all signals received by the hardware channel to obtain the number of valid signals, and determine the signal description file that matches the hardware channel in the alternative file set based on the number of valid signals.
[0012] Optionally, determining the protocol type of each of the hardware channels includes: Determining the protocol type of each hardware channel based on the data structure of the signal received by each hardware channel; and / or, The protocol type of each of the hardware channels is determined based on the field value of a preset field in the signal received by each of the hardware channels.
[0013] The present application also provides an electronic device, the electronic device comprising: Processor and memory; The processor is used to execute the steps of the method for generating an engineering file for data acquisition provided in any embodiment of the present application by calling the program or instruction stored in the memory.
[0014] An embodiment of the present application also provides a computer-readable storage medium, which stores a program or instruction, and the program or instruction enables a computer to execute the steps of the method for generating engineering files for data acquisition provided in any embodiment of the present application.
[0015] In summary, the present application proposes a method for generating engineering files for data acquisition, which determines each hardware channel to be matched in a data acquisition system, obtains each signal description file to be matched, determines the protocol type of each hardware channel and the protocol type of each signal description file, and determines the hardware channels and signal description files with the same protocol type as a matching group, and then for each hardware channel in the matching group, according to the signal identifier of each signal received by the hardware channel within a set time and the signal identifier contained in each signal description file in the matching group, determines the signal description file matching the hardware channel in the matching group, and finally generates the final engineering file of the data acquisition system according to the matching relationship between each hardware channel and each signal description file, so as to facilitate the subsequent analysis of the signals received by each hardware channel through the final engineering file. The method can realize automatic matching between hardware channels and signal description files, solve channel matching problems in environments such as vehicle testing, and does not require manual interface viewing, thereby improving the efficiency and accuracy of channel matching, eliminating tedious verification work, and saving a lot of time costs. In addition, the method realizes matching through signal identifiers, without the need to specifically analyze each signal, which can further improve the matching efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 It is a flow chart of a method for generating engineering files for data collection provided in an embodiment of the present application; Figure 2is a schematic diagram of a data acquisition system provided in an embodiment of the present application; Figure 3 This is a schematic diagram of a four-channel data acquisition provided by an embodiment of the present application; Figure 4 It is a data structure of a CAN message and a CANFD message provided in an embodiment of the present application; Figure 5 is a schematic diagram of signal coincidence provided in an embodiment of the present application; Figure 6 It is a matching schematic diagram provided in an embodiment of the present application; Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.
[0019] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0020] As mentioned in the background technology, in response to the problems in the prior art, this application proposes a method for generating engineering files for data collection. Figure 1 This is a flow chart of a method for generating engineering files for data collection provided in an embodiment of the present application. Figure 1 , the data collection engineering file generation method specifically includes: S110, determining each hardware channel to be matched in the data acquisition system, and obtaining each signal description file to be matched.
[0021] The data acquisition system can be a data acquisition system for vehicle testing, such as collecting real vehicle data or vehicle test bench data. The data acquisition system can collect and analyze vehicle signal data based on CANoe (CAN Open Environment, bus development environment) signal analysis simulation software.
[0022] For example, Figure 2 is a schematic diagram of a data acquisition system provided in an embodiment of the present application, such as Figure 2As shown in the figure, the entire data acquisition system can be composed of the vehicle end or test bench to be collected, a data acquisition instrument (such as vector), and a PC (Personal Computer) connected to the data acquisition instrument. Among them, the vehicle end or test bench to be collected can send the vehicle signal to the data acquisition instrument in the form of OBD (On-Board Diagnostics) signal.
[0023] Specifically, the data acquisition instrument can be connected to the vehicle end or the test bench, and the data acquisition instrument can be connected to the computer. The data acquisition instrument and the vehicle end or the test bench can be connected through a collection harness. The production of the collection harness can be realized according to the pin definition. One end of the collection harness is connected to the vehicle end or the test bench, and the other end is connected to the data acquisition instrument. During the process of connecting the data acquisition instrument, each collection harness and each interface of the data acquisition instrument can be randomly connected.
[0024] In the embodiment of the present application, the hardware channel to be matched in the data acquisition system can be the hardware channel identified by the PC. Since each acquisition harness and each interface of the data acquisition instrument can be randomly connected, for the channel connected to the acquisition harness, it is impossible to know the signal source connected to the other end of the acquisition harness connected to it. Therefore, it can be regarded as a hardware channel that needs to be matched with the DBC file.
[0025] The signal description file to be matched can be a DBC file. The number of signal description files to be matched is the same as the number of hardware channels, that is, after matching, each hardware channel corresponds to a signal description file. Among them, the signal description file defines the signal name, start bit, length, data type and other signal-related information. Through the signal description file, the received signal can be parsed to understand the meaning of the values of each field in the signal and obtain the information carried in the signal. For example, the code in the signal is converted into a specific value based on the signal description file, or the flag bit in the signal is converted into a switch state based on the signal description file.
[0026] For example, taking a four-channel data acquisition scenario as an example, Figure 3 is a schematic diagram of a four-channel data acquisition provided by an embodiment of the present application, such as Figure 3 As shown, the signal source can send data in the form of OBD signal. One end of the data acquisition harness is connected to the signal source, and the other end is connected to the data acquisition instrument (VECTOR, ZLG or X-hunter), and the data acquisition instrument is connected to the PC.
[0027] Among them, the hardware channels channel1, channel2, channel3, and channel4 identified by the PC, and the hardware channels to be matched are channel1~ channel4. It can be assumed that channel1~ channel4 correspond to the channels CH1, CH2, CH3, and CH4 of the data acquisition instrument respectively. Therefore, in the embodiment of the present application, matching can refer to pairing channel1~ channel4 with 4 DBC files. The 4 DBC files shown in the figure are cha (signals describing vehicle charging information, etc.), info (signals describing basic vehicle information, etc.), bd (signals describing vehicle body status, etc.), and ev (signals describing vehicle events, etc.). In addition, they can also be other types, which are not limited in the embodiment of the present application.
[0028] Depend on Figure 3 As shown, in the process of online data acquisition and data playback, it is necessary to create a project file on the PC or the test bench, and correctly match the hardware channel identified by the PC with the channel and DBC file of the data acquisition instrument. However, if this project file needs to be correctly established, it is necessary to rely on knowing all the front-end hardware connection conditions and the channel definition on the development side. The embodiment of the present application can automatically match the hardware channel channel with the DBC file without knowing this information, and generate a correct project file for the engineer.
[0029] S120: Determine the protocol type of each hardware channel and the protocol type of each signal description file, and determine the hardware channels and signal description files with the same protocol type as a matching group.
[0030] The protocol type of the hardware channel may specifically be the protocol type of the signal transmitted by the hardware channel, and the protocol type of the signal description file may specifically be the protocol type of the signal described by the signal description file.
[0031] Exemplarily, the protocol types include, but are not limited to, CAN (Controller Area Network), CANFD (Controller Area Network with Flexible Data-Rate), LIN (Local Interconnect Network), LAN (Local Area Network), etc.
[0032] Specifically, the protocol type of each hardware channel can be determined based on the data structure of the signal it receives; for the protocol type of each signal description file, the signal description file may include a field that defines the protocol type, and the protocol type of the signal description file can be determined based on the value in the field.
[0033] In a specific implementation, determining the protocol type of each hardware channel includes: The protocol type of each hardware channel is determined based on the data structure of the signal received by each hardware channel; and / or the protocol type of each hardware channel is determined based on the field value of a preset field in the signal received by each hardware channel.
[0034] Specifically, for some protocol types with large differences, such as LIN and LAN, the composition of their data structures is quite different. The protocol type can be determined directly based on the data structure, for example, whether there are set fields in the data structure, or whether the number of data bodies in the data structure is the same.
[0035] In addition, for protocol types with smaller differences, such as CAN and CANFD, the composition of their data structures is relatively similar, and the protocol type can be determined based on the field values of the preset fields therein.
[0036] Exemplarily, the preset field may be a FDF (Flexible Data Rate Format) field, which is used to distinguish between CAN messages and CAN FD messages. When the field value of the FDF field is 1, it indicates that the message is a CAN FD protocol; when the field value of the FDF field is 0, it indicates that the message is a CAN protocol.
[0037] like Figure 4 As shown, Figure 4 It is a data structure of a CAN message and a CANFD message provided in an embodiment of the present application, wherein the FDF field can describe the protocol type of the message, and 0 and 1 correspond to CAN and CANFD respectively.
[0038] Through the above implementation, the protocol type of each hardware channel can be determined based on the field value of the preset field in the data structure or signal, which realizes the rapid determination of the hardware channel type without the need to manually analyze the signal transmitted by the hardware channel, further improving the matching efficiency between the hardware channel and the DBC file. For example, it can be determined first whether there is a signal with a preset field in the signal transmitted by each hardware channel. If so, the corresponding protocol type can be determined based on the field value of the preset field. If not, the corresponding protocol type can be determined based on the data structure of the signal.
[0039] After obtaining the protocol type of each hardware channel and the protocol type of each signal description file, further grouping can be performed according to the protocol type, and the hardware channels and signal description files with the same protocol type can be divided into a matching group.
[0040] For example, taking 4 hardware channels and 4 DBC files as an example, assuming that the protocol type of the 4 hardware channels and the 4 DBC files is CAN, then one matching group can be obtained, and there are 4 hardware channels and 4 DBC files under this matching group. Assuming that the protocol type of 2 hardware channels and 2 DBC files is CAN, and the protocol type of 2 hardware channels and 2 DBC files is CANFD, then 2 matching groups can be obtained, one matching group has 2 CAN hardware channels and 2 CAN DBC files, and the other matching group has 2 CANFD hardware channels and 2 CANFD DBC files.
[0041] It should be noted that in the embodiment of the present application, the hardware channels and signal description files with the same protocol type are determined as a matching group. The purpose is that: since the signal description file describes the signal transmitted in the hardware channel that matches it, the protocol type of the hardware channel and signal description file that actually match should be consistent. It can be seen from this that there must be no matching relationship between hardware channels and signal description files with different protocol types. The hardware channels and signal description files that may have a matching relationship can be placed in a matching group by protocol type for subsequent matching. While ensuring the accuracy of the matching, the matching efficiency can be further improved.
[0042] Exemplarily, using the example in which the protocol type between the two hardware channels and the two DBC files is CAN, and the protocol type between the two hardware channels and the two DBC files is CANFD, if they are not grouped by protocol type, there may be 16 matching relationships between the four hardware channels and the four DBC files, and it is necessary to further determine the final matching relationship from the 16 matching relationships. After grouping by protocol type, for each matching group, there may be 4 matching relationships between the two hardware channels and the two DBC files, and there are 8 matching relationships in total for the two matching groups. It is then only necessary to further determine the final matching relationship from the 8 matching relationships, which can greatly improve the matching efficiency.
[0043] S130. For each hardware channel in the matching group, based on the signal identifiers of each signal received by the hardware channel within a set time and the signal identifiers included in each signal description file in the matching group, determine a signal description file that matches the hardware channel in the matching group.
[0044] After grouping according to protocol type, for each matching group, matching between the hardware channels in the group and the signal description file can be performed.
[0045] In the embodiment of the present application, taking any matching group as an example, the matching process between the hardware channel in the group and the signal description file is described. Specifically, if the front-end physical channel is connected or a BLF (Binary LoggingFormat) file is available, the signals received by each hardware channel in the matching group within the set time can be collected, and then the signal description file is matched for each hardware channel in the matching group based on the signal identifier of each received signal and the signal identifier contained in each signal description file in the matching group.
[0046] The setting time may be a signal collection period, and the setting time may be determined according to the sampling frequency and signal transmission frequency of each device. For example, considering that the signal transmission frequencies of different devices are different, in order to obtain the signals sent by all devices in one signal collection process as much as possible, the setting time may be set to a transmission period that can cover all signals, such as 1s.
[0047] In a specific implementation, for each hardware channel in a matching group, based on the signal identifiers of each signal received by the hardware channel within a set time and the signal identifiers contained in each signal description file in the matching group, determining a signal description file matching the hardware channel in the matching group includes the following steps: Step 11: For each matching group, establish a relationship between any hardware channel in the matching group and any signal description file, obtain various candidate relationships under the matching group, and generate an initial engineering file corresponding to the matching group according to all candidate relationships; Step 12: Obtain each signal received by all hardware channels within a set time; Step 13: for each candidate relationship in the initial engineering file, based on the signal identifiers of each signal received by the hardware channel in the candidate relationship within a set time and the signal identifiers contained in the signal description file in the candidate relationship, determine the signal coincidence degree between the hardware channel in the candidate relationship and the signal description file; Step 14: Based on the signal coincidence between the hardware channel and the signal description file in each candidate relationship, determine the signal description file that matches each hardware channel in the matching group.
[0048] Among them, in step 11, in a matching group, all possible matching relationships can be established based on all hardware channels and all signal description files in the matching group as candidate relationships. For example, a candidate relationship between each signal description file in the matching group and each hardware channel can be established in turn, that is, a network, and then an initial engineering file containing all candidate relationships in the matching group is generated.
[0049] Using the example of 4 hardware channels and 4 DBC files under the above matching group, the number of candidate relationships can be 16, and the 16 candidate relationships can be named as: CHA1~4, EV1~4, DB1~4, INFO1~4. Among them, CHA1 represents the candidate relationship between channel1 and CHA, DB2 represents the candidate relationship between channel2 and DB, INFO3 represents the candidate relationship between channel3 and INFO, and EV4 represents the candidate relationship between channel4 and EV.
[0050] Furthermore, in step 12, each signal received by each hardware channel in the matching group within a set time may be collected. The collection of each signal received by each hardware channel in the matching group within a set time may be online collection, i.e., real-time reception, or may be offline collection, i.e., extracting playback data of each hardware channel.
[0051] Further, in step 13, for each candidate relationship in the initial engineering file, that is, each candidate relationship in the matching group, the signal coincidence between the hardware channel in the candidate relationship and the signal description file can be calculated based on the signal identifiers of each signal received by the hardware channel in the candidate relationship within the set time and the signal identifiers contained in the signal description file in the candidate relationship. Among them, the hardware channel and signal description file in the candidate relationship can be understood as the hardware channel and signal description file described by the candidate relationship.
[0052] The signal identifier included in the signal description file may be the ID of the signal described in the signal description file. The signal coincidence degree may be understood as the degree of similarity between the signal received by the hardware channel and the signal described in the signal description file, and may reflect the degree to which the signal received by the hardware channel conforms to the signal description file. Exemplarily, the number of repeated signal identifiers between the hardware channel and the signal description file may be determined and used as the signal coincidence degree.
[0053] With respect to the above step 13, in one example, based on the signal identifiers of the signals received by the hardware channels in the candidate relationship within the set time and the signal identifiers contained in the signal description files in the candidate relationship, determining the signal coincidence between the hardware channels in the candidate relationship and the signal description files includes the following steps: Step 131, obtaining a first identification set according to the signal identification of each signal received by the hardware channel in the candidate relationship within a set time, and obtaining a second identification set according to the signal identification included in the signal description file in the candidate relationship; Step 132: determine the intersection between the first identification set and the second identification set, and determine the number of identifications in the intersection as the signal overlap between the hardware channel in the candidate relationship and the signal description file.
[0054] Specifically, in step 131-step 132, the signal identifiers of the signals received by the hardware channels in the candidate relationship can be used as the first identifier set, and the signal identifiers contained in the signal description file in the candidate relationship can be used as the second identifier set. Furthermore, the intersection between the first identifier set and the second identifier set can be calculated, and the signal coincidence degree can be determined according to the number of signal identifiers in the intersection.
[0055] Through the above example, the signal coincidence between the hardware channel described by the candidate relationship and the signal description file can be quickly determined without parsing the signal, and only the signal ID is required, thereby ensuring the matching efficiency of the hardware channel.
[0056] After obtaining the signal coincidence between the hardware channel and the signal description file in each candidate relationship, further, in step 14, the signal description files respectively matching the hardware channels can be determined in the matching group according to the signal coincidence. For example, for each hardware channel, the signal description file with the highest signal coincidence can be selected as the signal description file matching the hardware channel according to the signal coincidence corresponding to all candidate relationships related to the hardware channel.
[0057] Taking into account the possibility that the signal description file with the highest signal overlap may not be unique, for such cases, we can combine the characteristic that each hardware channel can only match one signal description file, first determine the matching signal description file for the unique hardware channel with the highest signal description file, and then eliminate the matched signal description file and continue to determine the matching signal description file for other hardware channels.
[0058] With respect to the above step 14, in one example, based on the signal coincidence between the hardware channel and the signal description file in each candidate relationship, determining the signal description file that matches each hardware channel in the matching group includes the following steps: Step 141: Determine a candidate file set for each hardware channel based on the signal overlap between the hardware channel and the signal description file in each candidate relationship; Step 142, determining whether there is a hardware channel with a unique signal description file in the candidate file set among all the hardware channels; Step 143: If yes, for the hardware channel with the only signal description file in the candidate file set, determine the signal description file in the candidate file set as the signal description file matching the hardware channel; Step 144: For a hardware channel whose signal description file is not unique in the candidate file set, determine a signal description file that matches the hardware channel from the remaining unmatched signal description files based on the matched signal description files.
[0059] Among them, in step 141, taking a hardware channel as an example, the signal description files can be sorted according to the signal overlap of the signal description files in all candidate relationships related to the hardware channel, and the signal description file with the largest signal overlap is selected to construct a candidate file set.
[0060] Furthermore, in step 142-step 143, it can be determined whether there is a hardware channel with a unique signal description file in the candidate file set for all hardware channels. If so, further, the signal description file in the candidate file set can be used as a matching signal description file for the unique hardware channel with the signal description file. Furthermore, in step 144, for hardware channels whose signal description files are not unique in the alternative file set, signal description files that have been matched to other hardware channels can be removed from the alternative file set to determine whether the remaining signal description files in the alternative file set after the removal are unique. If so, the remaining signal description files can be directly determined as signal description files that match them.
[0061] With respect to the above step 144, optionally, for a hardware channel whose signal description file is not unique in the candidate file set, based on the matched signal description files, a signal description file matching the hardware channel is determined from the remaining unmatched signal description files, including the following steps: Step 1441: for a hardware channel whose signal description file is not unique in the candidate file set, determine whether there is a matched signal description file in the candidate file set of the hardware channel; if so, remove the matched signal description file from the candidate file set; Step 1442: If the signal description file in the set of candidate files after elimination is unique, the signal description file in the set of candidate files after elimination is determined as the signal description file matching the hardware channel.
[0062] Specifically, in step 1441-step 1442, it can be determined first whether there is a matched signal description file in the alternative file set. If so, it can be removed from the alternative file set. If the signal description file is unique in the alternative file set after removal, the signal description file can be directly used as the signal description file that matches the hardware channel.
[0063] For example, Figure 5It is a schematic diagram of a signal overlap provided in an embodiment of the present application, wherein, for channel1, the signal overlap between it and the signal description file ev is the highest, therefore, the alternative file set SET A includes the signal description file ev; for channel2, the signal overlap between it and the signal description files bd and info is the highest, therefore, the alternative file set SET A includes the signal description files bd and info; for channel3, the signal overlap between it and the signal description files bd and cha is the highest, therefore, the alternative file set SET A includes the signal description files bd and cha; for channel4, the signal overlap between it and the signal description files cha and info is the highest, therefore, the alternative file set SET A includes the signal description files cha and info.
[0064] like Figure 5 As shown, after obtaining the candidate file set of each hardware channel, the signal description file matching the hardware channel can be determined by the candidate file set. For example, for channel1, its candidate file set SET A signal description file is unique, which can be input into the final file set SET a to determine that channel1 matches ev in SET a. At the same time, the matched channel1 can be deleted from the hardware channel set Channels SET, and the matched ev can be deleted from the file set DBC SET. For channel2~4, the corresponding SET a can be an empty set. Furthermore, the signal description file matching channel2~4 can be determined by excluding the matched signal description file.
[0065] Exemplarily, following the above example, the difference between SET A of the four channels and SET a of channel 1 can be calculated, and the SET A after the difference is made into a new SET A. It is determined whether there is a unique element in it. If there is, it is input into the corresponding SET a, and the difference is taken again to determine the uniqueness, until the new SET A is non-unique. At this time, the result of SET a is output as the true value, and the signal is returned to be pulled again and the signal coincidence is calculated. The objects of each verification are DBC SET and Channels SET, until DBCSET or Channels SET is an empty set.
[0066] Through the above steps 141 to 144, the signal description file with the highest signal overlap can be first determined as the signal description file that matches the hardware channel, and then for the remaining hardware channels, the matched signal description files can be eliminated from the candidate file set. If there is a unique signal description file after elimination, the matching signal description file can be determined. Compared with directly re-pulling the signal to calculate the signal overlap, the matching efficiency can be improved while ensuring the matching accuracy.
[0067] It should be noted that, considering that after the matched signal description files are removed from the alternative file set, the signal description files in the alternative file set of each hardware channel may still not be unique, or there may be a situation where the signal description files in the alternative file set of all hardware channels are not unique. For such situations, the signal can be pulled again to calculate the signal overlap.
[0068] In one example, the method provided in the embodiment of the present application further includes the following steps: Step 145: If there is no hardware channel with a unique signal description file in the candidate file set among all the hardware channels, or if the signal description file in the candidate file set is not unique after elimination, the matched hardware channel is eliminated from all the hardware channels, and the matched signal description file is eliminated from all the signal description files; Step 146, return to the step of obtaining each signal received by all hardware channels within the set time, and for each candidate relationship in the initial project file, based on the signal identifier of each signal received by the hardware channel in the candidate relationship within the set time, and the signal identifier contained in the signal description file in the candidate relationship, determine the signal coincidence between the hardware channel in the candidate relationship and the signal description file.
[0069] Specifically, if the signal description files in the candidate file set of all hardware channels are not unique, you can directly return to step 12 to re-pull the signal within the next set time to calculate the signal coincidence. If after removing the matched signal description files, the signal description files in the candidate file set of each hardware channel are still not unique, the matched hardware channels can be removed from all hardware channels, and the matched signal description files can be removed from all signal description files, and then return to step 12 to re-pull the signal within the next set time to calculate the signal coincidence.
[0070] Through the above examples, when the signal description files of all hardware channels are not the highest unique one, or when the signal description files in the candidate file set are still not unique after the matched signal description files are eliminated, the signal coincidence can be re-pulled to calculate the signal coincidence. Among them, the matched hardware channels and signal description files can be eliminated to avoid recalculating the signal coincidence of the candidate relationships related to the matched hardware channels and the matched signal description files, which can reduce the amount of calculation and improve the matching efficiency.
[0071] For example, Figure 6 This is a matching schematic diagram provided by an embodiment of the present application. Among them, at Second 1, that is, after calculating the signal coincidence based on the signal pulled at the 1st second, the result obtained is: the candidate file set of Channel 1 includes ev, the candidate file set of Channel 2 includes bd and info, the candidate file set of Channel 3 includes cha and bd, and the candidate file set of Channel 4 includes info and cha.
[0072] At this time, we can set SET a1=SET A1=(ev、Channel1), associate the two elements in SET a1 into a combined element (Channel 1,ev) and output it to ture. Furthermore, SET a1 and the four sets of SET A are subtracted, and SETA1~SET A4=SET A1~SET A4-SET a1. The new SET A1 is an empty set, and SET A2, SET A3, and SET A4 still have two elements. The TBD set is (Channel 2, Channel 3, Channel 4). At this time, the 1s signal can be pulled down.
[0073] At Second 2, that is, after calculating the signal overlap based on the signal pulled at the 2nd second, the results are: the candidate file set of Channel 2 includes bd, the candidate file set of Channel 3 includes cha and bd, and the candidate file set of Channel 4 includes info and cha, among which only SET A2 is the unique element set, SET a2=(bd, Channel 2), SET a and SET A take the difference set, and the result is three new SET A, among which SET A2 is an empty set, SET A3=(cha), SET A4=(info, cha), SET A3 is the unique element set, which is output to SET a3, and after taking the difference set with SET A, SET A3 is an empty set, SET A4=(info), SET A4 is the unique element set, which is output to SET a4. At this time, TBD is an empty set, and the four groups of SET a are formed into four combined elements (channel 1, ev), (channel 2, bd), (channel 3, cha), and (channel 4, info) and output to ture.
[0074] In addition, in the embodiment of the present application, considering that there may be repeated pulling of signals, and each time the signal is pulled, it is still impossible to determine the unique signal description file with the highest signal overlap, for such a situation, it is also possible to stop pulling the signal and match it according to the number of valid signals.
[0075] Optionally, before returning to execute obtaining each signal received by all hardware channels within the set time, it also includes: Determine the number of times the signal is acquired, and judge whether the number of times the signal is acquired is greater than a preset number threshold; If so, for the hardware channel whose signal description file is not unique in the candidate file set, filter out valid signals from all signals received by the hardware channel to obtain the number of valid signals, and determine the signal description file that matches the hardware channel in the candidate file set based on the number of valid signals.
[0076] The number of signal acquisitions may be the number of times the signals received in each hardware channel are pulled, that is, it may be understood as the number of times the signal coincidence is calculated. The preset number threshold may be a preset maximum number of signal acquisitions, such as 3 times.
[0077] Specifically, if the number of signal acquisition times is greater than the preset threshold, then the acquisition of the signal within the next set time can be terminated at this time, and instead the signal can be analyzed to see whether it is valid, and the number of valid signals among the signals with repeated identifiers between the hardware channel and each signal description file in the alternative file set can be determined. The signal description file with the highest number of valid signals is determined as the signal description file that matches the hardware channel.
[0078] Through the above-mentioned optional implementation, when the matching relationship between the hardware channel and the signal description file cannot be determined for multiple consecutive times, the judgment can be made in combination with the number of valid signals, wherein the process of determining the valid signal is simple, and there is no need to verify whether the value is normal. As long as the value exists, it can be considered to be a valid signal, which can improve the efficiency of the entire matching process.
[0079] S140 , generating a final engineering file of the data acquisition system according to the matching relationship between each hardware channel and each signal description file, so as to analyze the signal received by each hardware channel based on the final engineering file.
[0080] Specifically, after matching each hardware channel with each signal description file, a final engineering file of the data acquisition system may be generated according to the matching relationship, wherein the final engineering file may describe a hardware channel that can use each signal description file for signal analysis.
[0081] In an embodiment of the present application, based on the final engineering file, online data analysis and data playback can be performed. For example, for a signal received by a hardware channel, through the matching relationship between the signal description file in the final engineering file and the hardware channel, a corresponding signal description file can be selected to parse the signal.
[0082] The engineering file generation method for data acquisition provided in the embodiment of the present application determines each hardware channel to be matched in the data acquisition system, obtains each signal description file to be matched, determines the protocol type of each hardware channel and the protocol type of each signal description file, and determines the hardware channels and signal description files with the same protocol type as a matching group, and then for each hardware channel in the matching group, according to the signal identifier of each signal received by the hardware channel within a set time and the signal identifier contained in each signal description file in the matching group, determines the signal description file matching the hardware channel in the matching group, and finally generates the final engineering file of the data acquisition system according to the matching relationship between each hardware channel and each signal description file, so as to facilitate the subsequent analysis of the signals received by each hardware channel through the final engineering file. The method can realize automatic matching between hardware channels and signal description files, solve the channel matching problem in environments such as vehicle testing, and does not require manual interface viewing, thereby improving the efficiency and accuracy of channel matching, eliminating tedious verification work, and saving a lot of time cost. In addition, the method realizes matching through signal identifiers without the need to specifically analyze each signal, which can further improve the matching efficiency.
[0083] The method provided in the embodiment of the present application can replace manual data analysis and matching, eliminating tedious verification work and saving a lot of time costs; moreover, the entire method has good compatibility, is applicable to both online and offline modes, can be used in PCs or integrated bench systems, and the application scenarios during online analysis can be laboratory scenarios or vehicle real-time acquisition scenarios; moreover, the method has good replicability, and in addition to being implemented based on CANoe, it can also be developed based on some other data analysis software, and only the code of the interactive part such as the data interface address needs to be adjusted; moreover, during online analysis, in theory, in most cases, all channel matching can be completed using signals within 1s, and it is very rare for multiple DBCs in the same channel to have the same degree of overlap, so the channel matching efficiency can be greatly improved.
[0084] In addition, in the embodiment of the present application, through 1. the method of cyclic assignment judgment, the channel and the DBC file can be matched quickly and accurately. When there is a unique element in SET A, the SET a collection is reversely brought into SET A to obtain the difference set to determine whether the current 1s result already has a unique solution; by adding the comparison of the number of valid signals, the situation of performing an invalid 1s judgment process for a long time in extremely rare special cases is solved. In scenarios with a large number of signals or complex signal fields, compared with calculating and comparing signal IDs, it requires greater computing resources and capabilities, so only statistical analysis of valid signals is performed in special cases; in addition, a simple matching project generation method is set up, and multiple networks are set in the matching project, which can facilitate statistical analysis of the number of parsed signals, and the corresponding network message can be directly viewed without regenerating the project or network, resulting in waste of previously parsed results.
[0085] Figure 7 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device 400 includes one or more processors 401 and a memory 402 .
[0086] The processor 401 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.
[0087] The memory 402 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 401 may run the program instructions to implement the engineering file generation method for data acquisition of any embodiment of the present application described above and / or other desired functions. Various contents such as initial external parameters, thresholds, etc. may also be stored in the computer-readable storage medium.
[0088] In one example, the electronic device 400 may further include: an input device 403 and an output device 404, which are interconnected via a bus system and / or other forms of connection mechanisms (not shown). The input device 403 may include, for example, a keyboard, a mouse, etc. The output device 404 may output various information to the outside, including early warning prompt information, braking force, etc. The output device 404 may include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.
[0089] Of course, to simplify, Figure 7 Only some of the components related to the present application in the electronic device 400 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application conditions, the electronic device 400 may also include any other appropriate components.
[0090] In addition to the above-mentioned methods and devices, the embodiments of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the data acquisition engineering file generation method provided in any embodiment of the present application.
[0091] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0092] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the method for generating engineering files for data acquisition provided in any embodiment of the present application.
[0093] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0094] It should be noted that the terms used in this application are only for describing specific embodiments, rather than limiting the scope of this application. As shown in the specification and claims of this application, unless the context clearly indicates an exception, the words "one", "a", "a kind of" and / or "the" do not specifically refer to the singular, but may also include the plural. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method or device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the presence of other identical elements in the process, method or device including the elements.
[0095] It should also be noted that the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present application. Unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", etc. should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0096] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and its core ideas of this application. The above is only the preferred implementation method of this application. It should be pointed out that due to the limitations of textual expression and the objective existence of infinite specific structures, ordinary technicians in this technical field can make several improvements, modifications or changes without departing from the principles of this application, and can also combine the above technical features in an appropriate manner; these improvements, modifications, changes or combinations, or the direct application of the concept and technical solution of the invention to other occasions without improvement, should be regarded as the scope of protection of this application.
Claims
1. A method for generating engineering files for data collection, characterized in that: include: Determine each hardware channel to be matched in the data acquisition system, and obtain each signal description file to be matched; Determine the protocol type of each of the hardware channels and the protocol type of each of the signal description files, and determine the hardware channels and signal description files with the same protocol type as a matching group; For each hardware channel in the matching group, based on the signal identifiers of each signal received by the hardware channel within a set time and the signal identifiers included in each signal description file in the matching group, determining a signal description file matching the hardware channel in the matching group; According to the matching relationship between each of the hardware channels and each of the signal description files, a final engineering file of the data acquisition system is generated, so as to analyze the signals received by each of the hardware channels based on the final engineering file.
2. The method for generating engineering files for data collection according to claim 1, characterized in that: For each hardware channel in the matching group, based on the signal identifiers of each signal received by the hardware channel within a set time and the signal identifiers included in each signal description file in the matching group, determining a signal description file matching the hardware channel in the matching group includes: For each matching group, a relationship between any hardware channel in the matching group and any signal description file is established to obtain various candidate relationships under the matching group, and an initial engineering file corresponding to the matching group is generated according to all candidate relationships; Get all signals received by all hardware channels within the set time; For each candidate relationship in the initial engineering file, based on the signal identifiers of the signals received by the hardware channel in the candidate relationship within a set time and the signal identifiers included in the signal description file in the candidate relationship, determine the signal coincidence degree between the hardware channel in the candidate relationship and the signal description file; Based on the signal coincidence degree between the hardware channel and the signal description file in each of the candidate relationships, a signal description file that matches each of the hardware channels is determined in the matching group.
3. The method for generating engineering files for data collection according to claim 2, characterized in that: Determining the signal coincidence between the hardware channel in the candidate relationship and the signal description file based on the signal identifier of each signal received by the hardware channel in the candidate relationship within a set time and the signal identifier included in the signal description file in the candidate relationship, including: Obtain a first identification set according to the signal identification of each signal received by the hardware channel in the candidate relationship within a set time, and obtain a second identification set according to the signal identification included in the signal description file in the candidate relationship; An intersection between the first identification set and the second identification set is determined, and the number of identifications in the intersection is determined as the signal overlap between the hardware channel in the candidate relationship and the signal description file.
4. The method for generating engineering files for data collection according to claim 2, characterized in that: Based on the signal coincidence degree between the hardware channel and the signal description file in each of the candidate relationships, determining the signal description file that matches each of the hardware channels in the matching group, including: Determine a candidate file set for each of the hardware channels based on the signal overlap between the hardware channels and the signal description files in each of the candidate relationships; Determine whether there is a hardware channel with a unique signal description file in the candidate file set among all hardware channels; If so, for the hardware channel with the only signal description file in the candidate file set, determine the signal description file in the candidate file set as the signal description file matching the hardware channel; For a hardware channel whose signal description file is not unique in the candidate file set, a signal description file matching the hardware channel is determined from the remaining unmatched signal description files based on the matched signal description files.
5. The method for generating engineering files for data collection according to claim 4, characterized in that: For a hardware channel whose signal description file is not unique in the candidate file set, determining a signal description file that matches the hardware channel from the remaining unmatched signal description files based on the matched signal description files, including: For a hardware channel whose signal description file is not unique in the candidate file set, determine whether there is a matched signal description file in the candidate file set of the hardware channel, and if so, remove the matched signal description file from the candidate file set; If the signal description file in the set of candidate files after elimination is unique, the signal description file in the set of candidate files after elimination is determined as the signal description file matching the hardware channel.
6. The method for generating engineering files for data collection according to claim 5, characterized in that: The method further comprises: If there is no hardware channel with a unique signal description file in the candidate file set among all hardware channels, or if the signal description file in the candidate file set is not unique after elimination, the matched hardware channel is eliminated from all hardware channels, and the matched signal description file is eliminated from all signal description files; Return to the step of obtaining each signal received by all hardware channels within a set time, and for each candidate relationship in the initial engineering file, determining the signal coincidence between the hardware channel in the candidate relationship and the signal description file based on the signal identifier of each signal received by the hardware channel in the candidate relationship within the set time and the signal identifier contained in the signal description file in the candidate relationship.
7. The method for generating engineering files for data collection according to claim 6, characterized in that: Before returning to execute to obtain each signal received by all hardware channels within the set time, it also includes: Determine the number of signal acquisition times, and judge whether the number of signal acquisition times is greater than a preset number threshold; If so, for the hardware channel whose signal description file is not unique in the alternative file set, filter valid signals from all signals received by the hardware channel to obtain the number of valid signals, and determine the signal description file that matches the hardware channel in the alternative file set based on the number of valid signals.
8. The method for generating engineering files for data collection according to claim 1, characterized in that: Determining the protocol type of each of the hardware channels includes: Determining the protocol type of each hardware channel based on the data structure of the signal received by each hardware channel; and / or, The protocol type of each of the hardware channels is determined based on the field value of a preset field in the signal received by each of the hardware channels.
9. An electronic device, characterized in that: The electronic device comprises: Processor and memory; The processor is used to execute the steps of the method for generating engineering files for data acquisition as described in any one of claims 1 to 8 by calling the program or instructions stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute the steps of the method for generating an engineering file by data acquisition according to any one of claims 1 to 8.