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

Vehicle-mounted bus signal access method and device Download PDF

Info

Publication number
CN115001894A
CN115001894A CN202210574316.6A CN202210574316A CN115001894A CN 115001894 A CN115001894 A CN 115001894A CN 202210574316 A CN202210574316 A CN 202210574316A CN 115001894 A CN115001894 A CN 115001894A
Authority
CN
China
Prior art keywords
data
data point
pointer
vehicle
time period
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.)
Granted
Application number
CN202210574316.6A
Other languages
Chinese (zh)
Other versions
CN115001894B (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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

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

Description

Vehicle-mounted bus signal access method and device
Technical Field
The application relates to the field of automobile bus data analysis, in particular to a vehicle-mounted bus signal access method and device.
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 signal needs to be stored and read, and the existing implementation methods mainly comprise the following two methods: the first method uses the memory of the computer to directly store data and read historical data; the second method uses a text file to store the signal data in the form of characters and parse the loading-specified line number history data as needed.
In the first method, a computer memory is used to realize rapid data storage and rapid historical data extraction, but in the actual automobile bus data communication process, massive signal data storage is involved, and because the computer memory is limited, some historical data must be discarded, which can cause that the discarded data cannot be analyzed, so that some key information may be missed, and the whole collected data is invalid; in the second method, signal data is stored in a text file in a character form, so that a large number of data signals can be stored, but the text characters occupy a large byte space, and when the data amount is very large, a huge data file is formed, and in this way, a large amount of computer performance is consumed during data storage and analysis, and the analysis process cannot accurately analyze the signal data within a specified time period range through text line number analysis.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for accessing a vehicle bus signal, so as to solve the problems in the prior art that historical data needs to be discarded, and text characters occupy more 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:
a vehicle-mounted bus signal access method comprises the following steps:
storing the acquired data points of the plurality of vehicle-mounted bus signals in corresponding data files in a binary byte format to obtain a data file set consisting of the data files respectively corresponding to the plurality of vehicle-mounted bus signals;
when data points of the appointed vehicle-mounted bus signals need to be read, determining a data file corresponding to the appointed vehicle-mounted bus signals from the data file set as a target data file;
determining the number of bytes which need to be moved by a data pointer according to the position of a data point which is currently pointed by the data pointer in a target data file and a specified time period;
moving the data pointer according to the number of bytes, and judging whether a data point in a pointing range of the moved data pointer is a data point in a specified time period or not;
and if so, analyzing all data points in the pointing range of the moved data pointer to obtain the analysis results of all data points in the appointed time period.
Optionally, the method further includes:
if not, returning to execute the step of 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 designated time period.
Optionally, determining the number of bytes that 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, where the determining includes:
determining the number of bytes which the starting pointer needs to move according to the position of the data point which the starting pointer points to at present and the starting time of the designated time period;
and determining the number of bytes which need to be moved by the end pointer according to the position of the data point currently pointed by the end pointer and the end time of the specified time period.
Optionally, any data point includes a timestamp and a signal value when a corresponding vehicle bus signal is acquired;
determining the number of bytes which the start pointer needs to move according to the position of the data point which the start pointer points to currently and the start time of the designated time period, wherein the determining comprises the following steps:
determining a first initial data point according to the position of the data point currently pointed by the initial pointer, and calculating a signal period at the first initial data point according to the time stamp of the first initial data point to be used as an initial signal period;
determining the number of bytes which the starting pointer needs to move according to the starting signal period, the position of the data point which the starting pointer points to at present and the starting time of the designated time period;
determining the number of bytes required to be moved by the ending pointer according to the position of the data point currently pointed by the ending pointer and the ending time of the designated time period, wherein the determining comprises the following steps:
determining a first end data point according to the position of the data point currently pointed by the end pointer, and calculating a signal cycle at the first end data point according to the timestamp of the first end data point to be used as an end signal cycle;
and determining the number of bytes which need to be moved by the end pointer according to the end signal period, the position of the data point currently pointed by the end pointer and the end time of the designated time period.
Optionally, calculating a signal period at the first start data point according to the timestamp of the first start data point, including:
calculating the difference value between the time stamp of the backward adjacent data point of the first initial data point and the time stamp of the first initial data point, and taking the calculated difference value as the signal period at the first initial data point;
calculating a signal period at the first end data point based on the timestamp of the first end data point, comprising:
and calculating the difference value of the time stamp of the first ending data point and the time stamp of the forward adjacent data point of the first ending data point, and taking the calculated difference value as the signal period at the first ending data point.
Optionally, determining the number of bytes that the start pointer needs to move according to the start signal cycle, the position of the data point currently pointed by the start pointer, and the start time of the specified time period, includes:
determining the time of the position of the data point currently pointed by the starting pointer, and calculating the difference between the starting 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 starting signal to obtain a quotient value which is used as the number of data points which need to be moved by the starting pointer;
calculating the product of the number of data points needing to be moved by the start pointer and the number of bytes occupied by the data points, and taking the product result as the number of bytes needing to be moved by the start pointer;
determining the number of bytes required to be moved by the end pointer according to the end signal cycle, the position of the data point currently pointed by the end pointer and the end time of the designated time period, wherein the determining comprises the following steps:
determining the time of the position of the data point pointed by the ending pointer at present, and calculating the difference between the ending time of the appointed time period and the determined time to obtain a first difference;
dividing the first difference value by the ending signal period to obtain a quotient value serving as the number of data points needing to be moved by the ending pointer;
and calculating the product of the number of the data points needing to be moved by the end pointer and the number of bytes occupied by the data points, and taking the product as the number of bytes needing to be moved by the end pointer.
Optionally, determining whether the data point within the range pointed by 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 moved initial pointer, and judging whether the second initial data point is a data point in a specified time period or not 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 ending data point according to the position of the data point pointed by the moving ending pointer, and judging whether the second ending data point is a data point in a specified time period according to the time stamp of the second ending data point and the time stamp of a backward adjacent data point of the second ending 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 a specified vehicle-mounted bus signal from the data file set as a target data file, wherein the data file comprises the following steps:
for each data file in the data file set, analyzing an identification length corresponding to unique identification information of a corresponding vehicle-mounted bus signal from the data file, 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 to serve 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 to which the corresponding vehicle-mounted bus signal belongs, target information, a signal name and a preset symbol, wherein the target information is message name information or protocol data unit name information.
An access device for vehicle bus signals, comprising:
the data point storage module is used for storing the acquired data points of the plurality of vehicle-mounted bus signals in the corresponding data files in a binary byte format so as to obtain a data file set consisting of the data files respectively corresponding to the plurality of 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 a 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 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 designated time period;
the data point judgment module is used for 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 a data point in a specified time period or not;
and the data point analyzing module is used for analyzing all data points in the pointing range of the moved data pointer when the data point judging module judges that the data points in the pointing range of the moved data pointer are data points in the designated time period, so as to obtain the analysis results of all the data points in the designated time period.
According to the technical scheme, the vehicle-mounted bus signal access method comprises the steps of firstly storing collected data points of a plurality of vehicle-mounted bus signals in a corresponding data file in a binary byte format to obtain a data file set formed by 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, determining the data file corresponding to the specified vehicle-mounted bus signals from the data file set as a target data file, then determining the number of bytes which the data pointer needs to move according to the position of the data point pointed by the data pointer in the target data file and a specified time period, then moving the data pointer according to the number of bytes, judging whether the data points pointed by the moved data pointer are the data points in the specified time period or not, and finally analyzing all the data points pointed by the moved data pointer in the range if the data points are the data points in the specified time period, and obtaining the analysis result of all data points in the specified time period. According to the method, the data points of the acquired vehicle-mounted bus signals can be stored in the corresponding data files in a binary byte format, the data files can be stored in the magnetic disk in a storage mode, historical data do not need to be discarded due to the fact that the magnetic disk space is large, the data points are stored in the binary byte format, occupied storage space is small, and the access speed is high; meanwhile, when data points of the appointed vehicle-mounted bus signals need to be read, all the data points in the appointed time period can be accurately analyzed by combining the data pointer.
In addition, the 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 needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a schematic flowchart illustrating a method for accessing a vehicle bus signal according to an embodiment of the present disclosure;
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 illustrating a location of a data point currently pointed to by a data pointer according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of the location of a data point pointed to by a data pointer before and after movement according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of an access device for vehicle bus signals according to an embodiment of the present disclosure;
fig. 6 is a block diagram of a hardware structure of an access device for a vehicle bus signal according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In view of the problems that the existing method for directly storing data and reading historical data by using a memory of a computer needs to discard the historical data due to the limited memory of the computer and the problem that the method for storing vehicle-mounted bus signal data by using a text file in a character form occupies a large byte space, has low access speed and cannot accurately analyze the signal data within a specified time period range, the inventor of the present application has conducted intensive research and finally provides a vehicle-mounted bus signal access method.
Vehicle bus signal (signal for short): the method comprises the steps of defining signals in a vehicle bus database (database for short) file, defining information such as names, start bits, lengths and calculation rules of signal physical values in the database, wherein the signal values are the results of intercepting and calculating data bytes in real bus data according to the definition.
Data points: data information of the vehicle bus signal, optionally the data point includes a bus time stamp (optionally in seconds) of the signal and a signal value.
Signal unique identification: the identification of the signal is uniquely identified in a vehicle communication network segment.
The following embodiments will describe the access method of the vehicle bus signal provided by the present application in detail.
Referring to fig. 1, a schematic flow chart of an access method of a vehicle bus signal provided in an embodiment of the present application is shown, where the access method of the vehicle bus signal may include:
step S101, storing the acquired data points of the plurality of vehicle-mounted bus signals in corresponding data files in a binary byte format to obtain a data file set consisting of the data files respectively corresponding to the plurality of vehicle-mounted bus signals.
In this embodiment, a corresponding data file in binary byte format may be defined for each vehicle bus signal, and optionally, a data file in binary byte with a suffix name 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 the corresponding data file, and when the data points are stored, the collected data points need to be converted into a binary byte format for storage.
And S102, when data points of the specified vehicle-mounted bus signals need to be read, determining data files corresponding to the specified vehicle-mounted bus signals from the data file set as target data files.
Specifically, the step may analyze the data file set to determine a data file corresponding to the designated vehicle bus signal from the data file set. Here, the designated in-vehicle bus signal refers to an in-vehicle bus signal corresponding to a data point that needs to be read.
Step S103, determining the number of bytes which the data pointer needs to move according to the position of the data point which the data pointer currently points to 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 currently pointed by the data pointer and the specified time period.
Here, if the data point in the specified time period read this time is read for the first time, the data point currently pointed by the data pointer is the first data point in the target data file, and if the data point in the specified time period read this time is not read for the first time, that is, the data point in a certain time period has been read by the history, the data point currently pointed by the data pointer is the position of the data point pointed by the data pointer when the data point in a certain time period has been read by the history last time.
And step S104, moving the data pointer according to the number of bytes, and judging whether the data point in the range pointed by the moved data pointer is the data point in the specified time period.
After the number of bytes is determined in the foregoing steps, 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.
Considering that analysis processing is needed when the data point is read, if the data point outside the specified time period range is analyzed, additional analysis time is consumed, and the reading efficiency of the data point is reduced.
And step S105, if yes, analyzing all data points in the pointing range of the moved data pointer to obtain the analysis results of all data points in the appointed time period.
Specifically, in this step, when it is determined that the data point within the range pointed by the moved data pointer is a data point within the specified time period, all the data points within the range pointed by the moved data pointer are sequentially analyzed according to the storage format in step S101, so as to obtain an analysis result.
The access method of the vehicle-mounted bus signals comprises the steps of firstly storing collected data points of a plurality of vehicle-mounted bus signals in corresponding data files in a binary byte format to obtain a data file set formed by the data files corresponding to the vehicle-mounted bus signals respectively, determining the data file corresponding to the specified vehicle-mounted bus signal from the data file set as a target data file when the data points of the specified vehicle-mounted bus signal need to be read, then determining the number of bytes needing to be moved by a data pointer according to the position of the data point currently pointed by the data pointer in the target data file and a specified time period, then moving the data pointer according to the number of bytes, judging whether the data point pointed by the moved data pointer in a range is the data point in the specified time period or not, and finally analyzing all the data points pointed by the moved data pointer in the range if the data point is the data point in the specified time period, and obtaining the analytic result of the data points in the designated time period. According to the method, the data points of the acquired vehicle-mounted bus signals can be stored in the corresponding data files in a binary byte format, the data files can be stored in the magnetic disk in a storage mode, historical data do not need to be discarded due to the fact that the magnetic disk space is large, the data points are stored in the binary byte format, occupied storage space is small, and the access speed is high; meanwhile, when data points of the appointed vehicle-mounted bus signals need to be read, all the data points in the appointed time period can be accurately analyzed by combining the data pointer.
In addition, the 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 order to make the present application more understandable to those skilled in the art, the foregoing embodiments are described in detail below with reference to specific implementation processes of various steps.
First, taking any one of a plurality of vehicle-mounted bus signals as an example, a specific implementation process of storing the collected data points of the vehicle-mounted bus signal in a binary byte format in a corresponding data file in the foregoing step S101 will be described.
Optionally, the specific implementation process of the step S101 "storing the acquired data points of the vehicle-mounted bus signal in a corresponding data file in a binary byte format" includes:
step a1, storing the identification length corresponding to the unique identification information of the vehicle bus signal in the first 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 can be used as the identification length corresponding to the unique identification information of the vehicle-mounted bus signal and stored in the first bits of the corresponding data file.
In an alternative embodiment, this step may convert the number of characters included in the unique identification information into a binary value with a length of several bits, and then store the binary value obtained by conversion in the first several bits of the corresponding data file.
Optionally, the first bits may be the first 12 bits, that is, the identification length in this step is composed of 12 bits, and the 12 bits may represent a value range of 1 to 4095 bytes (byte).
For example, see fig. 2 for a schematic diagram of a specific storage structure of the data file. The identification length in this step is the Key length, and in this step, the number of characters contained in the unique identification information can be converted into a 12-bit binary value and stored at the position of the Key length.
Step a2, storing the unique identification information of the vehicle bus signal in a plurality of bytes after the identification length of the corresponding data file.
Optionally, in this step, the byte sequence of the unique identification information may be mapped through an ASCII code table to obtain readable character string format identification information (binary value), and then the character string format 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 included in the character string format 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 the like.
It should be noted that the unique identification information stored in the corresponding data file in this step does not include a chinese character.
For example, referring to fig. 2, the unique identification information in this step refers to a Key value, and the maximum length of the Key value is 4095 bytes.
As shown in fig. 2, the present embodiment may use the above 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 to which the corresponding vehicle-mounted bus signal belongs, 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 (PDU) name information; optionally, the preset symbol may be an english double colon.
Step a3, storing the collected data points of the vehicle bus signal in 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 that the data points can be analyzed in the subsequent reading process.
Optionally, the data point of the vehicle-mounted bus signal specifically includes a timestamp and a signal value when the vehicle-mounted bus signal is collected, that is, the timestamp 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 point in the specified time period is conveniently and accurately analyzed subsequently.
It should be noted that, in this step, after the data point is collected, the data point needs to be converted into a binary character format (i.e., a binary value), and then the data point is sequentially stored in 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 finished.
Optionally, in this embodiment, the timestamp of the data point may occupy 8 bytes, the corresponding signal value may occupy 8 bytes, and all the data points of the vehicle bus signal are sequentially stored according to the sequence of the timestamps.
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 timestamps, for each data point, the timestamp at the time of acquisition occupies 8 bytes, and the specific signal value acquired occupies 8 bytes.
By adopting the storage method introduced in the above step, all data points of the vehicle-mounted bus signal can be stored in the corresponding data file, so that the data file set in the step can be obtained.
When data points of the designated vehicle-mounted bus signals need to be read, the data files in the data file set can be analyzed based on the introduced storage structure to obtain a target data file, and then all the data points in the designated time period in the target data file are accurately analyzed.
Specifically, in an alternative embodiment, the aforementioned "step S102, when the data point of the specified vehicle-mounted bus signal needs to be read, determining the data file corresponding to the specified vehicle-mounted bus signal from the data file set, and using the data file as the target data file" includes:
step b1, for each data file in the data file set, analyzing the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal from the data file, and according to the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal, analyzing the unique identification information of the corresponding vehicle-mounted bus signal from the data file as the unique identification information corresponding to the data file.
Optionally, as introduced in the foregoing step, the first several bits of the data file may be first parsed to obtain the identification length corresponding to the unique identification information of the corresponding vehicle-mounted bus signal, and then, the bytes with the identification length after the first several bits of the data file may be parsed to obtain the parsed unique identification information.
For example, first 12 bits of the data file are taken out, a shaping numerical value is calculated according to unsigned condition, the shaping numerical value is an identification length corresponding to unique identification information of the vehicle-mounted bus signal corresponding to the data file, and assuming that 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, so that 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 specified vehicle-mounted bus signal as a target data file according to the unique identification information corresponding to each data file.
After the unique identification information corresponding to each data file in the data file set is determined in the step b1, the data file corresponding to the unique identification information of the designated vehicle 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 target data file within the specified time period may 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 aforementioned "step S103, determining the number of bytes that 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:
and c1, determining the number of bytes that the start pointer needs to move according to the position of the data point currently pointed by the start pointer and the start time of the specified time period.
Optionally, the process of this step specifically includes steps c11 to c 12:
step c11, determining a first start data point according to the position of the data point currently pointed to by the start pointer, and calculating the signal period at the first start data point according to the time stamp of the first start data point as the start signal period.
In this step, the data point currently pointed to by the start pointer is recorded as the first start data point. As shown in FIG. 3, the start pointer refers to p s The time at the position 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.
Alternatively, the process of "calculating the signal period at the first start data point according to the time stamp of the first start data point" includes: and calculating the difference value of the time stamp of the backward adjacent data point of the first initial data point and the time stamp of the first initial data point, wherein the calculated difference value is used as the signal period at the first initial data point. For example, the difference between the time stamp of the first start data point M +1 and the time stamp of the data point M in fig. 3 is determined as the signal period at the first start data point M.
It should be noted that the process of calculating the signal period at the first start data point according to the timestamp of the first start data point given in this step is only an example, and other ways may also be adopted besides this, for example, a difference between the timestamp of the first start data point and the timestamp of the forward adjacent data point of the first start data point is calculated as the signal period at the first start data point, which is not limited in this application.
And c12, determining the number of bytes that the start pointer needs to move according to the start signal period, 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 c 123:
and step c121, determining the time of the position of the data point currently pointed by the start pointer, and calculating the difference between the start time of the specified time period and the determined time to obtain a first difference.
And c122, dividing the first difference by the period of the starting signal to obtain a quotient value which is used as the number of data points required to be moved by the starting pointer.
And c123, calculating the product of the number of the data points which need to be moved by the start pointer and the number of bytes occupied by the data points, and taking the product as the number of the bytes which need to be moved by the start pointer.
In this embodiment, the number of bytes occupied by each data point is a preset fixed value, and after the number of data points that the start pointer needs to move is determined, the number of data points that the start pointer needs to move may be multiplied by the number of bytes occupied by the data point to obtain the number of bytes that the start pointer needs to move.
That is, the step can determine the number of bytes that the start pointer needs to move by using the following formula (1).
Figure BDA0003661465250000131
In the formula, count s Means the number of bytes that the start pointer needs to move, t news Refers to the starting time, t, of a specified time period m Refers to the time, Δ t, at the position of the data point currently pointed to by the start pointer m Refers to the starting signal period, and λ refers to the number of bytes occupied by the data point (i.e., the number of bytes occupied by each data point).
Alternatively, as described above for data points, λ may be specifically 16 (i.e., 8 bytes occupied by the timestamp plus 8 bytes occupied by the signal value, which is 16 bytes); of course, in practical applications, λ may be other, which is not limited in this application.
It should be noted that, if the number count of bytes determined in this step is determined in this step s If the value is positive, the representation starting pointer needs to be moved backwards by a corresponding number of bytes; if the byte number count determined in this step s Is a negative value, thenCharacterizing the start pointer requires a corresponding number of bytes to be advanced.
And c2, determining the number of bytes that the end pointer needs to move according to the position of the data point currently pointed by the end pointer and the end time of the specified time period.
Optionally, the process of this step specifically includes the following steps c21 to c 22:
and c21, determining a first end data point according to the position of the data point currently pointed by the end pointer, and calculating the signal period at the first end data point according to the time stamp of the first end data point as an end signal period.
In this step, the data point currently pointed to by the end pointer is recorded as the first end data point. As shown in FIG. 3, the end pointer refers to p e The time at the position of the data point currently pointed to by the end pointer (defined as the end time) is t n+1 The first end data point is data point N + 1.
Alternatively, the process of "calculating the signal period at the first end data point from the time stamp of the first end data point" includes: a difference between the timestamp of the first end data point and the timestamp of a forward adjacent data point to the first end data point is calculated, and the calculated difference is taken as 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 only an example, and other manners may also be adopted besides this, for example, a 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 is calculated as the signal period at the first end data point, which is not limited in this application.
And c22, determining the number of bytes that the end pointer needs to move according to the end signal period, the position of the data point currently pointed by the end pointer and the end time of the designated time period.
Optionally, the process of this step includes the following steps c221 to c 223:
and step c221, determining the time of the position of the data point currently pointed by the ending pointer, and calculating the difference between the ending time of the appointed time period and the determined time to obtain a first difference.
Step c222, dividing the first difference by the ending signal period to obtain a quotient, and using the quotient as the number of data points required to be moved by the ending pointer.
And step c223, calculating the product of the number of the data points which need to be moved by the ending pointer and the number of bytes occupied by the data points, and taking the product result as the number of the bytes which need to be moved by the ending pointer.
As described in step c123, the number of bytes occupied by each data point is a preset fixed value, and after the number of data points that the end pointer needs to move is determined, the number of bytes occupied by the data points that the end pointer needs to move may be multiplied by the number of bytes occupied by the data points, so as to obtain the number of bytes that the end pointer needs to move.
That is, the step can determine the number of bytes that the start pointer needs to move by using the following formula (2).
Figure BDA0003661465250000141
In the formula, count e Means the number of bytes that the start pointer needs to move, t newe Refers to the starting time, t, of a specified time period n+1 Refers to the time, Δ t, at the position of the data point currently pointed to by the start pointer n Refers to the starting signal period, and λ refers to the number of bytes occupied by each data point.
It should be noted that, if the number count of bytes determined in this step is determined in this step e If the value is positive, the representation ending pointer needs to be moved backwards by a corresponding number of bytes; if the byte number count determined in this step is not the same as the byte number count determined in the previous step e A negative value indicates that the end pointer needs to be moved forward by a corresponding number of bytes.
After the foregoing steps c1 and c2 determine the number of bytes that the start pointer and end pointer need to be moved,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 moving are as shown in fig. 4. In FIG. 4, the pre-movement start pointer p s Point to the first starting data point as data point M, move the ending pointer p e If the first end data point is the data point N +1, the pre-start pointer p is moved s And an end pointer p e The Data points within the pointing range are Data points M to N +1, i.e., Data in FIG. 4 old (ii) a Moving the starting pointer p s Point to the second starting data point, data point 2, and end pointer p after movement e If the second end data point is the data point M, the start pointer p is moved s And an end pointer p e The Data points within the pointing range are Data points 2-M, i.e., Data in FIG. 4 new
That is, step S104 is to move the start pointer based on the signal period at the first start data point and to move the end pointer based on the signal period at the first end data point. Considering that the acquisition cycle of the vehicle-mounted bus signal may change during the acquisition process, if the change time of the acquisition cycle is within the moving range of the start pointer, the start pointer points to the wrong data point after moving, and similarly, if the change time of the acquisition cycle is within the moving range of the end pointer, the end pointer points to the wrong data point after moving.
In order to avoid the inconsistency between the range pointed by the moved data pointer and the specified time period, the position of the data point pointed by the moved data pointer needs to be checked in step S104, that is, "determine whether the data point in the range pointed by the moved data pointer is the data point in the specified time period".
In an alternative embodiment, the process of determining whether the data point within the range pointed by the moved data pointer is a data point within a specified time period in step S104 may include:
and d1, determining a second starting data point according to the position of the data point pointed by the moving starting pointer, and judging whether the second starting data point is a data point in the designated time period according to the time stamp of the second starting data point and the time stamp of the forward adjacent data point of the second starting data point.
Specifically, after determining the second starting data point, the present step can determine whether the starting time of the specified time period is within a time range formed by the timestamp of the forward adjacent data point of the second starting data point and the timestamp of the second starting data point, so as to determine whether the second starting data point is a data point within the specified time period.
For example, referring to FIG. 4, where the second starting data point is data point 2, then this step can determine whether the starting time of the specified time period is [ t ] 1 ,t 2 ]Within the range, if yes, it indicates that the second initial data point is a data point within the specified time period, and if no, it indicates that the second initial data point is not a data point within the specified time period.
And d2, determining a second ending data point according to the position of the data point pointed by the moving ending pointer, and judging whether the second ending data point is a data point in the appointed time period according to the time stamp of the second ending data point and the time stamp of the backward adjacent data point of the second ending data point.
Specifically, the step may determine whether the second end data point is a data point within the specified time period by determining whether the end time of the specified time period is within a time range formed by 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 after determining 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 whether the ending time of the specified time period is [ t ] m ,t m+1 ]Within the range, if yes, it indicates that the second end data point is a data point within the specified time period, and if no, it indicates that the second end data point is not a data point within the specified 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 point between the second start data point and the second end data point is also a data point within the specified time period, and then the data point within the pointing range of the moved data pointer is determined to be a data point within the specified time period; and if the second starting data point is not the data point in the specified time period, or the second ending data point is not the data point in the specified time period, or neither the second starting data point nor the second ending data point is the data point in the specified time period, judging that the data point in the pointing range of the moved data pointer is not the data point in the specified time period.
Thus, the aforementioned step S105 may be performed when the second start data point and the second end data point are both data points within the specified time period.
In step S105, each data point within the moving data pointer pointing range needs to be sequentially extracted and analyzed according to the sequence, and when each data point is analyzed, the timestamp of each data point needs to be first analyzed according to the storage sequence, and then the signal value of the data point needs to be analyzed. And sequentially resolving to restore all data points in the designated time period.
For example, taking an example that one data point occupies 16 bytes, wherein the timestamp occupies 8 bytes, and the signal value occupies 8 bytes, a process of "analyzing all data points in the range pointed by the moved data pointer to obtain an analysis result of all data points in a specified time period" in step S105 is 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 analyzed into a time stamp of the first data point in the pointing range of the moved data pointer according to a double-precision type, and the last 8 bytes are analyzed into a signal value of the first data point in the pointing range of the moved data pointer according to the double-precision type, so that the analysis result of the first data point in the specified time period can be obtained.
And then extracting the second 16 bytes in the range pointed by the moved data pointer, analyzing the first 8 bytes in the second 16 bytes into a time stamp of the second data point in the range pointed by the moved data pointer according to a double-precision type, and analyzing the last 8 bytes into a signal value of the second data point in the range pointed by the moved data pointer according to the double-precision type, so that an analysis result of the second data point in the specified time period can be obtained.
By analogy, the analytic results of all data points in the specified time period can be obtained.
In summary, the method for accessing the vehicle bus signal provided by the embodiment occupies a small storage space, and has a fast and accurate loading speed. The method can solve the problems that the storage file is too large, the past data is slowly analyzed, and the loaded data segment is inaccurate when the vehicle-mounted bus signal data is recorded for a long time and the past signal data needs to be checked at any time. Meanwhile, the data points of the vehicle-mounted bus signals are stored in a binary value format manner, so that the safety of the data is guaranteed to a certain extent, and the data are not easy to tamper.
In step S104 in the foregoing embodiment, when determining whether the data point within the range pointed by the data pointer after movement is a data point within the specified time period, a situation may occur in which the data point within the range pointed by the data pointer after movement is not a data point within the specified time period, that is, a situation may occur in which the second start data point is not a data point within the specified time period, or the second end data point is not a data point within the specified time period, or neither the second start data point nor the second end data point is a data point within the specified time period.
In this embodiment, when the determination in step S104 is no, the process may return to step S103, 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 by the data pointer in the target data file and the specified time period, until step S104 determines that the data point in the pointing range of the data pointer after the movement is the data point in the specified time period, and then the data point is analyzed according to step S105.
It should be noted that, when step S103 is executed again, 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, without moving the data pointer, 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, assuming that after the data pointer is moved for the first time, the start pointer points to the data point 2, and the end pointer points to the data point M, it needs to be determined whether the data point in the range pointed by the moved data pointer is a data point in the specified time period based on step S104 ".
If the judgment in the step S104 is no, the step S103 needs to be executed again, 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 in the pointing range of the data pointer after moving is the data point in the specified time period is judged again in the step S104 ", if not, the step S103 is executed again, and so on.
If the determination in step S104 is yes, the step S103 does not need to be executed again, but the analysis result of all data points in the pointed range of the moved data pointer can be obtained by analyzing all data points in the pointed range of the moved data pointer in step S105.
The implementation process of each step in this embodiment is the same as that in the foregoing embodiment, and details can refer to the description in the foregoing embodiment, which is not repeated herein.
In this embodiment, when the determination in step S104 is negative, the number of bytes can be determined again, and the data pointer can be moved again, so that after the embodiment is moved for one or more times, the pointing range of the data pointer is consistent with the specified time period, and at this time, all data points in the pointing range of the moved data pointer are analyzed, so that 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 following describes the access device for the vehicle-mounted bus signals provided by the embodiment of the present application, and the access device for the vehicle-mounted bus signals described below and the access method for the vehicle-mounted bus signals described above may be referred to correspondingly.
Referring to fig. 5, a schematic structural diagram of an access apparatus for vehicle bus signals provided in the embodiment of the present application is shown, and as shown in fig. 5, the access apparatus for vehicle bus signals 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 the collected data points of the plurality of vehicle-mounted bus signals in a binary byte format in corresponding data files, so as to obtain a data file set composed of the data files corresponding to the plurality of vehicle-mounted bus signals, respectively.
And a target data file determining module 502, configured to determine, from the data file set, a data file corresponding to the specified vehicle-mounted bus signal as a target data file when a data point of the specified vehicle-mounted bus signal needs to be read.
The byte number determining module 503 is configured to determine the number of bytes that 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.
The data point determining module 504 is configured to move the data pointer according to the number of bytes, and determine whether a data point in a range pointed by the moved data pointer is a data point in a specified time period.
And the data point analyzing module 505 is configured to analyze all data points in the range pointed by the moved data pointer when the data point judging module judges that the data points in the range pointed by the moved data pointer are data points in the specified time period, so as to obtain an analysis result of all data points in the specified time period.
The access device for the vehicle-mounted bus signals comprises the steps of firstly storing collected data points of a plurality of vehicle-mounted bus signals in corresponding data files in a binary byte format to obtain a data file set consisting of the data files corresponding to the vehicle-mounted bus signals respectively, determining the data file corresponding to the specified vehicle-mounted bus signal from the data file set as a target data file when the data points of the specified vehicle-mounted bus signal need to be read, then determining the number of bytes needing to be moved by a data pointer according to the position of the data point currently pointed by the data pointer in the target data file and a specified time period, then moving the data pointer according to the number of bytes, judging whether the data point pointed by the moved data pointer in a range is the data point in the specified time period or not, and finally analyzing all the data points pointed by the moved data pointer in the range if the data point is the data point in the specified time period, and obtaining the analysis result of the data points in the designated time period. According to the method, the data points of the acquired vehicle-mounted bus signals can be stored in the corresponding data files in a binary byte format, the data files can be stored in the magnetic disk in a storage mode, historical data do not need to be discarded due to the fact that the magnetic disk space is large, the data points are stored in the binary byte format, occupied storage space is small, and the access speed is high; meanwhile, when data points of the specified vehicle-mounted bus signals need to be read, all the data points in the specified time period can be accurately analyzed by combining the data pointer.
In addition, the 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 a possible implementation manner, the byte number determining module 503 may be further configured to determine, when the data point judging module 504 judges that the data point within the range pointed by the data pointer after the movement is a data point within the specified time period, the number of bytes that 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.
In a possible implementation manner, the above-mentioned byte number determining module 503 may include: a first byte number determination submodule and a second byte number determination submodule.
And the first byte number determining submodule is used for determining the number of bytes which the start pointer needs to move according to the position of the data point currently pointed by the start pointer and the start time of the specified time period.
And the second byte number determining submodule is used for determining the number of bytes required to be moved by the ending pointer according to the position of the data point currently pointed by the ending pointer and the ending time of the specified time period.
In one possible implementation, any one data point includes a timestamp and a signal value when the corresponding vehicle bus signal was acquired.
Based on this, the first byte number determination submodule may include: a starting signal period calculation submodule and a first byte number calculation submodule.
And the starting signal period calculation submodule is used for determining a first starting data point according to the position of the data point currently pointed by the starting pointer and calculating the signal period at the first starting data point as the starting signal period according to the time stamp of the first starting data point.
And the first byte number calculation submodule is used for determining the number of bytes which the start pointer needs to move according to the start signal period, the position of the data point currently pointed by the start pointer and the start time of the specified time period.
Correspondingly, the second byte number determining submodule may include: an ending signal period calculating submodule and a second byte number calculating submodule.
And the ending signal period calculation submodule is used for determining a first ending data point according to the position of the data point currently pointed by the ending pointer and calculating the signal period at the first ending data point as an ending signal period according to the timestamp of the first ending data point.
And the second byte number calculation submodule is used for determining the number of bytes required to be moved by the ending pointer according to the ending signal period, the position of the data point currently pointed by the ending pointer and the ending time of the designated time period.
In a possible implementation manner, the starting signal period calculating submodule may be specifically configured to calculate 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, and the calculated difference is used as the signal period at the first starting data point.
The ending signal period calculating submodule may be specifically configured to calculate a difference between a timestamp of the first ending data point and a timestamp of a forward adjacent data point of the first ending data point, and the calculated difference is used as a signal period at the first ending data point.
In a possible implementation manner, the first byte number calculation submodule may include: the device comprises a first difference value calculation submodule, a first quotient value calculation submodule and a first multiplication calculation submodule.
And the first difference calculation submodule is used for determining the time of the position of the data point currently pointed by the start pointer, and calculating the difference between the start time of the appointed time period and the determined time to obtain a first difference.
And the first quotient value calculation submodule is used for dividing the first difference value by the period of the starting signal to obtain a quotient value which is used as the number of data points which need to be moved by the starting pointer.
And the first multiplication calculation submodule is used for calculating the product of the number of data points which need to be moved by the start pointer and the number of bytes occupied by the data points, and the product result is used as the number of bytes which need to be moved by the start pointer.
Correspondingly, the second byte number calculation submodule may include: a second difference value calculation submodule, a second quotient value calculation submodule and a second multiplication calculation submodule.
And the second difference value calculation submodule is used for determining the time of the position of the data point currently pointed by the ending pointer, and calculating the difference value between the ending time of the appointed time period and the determined time to obtain a first difference value.
And the second quotient value calculation submodule is used for dividing the first difference value by the ending signal period to obtain a quotient value which is used as the number of data points needing to be moved by the ending pointer.
And the second multiplication calculation submodule is used for calculating the product of the number of the data points which need to be moved by the ending pointer and the number of bytes occupied by the data points, and the product result is used as the number of the bytes which need to be moved by the ending pointer.
In one possible implementation, the data point determining module 504 may include: a first data point judgment submodule and a second data point judgment submodule.
And the first data point judgment submodule is used for determining a second starting data point according to the position of the data point pointed by the moving starting pointer and judging whether the second starting data point is a data point in a specified time period or not according to the time stamp of the second starting data point and the time stamp of a forward adjacent data point of the second starting data point.
And the second data point judgment submodule is used for determining a second ending data point according to the position of the data point pointed by the moving ending pointer, and judging whether the second ending data point is a data point in a specified time period or not according to the time stamp of the second ending data point and the time stamp of a backward adjacent data point of the second ending data point.
In one possible implementation manner, the data file includes unique identification information corresponding to the vehicle-mounted bus signal and an identification length corresponding to the unique identification information.
Based on this, the target data file determining module 502 may include: an identification analysis submodule and an identification comparison submodule.
And 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, wherein the unique identification information is used as the unique identification information corresponding to the data file.
And the identification comparison submodule is used for 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.
In a possible implementation manner, the unique identification information is composed of a network segment name to which the corresponding vehicle-mounted bus signal belongs, target information, a signal name and a preset symbol, wherein the target information is message name information or protocol data unit name information.
The embodiment of the application also provides an access device of the vehicle-mounted bus signal. Alternatively, fig. 6 shows a block diagram of a hardware structure of an access device for vehicle-mounted bus signals, and referring to fig. 6, the hardware structure of the access device for vehicle-mounted bus signals 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;
the processor 601 may be a central processing unit CPU, or an application Specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present invention, or the like;
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, and the processor 601 may call the program stored in the memory 603 for:
storing the acquired data points of the plurality of vehicle-mounted bus signals in corresponding data files in a binary byte format to obtain a data file set consisting of the data files respectively corresponding to the plurality of vehicle-mounted bus signals;
when data points of the appointed vehicle-mounted bus signals need to be read, determining a data file corresponding to the appointed vehicle-mounted bus signals from the data file set as a target data file;
determining the number of bytes which need to be moved by a data pointer according to the position of a data point which is currently pointed by the data pointer in a target data file and a specified 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 a data point in a specified time period or not;
and if so, analyzing all data points in the pointing range of the moved data pointer to obtain the analysis results of all data points in the appointed time period.
Alternatively, the detailed function and the extended function of the program may refer to the above description.
The embodiment of the present application further provides a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for accessing the vehicle bus signal is implemented.
Alternatively, the detailed function and the extended function of the program may be as described above.
Finally, it is further noted that, herein, relational terms such as, for example, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred 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 (10)

