Data format conversion method and device, electronic equipment and storage medium

By constructing a structural matrix to convert vehicle log data, the high cost and error problems in vehicle log format conversion are solved, and low-cost, fast and accurate conversion effect is achieved.

CN118939614APending Publication Date: 2024-11-12CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411072598.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-06
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, separate tools or manual participation is required when converting vehicle log formats, resulting in high costs and prone to errors, resulting in inaccurate format conversion.

Method used

By constructing a structure matrix of vehicle log data, including at least two structures with nested relationships, generate target data in the target format, avoid using separate tools or manual participation, and achieve low-cost, fast and accurate format conversion.

Benefits of technology

Accurate conversion of vehicle log formats is realized, reducing conversion costs, avoiding manual errors, and improving conversion efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939614A_ABST
    Figure CN118939614A_ABST
Patent Text Reader

Abstract

The invention relates to a data format conversion method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining to-be-converted initial data, the initial data comprising at least two dimensions of data having a nested relationship; constructing a structural body matrix of the initial data, wherein the structural body matrix comprises at least two structural bodies with a nested relationship; according to the structure matrix, target data in a target format is generated, and the target format is different from the format of the initial data. Therefore, the log format of the vehicle can be quickly and accurately converted at low cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle technology, and in particular to a data format conversion method, device, electronic device and storage medium. Background Art

[0002] With the popularization and development of vehicles, vehicles are prone to various fault conditions. For vehicle condition analysis, cloud platforms can be used to analyze the fault conditions of the entire vehicle. However, there are certain problems with the current cloud platform data. For example, the vehicle intelligent test platform needs to mount data acquisition equipment, which increases the cost of vehicle testing. In this regard, since the underlying logs of the vehicle can be recorded and read in a specific format, the fault conditions of the vehicle can be analyzed based on the vehicle logs.

[0003] However, the logs recorded by general vehicles are tabular data in Excel format, and parsing the vehicle logs requires specific JSON script parsing, which requires a method to convert the log format from Excel format to JSON format.

[0004] In the prior art, when converting the log format of a vehicle, it is generally necessary to use a separate tool or manual participation, which results in high conversion costs and manual participation that is prone to errors, leading to inaccurate format conversion. Summary of the invention

[0005] The present application provides a data format conversion method, device, electronic device and storage medium to solve the technical problems in the prior art that when converting the log format of a vehicle, a separate tool or manual participation is generally required, which results in high conversion costs and manual participation is prone to errors, leading to inaccurate format conversion.

[0006] In a first aspect, the present application provides a data format conversion method, comprising:

[0007] Acquire initial data to be converted, wherein the initial data includes data of at least two dimensions in a nested relationship;

[0008] Constructing a structure matrix of the initial data, wherein the structure matrix includes at least two structures in a nested relationship;

[0009] According to the structure matrix, target data in a target format is generated, wherein the target format is different from a format of the initial data.

[0010] As a possible implementation manner, the initial data is tabular data, and obtaining the initial data to be converted includes:

[0011] Obtain the table file to be converted through the visual interface;

[0012] The table data in the table file is read using a preset reading function, and the read table data is determined as initial data to be converted.

[0013] As a possible implementation, the initial data includes basic data and a plurality of first-dimensional data, each of the first-dimensional data includes a plurality of second-dimensional data, and the step of constructing a structure matrix of the initial data includes:

[0014] Traversing all the first-dimensional data included in the initial data;

[0015] For each first-dimensional data traversed, record the first parameter data of the first-dimensional data, and construct a substructure matrix corresponding to the first-dimensional data based on the plurality of second-dimensional data included in the first-dimensional data;

[0016] The structure matrix of the initial data is constructed according to the first parameter data and the substructure matrix of each first dimensional data, and the basic data.

[0017] As a possible implementation manner, constructing a substructure matrix corresponding to the first dimensional data based on the plurality of second dimensional data included in the first dimensional data includes:

[0018] Traversing all the second-dimensional data included in the first-dimensional data;

[0019] For each traversed second-dimensional data, record the second parameter data of the second-dimensional data;

[0020] A substructure matrix corresponding to the first dimensional data is constructed according to the second parameter data of all the second dimensional data.

