Calibration data file analysis method and device, electronic equipment and storage medium

By reading and parsing the calibration data file line by line, structured data objects are generated, which solves the problems of incomplete parsing and incomplete data processing in the existing technology, and achieves more comprehensive data parsing and processing.

CN119358537APending Publication Date: 2025-01-24CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411607548.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-12
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The existing calibration data file analysis method is not comprehensive in the parsing and only supports specific keywords and data structures, resulting in incomplete data processing and easily lead to parsing failure.

Method used

By reading the calibration data file by line, determine whether the current line is an empty line or annotation line.

Benefits of technology

A comprehensive analysis of calibration data files, support more keywords and data structures, ensure complete data processing, and avoid analysis failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119358537A_ABST
    Figure CN119358537A_ABST
Patent Text Reader

Abstract

The invention provides a calibration data file analysis method and device, electronic equipment and a storage medium. The method comprises the following steps: reading the content of a calibration data file line by line; determining whether the current line is at the end of the calibration data file or not when one line is read every time, if not, determining whether the current line is an empty line or an annotation line or not, and if yes, skipping the current line and continuing to read the next line; under the condition that the current line is not the null line or the annotation line, analyzing the content of the current line according to a preset keyword analysis rule; determining a data type corresponding to the keyword according to the keyword obtained through analysis, and generating a structured data object according to the keyword and the data type; and storing the structured data object or providing the structured data object to an external module for subsequent operation or calling. According to the method and the device, comprehensive analysis of the calibration data file can be realized, more keywords and data structures are supported, data processing is complete, and analysis failure is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a calibration data file parsing method, device, electronic device and storage medium. Background Art

[0002] During the integration process, calibration engineers often need to integrate calibration data files generated by tools, such as DCM (Data Conservation Format, referred to as DCM) files, into the software and generate new software versions for test engineers to use. This process usually uses the following two methods for data integration.

[0003] The first is to rely on the original tool integration, that is, according to the tool that generates the DCM file, use the corresponding tool to integrate the data. Although this can ensure compatibility, it will cause dependence on specific tools and there is a risk of manual operation errors, which affects the integration efficiency and the effect of batch operations.

[0004] The second is to develop automated tools for integration, that is, to develop customized automated tools to parse DCM files and automatically integrate their data into the software. This approach not only improves efficiency, but also reduces manual errors and improves the reliability of software integration.

[0005] However, existing automated tools are usually developed based on the DCM file structure of a specific manufacturer. The parsing process of existing automated tools only covers specific keywords and formats, especially only considers part of the annotations and data content. Therefore, the existing calibration data file parsing methods are not comprehensive and only support specific keywords and data structures, resulting in incomplete data processing and parsing failure. Summary of the invention

[0006] In view of this, the embodiments of the present application provide a calibration data file parsing method, device, electronic device and storage medium to solve the problems of incomplete parsing in the prior art, only supporting specific keywords and data structures, incomplete data processing, and easily leading to parsing failure.

[0007] In a first aspect of an embodiment of the present application, a calibration data file parsing method is provided, comprising: reading the contents of the calibration data file line by line; when each line is read, determining whether the current line is at the end of the calibration data file, if not, determining whether the current line is a blank line or a comment line, and if so, skipping the current line and continuing to read the next line; when the current line is not a blank line or a comment line, parsing the contents of the current line according to predetermined keyword parsing rules, wherein the keyword parsing rules include comment keyword parsing rules and function keyword parsing rules; determining the data type corresponding to the keyword based on the keyword obtained by the parsing, and generating a structured data object based on the keyword and the data type; storing or providing the structured data object to an external module for subsequent operation or calling.

[0008] According to a second aspect of an embodiment of the present application, a calibration data file parsing device is provided, comprising: a reading module, which reads the contents of the calibration data file line by line; a determination module, which determines whether the current line is at the end of the calibration data file each time a line is read, and if not, determines whether the current line is a blank line or a comment line, and if so, skips the current line and continues to read the next line; a parsing module, which, if the current line is not a blank line or a comment line, parses the contents of the current line according to predetermined keyword parsing rules, wherein the keyword parsing rules include comment keyword parsing rules and function keyword parsing rules; a generation module, which determines the data type corresponding to the keyword based on the keyword obtained by the parsing, and generates a structured data object based on the keyword and the data type; a storage module, which stores or provides the structured data object to an external module for subsequent operation or call.

[0009] According to a third aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the above method are implemented when the processor executes the computer program.

[0010] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0011] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

[0012] By reading the contents of the calibration data file line by line; each time a line is read, determine whether the current line is at the end of the calibration data file, if not, determine whether the current line is a blank line or a comment line, if so, skip the current line and continue to read the next line; when the current line is not a blank line or a comment line, parse the contents of the current line according to predetermined keyword parsing rules, wherein the keyword parsing rules include comment keyword parsing rules and function keyword parsing rules; according to the keywords obtained by parsing, determine the data type corresponding to the keyword, and generate a structured data object according to the keywords and data types; store or provide the structured data object to an external module for subsequent operation or call. The present application can achieve comprehensive parsing of calibration data files, support more keywords and data structures, and complete data processing to avoid parsing failure. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0014] Figure 1 It is a schematic diagram of the overall implementation process of the calibration data file parsing method provided in the embodiment of the present application;

