Disclosure of Invention
In order to solve the technical problems in the prior art, the invention provides a data analysis method and an analysis platform, which can automatically analyze various data sources in the test of the motor train unit and improve the working efficiency and the accuracy.
The embodiment of the invention provides a data analysis method, which is applied to a motor train unit debugging platform, wherein the motor train unit debugging platform comprises a plurality of different data interfaces, the different data interfaces correspond to different tested equipment on a train, and the different data interfaces correspond to different data protocols;
the method comprises the following steps:
receiving source data transmitted by different data interfaces, wherein the source data carries data type identification;
analyzing a frame header of the source data, and analyzing a data type identifier of the source data from the frame header;
selecting a data analysis rule corresponding to the data type according to the data type identifier;
and analyzing the data content in the source data by using the data analysis rule.
Preferably, the data type identification comprises a data source ID and/or a data protocol ID.
Preferably, when the data type identifier includes the data source ID and the data protocol ID, the selecting, according to the data type identifier, a data parsing rule corresponding to the data type specifically includes:
selecting a data analysis rule corresponding to the data type according to the data source ID;
selecting a data analysis rule corresponding to the data type according to the data protocol ID;
and when the data analysis rule selected according to the data source ID is the same as the data analysis rule selected according to the data protocol ID, analyzing the data content in the source data according to the selected data analysis rule.
Preferably, the parsing the data content in the source data by using the data parsing rule includes:
and analyzing the position and the number of the equipment to be tested and the type and the size of the parameter to be tested according to the data analysis rule.
Preferably, after the parsing the data content in the source data by using the data parsing rule, the method further includes:
and storing the size of the parameter to be detected into a table corresponding to the parameter to be detected according to the type of the parameter to be detected.
Preferably, the data interface comprises at least: the multifunctional vehicle comprises a multifunctional vehicle bus network interface, a WIFI interface, a serial interface and a Bluetooth interface.
Preferably, the method further comprises the following steps: the method comprises the steps of firstly storing source data transmitted by the multifunctional vehicle bus network interface in a buffer pool, and calling the source data from the buffer pool according to a preset sampling period.
The embodiment of the invention also provides a data analysis platform for analyzing the debugging data of the motor train unit, which comprises the following steps: the system comprises a plurality of different data interfaces, a plurality of data processing units and a plurality of data processing units, wherein the different data interfaces correspond to different tested equipment on a train and correspond to different data protocols; further comprising: a processor;
the processor is configured to receive source data transmitted by the different data interfaces, where the source data carries a data type identifier;
analyzing a frame header of the source data, and analyzing a data type identifier of the source data from the frame header;
selecting a data analysis rule corresponding to the data type according to the data type identifier;
and analyzing the data content in the source data by using the data analysis rule.
Preferably, the data interface comprises at least: the multifunctional vehicle comprises a multifunctional vehicle bus network interface, a WIFI interface, a serial interface and a Bluetooth interface.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps:
receiving source data transmitted by different data interfaces, wherein the source data carries data type identification;
analyzing a frame header of the source data, and analyzing a data type identifier of the source data from the frame header;
selecting a data analysis rule corresponding to the data type according to the data type identifier;
and analyzing the data content in the source data by using the data analysis rule.
Compared with the prior art, the invention has at least the following advantages:
according to the data analysis method provided by the embodiment of the invention, the motor train unit debugging platform receives different source data through different data interfaces, obtains the data type identification of the source data through analyzing the frame header of the source data, and selects the corresponding data analysis rule according to the data type identification, so that the data content in the source data is analyzed by using the data analysis rule.
Therefore, when the method provided by the embodiment of the invention is applied to various different source data, the motor train unit debugging platform can automatically analyze various source data in the motor train unit test, and the corresponding data analysis rule is selected according to the data type identifier in the source data, so that the data content can be quickly analyzed, and the working efficiency and the accuracy are improved.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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 invention.
In order to facilitate understanding of the technical solutions provided by the present invention, the technical research background of the present invention is briefly described below.
The inventor finds that, in the process of researching the traditional manual data processing technology, when the complex and huge data is faced, the traditional manual data processing method is difficult to extract and process the effective information of the data, and particularly has a certain bottleneck in the processing of high-frequency data.
Based on this, the inventor provides a technical scheme of the present invention through research, receives source data transmitted by different data structures, analyzes a frame header of the source data, obtains a data type identifier of the source data, then selects a data analysis rule corresponding to the data type by using the data type identifier, and analyzes data content in the source data by using the data analysis rule, thereby achieving an objective of intelligently processing data and improving work efficiency and accuracy. Therefore, according to the technical scheme of the invention, when various source data are faced, the data analysis rule required by the data type can be automatically matched according to the data type identification, so that the data content in the source data can be quickly analyzed.
A data parsing method according to an exemplary embodiment of the present invention will be described with reference to fig. 1.
Referring to fig. 1, a flowchart of a data parsing method according to an embodiment of the present invention is provided.
The data analysis method provided by the embodiment is applied to a motor train unit debugging platform, the motor train unit debugging platform comprises a plurality of different data interfaces, the different data interfaces correspond to different tested equipment on a train, and the different data interfaces correspond to different data protocols; the method comprises the following steps:
s101: and receiving source data transmitted by the different data interfaces, wherein the source data carries a data type identifier.
Wherein the data type identification is used to identify a data type of the source data. In practical application, because different data collected by different tested devices have different meanings, based on the difference, data type identifiers can be preset for different data types so as to identify different types of data through the data type identifiers, specifically, binary 0 and binary 1 can be used for representing, and when only two data types exist, a one-bit binary can be used for marking; if there are four data types, it can be marked with a two-bit binary. Of course, in particular implementations, the identification of the data type may also be represented in other ways.
In the embodiment of the invention, different data interfaces can correspond to different tested devices on a train, and source data transmitted by different data interfaces can come from different tested devices. The device under test may be an in-vehicle infrastructure (such as an air conditioner, a display screen, a water heater, etc.), an instrument (a tester, a driver's cab, etc.), a test stand, a terminal, etc., among others. Different tested devices send source data through respective corresponding data interfaces.
In practical application, a data acquisition end, namely different tested equipment, negotiates with a motor train unit debugging platform in advance, and source data is formed by encoding according to a specified data format, so that the motor train unit debugging platform can identify the source data. Different tested devices encode the acquired data according to different data formats to form source data, so that the motor train unit debugging platform can quickly identify the source data.
In specific implementation, collected data can be encoded by devices under test belonging to one class according to a uniform data format to form source data. For example, the instrument class includes a tester and a driver's seat, and the tester and the driver's seat can encode the collected data according to a uniform data format to form source data.
S102: and analyzing the frame header of the source data, and analyzing the data type identification of the source data from the frame header.
In the embodiment of the present invention, the source data may include a frame header, and when the embodiment is implemented, the frame header may include some necessary control information, such as address information, synchronization information, and the like, in addition to the data type identifier.
S103: and selecting a data analysis rule corresponding to the data type according to the data type identifier.
Different data types correspond to different data transmission protocols, and the data transmission protocols may include the following: multifunctional Vehicle Bus (MVB), Vehicle-mounted wireless transmission protocol, Train Communication Network (TCN), TCP/IP, and Ake Network (ARCnet).
It is understood that the data parsing rule refers to parsing data using a data transmission protocol corresponding to the data type.
In the embodiment of the invention, the motor train unit debugging platform selects the data analysis rule corresponding to the data type from the analysis rule database according to the data type identification. The analysis rule database can store a plurality of different data analysis rules so that source data of different data types can be analyzed.
In practical application, according to actual requirements, the motor train unit debugging platform can continuously perfect the analysis rule database, update of the analysis rule database is achieved, source data of new data types are analyzed, therefore, more source data can be processed by the motor train unit debugging platform, and working efficiency is improved.
S104: and analyzing the data content in the source data by using the data analysis rule.
In the embodiment of the invention, the data content is actually acquired data sent by the tested device, and the data content carried by source data sent by different tested devices is different.
During specific implementation, the acquired data are coded according to a uniform data format by the equipment to be tested belonging to one class and form source data, that is, the data types of the source data formed according to the uniform data format coding are the same, the motor train unit debugging platform analyzes the source data by adopting the same data analysis rule, but the data contents obtained after analysis can be different. For example, the instrument includes a tester and a driver's seat, the tester and the driver's seat encode the respective collected data according to a uniform data format to form source data, that is, the data types of the source data formed by the two tested devices are the same, and the motor train unit debugging platform analyzes the source data by using the same data analysis rule to obtain the data content collected by the tester and the data content collected by the driver's seat respectively.
By utilizing the method provided by the embodiment of the invention, when the debugging platform of the motor train unit receives various source data transmitted by different data interfaces, the data type identification of the source data can be obtained by analyzing the frame header of the source data, and the corresponding data analysis rule is selected according to the data type identification, so that various source data in the motor train unit test can be automatically analyzed to obtain the required data content, the working efficiency and the accuracy are improved, and the problems of low working efficiency and easy error caused by manual data analysis in the prior art are solved.
The embodiment of the method illustrated in fig. 1 generally describes an implementation process of data parsing, and the following describes a process of data parsing in detail.
Referring to fig. 2, a flowchart of another data analysis method provided in the embodiment of the present invention is a flowchart, where the method is applied to a motor train unit debugging platform, where the motor train unit debugging platform includes a plurality of different data interfaces, the different data interfaces correspond to different devices to be tested on a train, and the different data interfaces correspond to different data protocols, and the method includes:
s201: the motor train unit debugging platform receives source data transmitted by different data interfaces, wherein the source data carries data type identification, and the data type identification comprises a data source ID and/or a data protocol ID.
In practical application, the data interface at least comprises: the multifunctional vehicle comprises a multifunctional vehicle bus network interface, a WIFI interface, a serial interface and a Bluetooth interface.
The multifunctional vehicle bus network interface is an important component of a train communication network, becomes a key component of a high-speed electric train control system, and can be used as an important interface for operation such as train state detection, fault diagnosis, development and debugging of vehicle-mounted equipment and the like. The multifunctional vehicle bus network interface is a serial data communication bus interface which is mainly used for serial data communication between interconnection equipment with interoperability and interchangeability requirements, and is used for transmitting data of standard equipment in the same vehicle or different vehicles so as to enable the interconnection equipment to be communicated.
In practical application, the source data transmitted through the multifunctional vehicle bus network interface is transmitted at a high frequency, but the capability of the motor train unit debugging platform for processing the source data is limited, so that all the source data can be analyzed and processed, the source data transmitted by the multifunctional vehicle bus network structure can be stored in a buffer pool, and the source data can be called from the buffer pool according to a preset sampling period, so that the motor train unit debugging platform can process the source data in the buffer pool in time. The preset adoption period can be set according to the processing condition of the motor train unit debugging platform.
In an embodiment of the present invention, the data type identifier may include one or more of a data source ID and/or a data protocol ID.
When the data type identification comprises a data source ID, the motor train unit debugging platform executes step S202, selects a data analysis rule corresponding to the data type by using the data source ID, and then executes step S205.
When the data type identification comprises a data protocol ID, the motor train unit debugging platform executes step S203, selects a data analysis rule corresponding to the data type by using the data protocol ID, and then executes step S205.
In practical application, preferably, the data type identifier includes a data source ID and a data protocol ID, so as to ensure the correctness of the source data received by the motor train unit debugging platform.
When the data type identification comprises a data source ID and a data protocol ID, the motor train unit debugging platform executes the steps S202 and S203.
S202: and selecting a data analysis rule corresponding to the data type according to the data source ID.
In practical application, the data analysis rules are stored in the analysis rule database, and in order to facilitate management of the analysis rule database and quickly select the corresponding data analysis rules from the analysis rule database, the data analysis rules can be assigned with ID numbers. During specific implementation, a corresponding relation table between the data source ID and the data analysis rule ID can be established in advance, when the motor train unit debugging platform analyzes the data source ID, the corresponding data analysis rule ID can be quickly selected through the corresponding relation table, and then the data analysis rule is called from the analysis rule database by using the data analysis rule ID.
S203: and selecting a data analysis rule corresponding to the data type according to the data protocol ID.
In practical application, the data analysis rule is stored in the analysis rule data, and in order to facilitate management of the analysis rule database and quickly select the corresponding data analysis rule from the analysis rule database, an ID number can be allocated to the data analysis rule, wherein the data protocol ID is the same as the data analysis rule ID. In concrete implementation, when the motor train unit debugging platform analyzes the data source ID, the data analysis rule is called from the analysis rule database according to the ID.
It should be noted that, when the data type identifier includes a data source ID and a data protocol ID, the execution sequence of step S202 and step S203 is not limited, and of course, the two steps may also be executed in parallel, so as to improve the work efficiency. In specific application, a user can pre-configure the sequence of executing the steps on the motor train unit debugging platform according to actual requirements, and the embodiment of the invention only provides an optional implementation mode.
S204: judging whether the data analysis rule selected according to the data source ID is the same as the data analysis rule selected according to the data protocol ID, if so, executing the step S205; if not, step 207 is performed.
In the embodiment of the present invention, when the data type identifier includes a data source ID and a data protocol ID, it is determined whether the data parsing rules selected by the two IDs are the same, so as to prevent an error from occurring in the transmission process of the source data.
S205: and analyzing the data content in the source data by using the selected data analysis rule.
The data content may include the position and number of the device under test, and the type and size of the parameter under test.
In practical application, the device to be tested can not only send the size and the type of the parameter to be tested, but also send the position, the number and the name of the device to be tested. For example, each car of the train is provided with an electric box, and one or more voltage meters can be included in the electric box to measure the electricity consumption condition of each car. When the data content sent by the voltage instrument of the equipment to be tested can include that the voltage instrument belongs to a carriage, the equipment number, the equipment name, the type of the parameter to be tested is voltage, voltage value and the like, so that the debugging platform of the motor train unit can identify that the currently acquired data content corresponds to the specific equipment to be tested.
During specific implementation, the motor train unit debugging platform analyzes the position and the number of the equipment to be tested and the type and the size of the parameter to be tested according to the data analysis rule.
S206: and storing the size of the parameter to be detected into a table corresponding to the parameter to be detected according to the type of the parameter to be detected.
In practical applications, in order to search and analyze data, a table may be established for each device to be tested, specifically, a corresponding table is established according to a type of a parameter to be tested sent by the device to be tested, for example, a table corresponding to a current is established for a current tester, a table corresponding to a voltage is established for a voltage tester, and the like.
When the motor train unit debugging platform analyzes the data content in the source data, the data of the parameter to be tested of the device to be tested obtained by analysis can be stored in a corresponding table, for example, the current value obtained by analysis is stored in a current table, the voltage value obtained by analysis is stored in a voltage table,
s207: discarding the source data, requesting the data acquisition end to resend the source data, and executing step S201.
In the embodiment of the invention, when the data analysis rule selected according to the data source ID is different from the data analysis rule selected according to the data protocol ID, the source data is wrong, the motor train unit debugging platform can discard the source data and request the data end to resend the source data, so that the data content in the source data can be analyzed again.
By using the method provided by the embodiment of the invention, when the data type comprises the data source ID and/or the data protocol ID, the data analysis rule can be selected according to the data source ID and/or the data protocol ID, the motor train unit debugging platform can judge whether the data analysis rules selected by the two IDs are the same, and when the data analysis rules are the same, the data content in the source data is analyzed by using the data analysis rule; and when the source data are different, discarding the source data, and requesting the data acquisition end to resend the source data, so that correct data content can be analyzed, and the data content can be recorded conveniently. Therefore, the data analysis method provided by the embodiment of the invention can automatically analyze various data sources in the test of the motor train unit, improve the working efficiency and the accuracy, and can detect the correctness of the source data.
In order to facilitate understanding of the data analysis method provided in the embodiment of the present invention, the method will be described in detail below with reference to specific application scenarios.
Referring to fig. 3, an exemplary diagram of an application scenario corresponding to the method provided by the present invention is shown.
The application scenario shown in fig. 3 is to implement data transmission between the vehicle door and the vehicle door detection device through MVB and TCP/IP protocol.
Taking analysis of the content of the vehicle door state data as an example, three key links of vehicle door control instructions, vehicle door operation states and vehicle door tension measurement are needed in the process of realizing vehicle door state data acquisition.
In practical application, the vehicle door control device sends a command for controlling the vehicle door to close or open so as to control the vehicle door to perform corresponding closing or opening operation, when the vehicle door completes corresponding operation according to the vehicle door control command, the train control and management system collects various information such as the vehicle door working state, the vehicle door position and the vehicle door motion state, forms source data from the various information according to a specified format, and transmits the source data to the motor train unit debugging platform through the multifunctional vehicle bus network interface.
Meanwhile, the vehicle door clamping force tester measures information such as vehicle door clamping force, such as measuring time, a clamping force data set and vehicle door related information, and forms source data according to a specified format, and transmits the source data to the motor train unit debugging platform through TCP/IP.
When the motor train unit debugging platform receives the two groups of source data, the two groups of source data are preprocessed, frame headers of the two groups of source data are respectively analyzed, data type identifications of the source data are obtained, data analysis rules corresponding to the data types are selected according to the data type identifications, data contents in the source data are analyzed by the data analysis rules, data contents carried by the two groups of source data are obtained, parameters to be detected in the two groups of data contents are stored in corresponding tables for subsequent searching, the two groups of data contents are synchronized and fused at the same time, result information about the state of the vehicle door is obtained, and finally the result information is output so that a user can check the state of the vehicle door.
The above is a data analysis method provided by the embodiment of the present invention, and the present invention also provides a data analysis platform, which will be described below with reference to the accompanying drawings.
Referring to fig. 4, a data analysis platform provided in the embodiment of the present invention is used for analyzing debugging data of a motor train unit, and includes: the system comprises a plurality of different data interfaces, a plurality of data processing units and a plurality of data processing units, wherein the different data interfaces correspond to different tested equipment on a train and correspond to different data protocols; further comprising: a processor 401;
the processor is configured to receive source data transmitted by the different data interfaces, where the source data carries a data type identifier;
analyzing a frame header of the source data, and analyzing a data type identifier of the source data from the frame header;
selecting a data analysis rule corresponding to the data type according to the data type identifier;
and analyzing the data content in the source data by using the data analysis rule.
In some embodiments, the data interface comprises at least: the multifunctional vehicle comprises a multifunctional vehicle bus network interface, a WIFI interface, a serial interface and a Bluetooth interface.
In some embodiments, the processor 401 is specifically configured to store the source data transmitted by the multifunction vehicle bus network interface in a buffer pool, and retrieve the source data from the buffer pool according to a predetermined sampling period.
In some embodiments, when the data type identifier includes a data source ID and the data protocol ID, the processor 401 is specifically configured to select a data parsing rule corresponding to the data type according to the data source ID; selecting a data analysis rule corresponding to the data type according to the data protocol ID; and when the data analysis rule selected according to the data source ID is the same as the data analysis rule selected according to the data protocol ID, analyzing the data content in the source data according to the selected data analysis rule.
In some embodiments, said parsing data content in said source data using said data parsing rule comprises: and analyzing the position and the number of the equipment to be tested and the type and the size of the parameter to be tested according to the data analysis rule, wherein the processor is specifically used for storing the size of the parameter to be tested to a table corresponding to the parameter to be tested according to the type of the parameter to be tested.
According to the data analysis platform provided by the embodiment of the invention, the processor receives the source data through different data interfaces, analyzes the frame header of the source data, acquires the data type identification of the source data, selects the data analysis rule corresponding to the data type according to the data type identification, and analyzes the data content in the source data by using the data analysis rule, so that the aim of automatically analyzing various source data in the test of the motor train unit is fulfilled, and meanwhile, the working efficiency and the accuracy are improved.
Referring to fig. 5, a block diagram of a data parsing apparatus provided in an embodiment of the present invention includes: at least one processor 501 (e.g., CPU), memory 502 and at least one communication bus 503 for enabling communications among the devices. The processor 501 is arranged to execute executable modules, such as computer programs, stored in the memory 502. The Memory 502 may comprise a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory.
The processor 501 is specifically configured to perform operations of a method for hybrid vehicle control, specifically including:
receiving source data transmitted by different data interfaces, wherein the source data carries data type identification;
analyzing a frame header of the source data, and analyzing a data type identifier of the source data from the frame header;
selecting a data analysis rule corresponding to the data type according to the data type identifier;
and analyzing the data content in the source data by using the data analysis rule.
In some embodiments, the data type identifier includes a data source ID and/or a data protocol ID, and when the data type identifier includes a data source ID and a data protocol ID, the processor 501 executes the data parsing rule corresponding to the data type selected according to the data type identifier, specifically including:
selecting a data analysis rule corresponding to the data type according to the data source ID;
selecting a data analysis rule corresponding to the data type according to the data protocol ID;
and when the data analysis rule selected according to the data source ID is the same as the data analysis rule selected according to the data protocol ID, analyzing the data content in the source data according to the selected data analysis rule.
In some embodiments, said parsing data content in said source data using said data parsing rule comprises: analyzing the position and number of the device to be tested and the type and size of the parameter to be tested according to the data analysis rule, after the processor 501 executes the data content in the source data analyzed by using the data analysis rule, the method further includes:
and storing the size of the parameter to be detected into a table corresponding to the parameter to be detected according to the type of the parameter to be detected.
In some embodiments, the data interface comprises at least: the processor 501 is further specifically configured to execute the following steps:
the method comprises the steps of firstly storing source data transmitted by the multifunctional vehicle bus network interface in a buffer pool, and calling the source data from the buffer pool according to a preset sampling period.
The foregoing is merely a preferred embodiment of the invention and is not intended to limit the invention in any manner. Although the present invention has been described with reference to the preferred embodiments, it is not intended to be limited thereto. Those skilled in the art can make numerous possible variations and modifications to the present teachings, or modify equivalent embodiments to equivalent variations, without departing from the scope of the present teachings, using the methods and techniques disclosed above. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention are still within the scope of the protection of the technical solution of the present invention, unless the contents of the technical solution of the present invention are departed.