CN115001894B - Vehicle-mounted bus signal access method and device - Google Patents

Vehicle-mounted bus signal access method and device Download PDF

Info

Publication number
CN115001894B
CN115001894B CN202210574316.6A CN202210574316A CN115001894B CN 115001894 B CN115001894 B CN 115001894B CN 202210574316 A CN202210574316 A CN 202210574316A CN 115001894 B CN115001894 B CN 115001894B
Authority
CN
China
Prior art keywords
data
data point
pointer
vehicle
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210574316.6A
Other languages
Chinese (zh)
Other versions
CN115001894A (en
Inventor
孙华宝
曹海成
刘振宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingwei Hirain Tech Co Ltd
Original Assignee
Beijing Jingwei Hirain Tech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingwei Hirain Tech Co Ltd filed Critical Beijing Jingwei Hirain Tech Co Ltd
Priority to CN202210574316.6A priority Critical patent/CN115001894B/en
Publication of CN115001894A publication Critical patent/CN115001894A/en
Application granted granted Critical
Publication of CN115001894B publication Critical patent/CN115001894B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a method and a device for accessing vehicle-mounted bus signals, wherein the method comprises the following steps: storing the data points of the acquired vehicle-mounted bus signals in the corresponding data files in a binary byte format to obtain a data file set; when the data points of the appointed vehicle-mounted bus signals need to be read, determining the data files corresponding to the appointed vehicle-mounted bus signals from the data file set as target data files; determining the number of bytes to be moved by the data pointer according to the position of the data point pointed by the data pointer in the target data file and the appointed time period; moving the data pointer according to the number of bytes, and judging whether the data point in the pointing range of the moved data pointer is the data point in the appointed time period or not; if yes, all the data points in the pointing range of the moved data pointer are analyzed, and analysis results of all the data points in the appointed time period are obtained. The method and the device have the advantages that historical data do not need to be discarded, the access speed is high, and data points in a specified time period can be accurately analyzed.

Description

Vehicle-mounted bus signal access method and device
Technical Field
The present disclosure relates to the field of automotive bus data analysis, and in particular, to a method and an apparatus for accessing a vehicle bus signal.
Background
In the process of analyzing the communication data of the automobile bus, the change of each signal in the bus message needs to be analyzed, so that the data of the signals need to be stored and read, and the existing implementation method mainly comprises the following two steps: the first method uses the memory of the computer to directly store data and read history data; the second method uses text file to store signal data in character form, and analyzes and loads appointed line number history data according to the need.
In the first method, the computer memory can be used for realizing quick data storage and quick historical data extraction, but in the actual automobile bus data communication process, massive signal data storage is involved, because the computer memory is limited, some historical data must be discarded, so that the discarded data cannot be analyzed, some key information can be missed, and the whole collected data is invalid; in the second method, the text file is used for storing signal data in the form of characters, so that a large number of data signals can be stored, but the text characters occupy more byte space, huge data files can be formed when the data volume is very large, and the mode consumes larger computer performance when the data is stored and analyzed, and the signal data in the specified time period cannot be accurately analyzed through the analysis of the number of text lines in the analysis process.
Disclosure of Invention
In view of this, the present application provides a method and apparatus for accessing a vehicle bus signal, so as to solve the problems in the prior art that historical data needs to be discarded, text characters occupy a large amount of byte space, have a slow access speed, and cannot accurately analyze signal data within a specified time period, and the technical scheme is as follows:
an access method of a vehicle-mounted bus signal, comprising:
storing the data points of the acquired vehicle-mounted bus signals in the corresponding data files in a binary byte format to obtain a data file set formed by the data files respectively corresponding to the vehicle-mounted bus signals;
when the data points of the appointed vehicle-mounted bus signals need to be read, determining the data files corresponding to the appointed vehicle-mounted bus signals from the data file set as target data files;
determining the number of bytes to be moved by the data pointer according to the position of the data point pointed by the data pointer in the target data file and the appointed time period;
moving the data pointer according to the number of bytes, and judging whether the data points in the pointing range of the moved data pointer are data points in a specified time period or not;
if yes, all the data points in the pointing range of the moved data pointer are analyzed, and analysis results of all the data points in the appointed time period are obtained.
Optionally, the method further comprises:
if not, returning to execute the step of determining the number of bytes to be moved by the data pointer according to the position of the data point pointed by the data pointer in the target data file and the appointed time period.
Optionally, determining the number of bytes the data pointer needs to move according to the position of the data point currently pointed by the data pointer in the target data file and the specified time period includes:
determining the number of bytes to be moved by the initial pointer according to the position of the data point pointed by the initial pointer currently and the initial time of the appointed time period;
and determining the number of bytes to be moved by the end pointer according to the position of the data point pointed by the end pointer currently and the end time of the appointed time period.
Optionally, any data point includes a time stamp and a signal value when the corresponding vehicle bus signal is collected;
determining the number of bytes to be moved by the start pointer according to the position of the data point currently pointed by the start pointer and the start time of the designated time period, including:
determining a first initial data point according to the position of the data point pointed by the initial pointer currently, and calculating a signal period at the first initial data point according to the timestamp of the first initial data point to serve as an initial signal period;
Determining the number of bytes to be moved by the initial pointer according to the initial signal period, the position of the data point pointed by the initial pointer currently and the initial time of the appointed time period;
determining the number of bytes to be moved by the end pointer according to the position of the data point pointed by the end pointer and the end time of the appointed time period, wherein the method comprises the following steps:
determining a first end data point according to the position of the data point pointed by the end pointer currently, and calculating a signal period at the first end data point according to the timestamp of the first end data point to serve as an end signal period;
and determining the number of bytes to be moved by the end pointer according to the period of the end signal, the position of the data point pointed by the end pointer currently and the end time of the appointed time period.
Optionally, calculating the signal period at the first starting data point based on the timestamp of the first starting data point includes:
calculating a difference between a timestamp of a backward adjacent data point of the first starting data point and a timestamp of the first starting data point, wherein the calculated difference is used as a signal period at the first starting data point;
calculating a signal period at the first end data point from the timestamp of the first end data point, comprising:
A difference between the time stamp of the first end data point and the time stamp of the forward adjacent data point of the first end data point is calculated, the calculated difference being the signal period at the first end data point.
Optionally, determining the number of bytes that the start pointer needs to move according to the start signal period, the position of the data point that the start pointer points to and the start time of the designated time period includes:
determining the time of the position of the data point pointed by the initial pointer currently, and calculating the difference between the initial time of the appointed time period and the determined time to obtain a first difference;
dividing the first difference value by the initial signal period to obtain a quotient as the number of data points to be moved by the initial pointer;
calculating the product of the data point data needing to be moved by the initial pointer and the occupied byte number of the data point, wherein the product result is used as the byte number needing to be moved by the initial pointer;
determining the number of bytes to be moved by the end pointer according to the end signal period, the position of the data point pointed by the end pointer and the end time of the appointed time period, wherein the method comprises the following steps:
determining the time at the position of the data point pointed by the end pointer currently, and calculating the difference between the end time of the appointed time period and the determined time to obtain a first difference;
Dividing the first difference value by the period of the ending signal to obtain a quotient as the number of data points to be moved by the ending pointer;
and calculating the product of the data point data needing to be moved by the end pointer and the occupied byte number of the data point, wherein the product result is taken as the byte number needing to be moved by the end pointer.
Optionally, determining whether the data point within the pointing range of the moved data pointer is a data point within a specified time period includes:
determining a second initial data point according to the position of the data point pointed by the initial pointer after movement, and judging whether the second initial data point is a data point in a specified time period according to the time stamp of the second initial data point and the time stamp of a forward adjacent data point of the second initial data point;
and determining a second end data point according to the position of the data point pointed by the end pointer after movement, and judging whether the second end data point is a data point in a specified time period according to the time stamp of the second end data point and the time stamp of a backward adjacent data point of the second end data point.
Optionally, the data file includes unique identification information corresponding to the vehicle-mounted bus signal and an identification length corresponding to the unique identification information;
determining a data file corresponding to the specified vehicle-mounted bus signal from the data file set as a target data file, wherein the data file comprises:
Analyzing the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal from the data file aiming at each data file in the data file set, and analyzing the unique identification information of the corresponding vehicle-mounted bus signal from the data file according to the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal as the unique identification information corresponding to the data file;
and determining the data file corresponding to the unique identification information of the appointed vehicle-mounted bus signal as a target data file according to the unique identification information corresponding to each data file.
Optionally, the unique identification information is composed of a network segment name, target information, a signal name and a preset symbol, which correspond to the vehicle-mounted bus signal, wherein the target information is message name information or protocol data unit name information.
An access device for an in-vehicle bus signal, comprising:
the data point storage module is used for storing the data points of the acquired vehicle-mounted bus signals in the corresponding data files in a binary byte format so as to obtain a data file set formed by the data files respectively corresponding to the vehicle-mounted bus signals;
the target data file determining module is used for determining a data file corresponding to the specified vehicle-mounted bus signal from the data file set as a target data file when the data point of the specified vehicle-mounted bus signal needs to be read;
The byte number determining module is used for determining the number of bytes to be moved by the data pointer according to the position of the data point pointed by the data pointer in the target data file and the appointed time period;
the data point judging module is used for moving the data pointer according to the number of bytes and judging whether the data points in the pointing range of the moved data pointer are the data points in the appointed time period or not;
and the data point analysis module is used for analyzing all the data points in the pointing range of the moved data pointer to obtain analysis results of all the data points in the appointed time period when the data point judgment module judges that the data points in the pointing range of the moved data pointer are the data points in the appointed time period.
According to the technical scheme, the access method for the vehicle-mounted bus signals comprises the steps of firstly storing the collected data points of the vehicle-mounted bus signals in the corresponding data files in a binary byte format to obtain a data file set composed of the data files corresponding to the vehicle-mounted bus signals, determining the data file corresponding to the specified vehicle-mounted bus signals from the data file set when the data points of the specified vehicle-mounted bus signals need to be read, taking the data file as a target data file, then determining the number of bytes required to be moved by the data pointer according to the position of the data point currently pointed by the data pointer in the target data file and the specified time period, then moving the data pointer according to the number of bytes, judging whether the data points in the pointed range of the moved data pointer are the data points in the specified time period, and finally analyzing all the data points in the pointed range of the moved data pointer if so as to obtain analysis results of all the data points in the specified time period. The data points of the collected vehicle-mounted bus signals can be stored in the corresponding data files in the binary byte format, the data files can be stored in the magnetic disk in the storage mode, historical data are not required to be discarded due to the fact that the magnetic disk space is large, the data points are stored in the binary byte format, the occupied storage space is small, and the access speed is high; meanwhile, when the data points of the appointed vehicle-mounted bus signals need to be read, the method and the device can accurately analyze all the data points in the appointed time period by combining the data pointer.
In addition, data points corresponding to the vehicle-mounted bus signals are stored in the data file in a binary format mode, so that the safety of the vehicle-mounted bus signals is guaranteed to a certain extent, and the vehicle-mounted bus signals are not easy to tamper.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
Fig. 1 is a flow chart of a method for accessing a vehicle bus signal according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a specific storage structure of a data file according to an embodiment of the present application;
FIG. 3 is a schematic diagram of the location of a data point currently pointed to by a data pointer according to an embodiment of the present application;
FIG. 4 is a schematic diagram of the positions of data points pointed by the data pointers before and after movement according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an access device for a vehicle bus signal according to an embodiment of the present application;
fig. 6 is a hardware block diagram of an access device for a vehicle bus signal according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In view of the problems that the existing method for directly storing data and reading historical data by using the memory of a computer has the problem that the historical data needs to be discarded due to the limited memory in the computer, and the method for storing the vehicle-mounted bus signal data in the form of characters by using text files has the problems that the text characters occupy large byte space, have low access speed and cannot accurately analyze signal data within a specified time period, the inventor carries out intensive research, and finally provides a vehicle-mounted bus signal access method, and before the vehicle-mounted bus signal access method is introduced, several nouns related to the application are firstly explained.
Vehicle bus signal (signal for short): the signal is defined in the file of the bus database (database for short), the information such as the name, start bit, length and calculation rule of the physical value of the signal is defined in the database, the signal value is the result of intercepting and calculating the data bytes in the real bus data according to the definition.
Data points: the data information of the on-board bus signal, optionally, the data points include a bus time stamp (optionally, in seconds) of the signal and a signal value.
Signal unique identification: a flag uniquely identifying the signal in a vehicle communication network segment.
The following embodiments are used to describe the method for accessing the vehicle bus signal provided in the present application in detail.
Referring to fig. 1, a flowchart of an access method for a vehicle bus signal provided in an embodiment of the present application is shown, where the access method for a vehicle bus signal may include:
step S101, data points of a plurality of acquired vehicle-mounted bus signals are stored in corresponding data files in a binary byte format, so that a data file set formed by the data files corresponding to the vehicle-mounted bus signals respectively is obtained.
In this embodiment, a corresponding binary byte data file may be defined for each vehicle bus signal, and optionally, a binary byte data file with a suffix sig may be defined.
In this step, after the data points of the vehicle bus signal are collected, the collected data points may be stored in a corresponding data file, and when the data points are stored, the collected data points need to be converted into a binary byte format to be stored.
Step S102, when the data points of the appointed vehicle-mounted bus signals need to be read, determining the data files corresponding to the appointed vehicle-mounted bus signals from the data file set as target data files.
Specifically, the data file set may be parsed in this step to determine, from the data file set, a data file corresponding to the specified vehicle bus signal. Here, the specified in-vehicle bus signal refers to an in-vehicle bus signal corresponding to a data point to be read.
Step S103, determining the number of bytes to be moved by the data pointer according to the position of the data point pointed by the data pointer in the target data file and the designated time period.
In this step, a data pointer may be set in the target data file, and when a data point in a specified time period needs to be read, the number of bytes that the data pointer needs to move may be determined according to the position of the data point to which the data pointer is currently pointed and the specified time period.
Here, if the data point in the specified time period of the current reading is the first data point in the target data file, and if the data point in the specified time period of the current reading is not the first data point in the target data file, that is, the data point in the specified time period of the current reading is the data point in a certain time period already read by the history, the data point in the current pointing of the data pointer refers to the position of the data point pointed by the data pointer when the data point in a certain time period is read by the history last time.
Step S104, the data pointer is moved according to the number of bytes, and whether the data points in the pointing range of the moved data pointer are the data points in the appointed time period is judged.
After the number of bytes is determined in the foregoing step, the data pointer may be moved according to the number of bytes. Here, when the data pointer is moved according to the number of bytes, the data pointer may be moved forward or moved backward.
In order to avoid the situation, whether the data points in the pointing range of the data pointer after moving are the data points in the appointed time period can be judged by the step.
And step 105, if yes, analyzing all the data points in the pointing range of the moved data pointer to obtain analysis results of all the data points in the appointed time period.
Specifically, in this step, when it is determined that the data point within the pointing range of the moved data pointer is the data point within the specified time period, all the data points within the pointing range of the moved data pointer are sequentially parsed according to the storage format in step S101, so as to obtain a parsing result.
According to the access method for the vehicle-mounted bus signals, firstly, data points of a plurality of collected vehicle-mounted bus signals are stored in corresponding data files in a binary byte format to obtain a data file set composed of data files corresponding to the vehicle-mounted bus signals respectively, when the data points of the specified vehicle-mounted bus signals need to be read, the data files corresponding to the specified vehicle-mounted bus signals are determined from the data file set to serve as target data files, then the number of bytes required to be moved by the data pointers is determined according to the positions of the data points currently pointed by the data pointers in the target data files and the specified time period, then the data pointers are moved according to the number of bytes, whether the data points in the pointing range of the moved data pointers are the data points in the specified time period or not is judged, and finally, if so, all the data points in the pointing range of the moved data pointers are analyzed, and the analysis result of the data points in the specified time period is obtained. The data points of the collected vehicle-mounted bus signals can be stored in the corresponding data files in the binary byte format, the data files can be stored in the magnetic disk in the storage mode, historical data are not required to be discarded due to the fact that the magnetic disk space is large, the data points are stored in the binary byte format, the occupied storage space is small, and the access speed is high; meanwhile, when the data points of the appointed vehicle-mounted bus signals need to be read, the method and the device can accurately analyze all the data points in the appointed time period by combining the data pointer.
In addition, data points corresponding to the vehicle-mounted bus signals are stored in the data file in a binary format mode, so that the safety of the vehicle-mounted bus signals is guaranteed to a certain extent, and the vehicle-mounted bus signals are not easy to tamper.
For a better understanding of the present application, the following detailed description of the foregoing embodiments is provided in connection with the implementation of the steps.
First, taking any one of the plurality of in-vehicle bus signals as an example, a specific implementation process in which the collected data points of the in-vehicle bus signal are stored in the corresponding data file in the binary byte format in the above step S101 is described.
Optionally, the specific implementation process of the step S101 "storing the collected data points of the vehicle bus signal in the binary byte format in the corresponding data file" includes:
and a1, storing the identification length corresponding to the unique identification information of the vehicle-mounted bus signal in the first several bits of the corresponding data file.
In this step, the unique identification information of the vehicle-mounted bus signal is a byte sequence, and in this step, the number of bytes included in the byte sequence may be used as the identification length corresponding to the unique identification information of the vehicle-mounted bus signal, and stored in the first several bits of the corresponding data file.
In an alternative embodiment, the number of characters included in the unique identification information may be first converted into a binary value with a length of several bits, and then the converted binary value may be stored in the first several bits of the corresponding data file.
Alternatively, the first several bits may be specifically the first 12 bits, that is, the length of the identifier in this step is composed of 12 bits, and the 12 bits may represent a value ranging from 1 to 4095 bytes (byte).
See, for example, the schematic diagram of a specific storage structure for a data file shown in fig. 2. The identification length in this step refers to the Key length, and this step can convert the number of characters contained in the unique identification information into a binary value of 12 bits, and store the binary value in the position where the Key length is located.
Step a2, storing the unique identification information of the vehicle-mounted bus signal in a plurality of bytes after the identification length of the corresponding data file.
Alternatively, in this step, the byte sequence of the unique identification information may be mapped by an ASCII code table to obtain readable character string form identification information (binary value), and then the character string form identification information is stored in a plurality of bytes after the identification length of the corresponding data file.
Here, the number of bytes specifically refers to the number of characters contained in the character string form identification information. For example, if the character string form identification information corresponding to the unique identification information of the vehicle-mounted bus signal contains 20 characters, the character string form identification information is stored in 20 bytes after the identification length of the corresponding data file; if the character string form identification information corresponding to the unique identification information of the vehicle-mounted bus signal contains 10 characters, the character string form identification information is stored in 10 bytes after the identification length of the corresponding data file, and so on.
It should be noted that, in this step, the unique identification information stored in the corresponding data file does not include chinese characters.
For example, referring to fig. 2, the unique identification information in this step refers to a Key value having a maximum length of 4095 bytes.
As shown in fig. 2, the present embodiment can use the above-described identification length (Key length) and unique identification information (Key value) together as a header file portion of a data file.
Optionally, in this step, the unique identification information of the vehicle-mounted bus signal is composed of a network segment name, target information, a signal name and a preset symbol, which correspond to the vehicle-mounted bus signal, and specifically, each two of the network segment name, the target information and the signal name may be connected through the preset symbol.
Optionally, the target information refers to message name information or protocol data unit (Protocol Data Unit, PDU) name information; optionally, the preset symbol may be an english double colon.
And a3, storing the collected data points of the vehicle-mounted bus signal in a binary byte format in a plurality of bytes after the unique identification information of the corresponding data file.
In this step, the number of bytes occupied by each data point of the vehicle bus signal is fixed, so as to facilitate the analysis of the data points during the subsequent reading.
Optionally, the data points of the vehicle-mounted bus signal specifically include a time stamp and a signal value when the vehicle-mounted bus signal is collected, that is, the time stamp and the collected signal value when the vehicle-mounted bus signal is collected need to be correspondingly stored in a data file in this step, so that the data points in a specified time period can be accurately analyzed later.
It should be noted that, after the data point is collected in this step, the data point needs to be converted into a binary character format (i.e. binary value), and then the binary character format is sequentially stored into the corresponding data file according to the structure stored in the data file, so that the data point is repeatedly stored until the collection is completed.
Alternatively, the embodiment may enable the time stamp of the data point to occupy 8 bytes, enable the corresponding signal value to occupy 8 bytes, and sequentially store all the data points of the vehicle bus signal according to the sequence of the time stamps.
For example, referring to fig. 2, in this step, the data points of the vehicle bus signal may be sequentially stored in the data point group portion according to the sequence of the time stamps, and for each data point, the time stamp at the time of collection occupies 8 bytes, and the specific signal value collected occupies 8 bytes.
By adopting the storage method described in the above steps, all data points of the vehicle-mounted bus signals can be stored in the corresponding data files, so that the data file set in the step can be obtained.
When the data points of the appointed vehicle-mounted bus signal need to be read, the data files in the data file set can be analyzed based on the storage structure to obtain a target data file, and then all the data points in the appointed time period in the target data file are accurately analyzed.
Specifically, in an alternative embodiment, when the data point of the specified vehicle bus signal needs to be read, the process of determining, as the target data file, the data file corresponding to the specified vehicle bus signal from the data file set in step S102 includes:
and b1, analyzing the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal from each data file in the data file set, and analyzing the unique identification information of the corresponding vehicle-mounted bus signal from the data file according to the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal as the unique identification information corresponding to the data file.
Optionally, as described in the foregoing step, the first several bits of the data file may be first parsed to obtain an identification length corresponding to the unique identification information of the vehicle bus signal, and then, after the first several bits of the data file are parsed, the length is several bytes of the identification length, so as to obtain parsed unique identification information.
For example, first 12 bits of the data file are taken out, an integer value is calculated according to unsigned symbols, the integer value is the identification length corresponding to the unique identification information of the vehicle-mounted bus signal corresponding to the data file, if the obtained identification length is 20, the first 20 bytes after the identification length in the data file are analyzed, for example, the 20 bytes are mapped into characters according to an ASCII code table and spliced into a character string, and the unique identification information of the vehicle-mounted bus signal corresponding to the data file is obtained.
And b2, determining the data file corresponding to the unique identification information of the appointed vehicle-mounted bus signal as a target data file according to the unique identification information corresponding to each data file.
After determining the unique identification information corresponding to each data file in the data file set in the step b1, the data file corresponding to the unique identification information of the specific vehicle-mounted bus signal can be determined according to the unique identification information.
After the target data file is determined in step S102, the data points in the designated time period in the target data file can be read according to steps S103 to S105. Here, the data pointers in step S103 to step S105 include a start pointer and an end pointer.
In an alternative embodiment, the step S103, determining the number of bytes the data pointer needs to move according to the location of the data point currently pointed to by the data pointer in the target data file and the specified time period includes:
and c1, determining the number of bytes to be moved by the initial pointer according to the position of the data point pointed by the initial pointer currently and the initial time of the appointed time period.
Optionally, the process of this step specifically includes steps c11 to c12:
step c11, determining a first initial data point according to the position of the data point pointed by the initial pointer currently, and calculating a signal period at the first initial data point according to the timestamp of the first initial data point to serve as an initial signal period.
In this step, the data point to which the start pointer is currently pointed is recorded as the first start data point. As shown in FIG. 3, the start pointer refers to p s The time at the location of the data point currently pointed to by the start pointer (defined as the start time) is t m The first starting data point is data point M.
Optionally, the process of "calculating the signal period at the first starting data point from the timestamp of the first starting data point" includes: the difference between the time stamp of the backward adjacent data point of the first starting data point and the time stamp of the first starting data point is calculated, and the calculated difference is taken as the signal period at the first starting data point. For example, the difference between the timestamp of the first starting data point M+1 in FIG. 3 and the timestamp of data point M is determined as the signal period at the first starting data point M.
It should be noted that the process of calculating the signal period at the first initial data point according to the timestamp of the first initial data point given in this step is merely an example, and other manners may be adopted, for example, calculating the difference between the timestamp of the first initial data point and the timestamp of the preceding adjacent data point of the first initial data point, as the signal period at the first initial data point, which is not limited in this application.
Step c12, determining the number of bytes to be moved by the start pointer according to the period of the start signal, the position of the data point currently pointed by the start pointer and the start time of the designated time period.
Optionally, the process of this step includes the following steps c121 to c123:
step c121, determining the time at the position of the data point pointed by the start pointer currently, and calculating the difference between the start time of the designated time period and the determined time to obtain a first difference.
Step c122, dividing the first difference by the period of the start signal, and taking the quotient obtained as the number of data points to be moved by the start pointer.
Step c123, calculating the product of the data point data to be moved by the start pointer and the number of occupied bytes of the data point, and taking the product result as the number of bytes to be moved by the start pointer.
In this embodiment, the number of bytes occupied by each data point is a preset constant value, and after determining the number of data points to be moved by the start pointer, the number of data points to be moved by the start pointer can be multiplied by the number of bytes occupied by the data points to obtain the number of bytes to be moved by the start pointer.
That is, this step may employ the following formula (1) to determine the number of bytes the start pointer needs to move.
Figure BDA0003661465250000131
In count s Refers to the number of bytes the starting pointer needs to move, t news Refer to the start time of a specified time period, t m Refers to the time at the location of the data point currently pointed to by the start pointer, Δt m Referring to the start signal period, λ is the number of bytes occupied by the data points (i.e., the number of bytes occupied by each data point).
Alternatively, as described above for Wen Duishu points, λ may be specifically 16 (8 bytes occupied by timestamp plus 8 bytes occupied by signal value, 16 bytes total); of course, λ may be other in practical application, and this application is not limited thereto.
It should be noted that, if the number of bytes count determined in this step s If the value is positive, representing that the initial pointer needs to be shifted by a corresponding number of bytes; if the number of bytes count determined in the step is the same s Negative values, the start pointer is characterized by a corresponding number of bytes preceding.
And c2, determining the number of bytes to be moved by the end pointer according to the position of the data point pointed by the end pointer currently and the end time of the appointed time period.
Optionally, the process of this step specifically includes the following steps c21 to c22:
step c21, determining a first end data point according to the position of the data point pointed by the end pointer currently, and calculating a signal period at the first end data point according to the timestamp of the first end data point to serve as an end signal period.
In this step, the data point to which the end pointer is currently pointed is noted as the first end data point. As shown in FIG. 3, the end pointer refers to p e The time at the location of the data point currently pointed to by the end pointer (defined as the junctionBeam time) is t n+1 The first end data point is data point n+1.
Optionally, the process of "calculating the signal period at the first end data point from the timestamp of the first end data point" includes: a difference between the time stamp of the first end data point and the time stamp of the forward adjacent data point of the first end data point is calculated, the calculated difference being the signal period at the first end data point. For example, the difference between the timestamp of the first end data point n+1 and the timestamp of data point N in fig. 3 is determined as the signal period at the first end data point n+1.
It should be noted that the process of calculating the signal period at the first end data point according to the timestamp of the first end data point given in this step is merely an example, and other manners may be adopted in addition to this, for example, calculating the difference between the timestamp of the backward adjacent data point of the first end data point and the timestamp of the first end data point, as the signal period at the first end data point, which is not limited in this application.
Step c22, determining the number of bytes to be moved by the end pointer according to the period of the end signal, the position of the data point pointed by the end pointer currently and the end time of the appointed time period.
Optionally, the process of this step includes the following steps c221 to c223:
step c221, determining the time at the position of the data point pointed by the end pointer currently, and calculating the difference between the end time of the designated time period and the determined time to obtain a first difference.
Step c222, dividing the first difference by the end signal period to obtain a quotient as the number of data points to be moved by the end pointer.
Step c223, calculating the product of the data point data to be moved by the end pointer and the number of occupied bytes of the data point, and taking the product result as the number of bytes to be moved by the end pointer.
As described in the foregoing step c123, the number of bytes occupied by each data point is a preset constant value, and after determining the number of data points that the end pointer needs to move, the number of data points that the end pointer needs to move can be multiplied by the number of bytes occupied by the data points to obtain the number of bytes that the end pointer needs to move.
That is, this step may employ the following formula (2) to determine the number of bytes the start pointer needs to move.
Figure BDA0003661465250000141
In count e Refers to the number of bytes the starting pointer needs to move, t newe Refer to the start time of a specified time period, t n+1 Refers to the time at the location of the data point currently pointed to by the start pointer, Δt n Refers to the start signal period, and λ refers to the number of bytes occupied by each data point.
It should be noted that, if the number of bytes count determined in this step e If the value is positive, representing bytes of the corresponding number of the required post-phase shift of the end pointer; if the number of bytes count determined in the step is the same e Negative, the characterising end pointer requires a corresponding number of bytes to be preceded.
After determining the number of bytes that the start pointer and the end pointer need to move in the foregoing steps c1 and c2, step S104 may move the start pointer and the end pointer according to the determined number of bytes, for example, the positions of the data points pointed by the start pointer and the end pointer after the movement are shown in fig. 4. In FIG. 4, the pre-movement start pointer p s The first start data point pointed to is data point M, and the end pointer p before moving e The first ending data point pointed to is data point N+1, then the pre-movement start pointer p is moved s And end pointer p e The Data points within the pointing range are Data points M through N+1, data points in FIG. 4 old The method comprises the steps of carrying out a first treatment on the surface of the After-movement start pointer p s The second initial data point pointed to is data point 2, and the end pointer p after movement e The second end data point pointed to is data point M, then the start pointer p after movement s And end pointer p e The Data points within the pointing range are Data points 2 through M, data point in FIG. 4 new
That is, step S104 moves the start pointer based on the signal period at the first start data point and moves the end pointer based on the signal period at the first end data point. Considering that the vehicle-mounted bus signal may change in the acquisition process, if the change time of the acquisition period is within the range of the movement of the initial pointer, the initial pointer after the movement points to the wrong data point, and similarly, if the change time of the acquisition period is within the range of the movement of the end pointer, the end pointer after the movement points to the wrong data point.
In order to avoid that the pointing range of the moved data pointer is inconsistent with the specified time period, it is necessary to check the position of the data point pointed by the moved data pointer in step S104, that is, "determine whether the data point in the pointing range of the moved data pointer is a data point in the specified time period".
In an alternative embodiment, the process of determining whether the data points within the pointing range of the moved data pointer are the data points within the specified time period in the aforementioned step S104 may include:
and d1, determining a second initial data point according to the position of the data point pointed by the initial pointer after movement, and judging whether the second initial data point is a data point in a specified time period according to the time stamp of the second initial data point and the time stamp of a forward adjacent data point of the second initial data point.
Specifically, this step may determine whether the second start data point is a data point within the specified period by determining whether the start time of the specified period is within a time range consisting of a time stamp of a preceding adjacent data point to the second start data point and a time stamp of the second start data point after determining the second start data point.
For example, referring to FIG. 4, if the second starting data point is data point 2, then the step can determine if the starting time of the specified time period is at [ t ] 1 ,t 2 ]Within the range, if so, the second initial data point is the data point in the appointed time period, and if not, the second initial data point is not the data point in the appointed time period 。
And d2, determining a second end data point according to the position of the data point pointed by the end pointer after movement, and judging whether the second end data point is a data point in a specified time period according to the time stamp of the second end data point and the time stamp of a backward adjacent data point of the second end data point.
Specifically, this step may determine whether the second end data point is a data point within the specified period of time by determining whether the end time of the specified period of time is within a time range consisting of a time stamp of the second end data point and a time stamp of a data point immediately downstream of the second end data point after the second end data point.
For example, referring to FIG. 4, if the second ending data point is data point M, then the step can determine if the ending time of the specified time period is at [ t ] m ,t m+1 ]If the second ending data point is within the range, the second ending data point is indicated as the data point in the appointed time period, and if the second ending data point is not indicated as the data point in the appointed time period.
In this step, if the second start data point and the second end data point are both data points within the specified time period, the data points between the second start data point and the second end data point are also necessarily data points within the specified time period, and then the data points within the pointing range of the moved data pointer are judged to be data points within the specified time period; if the second initial data point is not the data point in the appointed time period, or the second end data point is not the data point in the appointed time period, or neither the second initial data point nor the second end data point is the data point in the appointed time period, judging that the data point in the pointing range of the moved data pointer is not the data point in the appointed time period.
Thus, when the second start data point and the second end data point are both data points within a specified period of time, the aforementioned step S105 may be performed.
In step S105, it is necessary to sequentially extract and parse each data point in the range pointed by the moved data pointer, and when parsing each data point, it is necessary to parse the time stamp of each data point according to the storage sequence, and then parse the signal value of the data point. And sequentially analyzing to restore all the data points in the appointed time period.
For example, taking a data point occupying 16 bytes, wherein the time stamp occupies 8 bytes and the signal value occupies 8 bytes as an example, the process of step S105 "parse all data points within the range pointed by the moved data pointer to obtain the parsing result of all data points within the specified time period" will be described.
Firstly, the first 16 bytes in the pointing range of the moved data pointer are extracted, the first 8 bytes in the first 16 bytes are resolved into the time stamp of the first data point in the pointing range of the moved data pointer according to the double-precision type, the last 8 bytes are resolved into the signal value of the first data point in the pointing range of the moved data pointer according to the double-precision type, and therefore the resolving result of the first data point in the appointed time period can be obtained.
Then, the second 16 bytes in the range pointed by the moved data pointer are extracted, the first 8 bytes in the second 16 bytes are resolved into the time stamp of the second data point in the range pointed by the moved data pointer according to the double-precision type, the last 8 bytes are resolved into the signal value of the second data point in the range pointed by the moved data pointer according to the double-precision type, and thus the resolving result of the second data point in the appointed time period can be obtained.
Similarly, the analysis results of all data points within the specified time period can be obtained.
In summary, the method for accessing the vehicle-mounted bus signal provided by the embodiment occupies small storage space, and has high loading speed and accuracy. The method can solve the problems of overlarge storage file, slow analysis of past data and inaccurate loading data segment when the signal data of the vehicle-mounted bus is recorded for a long time and the past signal data is required to be checked at any time. Meanwhile, the data points of the vehicle-mounted bus signals are stored in a binary value format mode, so that the safety of the data is guaranteed to a certain extent, and the data is not easy to tamper.
Considering that in step S104 in the foregoing embodiment, when "determining whether the data point within the range to which the moved data pointer points is a data point within the specified period of time", there may be a case where the data point within the range to which the moved data pointer points is not a data point within the specified period of time, that is, there may be a case where the second start data point is not a data point within the specified period of time, or the second end data point is not a data point within the specified period of time, or both the second start data point and the second end data point are not data points within the specified period of time.
In this embodiment, when step S104 determines no, step S103 may be executed in a return manner, that is, the number of bytes that the data pointer needs to move is determined according to the position of the data point currently pointed to by the data pointer in the target data file and the specified time period, until step S104 determines that the data point within the pointing range of the moved data pointer is the data point within the specified time period, and then the analysis is performed according to step S105.
In the returning to step S103, the "position of the data point currently pointed to by the data pointer" in step S103 refers to the position of the data point currently pointed to by the data pointer after the previous movement.
For example, as shown in FIG. 4, when the data pointer is not moved, the start pointer points to data point M+1 and the end pointer points to data point N+1.
First, the data pointer is moved for the first time based on steps S102 to S104, and after the data pointer is assumed to be moved for the first time, the start pointer points to the data point 2 and the end pointer points to the data point M, and at this time, it is required to determine whether the data point within the pointing range of the moved data pointer is the data point within the specified time period based on step S104 ".
If the step S104 is no, the step S103 needs to be executed in a return manner, that is, the number of bytes that the data pointer needs to move is determined according to the position of the data point 2 currently pointed by the start pointer, the position of the data point M currently pointed by the end pointer and the specified time period in the target data file, and whether the data point within the pointing range of the moved data pointer is the data point within the specified time period is determined again through the step S104", if not, the step S103 is executed again, and so on.
If the determination in step S104 is yes, the process does not need to return to step S103, but all the data points within the pointing range of the moved data pointer may be parsed according to step S105 "to obtain the parsing result of all the data points within the specified time period.
The implementation process of each step in this embodiment is the same as that of the previous embodiment, and reference may be made to the description of the previous embodiment in detail, which is not repeated here.
In the embodiment, when the judgment in step S104 is no, the number of bytes can be redetermined, and the data pointer is moved again, so that after one or more times of movement in the embodiment, the pointing range of the data pointer is consistent with the specified time period, and at the moment, all the data points in the pointing range of the moved data pointer are analyzed, so that the data points in the specified time period range can be accurately analyzed, and the accuracy of reading the vehicle-mounted bus signal data is improved.
The embodiment of the application further provides an access device for the vehicle-mounted bus signal, the access device for the vehicle-mounted bus signal provided by the embodiment of the application is described below, and the access device for the vehicle-mounted bus signal described below and the access method for the vehicle-mounted bus signal described above can be referred to correspondingly.
Referring to fig. 5, a schematic structural diagram of an access device for a vehicle bus signal provided in an embodiment of the present application is shown, and as shown in fig. 5, the access device for a vehicle bus signal may include: a data point storage module 501, a target data file determination module 502, a byte number determination module 503, a data point judgment module 504, and a data point parsing module 505.
The data point storage module 501 is configured to store data points of the acquired plurality of vehicle-mounted bus signals in corresponding data files in a binary byte format, so as to obtain a data file set formed by the data files respectively corresponding to the plurality of vehicle-mounted bus signals.
The target data file determining module 502 is configured to determine, when a data point of the specified vehicle bus signal needs to be read, a data file corresponding to the specified vehicle bus signal from the data file set, as a target data file.
The byte number determining module 503 is configured to determine the number of bytes that the data pointer needs to move according to the location of the data point currently pointed to by the data pointer in the target data file and the specified time period.
The data point judging module 504 is configured to move the data pointer according to the number of bytes, and judge whether the data point within the pointing range of the moved data pointer is a data point within a specified time period.
And the data point analyzing module 505 is configured to analyze all the data points in the pointing range of the moved data pointer to obtain an analysis result of all the data points in the specified time period when the data point judging module judges that the data points in the pointing range of the moved data pointer are the data points in the specified time period.
According to the access device for the vehicle-mounted bus signals, firstly, data points of a plurality of collected vehicle-mounted bus signals are stored in corresponding data files in a binary byte format to obtain a data file set composed of data files corresponding to the vehicle-mounted bus signals respectively, when the data points of the specified vehicle-mounted bus signals need to be read, the data files corresponding to the specified vehicle-mounted bus signals are determined from the data file set to serve as target data files, then the number of bytes required to be moved by the data pointers is determined according to the positions of the data points currently pointed by the data pointers in the target data files and the specified time period, then the data pointers are moved according to the number of bytes, whether the data points in the pointing range of the moved data pointers are the data points in the specified time period or not is judged, and finally, if so, all the data points in the pointing range of the moved data pointers are analyzed, and the analysis result of the data points in the specified time period is obtained. The data points of the collected vehicle-mounted bus signals can be stored in the corresponding data files in the binary byte format, the data files can be stored in the magnetic disk in the storage mode, historical data are not required to be discarded due to the fact that the magnetic disk space is large, the data points are stored in the binary byte format, the occupied storage space is small, and the access speed is high; meanwhile, when the data points of the appointed vehicle-mounted bus signals need to be read, the method and the device can accurately analyze all the data points in the appointed time period by combining the data pointer.
In addition, data points corresponding to the vehicle-mounted bus signals are stored in the data file in a binary format mode, so that the safety of the vehicle-mounted bus signals is guaranteed to a certain extent, and the vehicle-mounted bus signals are not easy to tamper.
In one possible implementation manner, the byte number determining module 503 may be further configured to determine, when the data point determining module 504 determines that the data point within the pointing range of the moved data pointer is the data point within the specified time period, the number of bytes that the data pointer needs to move according to the location of the data point currently pointed to by the data pointer in the target data file and the specified time period.
In one possible implementation, the byte number determining module 503 may include: a first byte count determination submodule and a second byte count determination submodule.
And the first byte number determining submodule is used for determining the number of bytes to be moved by the starting pointer according to the position of the data point currently pointed by the starting pointer and the starting time of the designated time period.
And the second byte number determining submodule is used for determining the number of bytes required to be moved by the end pointer according to the position of the data point pointed by the end pointer currently and the end time of the appointed time period.
In one possible implementation, a time stamp and signal value at the time the corresponding on-board bus signal was acquired is included in any one data point.
Based on this, the first byte number determining submodule may include: a start signal period calculation sub-module and a first byte number calculation sub-module.
The starting signal period calculation sub-module is used for determining a first starting data point according to the position of the data point pointed by the starting pointer currently, and calculating the signal period at the first starting data point according to the time stamp of the first starting data point to serve as the starting signal period.
And the first byte number calculation sub-module is used for determining the number of bytes to be moved by the initial pointer according to the initial signal period, the position of the data point currently pointed by the initial pointer and the initial time of the appointed time period.
Accordingly, the second byte number determining submodule may include: an end signal period calculation sub-module and a second byte number calculation sub-module.
And the ending signal period calculating sub-module is used for determining a first ending data point according to the position of the data point pointed by the ending pointer currently, and calculating the signal period at the first ending data point according to the timestamp of the first ending data point to serve as the ending signal period.
And the second byte number calculation sub-module is used for determining the number of bytes to be moved by the end pointer according to the end signal period, the position of the data point pointed by the end pointer currently and the end time of the appointed time period.
In one possible implementation manner, the start signal period calculation submodule may be specifically configured to calculate a difference between a timestamp of a backward adjacent data point of the first start data point and a timestamp of the first start data point, where the calculated difference is taken as a signal period at the first start data point.
The end signal period calculation submodule may be specifically configured to calculate a difference between a timestamp of the first end data point and a timestamp of a data point adjacent to the first end data point, where the calculated difference is used as the signal period at the first end data point.
In one possible implementation manner, the first byte number calculation sub-module may include: the system comprises a first difference value calculation sub-module, a first quotient calculation sub-module and a first multiplication calculation sub-module.
And the first difference value calculation sub-module is used for determining the time at the position of the data point pointed by the initial pointer currently, and calculating the difference value between the initial time of the appointed time period and the determined time to obtain a first difference value.
And the first quotient calculation submodule is used for dividing the first difference value by the period of the initial signal to obtain the quotient which is used as the number of data points of which the initial pointer needs to move.
And the first multiplication calculation sub-module is used for calculating the product of the data point data needing to be moved by the starting pointer and the number of bytes occupied by the data point, and the product result is used as the number of bytes needing to be moved by the starting pointer.
Accordingly, the second byte count calculation sub-module may include: the second difference value calculation sub-module, the second quotient calculation sub-module and the second multiplication calculation sub-module.
And the second difference value calculation sub-module is used for determining the time at the position of the data point pointed by the end pointer currently, and calculating the difference value between the end time of the designated time period and the determined time to obtain the first difference value.
And the second quotient calculation sub-module is used for dividing the first difference value by the period of the ending signal, and the obtained quotient is used as the number of data points to be moved by the ending pointer.
And the second multiplication computation sub-module is used for computing the product of the data point data needing to be moved by the end pointer and the occupied byte number of the data point, and the product result is used as the byte number needing to be moved by the end pointer.
In one possible implementation, the data point determination module 504 may include: the first data point judging sub-module and the second data point judging sub-module.
The first data point judging sub-module is used for determining a second initial data point according to the position of the data point pointed by the initial pointer after movement and judging whether the second initial data point is a data point in a specified time period according to the time stamp of the second initial data point and the time stamp of a forward adjacent data point of the second initial data point.
And the second data point judging sub-module is used for determining a second end data point according to the position of the data point pointed by the moved end pointer and judging whether the second end data point is a data point in a specified time period according to the time stamp of the second end data point and the time stamp of a backward adjacent data point of the second end data point.
In one possible implementation, the data file includes unique identification information corresponding to the vehicle bus signal and an identification length corresponding to the unique identification information.
Based on this, the above-described target data file determination module 502 may include: the device comprises an identification analysis sub-module and an identification comparison sub-module.
The identification analysis sub-module is used for analyzing the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal from the data file aiming at each data file in the data file set, and analyzing the unique identification information of the corresponding vehicle-mounted bus signal from the data file according to the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal as the unique identification information corresponding to the data file.
The identification comparison sub-module is used for determining the data file corresponding to the unique identification information of the appointed vehicle-mounted bus signal according to the unique identification information corresponding to each data file, and taking the data file as the target data file.
In one possible implementation manner, the unique identification information is composed of a network segment name, target information, a signal name and a preset symbol, which correspond to the vehicle-mounted bus signal, wherein the target information is message name information or protocol data unit name information.
The embodiment of the application also provides access equipment for the vehicle-mounted bus signals. Alternatively, fig. 6 shows a block diagram of a hardware structure of an access device for an in-vehicle bus signal, and referring to fig. 6, the hardware structure of the access device for an in-vehicle bus signal may include: at least one processor 601, at least one communication interface 602, at least one memory 603 and at least one communication bus 604;
in the embodiment of the present application, the number of the processor 601, the communication interface 602, the memory 603 and the communication bus 604 is at least one, and the processor 601, the communication interface 602 and the memory 603 complete communication with each other through the communication bus 604;
processor 601 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention, etc.;
The memory 603 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;
wherein the memory 603 stores a program, the processor 601 may call the program stored in the memory 603, the program being for:
storing the data points of the acquired vehicle-mounted bus signals in the corresponding data files in a binary byte format to obtain a data file set formed by the data files respectively corresponding to the vehicle-mounted bus signals;
when the data points of the appointed vehicle-mounted bus signals need to be read, determining the data files corresponding to the appointed vehicle-mounted bus signals from the data file set as target data files;
determining the number of bytes to be moved by the data pointer according to the position of the data point pointed by the data pointer in the target data file and the appointed time period;
moving the data pointer according to the number of bytes, and judging whether the data points in the pointing range of the moved data pointer are data points in a specified time period or not;
if yes, all the data points in the pointing range of the moved data pointer are analyzed, and analysis results of all the data points in the appointed time period are obtained.
Alternatively, the refinement function and the extension function of the program may be described with reference to the above.
The embodiment of the application also provides a readable storage medium, on which a computer program is stored, the computer program implementing the method for accessing the vehicle-mounted bus signal when being executed by a processor.
Alternatively, the refinement function and the extension function of the program may be described with reference to the above.
Finally, it is further noted that relational terms such as second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A method for accessing a vehicle bus signal, comprising:
storing the data points of the acquired vehicle-mounted bus signals in the corresponding data files in a binary byte format to obtain a data file set formed by the data files respectively corresponding to the vehicle-mounted bus signals;
when the data points of the appointed vehicle-mounted bus signals need to be read, determining the data files corresponding to the appointed vehicle-mounted bus signals from the data file set as target data files;
Determining the number of bytes to be moved by the data pointer according to the position of the data point pointed by the data pointer in the target data file and the appointed time period;
moving the data pointer according to the number of bytes, and judging whether the data points in the pointing range of the data pointer after the movement are the data points in the appointed time period or not;
if yes, analyzing all the data points in the pointing range of the data pointer after moving to obtain analysis results of all the data points in the appointed time period;
the data file comprises unique identification information corresponding to the vehicle-mounted bus signal and identification length corresponding to the unique identification information;
the determining, from the data file set, a data file corresponding to the specified vehicle-mounted bus signal as a target data file includes:
analyzing the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal from each data file in the data file set, and analyzing the unique identification information of the corresponding vehicle-mounted bus signal from the data file according to the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal as the unique identification information corresponding to the data file;
And determining the data file corresponding to the unique identification information of the appointed vehicle-mounted bus signal as the target data file according to the unique identification information corresponding to each data file.
2. The method for accessing an on-board bus signal according to claim 1, further comprising:
and if not, returning to execute the data point position pointed by the data pointer in the target data file and the appointed time period, and determining the number of bytes to be moved by the data pointer.
3. The method for accessing a vehicle-mounted bus signal according to claim 2, wherein the determining the number of bytes to be moved by the data pointer according to the location of the data point currently pointed to by the data pointer in the target data file and the specified time period includes:
determining the number of bytes to be moved by the initial pointer according to the position of the data point pointed by the initial pointer currently and the initial time of the appointed time period;
and determining the number of bytes to be moved by the end pointer according to the position of the data point pointed by the end pointer currently and the end time of the appointed time period.
4. A method of accessing a vehicle bus signal according to claim 3, wherein any one of the data points includes a time stamp and a signal value at the time of acquisition of the corresponding vehicle bus signal;
The determining the number of bytes to be moved by the start pointer according to the position of the data point pointed by the start pointer and the start time of the appointed time period comprises the following steps:
determining a first initial data point according to the position of the data point pointed by the initial pointer currently, and calculating a signal period at the first initial data point according to the timestamp of the first initial data point to serve as an initial signal period;
determining the number of bytes to be moved by the initial pointer according to the initial signal period, the position of the data point pointed by the initial pointer currently and the initial time of the appointed time period;
the determining the number of bytes to be moved by the end pointer according to the position of the data point pointed by the end pointer and the end time of the appointed time period comprises the following steps:
determining a first end data point according to the position of the data point pointed by the end pointer currently, and calculating a signal period at the first end data point according to the timestamp of the first end data point to be used as an end signal period;
and determining the number of bytes to be moved by the end pointer according to the end signal period, the position of the data point pointed by the end pointer currently and the end time of the appointed time period.
5. The method of claim 4, wherein calculating the signal period at the first starting data point based on the timestamp of the first starting data point comprises:
calculating a difference between a timestamp of a backward adjacent data point of the first starting data point and a timestamp of the first starting data point, the calculated difference being taken as a signal period at the first starting data point;
the calculating the signal period at the first end data point according to the timestamp of the first end data point comprises:
a difference between the time stamp of the first end data point and the time stamp of a forward adjacent data point of the first end data point is calculated, the calculated difference being the signal period at the first end data point.
6. The method for accessing a vehicle-mounted bus signal according to claim 4, wherein determining the number of bytes the start pointer needs to move according to the start signal period, the position of the data point to which the start pointer is currently pointing, and the start time of the specified time period comprises:
determining the time of the position of the data point pointed by the initial pointer currently, and calculating the difference value between the initial time of the appointed time period and the determined time to obtain a first difference value;
Dividing the first difference value by the initial signal period to obtain a quotient as the number of data points to be moved by the initial pointer;
calculating the product of data points to be moved of the initial pointer and the number of occupied bytes of the data points, wherein the product result is used as the number of bytes to be moved of the initial pointer;
the determining the number of bytes that the end pointer needs to move according to the end signal period, the position of the data point that the end pointer points to and the end time of the specified time period includes:
determining the time at the position of the data point pointed by the end pointer currently, and calculating the difference between the end time of the appointed time period and the determined time to obtain a first difference;
dividing the first difference value by the period of the ending signal to obtain a quotient as the number of data points to be moved by the ending pointer;
and calculating the product of the number of data points to be moved by the end pointer and the number of bytes occupied by the data points, wherein the product result is used as the number of bytes to be moved by the end pointer.
7. The method for accessing a vehicle bus signal according to claim 3, wherein determining whether the data point within the pointing range of the data pointer after the movement is the data point within the specified period of time comprises:
Determining a second initial data point according to the position of the data point pointed by the initial pointer after movement, and judging whether the second initial data point is the data point in the appointed time period according to the time stamp of the second initial data point and the time stamp of the forward adjacent data point of the second initial data point;
and determining a second end data point according to the position of the data point pointed by the end pointer after the movement, and judging whether the second end data point is the data point in the appointed time period according to the time stamp of the second end data point and the time stamp of the backward adjacent data point of the second end data point.
8. The method for accessing a vehicle-mounted bus signal according to claim 1, wherein the unique identification information is composed of a network segment name, target information, a signal name and a preset symbol to which the corresponding vehicle-mounted bus signal belongs, wherein the target information is message name information or protocol data unit name information.
9. An access device for a vehicle-mounted bus signal, comprising:
the data point storage module is used for storing the data points of the acquired vehicle-mounted bus signals in the corresponding data files in a binary byte format so as to obtain a data file set formed by the data files respectively corresponding to the vehicle-mounted bus signals;
The target data file determining module is used for determining a data file corresponding to the appointed vehicle-mounted bus signal from the data file set as a target data file when the data point of the appointed vehicle-mounted bus signal needs to be read;
the byte number determining module is used for determining the number of bytes to be moved by the data pointer according to the position of the data point pointed by the data pointer in the target data file and the appointed time period;
the data point judging module is used for moving the data pointer according to the number of bytes and judging whether the data points in the pointing range of the data pointer after the movement are the data points in the appointed time period or not;
the data point analyzing module is used for analyzing all the data points in the pointing range of the data pointer after the movement to obtain analysis results of all the data points in the appointed time period when the data point judging module judges that the data points in the pointing range of the data pointer after the movement are the data points in the appointed time period;
the data file comprises unique identification information corresponding to the vehicle-mounted bus signal and identification length corresponding to the unique identification information;
The target data file determining module includes: an identification analysis sub-module and an identification comparison sub-module;
the identification analysis submodule is used for analyzing the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal from each data file in the data file set, and analyzing the unique identification information of the corresponding vehicle-mounted bus signal from the data file according to the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal as the unique identification information corresponding to the data file;
the identification comparison sub-module is used for determining the data file corresponding to the unique identification information of the appointed vehicle-mounted bus signal according to the unique identification information corresponding to each data file, and taking the data file as the target data file.
CN202210574316.6A 2022-05-25 2022-05-25 Vehicle-mounted bus signal access method and device Active CN115001894B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210574316.6A CN115001894B (en) 2022-05-25 2022-05-25 Vehicle-mounted bus signal access method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210574316.6A CN115001894B (en) 2022-05-25 2022-05-25 Vehicle-mounted bus signal access method and device