[0021] As a possible implementation, constructing the structure matrix of the initial data according to the first parameter data and the substructure matrix of each first dimensional data, and the basic data, includes:

[0022] For each first-dimensional data, merging the first parameter data and the substructure matrix included in the first-dimensional data into a first substructure;

[0023] The basic data and all the first substructures are combined into a structure matrix of the initial data.

[0024] As a possible implementation, constructing the structure matrix of the initial data according to the first parameter data and the substructure matrix of each first dimensional data, and the basic data, includes:

[0025] For each of the substructure matrices, generating a first hyperlink identifier corresponding to the substructure matrix;

[0026] For each first dimensional data, merging the first parameter data and the corresponding first hyperlink identifier corresponding to the first dimensional data into a second substructure;

[0027] Merge all of the second substructures into a third substructure;

[0028] Generate a second hyperlink identifier corresponding to the third substructure;

[0029] The basic data and the second hyperlink identifier are combined into a structure matrix of the initial data.

[0030] As a possible implementation, the initial data is vehicle log data, and the vehicle log data is parsed by a preset tool, and the preset tool is used to parse data in the target format. The target data in the target format is generated according to the structure matrix, including:

[0031] A preset format conversion function is called to convert the structure matrix into target data in the target format, so as to parse the target data through the preset tool.

[0032] In a second aspect, the present application provides a data format conversion device, the device comprising:

[0033] An acquisition module, used to acquire initial data to be converted, wherein the initial data includes data of at least two dimensions in a nested relationship;

[0034] A construction module, used to construct a structure matrix of the initial data, wherein the structure matrix includes at least two structures in a nested relationship;

[0035] A generating module is used to generate target data in a target format according to the structure matrix, wherein the target format is different from the format of the initial data.

[0036] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, wherein the processor is used to execute a data format conversion program stored in the memory to implement the data format conversion method described in any one of the first aspects.

[0037] In a fourth aspect, the present application provides a storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the data format conversion method described in any one of the first aspects.

[0038] The technical solution provided by the embodiment of the present application obtains the initial data to be converted, the initial data includes data of at least two dimensions in a nested relationship, constructs a structure matrix of the initial data, the structure matrix includes at least two structures in a nested relationship, and generates target data in a target format according to the structure matrix, wherein the target format is different from the format of the initial data. This technical solution, when converting the log format of a vehicle, because the log data of the vehicle includes multiple layers of nested data, when converting the log format of the vehicle, a structure matrix of the vehicle log data can be constructed, the structure matrix can include at least two structures in a nested relationship, which can accurately represent the data in the log data in a nested relationship, based on this, the log format is converted according to the structure matrix, and it does not need to use a separate tool or manual participation, so it can achieve low-cost, fast and accurate conversion of the log format of the vehicle. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art texts are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0041] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0042] Figure 1 A flowchart of a data format conversion method provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of a structural matrix provided in an embodiment of the present application;

[0044] Figure 3 A flowchart of another data format conversion method provided in an embodiment of the present application;

[0045] Figure 4 A flowchart of another data format conversion method provided in an embodiment of the present application;

[0046] Figure 5 A schematic diagram of the structure of a signal matrix provided in an embodiment of the present application;

[0047] Figure 6 A schematic diagram of the structure of events provided in an embodiment of the present application;

[0048] Figure 7 A schematic diagram of another structural matrix provided in an embodiment of the present application;

[0049] Figure 8 A block diagram of an embodiment of a data format conversion device provided in an embodiment of the present application;

[0050] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described in conjunction with the drawings in the embodiments of the present application. Obviously, the embodiments described in the text are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0052] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0053] In order to solve the technical problems that in the prior art, when converting the vehicle log format, a separate tool or manual participation is generally required, which results in high conversion cost and easy errors in manual participation, leading to inaccurate format conversion, the present application provides a data format conversion method, device, electronic device and storage medium. When converting the vehicle log format, since the vehicle log data includes multiple layers of nested data, when converting the vehicle log format, a structure matrix of the vehicle log data can be constructed. The structure matrix may include at least two structures with nested relationships, which can accurately represent the data with nested relationships in the log data. Based on this, the log format is converted according to the structure matrix. In addition, there is no need to use a separate tool or manual participation, so the vehicle log format can be converted quickly and accurately at low cost.

[0054] The data format conversion method provided by the present application is further explained below with reference to specific embodiments in conjunction with the accompanying drawings. The embodiments do not constitute a limitation on the embodiments of the present invention.

[0055] join Figure 1 , is a flow chart of an embodiment of a data format conversion method provided in an embodiment of the present application. Figure 1 As shown, the process may include the following steps:

[0056] Step 101: Acquire initial data to be converted, where the initial data includes data of at least two dimensions in a nested relationship.

[0057] The above-mentioned initial data refers to data to be converted into a format, and can be tabular data, such as tabular data of the operating status of each operating component of the vehicle statistically during the operation of the vehicle, or data in other formats, which is not limited in the embodiment of the present application. Further, the initial data may include data of at least two dimensions storing a nested relationship.

[0058] In one embodiment, the execution subject of the embodiment of the present application may obtain the above-mentioned initial data to be format-converted from a preset storage medium.

[0059] For example, assuming that the above initial data is log data collected in real time during the operation of the vehicle, then each time the vehicle generates the above log data, the collected log data is stored in a preset storage medium (eg, a vehicle database).

[0060] Based on this, the execution entity of the embodiment of the present application can periodically obtain the log data stored in the vehicle from the above-mentioned storage medium.

[0061] In another embodiment, the execution subject of the embodiment of the present application can obtain the generated initial data to be format converted in real time, that is, once the initial data is generated, the execution subject of the embodiment of the present application can directly obtain it.

[0062] For example, assuming that the initial data is log data collected in real time during the operation of the vehicle, the vehicle will send the collected log data to the execution subject of the embodiment of the present application every time it generates the log data. Based on this, the execution subject of the embodiment of the present application can obtain the log data collected by the vehicle in real time.

[0063] In one embodiment, the raw data may be tabular data. Based on this, when obtaining the initial data to be converted, the tabular data to be converted may be obtained through a visual interface, and the tabular data in the tabular file may be read using a preset read function. Afterwards, the read tabular data may be determined as the initial data to be converted. The read function may be a uigetfile function in matlab, which is a function for reading excel data.

[0064] Step 102: construct a structure matrix of the initial data, wherein the structure matrix includes at least two structures in a nested relationship.

[0065] The above structure refers to structured data composed of a batch of data.

[0066] Accordingly, the above structure matrix may include at least two structures, and there is a nested relationship between the two structures.

[0067] In an embodiment of the present application, after obtaining the original data to be formatted, in order to accurately convert the format of the original data, the execution subject of the embodiment of the present application can construct a structure matrix of the above-mentioned initial data, so that the format of the original data can be further converted according to the structure matrix of the original data.

[0068] For example, assuming that the original data is the operating status data of various vehicle components collected during the operation of the vehicle, it may include multiple events included in the operation of the vehicle and some basic information of the vehicle (such as vehicle model, vehicle operation date and other information), and each event may include multiple signal information, each signal information records the operating status data of a component of the vehicle.

[0069] Based on this, the execution subject of the embodiment of the present application can convert the above raw data into a structure matrix consisting of two structures in a nested relationship, wherein one structure is an event structure consisting of multiple events, and the other is a signal structure consisting of multiple signals, wherein each event can nest a signal structure. Figure 2 , is a schematic diagram of a structure matrix provided in an embodiment of the present application. Figure 2 As shown, the first layer in the structure matrix may include other information of the vehicle and an event structure (events), and each event (Event) in the event structure may include a signal structure (Signals), and each signal structure may include multiple signals: Signal1, Signal2, Signal3, and Signal4.

[0070] As for how the execution subject of the embodiment of the present application specifically constructs the structure matrix of the above initial data, it can be described below by Figure 3 The process shown is explained and will not be described in detail here.

[0071] Step 103: Generate target data in a target format according to the structure matrix, wherein the target format is different from the format of the initial data.

[0072] The target format refers to the format of the original data to be converted, and can be JSON format or other formats. Further, when the original data is vehicle log data, since the subsequent analysis of vehicle log data is generally in JSON format, the target format is JSON format.

[0073] In the embodiment of the present application, since the structure matrix of the original data has been constructed, when converting the original data into target data in a target format, the target data in the target format can be directly generated according to the structure matrix.