1. A method for accessing vehicle-mounted bus signals is characterized by comprising the following steps:
storing data points of a plurality of collected vehicle-mounted bus signals in corresponding data files in a binary byte format to obtain a data file set consisting of the data files respectively corresponding to the vehicle-mounted bus signals;
when data points of the specified vehicle-mounted bus signals need to be read, determining data files corresponding to the specified vehicle-mounted bus signals from the data file set as target data files;
determining the number of bytes which need to be moved by the data pointer according to the position of the data point which is currently pointed by the data pointer in the target data file and the designated time period;
moving the data pointer according to the number of the bytes, and judging whether a data point in a pointing range of the data pointer after moving is a data point in the specified time period;
if so, analyzing all data points in the pointing range of the moved data pointer to obtain the analysis results of all data points in the specified time period.
2. The method for accessing the vehicle bus signal according to claim 1, further comprising:
if not, returning to execute the step of determining the number of bytes which need 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 designated time period.
3. The method for accessing the vehicle-mounted bus signal according to claim 2, wherein the determining the number of bytes that 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 comprises:
determining the number of bytes which need 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 appointed time period;
and determining the number of bytes which need to be moved by the end pointer according to the position of the data point currently pointed by the end pointer and the end time of the appointed time period.
4. The method for accessing the vehicle-mounted bus signal according to claim 3, wherein any data point comprises a timestamp and a signal value when the corresponding vehicle-mounted bus signal is acquired;
determining the number of bytes required 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 specified time period, including:
determining a first initial data point according to the position of the data point currently pointed by the initial pointer, and calculating a signal cycle at the first initial data point according to the timestamp of the first initial data point to be used as an initial signal cycle;
determining the number of bytes which need to be moved by the starting pointer according to the starting signal period, the position of the data point currently pointed by the starting pointer and the starting time of the designated time period;
determining the number of bytes which the end pointer needs to move according to the position of the data point currently pointed by the end pointer and the end time of the specified time period, wherein the determining comprises the following steps:
determining a first end data point according to the position of the data point currently pointed by the end pointer, and calculating a signal cycle at the first end data point according to the timestamp of the first end data point to be used as an end signal cycle;
and determining the number of bytes which need to be moved by the end pointer according to the end signal period, the position of the data point currently pointed by the end pointer and the end time of the specified time period.
5. The method for accessing the vehicle bus signal according to claim 4, wherein the calculating the signal period at the first start data point according to the timestamp of the first start data point comprises:
calculating a difference value 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, and taking the calculated difference value as a signal period at the first starting data point;
said calculating a signal period at said first end data point from a timestamp of said first end data point, comprising:
calculating a difference between the timestamp of the first end data point and the timestamp of a forward adjacent data point of the first end data point, the calculated difference being taken as the signal period at the first end data point.
6. The method for accessing the vehicle-mounted bus signal according to claim 4, wherein the determining the number of bytes that the start pointer needs to move according to the start signal cycle, the position of the data point currently pointed by the start pointer and the start time of the designated time period comprises:
determining the time of the position of the data point currently pointed by the starting pointer, and calculating the difference between the starting time of the specified time period and the determined time to obtain a first difference;
dividing the first difference value by the period of the starting signal to obtain a quotient value, and taking the quotient value as the number of data points which need to be moved by the starting pointer;
calculating the product of the number of data points which need to be moved by the start pointer and the number of bytes occupied by the data points, and taking the product result as the number of bytes which need to be moved by the start pointer;
determining the number of bytes that the end pointer needs to move according to the end signal cycle, the position of the data point currently pointed by the end pointer, and the end time of the designated time period, includes:
determining the time of the position of the data point currently pointed by the end pointer, and calculating the difference between the end time of the specified time period and the determined time to obtain a first difference;
dividing the first difference value by the ending signal period to obtain a quotient value which is used as the number of data points needing to be moved by the ending pointer;
and calculating the product of the number of the data points which need to be moved by the ending pointer and the number of bytes occupied by the data points, and taking the product as the number of the bytes which need to be moved by the ending pointer.
7. The method for accessing the vehicle-mounted bus signal according to claim 3, wherein the step of determining whether the data point within the range pointed by the data pointer after the movement is the data point within the specified time period comprises:
determining a second starting data point according to the position of the data point pointed by the starting pointer after the movement, and judging whether the second starting data point is a data point in the specified time period or not according to the time stamp of the second starting data point and the time stamp of a forward adjacent data point of the second starting data point;
and determining a second ending data point according to the position of the data point pointed by the ending pointer after the movement, and judging whether the second ending data point is the data point in the specified time period or not according to the time stamp of the second ending data point and the time stamp of the backward adjacent data point of the second ending data point.
8. The method for accessing the vehicle-mounted bus signal according to claim 1, wherein the data file comprises unique identification information corresponding to the vehicle-mounted bus signal and an identification length corresponding to the unique identification information;
the determining the data file corresponding to the specified vehicle-mounted bus signal from the data file set as a target data file comprises the following steps:
for each data file in the data file set, analyzing an identification length corresponding to unique identification information of a corresponding vehicle-mounted bus signal from the data file, 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 to be used 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.
9. The method according to claim 1, wherein the unique identification information comprises a network segment name, target information, a signal name and a preset symbol, wherein the network segment name, the target information, the signal name and the preset symbol belong to the corresponding vehicle bus signal, and the target information is message name information or protocol data unit name information.
10. An access device for vehicle bus signals, comprising:
the data point storage module is used for storing the acquired data points of the plurality of vehicle-mounted bus signals in the corresponding data files in a binary byte format so as to obtain a data file set consisting of the data files respectively corresponding to the plurality of 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 a 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 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 designated time period;
the data point judgment module is used for moving the data pointer according to the number of the bytes and judging whether the data point in the pointing range of the data pointer after moving is the data point in the specified time period;
and the data point analyzing module is used for analyzing all the data points in the pointing range of the data pointer after the movement 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, so as to obtain the analysis results of all the data points in the appointed time period.
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 true CN115001894A (en) 2022-09-02
CN115001894B 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 (8)