[0015] Figure 2 It is a flowchart of a calibration data file parsing method provided in an embodiment of the present application;

[0016] Figure 3 It is a schematic diagram of the relationship between various classes and functions in the calibration data file parsing process provided in the embodiment of the present application;

[0017] Figure 4 It is a structural schematic diagram of a calibration data file parsing device provided in an embodiment of the present application;

[0018] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0019] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0020] DCM (Data Conservation Format, referred to as DCM) file is a format of calibration data file, and its file suffix is ​​".dcm". This format is widely used in calibration software such as INCA to store and manage various calibration parameters, curves, and mapping (MAP) data. The calibration data file has a standardized document description. Although it uses German keywords and the format is relatively complex, its data integrity is well guaranteed.

[0021] In the calibration data file standard, the same function has multiple expression formats. For example, lines starting with "*", "!" or "." are comments, "KENNLINIE" and "FESTKENNLINIE" are keywords of the one-dimensional table, "FESTKENNFELD", "GRUPPENKENNFELD" and "KENNFELD" are all map types, etc. The choice of different definition methods of the same type is determined by the developer of the calibration tool. The keywords selected by CANape and INCA are different.

[0022] After obtaining the calibration data files generated by the tools, the integration engineer needs to integrate them into a specific version of the software, generate a new software version and deliver it to the test engineer for testing. This integration process can be achieved in two ways. The first method is to use the original tool, such as using CANape to integrate the calibration data file generated by CAN ape. This will cause dependence on the tool, which is not conducive to improving efficiency and batch operation, and there is a risk of error in manual operation, resulting in software integration failure or test failure. The second method is to develop an automated tool to parse the DCM data, and then integrate it into the software after obtaining the data. This improves efficiency while avoiding human errors.

[0023] The development of such tools is generally based on the calibration data files generated by specific tools. Taking CAN ape as an example, there are two problems in its parsing process:

[0024] 1. When judging the comment content, only the lines starting with "*" are judged, and the rest of the comment formats are not considered;

[0025] 2. In the section on processing content by row, only the following contents are included:

[0026]

[0027]

[0028] These are keywords and formats that only correspond to the calibration data files exported by the CANape tool. They are not comprehensive for other tools. When applied to the exported calibration data files with other tools, there will be a large number of rows or data that cannot be parsed, resulting in parsing failure and software integration failure.

[0029] In view of the problems existing in the prior art, the technical solution of this application aims to provide an improved calibration data file parsing method. In view of the defects in the prior art, a new Python code is developed to parse the calibration data file more comprehensively and adapt to the output formats of different tools. The overall implementation process of the calibration data file parsing method of this application will be summarized below with reference to the accompanying drawings. Figure 1 Schematic diagram of the overall implementation process of the calibration data file parsing method provided in the embodiment of the present application. Figure 1 As shown, the calibration data file parsing method may specifically include the following process:

[0030] 1. Start: Start the entire parsing process and initialize the parsing tool.

[0031] 2. Read the file line by line: The program reads the content of the calibration data file (such as DCM file) line by line to ensure that no data line is missed during the parsing process.

[0032] 3. Determine whether it is the end of the file: Each time a line is read, first check whether it has reached the end of the file. If it is the end of the file, end the parsing; otherwise, continue.

[0033] 4. Determine whether it is a blank line or a comment: Determine whether the line currently being read is a blank line or a comment (a comment line starts with "*", "!" or "."). If it is a blank line or a comment, skip the line and continue reading the next line.

[0034] 5. Execute content processing: If the line is not a blank line or a comment, the program will correspond to a specific calibration quantity (such as a curve, table, scalar, etc.) according to the keywords in the content of the line and process it.

[0035] 6. Return to the file reading step: Repeat this process until all files are read and the parsing is finally completed.

[0036] The contents of the technical solution of the present application are described in detail below with reference to the accompanying drawings and specific embodiments.

[0037] Figure 2 FIG. 1 is a flow chart of a calibration data file parsing method provided in an embodiment of the present application. Figure 2 As shown, the calibration data file parsing method may specifically include:

[0038] S201, reading the content of the calibration data file line by line;

[0039] S202, when each line is read, determine whether the current line is at the end of the calibration data file, if not, determine whether the current line is a blank line or a comment line, if so, skip the current line and continue to read the next line;

[0040] S203, if the current line is not a blank line or a comment line, parsing the content of the current line according to a predetermined keyword parsing rule, wherein the keyword parsing rule includes a comment keyword parsing rule and a function keyword parsing rule;

[0041] S204, determining the data type corresponding to the keyword according to the keyword obtained by the analysis, and generating a structured data object according to the keyword and the data type;

[0042] S205, storing or providing the structured data object to an external module for subsequent operation or calling.

[0043] In some embodiments, determining whether the current line is a blank line or a comment line includes:

[0044] For the current line being read, determine whether the current line is a blank line;

[0045] If it is not a blank line, determine whether the current line meets the judgment condition of the comment line, where the judgment condition of the comment line is a line starting with a preset character;

[0046] If satisfied, the current line is determined to be a comment line.

[0047] Specifically, this embodiment proposes a parsing method for determining whether the current line in a DCM file is a blank line or a comment line, aiming to improve the accuracy and efficiency of the parsing process. The method may include the following steps:

[0048] First, use the parsing tool to read the content of the DCM file line by line. After each line is read, the judgment phase begins.

[0049] Further, determine whether it is a blank line: for each line currently read, first determine whether the line is a blank line. Specifically, if the line contains only blank characters or has no content, it is determined to be a blank line. If the current line is determined to be a blank line, it is directly skipped without further processing, and the next line is read.

[0050] Further, determine whether it is a comment line: if the current line is not a blank line, then determine whether the line is a comment line. The judgment condition for a comment line is: whether the line starts with a preset character. In this embodiment, the comment line starts with a specific symbol, such as "*", "!" or ".". When the parsing tool detects these preset symbols as the starting characters of a line, the line is determined to be a comment line.

[0051] Furthermore, comment lines are skipped: if the current line is determined to be a comment line, there is no need to further parse its content, and the line is directly skipped and the next line is read to avoid interference from parsing irrelevant information.

[0052] Furthermore, the valid content line is processed: if the current line is neither a blank line nor a comment line, the line is regarded as a valid content line and will enter the subsequent keyword parsing stage to parse out the calibration data or related information corresponding to the line.

[0053] In some examples, a "parsing tool" refers to a software module or program for reading, parsing, and processing a calibration data file (such as a DCM file) line by line. The parsing tool can identify the file content according to predetermined keyword parsing rules, associate keywords in the calibration data file with corresponding data content, and generate structured data objects for further calibration processing and data management.

[0054] Through the above steps of this embodiment, this embodiment effectively avoids invalid parsing of blank lines and comment lines, improves the efficiency of file content processing, and lays a foundation for subsequent keyword parsing and data object generation.

[0055] In some embodiments, when the current line is not a blank line or a comment line, the content of the current line is parsed according to a predetermined keyword parsing rule, including:

[0056] If the current line is a non-blank line or a non-comment line, mark the current line as valid content for parsing;

[0057] Parse the valid content of the current row according to the predetermined keyword parsing rules to obtain the keywords in the current row;

[0058] According to the keywords in the current row, the keywords are parsed and associated with the parsed content;

[0059] The keyword rules include parsing rules for identifying annotation keywords that are used to identify annotation content and begin with target characters, and parsing rules for functional keywords that are used to identify different functions or data types in the calibration data file.

[0060] Specifically, this embodiment provides a method for valid content parsing for each line in a DCM file, which is used to parse the content of a non-blank line or a non-comment line according to a predetermined keyword parsing rule to generate structured calibration data. The method may specifically include the following steps:

[0061] First, mark the valid content line: When reading the DCM file line by line, first determine whether the current line is a blank line or a comment line. If the current line is neither a blank line nor a comment line, the line is marked as a valid content line and enters the parsing stage.

[0062] Further, parsing keywords: the current line marked as valid content is parsed according to a predetermined keyword parsing rule. The keyword rule is used to identify the content type and function of the line. During the parsing process, the function type is first determined based on the keyword at the beginning of the line. The following is the parsing rule for the keywords and their corresponding data types provided by this embodiment:

[0063]

[0064]

[0065] In the keyword parsing rules provided in the above embodiment, the lines starting with "*", "!" or "." are comments and are not further processed;

[0066] The keyword "FUNKTION" indicates the function definition, and the corresponding function data is obtained after parsing;

[0067] "EINHEIT_X" indicates the X-axis unit, and the unit information of the X-axis is obtained after parsing;

[0068] "EINHEIT_Y" indicates the Y-axis unit, and the unit information of the Y-axis is obtained after parsing;

[0069] "EINHEIT_W" indicates the unit of the value, and the unit of the data value is obtained after parsing;

[0070] "ST / X" and "ST / Y" represent the value lists of the X-axis and Y-axis respectively, and the corresponding coordinate axis values ​​are obtained after parsing;

[0071] "WERT" indicates a data value or a list of data values, which are parsed to obtain specific calibration data values;

[0072] "GRUPPENKENNLINIE" and "FESTKENNLINIE" represent arrays and fixed-point arrays respectively, and the corresponding array structures are generated after parsing;

[0073] "FESTKENNFELD" and "GRUPPENKENNFELD" represent chart data, and the corresponding chart objects are generated after parsing;

[0074] "FESTWERTEBLOCK" represents an array, and after parsing, an array data structure is generated;

[0075] "STUETZSTELLENVERTEILUNG" represents a coordinate value group, and the distribution of coordinate points is obtained after parsing;

[0076] "END" indicates the end of a value definition and marks the completion of parsing of the current data block.

[0077] Furthermore, during the parsing process, the keywords extracted from the current line are associated with the corresponding content. For example, if "FUNKTION" is parsed, it is associated with the corresponding function definition; if "WERT" is parsed, it is associated with a specific data value. In this way, it is ensured that each keyword can form a logical association with its parsed content, and provide support for subsequent data processing.

[0078] Furthermore, based on the parsed keywords and their associated contents, structured data objects are generated. For example, the parsed coordinate value list will be organized into an X-axis or Y-axis object, the chart data will be generated into a corresponding chart object, and the array data will be generated into an array structure. In this way, each row of data in the DCM file can be accurately parsed and mapped to a specific data type to form a structured calibration data object.

[0079] Ultimately, these generated structured data objects can be used for subsequent processing, such as presentation of calibration data, further calculations, or integration into software, ensuring that the parsed data can be used efficiently.

[0080] In some examples, comment keywords are used to identify comment lines in calibration data files (such as DCM files) so that parsing tools can identify and skip these irrelevant contents when processing files. Comment lines usually start with specific characters (such as "*", "!" or "."), which are comment keywords. The role of comment keywords is to mark descriptive content or remarks in files, helping parsing tools to effectively filter out content that does not participate in data processing, so as to focus on parsing calibration data.

[0081] Function keywords are used to identify different data types or functional contents in the file, helping the parsing tool to associate the specific data of each line with the corresponding structured object. For example, the keyword "FUNKTION" is used to define a function, "EINHEIT_X" and "EINHEIT_Y" represent the units of the X-axis and Y-axis respectively, and "WERT" represents the specific data value. Function keywords ensure that the parsing tool can accurately parse and classify the data content by indicating the type and function of the data in the line, thereby constructing different types of structured data objects such as calibrated quantities, coordinate axes, and charts.

[0082] Through the method of the present embodiment described above, the valid content in the DCM file can be accurately parsed according to the predetermined keyword parsing rules, and the corresponding structured object can be generated according to the data type, which greatly improves the accuracy and compatibility of file parsing.

[0083] In some embodiments, according to the keyword obtained by parsing, determining the data type corresponding to the keyword, and generating a structured data object according to the keyword and the data type includes:

[0084] According to the keyword of the current row, according to the predetermined matching relationship, determine the data type corresponding to the keyword, wherein the data type includes scalar, curve, chart, array and coordinate value group;

[0085] According to the keywords obtained through parsing and the corresponding data types, the keywords are associated with the parsed data content to generate corresponding structured data objects, which are used for subsequent step calls or processing.

[0086] Specifically, this embodiment also proposes a method for determining data types based on keyword analysis and generating structured data objects. The method can parse each line of content in a DCM file into a corresponding data type and generate a structured calibration data object.

[0087] First, in the process of reading and parsing the DCM file line by line, first determine the corresponding data type according to the keyword extracted from the current line according to the predetermined matching rule. Specifically, the corresponding relationship between the keyword and the data type is as follows:

[0088] "FUNKTION": parsed as a function, which is a scalar type;

[0089] "EINHEIT_X", "EINHEIT_Y", "EINHEIT_W": correspond to the X-axis unit, Y-axis unit, and data value unit, respectively, and are interpreted as scalars;

[0090] "ST / X", "ST / Y": parsed as coordinate value groups, representing the value lists of the X-axis and Y-axis respectively;

[0091] "WERT": Parse as a scalar or array, and determine whether it is a single data value or a data list based on the data content of the current row;

[0092] "GRUPPENKENNLINIE", "FESTKENNLINIE": parsed as a curve, representing a one-dimensional table or a fixed-point array;

[0093] "FESTKENNFELD", "GRUPPENKENNFELD": parsed as a chart, representing multidimensional mapping data;

[0094] "STUETZSTELLENVERTEILUNG": parsed as a set of coordinate values, used to describe the distribution of a specific point;

[0095] "FESTWERTEBLOCK": parsed as an array, representing a set of values;

[0096] "END": Indicates the end of the current value definition.

[0097] Furthermore, after parsing the keyword, the keyword is associated with the specific data content parsed from it. For example:

[0098] When the keyword is "WERT", if a single value is parsed, it is treated as a scalar; if multiple values ​​are parsed, they are treated as an array;

[0099] When the keyword is "ST / X" or "ST / Y", the parsed data will be a list of values ​​for the X-axis or Y-axis, respectively associated with the coordinate value group.

[0100] Furthermore, a structured data object is generated based on the keyword and the parsed data type. The object can be stored and organized using different data structures based on different keyword types. For example:

[0101] For scalar data, a scalar object containing the data value and unit is generated;

[0102] For curve data, a curve object containing coordinate values ​​and corresponding function relationships is generated;

[0103] For chart data, a chart object containing multidimensional data mapping relationships is generated;

[0104] For arrays or coordinate value groups, generate corresponding array or coordinate objects to ensure that the data is correctly organized and stored.

[0105] Furthermore, the generated structured data objects can be used for subsequent processing or calling. For example, calibration tools or test software can directly access these structured data objects and extract information such as curves, coordinate values, and charts from them to facilitate further operations. In addition, structured data objects can also be used to display calibration data or perform subsequent calculations and optimizations.

[0106] Through the above method of this embodiment, the keywords in the DCM file can be effectively associated with their corresponding data types and generate corresponding structured data objects, which provides a basis for subsequent calibration data processing. This method not only improves the accuracy of parsing, but also provides a more efficient mechanism for data storage and processing.

[0107] In some embodiments, the keywords are associated with the parsed data content to generate corresponding structured data objects, including:

[0108] During the parsing process, a structured data object for storing the parsing results is initialized according to a preset object model;

[0109] Associating keywords with the parsed data content, and filling each element in the calibration data file into the structured data object in turn according to the keywords and the corresponding data types;

[0110] After the parsing is completed, all data types related to the keyword are organized to generate a complete structured data object, wherein the structured data object includes a calibration object, a coordinate object and / or a calibration object.

[0111] Specifically, this embodiment also proposes a method for associating keywords in a DCM file with parsed data content and generating corresponding structured data objects. The method specifically includes the following steps:

[0112] First, in the process of parsing the DCM file, the structured data objects used to store the parsing results are initialized according to the predefined object model (such as the DCMINFO class). Each structured data object can represent different types of calibration data in the file, including calibration quantity objects, coordinate objects, and calibration objects.

[0113] Furthermore, for each row of parsed keywords, the keyword is associated with the corresponding parsed content according to its corresponding data type. The specific operation is as follows:

[0114] When parsing a calibration keyword (such as "FUNKTION" or "WERT"), associate it with the corresponding calibration data;

[0115] When a keyword related to the coordinate axis is parsed (such as "ST / X" or "ST / Y"), it is associated with the value list of the X-axis or Y-axis;

[0116] For chart and curve keywords (such as "FESTKENNFELD" or "KENNLINIE"), associate them with the corresponding multidimensional data structure or curve data.

[0117] Furthermore, according to the keywords and data contents obtained during the parsing process, each element in the calibration data file is sequentially filled into the corresponding structured data object. Specifically:

[0118] For the calibration quantity object, fill in its name, data value, unit, and defined start and end rows;

[0119] For coordinate objects, fill in the units of the X-axis or Y-axis and the corresponding value list;

[0120] For curve or chart objects, fill in coordinate values, mapping relationships, data tables, etc.

[0121] Furthermore, after the parsing is completed, all data types related to the keyword are organized to generate a complete structured data object. This object can comprehensively represent all the contents in the calibration data file and support subsequent data calls and processing. The structured data object can include the following:

[0122] Calibration quantity object: represents the calibration quantity data obtained through analysis, including name, unit, value, etc.

[0123] Coordinate object: represents the parsed coordinate axis information, including the units and values ​​of the X-axis and Y-axis;

[0124] Calibration object: represents complex calibration data, such as curves, charts, etc.

[0125] Furthermore, the generated structured data objects can be operated through classes and functions. The specific operation examples are as follows:

[0126] dcminfo.calibrations: can be used to obtain all parsed calibration objects;

[0127] getcalobject(): This function is used to obtain the specified calibration object. For example, by calling dcm.getcalobject('calibration','AAA'), you can obtain the calibration object named "AAA".

[0128] calibration.show(): This function can be used to display detailed information of the calibration quantity, such as the content of the curve and chart and the data structure.

[0129] Through the implementation of this embodiment, the keywords in the DCM file can be effectively associated with the parsed data content, thereby generating complete and structured objects. These structured data objects not only facilitate subsequent data operations, but also greatly improve the efficiency and accuracy of file parsing.

[0130] In some embodiments, the method further comprises:

[0131] During the parsing process of the calibration data file, the parsing results are organized into structured data objects using preset classes and functions; the classes include classes responsible for managing the reading and parsing process of the calibration data file, base classes, classes representing specific calibration quantities, coordinate classes, and classes representing complex calibration quantities.

[0132] Specifically, after the parsing is completed, a Python object will be obtained instead of a list, and the generated results can be called in other work to conveniently apply the parsed data. The following is a detailed description of the classes and functions involved in the calibration data file parsing process of this application in conjunction with the accompanying drawings and specific examples. Figure 3 Schematic diagram of the relationship between various classes and functions in the calibration data file parsing process provided by the embodiment of the present application. Figure 3 As shown, the outer frame represents a class, a box inside the outer frame represents a function, the black solid line with an arrow on the right represents the derivation of the class, and the black solid line with an arrow on the left represents the calling relationship of the function. Figure 3 The functions of each class and function are shown in the following table:

[0133]

[0134]

[0135] Corresponding to the above classes and functions, the commonly used parsing and calling process of this application is as follows:

[0136] dcm = dcminfo();

[0137] dcm.read("XXX.dcm");

[0138] dcm.calibrations#Get all calibration values

[0139] a=dcm.getcalobject('calibration','AAA')#Get the calibration quantity AAA

[0140] a=dcm.calibrations['AAA'] #Obtain another form of calibration quantity AAA

[0141] calibration.show(a) #Print calibration quantity

[0142] a.name #signal name

[0143] a.type #Signal type: POINTS

[0144] a.description#Signal description

[0145] axunit #X axis unit

[0146] ayunit #Y axis unit

[0147] a.unit #The unit of the data value, empty

[0148] axvalue #X axis value

[0149] ayvalue #Y axis value

[0150] a.value #data value, empty

[0151] In some embodiments, the method further comprises:

[0152] The class responsible for managing the reading and parsing process of the calibration data file is used to read the calibration data file line by line for parsing, and parse each line using the keyword parsing rules to obtain the keyword and the corresponding data content;

[0153] The base class is used to abstract the basic features of the data content, where the basic features include the start and end rows defined by rows, and the name of the data content;

[0154] The class representing the specific calibration quantity is used to obtain the name and numerical unit of the data content, and determine the starting row, ending row and data value of the data content;

[0155] The coordinate class is used to process the value list of the X-axis or Y-axis and display the coordinate curve; the class representing complex calibration quantities is used to process the data content into curves or charts.

[0156] Specifically, this embodiment also proposes a method for managing the calibration data file parsing process through multiple classes and functions. The method can parse the DCM file content line by line and generate structured data objects related to calibration quantities, coordinates, curves and charts. Specifically, it may include the following contents:

[0157] 1. Parsing management of dcminfo class:

[0158] The dcminfo class is responsible for managing the reading and parsing process of DCM files and provides several core functions:

[0159] read(): Reads the DCM file line by line and parses it line by line. During the reading process, the keyword parsing rules are called to parse each line and extract the keywords and corresponding content in the line.

[0160] split(): It is used to split the string content of each line according to the rules of the DCM file and parse out the keywords and their corresponding contents.

[0161] getcalobject(): Gets the calibration object, such as a curve or chart, based on the parsed keywords.

[0162] addfuncation(): Add the parsed function object to the parsing result for subsequent processing.

[0163] addcalibration(): Adds a calibration object (such as a curve or a chart) to the parsing results.

[0164] addaxis(): Adds the coordinate object of the X-axis or Y-axis to the parsing result to facilitate the management and display of coordinate data.

[0165] 2. Basic feature abstraction of function class:

[0166] As a base class, the function class abstracts the basic features of the calibrated quantity, including the name, start line, and end line of each calibrated quantity:

[0167] show(): is an empty function that can be implemented in different subclasses to display the detailed content of the calibration quantity.

[0168] __str__(): This function is used to return the name of the calibration quantity and the starting and ending line information of the calibration quantity in the file, so that users can understand the range of the calibration data.

[0169] 3. Calibration processing of calobject class:

[0170] The calobject class represents a specific calibration quantity and is mainly used to process the name, value, and unit information of the calibration data:

[0171] getlabel(): Get the name of the calibrated value and the unit of the data value. For example, when parsing a curve object, you can use this function to get the name of the curve and its unit information.

[0172] __str__(): Returns the name, starting row, ending row, data value and unit of the calibration quantity to help users quickly obtain the basic information of the calibration quantity.

[0173] 4. Coordinate processing of axis class:

[0174] The axis class is used to process the value list of the X-axis or Y-axis. Every time the axis data is parsed, it will be managed through this class:

[0175] show(): Used to display the coordinate curve and show the specific values ​​of the coordinate axis, such as the distribution of points on the X-axis or Y-axis.

[0176] __str__(): Returns the name, starting row, ending row, value list and unit information of the coordinate, which facilitates printing and display of coordinate axis data.

[0177] 5. Complex calibration management of calibration class:

[0178] The calibration class is used to manage complex calibration quantities, such as curves or charts. It can process the parsed data into a visual form, including:

[0179] show(): Displays complex quantification, such as the contents of a curve or chart. This is very important for data visualization during testing or debugging, and can help users quickly understand the overall trend or distribution of complex data.

[0180] __str__(): Returns the name, starting row, ending row, coordinate value, and data value information of the complex calibration quantity to help users understand the properties of the complex calibration quantity in detail.

[0181] Through the above method of this embodiment, various types and functions are used together to effectively manage the parsing process of the calibration data file, and organize the parsed data content into structured objects, such as calibration quantity, coordinates and curve objects. These objects can not only display their basic information, but also be further operated or processed, thereby providing strong support for calibration and calibration work.

[0182] In some examples, this embodiment stores the structured data objects generated by the analysis and provides them to the "external module" for further operation or calling to support subsequent calibration data analysis and processing requirements. In actual applications, depending on the application scenario, the external modules of this embodiment include but are not limited to the following modules: data visualization module, data calibration module, data storage and version management module, and test and verification module.