[0074] As an optional implementation method, the execution subject implemented by the present application can directly generate the above structure matrix into target data in the target format.

[0075] As an exemplary implementation, the above initial data is vehicle log data, which is parsed by a preset tool (such as a JSON script), and the preset tool is used to parse data in a target format. Based on this, the execution subject of the embodiment of the present application can call a preset format conversion function to convert the above structure matrix into target data in a target format, so as to parse the target data by the above preset tool. The above format conversion function can be a function in matlab for generating JSON format files, such as a jsonencode function.

[0076] The technical solution provided by the embodiment of the present application obtains the initial data to be converted, the initial data includes data of at least two dimensions in a nested relationship, constructs a structure matrix of the initial data, the structure matrix includes at least two structures in a nested relationship, and generates target data in a target format according to the structure matrix, wherein the target format is different from the format of the initial data. This technical solution, when converting the log format of a vehicle, because the log data of the vehicle includes multiple layers of nested data, when converting the log format of the vehicle, a structure matrix of the vehicle log data can be constructed, the structure matrix can include at least two structures in a nested relationship, which can accurately represent the data in the log data in a nested relationship, based on this, the log format is converted according to the structure matrix, and it does not need to use a separate tool or manual participation, so it can achieve low-cost, fast and accurate conversion of the log format of the vehicle.

[0077] See also Figure 3 , which is a flow chart of another data format conversion method provided in an embodiment of the present application. Figure 3 The process shown in Figure 1 Based on the illustrated process, it is described how to construct a structure matrix of the initial data when the initial data includes basic data and multiple first-dimensional data, and each first-dimensional data includes multiple second-dimensional data.

[0078] like Figure 3 As shown, the process may include the following steps:

[0079] Step 301: traverse all first dimension data included in the initial data.

[0080] In the embodiment of the present application, the initial data to be format-converted may include data of multiple dimensions, that is, the initial data may include multiple first-dimensional data, each first-dimensional data may include multiple second-dimensional data, and so on.

[0081] It should be noted that the dimensional data included in the initial data in the embodiment of the present application is not limited to the first dimensional data and the second dimensional data, but may also include the third dimensional data and the fourth dimensional data under the second dimensional data, and the embodiment of the present application does not impose any restrictions on this.

[0082] In one embodiment, when constructing the structure matrix of initial data, the basic framework of the structure matrix corresponding to the initial data can be constructed first, that is, the structure corresponding to the first dimension data of the initial data can be constructed. Therefore, the execution subject of the embodiment of the present application can first traverse all the first dimension data included in the initial data, and construct the structure matrix of the initial data based on each traversed first dimension data.

[0083] Step 302: for each first dimensional data traversed, record the first parameter data of the first dimensional data, and construct a substructure matrix corresponding to the first dimensional data based on the multiple second dimensional data included in the first dimensional data.

[0084] The above-mentioned first parameter data refers to some parameter values ​​corresponding to the first dimension data. For example, when the first dimension data refers to an event generated during the operation of a vehicle, the parameter values ​​included in the first dimension data may be the type and time of the event, as well as the specific components where the event occurred.

[0085] Correspondingly, the second dimensional data refers to the parameters under the first dimensional data. The difference between the second dimensional data and the first parameter data is that the parameters corresponding to the second dimensional data include multiple parameter values, that is, they correspond to a structure.

[0086] In an embodiment of the present application, in the process of traversing all first dimensional data included in the initial data, the first parameter data of each traversed first dimensional data can be recorded, and multiple second dimensional data included in the first dimensional data can be obtained.

[0087] Afterwards, a substructure matrix corresponding to the first dimensional data can be constructed based on the plurality of second dimensional data included in the first dimensional data. The substructure matrix here refers to a structure composed of the data structure of the second dimensional data.

[0088] As an optional implementation, the execution subject of the embodiment of the present application can traverse all the second dimension data included in the first dimension data currently traversed, and record the second parameter data of the second dimension data for each second dimension data traversed. The second parameter data refers to the parameter values ​​of multiple parameters included in the second dimension data. For example, when the second parameter data is a signal under a certain event during the operation of the vehicle, the second parameter data is the parameter data such as the name, state, and generation time of the signal.

[0089] Afterwards, a substructure matrix corresponding to the first dimensional data may be constructed according to the second parameter data of all the second dimensional data.

[0090] As an exemplary implementation, the correlation relationship between all second-dimensional data can be obtained. When the above-mentioned correlation relationship represents that the second-dimensional data are in a parallel relationship, the second parameter data corresponding to each second-dimensional data can be used as an element of a substructure matrix. Then, the second parameter data of all second-dimensional data can constitute the substructure matrix of the first-dimensional data.

[0091] As another exemplary implementation, the association relationship between all the second dimensional data can be obtained. When the above association relationship indicates that there is a nested relationship between the second dimensional data, a substructure matrix containing at least two structures and a nested relationship between the two structures can be constructed again according to the above nested relationship. It can be understood that the construction process of this substructure matrix is ​​the same as the method of constructing the structure matrix between the first dimensional data and the second dimensional data, which will not be repeated here.

[0092] As another exemplary implementation, the association relationship between all the second dimensional data can be obtained. When the above-mentioned association relationship represents the existence of parallel relationship and nested relationship between the second dimensional data, the second parameter data corresponding to each second dimensional data can be used as an element of a sub-structure matrix for the second dimensional data in a parallel relationship; and for the second dimensional data in a nested relationship, a third-dimensional sub-structure matrix under the sub-structure matrix containing at least two structures and a nested relationship between the two structures can be re-constructed according to the above-mentioned nested relationship, so as to obtain the sub-structure matrix corresponding to the second dimensional data according to the above-mentioned method.

[0093] Step 303: construct a structure matrix of initial data according to the first parameter data and the substructure matrix of each first dimensional data, and the basic data.

[0094] The above structure matrix refers to a structure matrix composed of all data included in the initial data.

[0095] From the above steps, it can be concluded that the data contained in the initial data has the following association relationship: the initial data includes basic data and multiple first-dimensional data, each first-dimensional data includes first parameter data and a substructure matrix, and each substructure matrix may include second parameter data under multiple second-dimensional data.

[0096] For the above-mentioned association relationship, for the substructure matrix included in each first-dimensional data that has been constructed above, the execution subject of the embodiment of the present application can directly construct the structure matrix of the initial data according to the following three parameters: the first parameter data and the substructure matrix included in each first-dimensional data, and the basic data included in the above-mentioned initial data.

[0097] In one embodiment, the execution subject of the embodiment of the present application can directly construct the structure matrix of the initial data according to the first parameter data and the substructure matrix included in each first dimension data, and the above-mentioned basic data. Based on this, the execution subject of the embodiment of the present application can merge the first parameter data and the substructure matrix included in each first dimension data into a first substructure.

[0098] Afterwards, the basic data and all the first substructures may be combined into a structure matrix of the initial data.

[0099] For example, assume that the first dimensional data includes A1, A2, and A3, wherein the first dimensional data A1 may include first parameter data a1 and substructure matrix b1, the first dimensional data A2 may include first parameter data a2 and substructure matrix b2, and the first dimensional data A3 may include first parameter data a3 and substructure matrix b3.

[0100] Then the first parameter data and the substructure matrix included in the first dimensional data are merged into the first substructure: A1: a1b1, A2: a2b2, A3: a3b3.

[0101] Continuing to assume that the basic data of the initial data is c1, then merging the above basic data and all the first substructures, we can get the structure matrix corresponding to the initial data: {c1, {a1b1, a2b2, a3b3}}.

[0102] In another embodiment, in order to make the structure matrix of the constructed initial data more simple and clear, the execution subject of the embodiment of the present application can generate a corresponding link for each structure, so that when constructing the structure matrix, each structure therein can be replaced by a corresponding link. Based on this, if the user wants to view a certain structure, he can view it by clicking on the link.

[0103] As an optional implementation, the execution subject of the embodiment of the present application can generate a first hyperlink mark corresponding to the substructure matrix for each substructure matrix of the first dimensional data. The first hyperlink mark can be a link address or a character mark, and the substructure matrix can be linked by clicking the first hyperlink mark. It is understandable that the first hyperlink marks corresponding to different substructure matrices are different.

[0104] Afterwards, for each first dimensional data, the first parameter data and the corresponding first hyperlink identifier corresponding to the first dimensional data may be merged into a second substructure, thereby obtaining a second substructure corresponding to each first dimensional data.

[0105] Based on this, all second substructures can be merged into a third substructure, and a second hyperlink identifier corresponding to the third substructure is generated. The second hyperlink identifier can be a link address or a character identifier, and by clicking the second hyperlink identifier, a link can be made to the third substructure containing all second substructures.

[0106] Finally, the basic data and the second hyperlink identifier may be combined into a structure matrix of the initial data.

[0107] For example, assume that the first dimensional data includes A1, A2, and A3, wherein the first dimensional data A1 may include first parameter data a1 and substructure matrix b1, the first dimensional data A2 may include first parameter data a2 and substructure matrix b2, and the first dimensional data A3 may include first parameter data a3 and substructure matrix b3.

[0108] Based on this, since each substructure matrix includes multiple data, in order to simplify the structure matrix, a first hyperlink identifier that can be linked to the substructure matrix can be generated for each substructure matrix. Continuing to assume that the first hyperlink identifier generated by the substructure matrix b1 is B1, the first hyperlink identifier generated by the substructure matrix b2 is B2, and the first hyperlink identifier generated by the substructure matrix b3 is B3.

[0109] Then, the first parameter data and the first hyperlink identifier included in the first dimension data are respectively merged into a second substructure: A1: a1B1, A2: a2B2, A3: a3B3. Afterwards, all the second substructures are merged into a third substructure {a1B1, a2B2, a3B3}.

[0110] Continuing to assume that the generated second hyperlink identifier that can be linked to the above third substructure is S, and the basic data of the initial data is c1, then the structure matrix of the initial data that combines the above basic data and the second hyperlink identifier is c1S.

[0111] The technical solution provided by the embodiment of the present application traverses all the first dimensional data included in the initial data, records the first parameter data of the first dimensional data for each traversed first dimensional data, and constructs a substructure matrix corresponding to the first dimensional data based on the multiple second dimensional data included in the first dimensional data, and constructs the structure matrix of the initial data according to the first parameter data and the substructure matrix of each first dimensional data, as well as the basic data. This technical solution constructs a structure corresponding to each dimensional data included in the initial data, and then merges the constructed structures to obtain the structure matrix corresponding to the initial data, thereby realizing the rapid and accurate construction of the structure matrix of the initial data.

[0112] In one embodiment, in order to facilitate understanding of the data format conversion method provided in the embodiment of the present application, the following is an example of the initial data to be format converted being the log data of the statistical vehicle:

[0113] See also Figure 4 , which is a flow chart of another data format conversion method provided in an embodiment of the present application. Figure 4The process shown takes the vehicle log data recorded as the initial data as an example to illustrate the data format conversion method provided by this application. Figure 4 As shown, the process may include the following steps:

[0114] Step 401: Obtain log data recorded by the vehicle.

[0115] Step 402: Obtain the data format of the log data.

[0116] The following is a unified description of step 401 and step 402:

[0117] The log data includes various events recorded by the vehicle, and various signal conditions included in each event. Further, the log data can be Excel data.

[0118] The above data format refers to the data format of log data.

[0119] In one embodiment, the execution subject of the embodiment of the present application can obtain statistical log data of the vehicle from a preset database of the vehicle, and obtain the data format of the log data.

[0120] In another embodiment, the user can obtain the log data of the vehicle and input the log data and the data format of the log data (e.g., Excel format) into the execution subject of the embodiment of the present application through the visual interface. Based on this, the execution subject of the embodiment of the present application can obtain the log data and the data format of the log data of the vehicle through the visual interface.

[0121] Step 403: process the signal under the single event level, traverse the single event and store the whole as signals.

[0122] The above-mentioned event may be the first dimension data included in the vehicle's log data, that is, the first dimension data of the initial data, which may refer to a specific event occurring in the vehicle. The above-mentioned signal may be the second dimension data under the first dimension data, and may refer to the signal status of each component in the vehicle.

[0123] In one embodiment, the execution subject of the embodiment of the present application may first process the signal at a single event level in the log data, and generate a signal matrix under the event, namely, signals, according to the parameter data under each signal (ie, the second parameter data under the second dimension data). Figure 5 , is a schematic diagram of the structure of a signal matrix provided in an embodiment of the present application. Figure 5As shown, the signal matrix may include: central locking status, central unlocking request status, four-door switch status, door switch request source, external unlocking trigger status, reserved 1, and reserved 2 signals, as well as some related field values ​​of each signal.

[0124] Step 404: Take the above signals as sub-members of the event structure, traverse the event, and store the whole as events.

[0125] The above events refers to a structure that includes multiple events, which can be equivalent to Figure 3 The first and third substructures in the process shown.

[0126] In one embodiment, after generating signals corresponding to each event, the execution subject of the embodiment of the present application may merge all events into one event.

[0127] As an exemplary implementation, since each event may include corresponding parameter information (i.e., the first parameter data under the first dimension data), for each event, the parameter information and signals under the event may be merged into a substructure of an event, and all substructures of the event may be merged into one event. For example, see Figure 6 , is a schematic diagram of the structure of events provided in an embodiment of the present application. Figure 6 As shown, the events may include multiple events, each of which may include its corresponding parameter data and the signals included in the event. Each signal may correspond to an identifier that can be linked to the signal, for example, "tx7struct", "tx2 struct", "tx3 struct", and "tx4struct" can be linked to the signals of the events "side control enhancement", "window combination service", "tailgate control enhancement", and "fuel filler lid control" respectively.

[0128] Step 405: events is combined with other basic information as a structure value member.

[0129] Step 406: Generate a json file.

[0130] The following is a unified description of step 405 and step 406:

[0131] The above-mentioned other basic information refers to some basic data included in the vehicle log data (i.e. Figure 3 The basic data in the process shown), such as the type, model, version and other data of the vehicle.

[0132] The above-mentioned json file refers to the target data after the vehicle's log data is format-converted, and the format of the target data is the target format (json format in the embodiment of the present application).