* 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
US20130187924A1 (en) * 2012-01-20 2013-07-25 Azbil Corporation Graph displaying device
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

Patent Citations (8)

* 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
US20130187924A1 (en) * 2012-01-20 2013-07-25 Azbil Corporation Graph displaying device
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
CN115001894B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN111813756B (en) Log retrieval system, method and device, electronic equipment and storage medium
CN108509592B (en) Data storage method, reading method and device based on Redis
CN111859033B (en) IP library query method and device and IP library compression method and device
CN110995273B (en) Data compression method, device, equipment and medium for power database
CN114817645A (en) Time sequence data storage and reading method, device, equipment and storage medium
CN111881094B (en) Method, device, terminal and storage medium for extracting key information in log
CN109510857B (en) Data storage method, device, server and system
CN112559482B (en) Binary data classification processing method and system based on distribution
CN115001894A (en) Vehicle-mounted bus signal access method and device
US9858170B2 (en) Function-calling-information collection method and computer-readable recording medium
CN115827702B (en) Software white list query method based on bloom filter
CN107943849B (en) Video file retrieval method and device
CN111078753A (en) HBase database-based time sequence data storage method and device
CN111026762A (en) Red and black tree index generation method and device, electronic equipment and storage medium
CN113468866B (en) Method and device for analyzing non-standard JSON string
CN114048238B (en) Storage method and device for industrial equipment time sequence data and electronic equipment
CN114661686A (en) Message extraction method, device, equipment, medium and program product of log file
CN111863043B (en) Audio transfer file generation method, related equipment and readable storage medium
CN115630100A (en) Mixed processing method and device for unit and multivariate time sequence data and computer equipment
CN111143554B (en) Data sampling method and device based on big data platform
CN105760473A (en) Recovery method and device used after exFAT file formatting
CN111382211A (en) Data summarizing method and device
CN118138483B (en) Data stream processing method, device, computer equipment and readable storage medium
CN117093541B (en) Data extraction and archiving system for remote sensing data
CN115617392B (en) Method and device for determining version number

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