Publications (2)

Publication Number Publication Date
CN115001894A CN115001894A (en) 2022-09-02
CN115001894B true CN115001894B (en) 2023-06-30

Family

ID=83028439

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210574316.6A Active CN115001894B (en) 2022-05-25 2022-05-25 Vehicle-mounted bus signal access method and device

Country Status (1)

Country Link
CN (1) CN115001894B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6760741B1 (en) * 2000-06-05 2004-07-06 Corage Ltd. FFT pointer mechanism for FFT memory management
CN112463734A (en) * 2020-11-20 2021-03-09 苏州浪潮智能科技有限公司 File retrieval method, system and related device
CN112904758A (en) * 2021-01-14 2021-06-04 北京经纬恒润科技股份有限公司 Data return link state monitoring method and system based on unmanned vehicle
CN113742298A (en) * 2021-11-04 2021-12-03 南京芯传汇电子科技有限公司 Airborne binary file general parallel analysis method and device and electronic equipment
CN114115023A (en) * 2021-11-24 2022-03-01 中清睿(厦门)环境科技有限公司 Method for realizing identification and operation of AVC configuration file
CN114268670A (en) * 2021-12-31 2022-04-01 上海创时汽车科技有限公司 Ethernet asynchronous message processing system and method based on time trigger
CN114490853A (en) * 2022-01-27 2022-05-13 腾讯科技(深圳)有限公司 Data processing method, device, equipment, storage medium and program product

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5851857B2 (en) * 2012-01-20 2016-02-03 アズビル株式会社 Graph display device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6760741B1 (en) * 2000-06-05 2004-07-06 Corage Ltd. FFT pointer mechanism for FFT memory management
CN112463734A (en) * 2020-11-20 2021-03-09 苏州浪潮智能科技有限公司 File retrieval method, system and related device
CN112904758A (en) * 2021-01-14 2021-06-04 北京经纬恒润科技股份有限公司 Data return link state monitoring method and system based on unmanned vehicle
CN113742298A (en) * 2021-11-04 2021-12-03 南京芯传汇电子科技有限公司 Airborne binary file general parallel analysis method and device and electronic equipment
CN114115023A (en) * 2021-11-24 2022-03-01 中清睿(厦门)环境科技有限公司 Method for realizing identification and operation of AVC configuration file
CN114268670A (en) * 2021-12-31 2022-04-01 上海创时汽车科技有限公司 Ethernet asynchronous message processing system and method based on time trigger
CN114490853A (en) * 2022-01-27 2022-05-13 腾讯科技(深圳)有限公司 Data processing method, device, equipment, storage medium and program product