[0133] In the embodiment of the present application, the execution subject of the embodiment of the present application determines events (that is, Figure 3 After the first substructure of the process shown in the figure, the basic data of events and log data can be merged to obtain the structure matrix corresponding to the log data.

[0134] Further, in order to simplify the matrix, the execution subject of the embodiment of the present application may first generate an identifier that can be linked to the events (ie Figure 3 The second hyperlink identifier of the process shown in the figure) can then be combined with the basic data of the log data to obtain the structure matrix of the log data. Figure 7 , is a schematic diagram of another structural matrix provided in an embodiment of the present application, such as Figure 7 As shown, the basic data included in the log data may include information data such as device type, controller version number, software version number, software description, etc., and the second hyperlink that can be linked to events is identified as "150x1 struct".

[0135] Based on this, after generating the above structure matrix, the execution subject of the embodiment of the present application can call a preset json file generation function to convert the above structure matrix into a json file.

[0136] The technical solution provided by the embodiment of the present application obtains the log data recorded by the vehicle, obtains the data format of the log data, processes the signal under the single event level, traverses the single event and stores the whole as signals, uses the above signals as the sub-members of the structure of the event, traverses the event, stores the whole as events, and merges events as the structure value member with other basic information to generate a json file. This technical solution, by converting the log data of the vehicle counted in the excel table into a json script, facilitates the collection of vehicle signals and the analysis of signals through the underlying log, and facilitates developers to count the signals that need to be observed and record and export them as json files. After the synchronous application layer design, the log is read, and the json file can be directly used to parse the log file, which optimizes the steps of generating the json file, speeds up the ability to troubleshoot vehicle problems, and reduces the use of test tools.

[0137] See also Figure 8 , is a block diagram of an embodiment of a data format conversion device provided in an embodiment of the present application. Figure 8As shown, the device may include:

[0138] An acquisition module 81 is used to acquire initial data to be converted, wherein the initial data includes data of at least two dimensions in a nested relationship;

[0139] A construction module 82 is used to construct a structure matrix of the initial data, wherein the structure matrix includes at least two structures in a nested relationship;

[0140] The generating module 83 is used to generate target data in a target format according to the structure matrix, wherein the target format is different from the format of the initial data.

[0141] like Fig. 9 As shown, it is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, including a processor 91, a communication interface 92, a memory 93 and a communication bus 94, wherein the processor 91, the communication interface 92, and the memory 93 communicate with each other through the communication bus 94.

[0142] Memory 93, used for storing computer programs;

[0143] In one embodiment of the present application, the processor 91 is used to implement the data format conversion method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 93, including:

[0144] Acquire initial data to be converted, wherein the initial data includes data of at least two dimensions in a nested relationship;

[0145] Constructing a structure matrix of the initial data, wherein the structure matrix includes at least two structures in a nested relationship;

[0146] According to the structure matrix, target data in a target format is generated, wherein the target format is different from a format of the initial data.

[0147] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the data format conversion method provided in any of the aforementioned method embodiments are implemented.

[0148] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.

[0149] Through the text of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiment.

[0150] It should be understood that the terms used in the text are only for the purpose of the specific example implementation of the text, and are not intended to be limited. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text can also be represented to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of the stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or their combinations. The method steps, processes, and operations of the text in the text are not interpreted as necessarily requiring them to be performed in the specific order of the text or description, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps can be used.

[0151] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A data format conversion method, characterized in that: The method comprises: Acquire initial data to be converted, wherein the initial data includes data of at least two dimensions in a nested relationship; Constructing a structure matrix of the initial data, wherein the structure matrix includes at least two structures in a nested relationship; According to the structure matrix, target data in a target format is generated, wherein the target format is different from a format of the initial data.

2. The method according to claim 1, characterized in that The initial data is table data, and the obtaining of the initial data to be converted includes: Obtain the table file to be converted through the visual interface; The table data in the table file is read using a preset reading function, and the read table data is determined as initial data to be converted.

3. The method according to claim 1, characterized in that The initial data includes basic data and a plurality of first dimensional data, each of the first dimensional data includes a plurality of second dimensional data, and the step of constructing a structure matrix of the initial data includes: Traversing all the first-dimensional data included in the initial data; For each first-dimensional data traversed, record the first parameter data of the first-dimensional data, and construct a substructure matrix corresponding to the first-dimensional data based on the plurality of second-dimensional data included in the first-dimensional data; The structure matrix of the initial data is constructed according to the first parameter data and the substructure matrix of each first dimensional data, and the basic data.

4. The method according to claim 3, characterized in that The constructing a substructure matrix corresponding to the first dimensional data based on the plurality of second dimensional data included in the first dimensional data includes: Traversing all the second-dimensional data included in the first-dimensional data; For each traversed second-dimensional data, record the second parameter data of the second-dimensional data; A substructure matrix corresponding to the first dimensional data is constructed according to the second parameter data of all the second dimensional data.

5. The method according to claim 3, characterized in that: The step of constructing the structure matrix of the initial data according to the first parameter data and the substructure matrix of each first dimensional data and the basic data includes: For each first-dimensional data, merging the first parameter data and the substructure matrix included in the first-dimensional data into a first substructure; The basic data and all the first substructures are combined into a structure matrix of the initial data.

6. The method according to claim 3, characterized in that The step of constructing the structure matrix of the initial data according to the first parameter data and the substructure matrix of each first dimensional data and the basic data includes: For each of the substructure matrices, generating a first hyperlink identifier corresponding to the substructure matrix; For each first dimensional data, merging the first parameter data and the corresponding first hyperlink identifier corresponding to the first dimensional data into a second substructure; Merge all of the second substructures into a third substructure; Generate a second hyperlink identifier corresponding to the third substructure; The basic data and the second hyperlink identifier are combined into a structure matrix of the initial data.

7. The method according to claim 1, characterized in that The initial data is vehicle log data, and the vehicle log data is parsed by a preset tool, and the preset tool is used to parse data in the target format. The generating target data in the target format according to the structure matrix includes: A preset format conversion function is called to convert the structure matrix into target data in the target format, so as to parse the target data through the preset tool.

8. A data format conversion device, characterized in that: The device comprises: An acquisition module, used to acquire initial data to be converted, wherein the initial data includes data of at least two dimensions in a nested relationship; A construction module, used to construct a structure matrix of the initial data, wherein the structure matrix includes at least two structures in a nested relationship; A generating module is used to generate target data in a target format according to the structure matrix, wherein the target format is different from the format of the initial data.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a data format conversion program stored in the memory to implement the data format conversion method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the data format conversion method according to any one of claims 1 to 7.