[0183] Through the "external module" call in this embodiment, the parsed structured data objects can be flexibly applied to meet the needs of analysis, storage, testing and management of calibration data, thereby effectively improving the functionality and scalability of the entire calibration data file processing system.

[0184] According to the technical solution provided by this application, this application can at least achieve the following technical effects:

[0185] 1. Achieved full analysis of calibration data file standards and specifications, making the tool applicable to all calibration data files and avoiding failures in the software integration process;

[0186] 2. Compatible with calibration tools of different departments, solving the problem of calibration data file formats being different due to different tools, which makes the calibration data file unavailable during the software integration process;

[0187] 3. The parsing results are stored as objects, which improves the access speed of the results and reduces the use of memory. This is very useful for the parsing of very large calibration data files and avoids the jamming of the parsing and access process.

[0188] 4. Developed using Python language, it improves the readability and maintainability of the code and avoids the loss of source code during use;

[0189] 5. In the software integration scenario, it provides the tool foundation for highly automated continuous integration.

[0190] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0191] Figure 4 Schematic diagram of the structure of the calibration data file parsing device provided in the embodiment of the present application. Figure 4 As shown, the calibration data file parsing device includes:

[0192] The reading module 401 reads the content of the calibration data file line by line;

[0193] Determination module 402, when reading each line, determines whether the current line is at the end of the calibration data file, if not, determines whether the current line is a blank line or a comment line, if so, skips the current line and continues to read the next line;

[0194] Parsing module 403, when the current line is not a blank line or a comment line, parses the content of the current line according to a predetermined keyword parsing rule, wherein the keyword parsing rule includes a comment keyword parsing rule and a function keyword parsing rule;

[0195] The generating module 404 is configured to determine the data type corresponding to the keyword according to the keyword obtained by parsing, and generate a structured data object according to the keyword and the data type;

[0196] The storage module 405 is configured to store or provide the structured data object to an external module for subsequent operation or calling.

[0197] In some embodiments, Figure 4 The determination module 402 determines whether the current line read is a blank line; if it is not a blank line, determines whether the current line meets the judgment condition of the comment line, wherein the judgment condition of the comment line is a line starting with a preset character; if it meets the judgment condition, the current line is determined to be a comment line.

[0198] In some embodiments, Figure 4The parsing module 403, if the current line is a non-blank line or a non-comment line, marks the current line as valid content for parsing; parses the valid content of the current line according to a predetermined keyword parsing rule to obtain the keywords in the current line; parses the keywords according to the keywords in the current line, and associates the keywords with the parsed content; wherein the keyword rules include parsing rules for identifying comment keywords that start with target characters and are used to identify comment content, and parsing rules for functional keywords that are used to identify different functions or data types in the calibration data file.

[0199] In some embodiments, Figure 4 The generation module 404 determines the data type corresponding to the keyword according to the keyword of the current row and a predetermined matching relationship, wherein the data type includes a scalar, a curve, a chart, an array, and a coordinate value group; according to the parsed keyword and the corresponding data type, the keyword is associated with the parsed data content to generate a corresponding structured data object, and the structured data object is used for subsequent step calls or processing.

[0200] In some embodiments, Figure 4 During the parsing process, the generation module 404 initializes a structured data object for storing the parsing results according to a preset object model; associates keywords with the parsed data content, and fills each element in the calibration data file into the structured data object in turn according to the keywords and the corresponding data types; after the parsing is completed, organizes all data types related to the keywords to generate a complete structured data object, wherein the structured data object includes a calibration quantity object, a coordinate object and / or a calibration object.

[0201] In some embodiments, Figure 4 The generation module 404 organizes the parsing results into structured data objects using preset classes and functions during the parsing of the calibration data file; wherein the classes include classes responsible for managing the reading and parsing process of the calibration data file, base classes, classes representing specific calibration quantities, coordinate classes, and classes representing complex calibration quantities.

[0202] In some embodiments, the class responsible for managing the reading and parsing process of the calibration data file is used to read the calibration data file line by line for parsing, and parse each line using the keyword parsing rules to obtain the keyword and the corresponding data content; the base class is used to abstract the basic features of the data content, where the basic features include the start and end rows defined by rows, and the name of the data content; the class representing the specific calibration quantity is used to obtain the name of the data content and the numerical unit, and determine the start row, end row and data value of the data content; the coordinate class is used to process the value list of the X-axis or Y-axis and display the coordinate curve; the class representing the complex calibration quantity is used to process the data content into a curve or chart.

[0203] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0204] Figure 5 Schematic diagram of the structure of the electronic device 5 provided in the embodiment of the present application. Figure 5 As shown, the electronic device 5 of this embodiment includes: a processor 501, a memory 502, and a computer program 503 stored in the memory 502 and executable on the processor 501. When the processor 501 executes the computer program 503, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 501 executes the computer program 503, the functions of the modules / units in the above-mentioned device embodiments are implemented.

[0205] Exemplarily, the computer program 503 may be divided into one or more modules / units, which are stored in the memory 502 and executed by the processor 501 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 503 in the electronic device 5.

[0206] The electronic device 5 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 5 may include, but is not limited to, a processor 501 and a memory 502. Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 5 and does not constitute a limitation of the electronic device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0207] The processor 501 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0208] The memory 502 may be an internal storage unit of the electronic device 5, for example, a hard disk or memory of the electronic device 5. The memory 502 may also be an external storage device of the electronic device 5, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. Further, the memory 502 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 502 is used to store computer programs and other programs and data required by the electronic device. The memory 502 may also be used to temporarily store data that has been output or is to be output.

[0209] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0210] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0211] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0212] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. Multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0213] 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0214] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0215] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0216] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A calibration data file parsing method, characterized in that: include: Read the contents of the calibration data file line by line; Each time a line is read, determining whether the current line is at the end of the calibration data file, if not, determining whether the current line is a blank line or a comment line, if so, skipping the current line and continuing to read the next line; If the current line is not a blank line or a comment line, the content of the current line is parsed according to a predetermined keyword parsing rule, wherein the keyword parsing rule includes a comment keyword parsing rule and a function keyword parsing rule; Determine the data type corresponding to the keyword according to the keyword obtained by the analysis, and generate a structured data object according to the keyword and the data type; The structured data object is stored or provided to an external module for subsequent operation or calling.

2. The method according to claim 1, characterized in that The step of determining whether the current line is a blank line or a comment line includes: For the current row read, determine whether the current row is a blank row; If it is not a blank line, determining whether the current line meets the judgment condition of a comment line, wherein the judgment condition of the comment line is a line starting with a preset character; If satisfied, the current line is determined to be the comment line.

3. The method according to claim 1, characterized in that: When the current line is not a blank line or a comment line, parsing the content of the current line according to a predetermined keyword parsing rule includes: If the current line is a non-blank line or a non-comment line, the current line is marked as valid content for parsing; Parsing the valid content of the current row according to a predetermined keyword parsing rule to obtain the keywords in the current row; According to the keyword in the current row, the keyword is parsed and the keyword is associated with the parsed content; The keyword rules include parsing rules for identifying annotation keywords starting with target characters and used to identify annotation contents, and parsing rules for functional keywords for identifying different functions or data types in the calibration data file.

4. The method according to claim 1, characterized in that: The step of determining the data type corresponding to the keyword according to the keyword obtained by parsing, and generating a structured data object according to the keyword and the data type includes: According to the keyword of the current row, according to a predetermined matching relationship, determining the data type corresponding to the keyword, wherein the data type includes a scalar, a curve, a chart, an array, and a coordinate value group; According to the keyword and the corresponding data type obtained by parsing, the keyword is associated with the parsed data content to generate the corresponding structured data object, which is used for calling or processing in subsequent steps.

5. The method according to claim 4, characterized in that The step of associating the keyword with the parsed data content to generate the corresponding structured data object includes: During the parsing process, a structured data object for storing the parsing results is initialized according to a preset object model; Associating the keyword with the parsed data content, and filling each element in the calibration data file into the structured data object in sequence according to the keyword and the corresponding data type; After the parsing is completed, all data types related to the keyword are organized to generate a complete structured data object, wherein the structured data object includes a calibration object, a coordinate object and / or a calibration object.

6. The method according to claim 1, characterized in that The method further comprises: During the parsing process of the calibration data file, the parsing results are organized into the structured data object using preset classes and functions; wherein the classes include classes responsible for managing the reading and parsing process of the calibration data file, base classes, classes representing specific calibration quantities, coordinate classes, and classes representing complex calibration quantities.

7. The method according to claim 6, characterized in that The method further comprises: The class responsible for managing the reading and parsing process of the calibration data file is used to read the calibration data file line by line for parsing, and parse each line using the keyword parsing rule to obtain the keyword and the corresponding data content; The base class is used to abstract the basic features of the data content, wherein the basic features include a start row and an end row defined by row, and the name of the data content; The class representing the specific calibration quantity is used to obtain the name and numerical unit of the data content, and determine the starting row, ending row and data value of the data content; The coordinate class is used to process the value list of the X-axis or Y-axis and display the coordinate curve; the class representing the complex calibration quantity is used to process the data content into a curve or a chart.

8. A calibration data file parsing device, characterized in that: include: A reading module reads the contents of the calibration data file line by line; The determination module determines whether the current line is at the end of the calibration data file each time a line is read. If not, it determines whether the current line is a blank line or a comment line. If so, it skips the current line and continues to read the next line. A parsing module, when the current line is not a blank line or a comment line, parses the content of the current line according to a predetermined keyword parsing rule, wherein the keyword parsing rule includes a comment keyword parsing rule and a function keyword parsing rule; A generating module is configured to determine a data type corresponding to the keyword according to the keyword obtained by parsing, and generate a structured data object according to the keyword and the data type; The storage module is configured to store or provide the structured data object to an external module for subsequent operation or calling.

9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.