Also Published As

Publication number Publication date
CN115001894A (en) 2022-09-02

Similar Documents

Publication Publication Date Title
US20140317065A1 (en) Reference counter integrity checking
US20130086005A1 (en) Hash pointer checking for hierarchical database logical relationship
EP0720107A1 (en) Dictionary retrieval apparatus
CN114817651B (en) Data storage method, data query method, device and equipment
CN111859033A (en) IP library query method and device and IP library compression method and device
CN115001894B (en) Vehicle-mounted bus signal access method and device
CN112949290B (en) Text error correction method and device and communication equipment
US8229891B2 (en) Method, apparatus and computer program for model-driven message parsing
CN110796060A (en) Method, device and equipment for determining high-speed driving route and storage medium
CN115967604A (en) Message transmission method and device, electronic equipment and computer readable storage medium
CN113468866B (en) Method and device for analyzing non-standard JSON string
CN112632132B (en) Processing method, device and equipment for abnormal imported data
CN111143554B (en) Data sampling method and device based on big data platform
CN114817645A (en) Time sequence data storage and reading method, device, equipment and storage medium
CN111813474A (en) Multi-language display method and device and electronic equipment
CN111708900A (en) Expansion method and expansion device for tag synonym, electronic device and storage medium
CN111143398A (en) Extra-large set query method and device based on extended SQL function
CN111882310B (en) Data comparison method, device and equipment and computer readable storage medium
CN114168079B (en) Method, device and related component for identifying tiff type data deleted from disk
CN111125147B (en) Extra-large set analysis method and device based on extended pre-calculation model and SQL function
CN115617392B (en) Method and device for determining version number
CN116800637B (en) Method for estimating base number of data item in data stream and related equipment
CN115237905A (en) Data management method and device, electronic equipment and computer readable storage medium
CN113704194A (en) Label type file management method and device, electronic equipment and storage medium
CN113641731A (en) Fuzzy search optimization method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant