Engine test data extraction method and device, electronic equipment and storage medium
By extracting the target information of the engine test data and the method of positioning the data, the problems of low efficiency and poor accuracy of the engine test data in the prior art are solved, and the rapid and accurate extraction of the test data is achieved.
Patent Information
- Application Number
- CN202411532009.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-03-07
AI Technical Summary
The prior art lacks analytical tools for direct summary and processing when processing engine reliability test data, resulting in low efficiency and poor accuracy of manual data extraction.
Provide a method for extracting engine test data, by obtaining the first N lines of data of the test data file, judging the file validity, and extracting target information, including parameter lines, effective data start lines, total number of lines, time range and file size. Based on this information, the file sequence number and byte address of the target test data for any test time are determined in the file, and the target test data is quickly and accurately extracted.
It realizes the rapid and accurate extraction of experimental data stored in sequential text, inconsistent format, and fragmented distribution, improves data processing efficiency and reduces the burden of manual operations.
Smart Images

Figure CN119578370A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method, device, electronic equipment and storage medium for extracting engine test data. Background Art
[0002] In the era of big data, there are many algorithms and software for database analysis, but all algorithms have more or less requirements for data formats, at least requiring the inclusion of index information, which records the address of each data in the file to facilitate the analysis software to extract data by address. Therefore, the characteristics of this type of data are that the format is first, the data is stored according to the format, and then read according to the format.
[0003] The test data generated during the engine reliability test is an ordinary text file, which is a sequential file without any index information and no unified standard for data parameters. The test data generated by various engine test bench control systems, including HORIBA, ALVPUMA, and various domestic self-developed control systems, are all such files. Each test will generate a large amount of such test data, with up to dozens of files, ranging in size from 1KB to several GB, and a total number of lines of up to about 8 million lines.
[0004] There is no ready-made processing software for engine reliability test data, and manual analysis is still the main method. There are two main methods: one is to manually determine which file the data is in, then open it with data software (such as Excel), and then copy some data from it for analysis; the other is that if the file is too large and the software cannot open it, the analysis can only be abandoned (in practice, such large files account for more than 20%), and the data is recorded manually at regular intervals, and then manually entered into the computer for analysis.
[0005] Currently, there is no analysis tool that can directly summarize and process test data. If the existing general method is used, the data is in sequential text format, so it cannot be randomly located at the target data location. It needs to be screened byte by byte, which is time-consuming due to the large amount of data. In actual work, the method of manually intercepting part of the data and then splicing it, or directly using the method of manually recording the data, is inefficient and has poor data accuracy. Summary of the invention
[0006] In view of this, it is necessary to provide a method, device, electronic device and storage medium for extracting engine test data to solve the problem of low efficiency and accuracy of existing manual data extraction.
[0007] In order to solve the above problems, the present invention provides a method for extracting engine test data, comprising: When the acquired test data file is a valid file, extracting target information of the test data file; the test data file includes a plurality of files; the test data file is determined by test data generated in an engine reliability test; Based on the target information, determine the file sequence number and byte address corresponding to the target test data at any test time in the test data file; The target test data is extracted from the test data file based on the file sequence number and the byte address.
[0008] In a possible implementation, when the acquired test data file is a valid file, before extracting the target information of the test data file, the method further includes: Obtain the first N rows of data of the test data file; When the first N lines of data contain characteristic characters, the test data file is determined to be a valid file; the characteristic characters are characters corresponding to the test data.
[0009] In a possible implementation manner, the target information includes: Parameter line, valid data start line, total number of lines, time range and file size.
[0010] In a possible implementation, determining, based on the target information, the file sequence number and byte address corresponding to the target test data at any test time in the test data file includes: Based on the target information, determine the first line number corresponding to any test time in the test data file, and the data length of each line of data in the test data file; Determine the first line number and the last line number of each file in the test data file based on the data length of each line of data; Determine the file sequence number, and the second line number of the file corresponding to the first line number based on the first line number, the first line sequence number and the last line sequence number of each file; Based on the second row number, the byte address is determined.
[0011] In a possible implementation, determining the file sequence number based on the first line number, the first line sequence number, and the last line sequence number of each file includes: When LSn≤L≤LEn, n is determined as the file sequence number; Among them, L represents the first line number, LSn represents the first line number of the nth file, and LEn represents the last line number of the nth file.
[0012] In a possible implementation, the data length of each row of data is determined by: Based on the valid data starting row, read M rows of data; The data length of each line of data is determined based on an average value of the lengths of the M lines of data.
[0013] In a possible implementation, extracting the target test data from the test data file based on the file sequence number and the byte address includes: Based on the file sequence number and the byte address, extracting row data corresponding to the target test data in the test data file; Splitting the row data corresponding to the target test data to obtain an array corresponding to the test data file; Based on the array, establishing a correspondence between the title parameters of the test data file and the title parameters of the preset template; Based on the corresponding relationship, the target test data is extracted.
[0014] The present invention also provides a device for extracting engine test data, comprising: A first extraction module is used to extract target information of the test data file when the acquired test data file is a valid file; the test data file includes a plurality of files; the test data file is determined by test data generated in the engine reliability test; A determination module, configured to determine, based on the target information, a file sequence number and a byte address corresponding to the target test data at any test time in the test data file; The second extraction module is used to extract the target test data from the test data file based on the file sequence number and the byte address.
[0015] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the method for extracting engine test data described in any of the above implementations.
[0016] On the other hand, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for extracting engine test data described in any of the above implementations is implemented.
[0017] The beneficial effects of the present invention are as follows: the engine test data extraction method, device, electronic device and storage medium provided by the present invention extract the target information of the test data file when judging that the acquired test data file is a valid file. The target information may include information such as parameter row, valid data starting row, total number of rows, time range and file size, and the file sequence number and byte address corresponding to the target test data at any test time in the test data file are determined through the target information. The target test data can be accurately and quickly extracted by locating the data position. The present invention is suitable for test data stored in a sequential text manner, with non-uniform format and fragmented distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 A method flow chart of an embodiment of the method for extracting engine test data provided by the present invention; Figure 2 A schematic diagram of the data structure analysis provided by the present invention; Figure 3 A schematic diagram of a file sequence number calculation method provided by the present invention; Figure 4 A schematic diagram of row data splitting provided by the present invention; Figure 5 A schematic diagram of the test data provided by the present invention being derived according to a template; Figure 6 A schematic diagram for comparative analysis of working conditions at different periods provided by the present invention; Figure 7 A schematic structural diagram of an embodiment of an engine test data extraction device provided by the present invention; Figure 8 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0021] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.
[0022] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0023] Figure 1 A method flow chart of an embodiment of the method for extracting engine test data provided by the present invention is as follows: Figure 1 As shown, the method for extracting engine test data includes: S101, when the acquired test data file is a valid file, extracting target information of the test data file; the test data file includes a plurality of files; the test data file is determined by test data generated in an engine reliability test; S102, based on the target information, determining the file number and byte address corresponding to the target test data at any test time in the test data file; S103: extract the target test data from the test data file based on the file sequence number and the byte address.
[0024] Compared with the prior art, the engine test data extraction method provided in the embodiment of the present invention extracts the target information of the test data file when judging that the acquired test data file is a valid file. The target information may include information such as parameter rows, starting rows of valid data, total number of rows, time range and file size. The target information is used to determine the file number and byte address corresponding to the target test data at any test time in the test data file. The target test data can be accurately and quickly extracted by locating the data position. The method is suitable for test data stored in a sequential text manner, with non-uniform format and fragmented distribution.
[0025] In some embodiments of the present invention, when the acquired test data file is a valid file, before extracting the target information of the test data file, the method further includes: Obtain the first N rows of data of the test data file; When the first N lines of data contain characteristic characters, the test data file is determined to be a valid file; the characteristic characters are characters corresponding to the test data.
[0026] In some embodiments of the present invention, the target information includes: Parameter line, valid data start line, total number of lines, time range and file size.
[0027] The first N lines of data can be obtained from the test data file, and whether the test data file is a valid file can be determined by finding out whether the first N lines of data contain characteristic characters.
[0028] And extract the target information of the test data file, which may include parameter rows, valid data start rows, total number of rows, time range and file size, etc.
[0029] For example, Figure 2 The data structure analysis diagram provided by the present invention is as follows: Figure 2 As shown, by searching for characteristic lines, reading the first N lines of data in the file, and detecting whether the first N lines of data contain characters unique to the test data, that is, characteristic characters, such as "Nm", "kg / h", etc. If contained, the test data file is judged to be a valid file.
[0030] After determining that the test data file is a valid file, continue to check upward and determine the row before the sudden decrease in the number of data as the parameter row, recorded as r0_sou.
[0031] Continue to read several lines. If the proportion of pure numbers is greater than 80%, the line is initially determined as the starting line of the data and recorded as rf_sou.
[0032] That is, an embodiment of the present invention provides a data structure parsing method. The following is the code of the data structure parsing method provided by the present invention. When the acquired test data file is a valid file, the basic information of the file can be determined through the data structure parsing method, such as whether it is a valid test data file, the file size, the time range corresponding to the data, etc.
[0033] The main code of the data structure parsing algorithm is as follows: Do'-------------------Seeking title r0_Txt, rt_Txt nj = nj + 1 If nj>1000 Then GetTitleSeek = -1: Close #1: Exit Function PosSeek = Seek(1) Line Input #1, a input_Id = input_Id + 1 If input_Id>= Pre_r0_Id Then If a = "" Then haveNull = 1 If Str0(0)<>"" Then If InStr(1, a, Str0(0), vbBinaryCompare)>0 Then r0_Txt = a: r0_Id = input_Id Line Input #1, a input_Id = input_Id + 1 rt_Txt = a End If Else For i = 1 To UBound(Str0) If FindDanWei(a, Str0(i)) = 1 Then rt_Txt = a: r0_Txt = olda: r0_Id = input_Id - 1 rt_Seek = PosSeek: r0_Seek = oldSeek Exit For End If Next End If olda = a: oldSeek = PosSeek If r0_Txt<>"" Then fLen = 0: ReDim StrLine(0) strLen = 0 For ij = 1 To 10 If EOF(1) Then Exit For PosSeek = Seek(1) Line Input #1, a input_Id = input_Id + 1 ii = DaCount(a, numN, emptN) strN = ii - (numN + emptN) If (haveNull = 0 And numN>1) Or (haveNull = 1 And numN>5) Then'向下每行至少有5个数字,则表示已进行数字区 If fLen = 0 Then rf_Id = input_Id: rf_Seek = PosSeek 'strLen = strLen + Len(a) fLen = fLen + 1 strLen = strLen + (Seek(1) - PosSeek) ReDim Preserve StrLine(fLen) StrLine(fLen) = a GetTitleSeek = ii End If Next If fLen = 0 Then r0_Txt = "" Else rf_LenSeek = strLen / fLen 0.98 'The average length of each row of data End If End If End If Loop While (Not EOF(1)) And r0_Txt = ""' Loop In some embodiments of the present invention, determining the file number and byte address corresponding to the target test data at any test time in the test data file based on the target information includes: Based on the target information, determine the first line number corresponding to any test time in the test data file, and the data length of each line of data in the test data file; Determine the first line number and the last line number of each file in the test data file based on the data length of each line of data; Determine the file sequence number, and the second line number of the file corresponding to the first line number based on the first line number, the first line sequence number and the last line sequence number of each file; Based on the second row number, the byte address is determined.
[0034] In some embodiments of the present invention, determining the file sequence number based on the first line number, the first line sequence number and the last line sequence number of each file includes: When LSn≤L≤LEn, n is determined as the file sequence number; Among them, L represents the first line number, LSn represents the first line number of the nth file, and LEn represents the last line number of the nth file.
[0035] In some embodiments of the present invention, the data length of each row of data is determined by: Based on the valid data starting row, read M rows of data; The data length of each line of data is determined based on an average value of the lengths of the M lines of data.
[0036] Any test time is recorded as X, then any test time X corresponds to the first row number L in the test data file, and the calculation formula is as follows: L=X / dL Among them, dL represents the interval time of each line, which is determined by the test type and input by the user.
[0037] By studying the characteristics of the test data file, the following estimation method can be used to calculate the data length dY (Byte length) of each line of data, specifically: Starting from the valid data start row rf_sou, several rows are read, for example, M rows, and the average value of the data length of the M rows of data is used as the data length dY of each row of data in the test data file.
[0038] Using this estimation method, the actual measurement shows that the error is within 1%, which meets the accuracy requirements of test data processing. For example, if you need to retrieve data between 100h and 120h, considering the error of dY, you can relax the range appropriately and retrieve data between 99h and 121h to achieve the purpose.
[0039] Figure 3 A schematic diagram of the file number calculation method provided by the present invention, such as Figure 3 As shown, according to the data length dY of each line of data, the first line sequence number LS and the last line sequence number LE of each file in the test data file can be calculated. LS and LE are cumulative sequence numbers. The calculation formula is as follows: LSn=LEn-1 + 1 LEn= LSn+(Ysum-Y0) / dY Among them, LSn represents the first line number of the nth file, LEn-1 represents the last line number of the n-1th file, LEn represents the last line number of the nth file, n represents the file number, Y0 represents the byte address corresponding to the first line of data, and Ysum represents the total number of bytes in the file, which is obtained by the function FileSize().
[0040] Therefore, according to the first line number L, the first line number LSn and the last line number LEn of each file, the file number n corresponding to the first line number L and the line number Ln in the nth file are calculated as follows: Compare LSn, L, LEn cyclically. When LSn≤L≤LEn is satisfied, n is the file number where the data is located.
[0041] Then the first line number L corresponds to the second line number Ln in the nth file as follows: Ln=L-LSn+1 Then the byte address Y corresponding to the second row number Ln is as follows: Y=Y0+ L d Y Since dY is an estimated value, in order to improve the positioning accuracy, a half-row positioning algorithm can be added to the calculation, specifically: According to Ys=Y0+(L-0.5) dY, locate the address at the first half of the Lth row, and then use the instruction InputLine to locate the pointer to the starting point of the next row of this half row, that is, the starting point of the Lth row.
[0042] That is, an embodiment of the present invention provides a random reading method for a sequential file. Exemplarily, the code of the random reading method for a sequential file provided by the present invention is shown below. Through the random reading method for a sequential file, the address of the row where the required data is located (Byte pointer address), as well as the file number n and the byte address Y corresponding to any test time X can be determined.
[0043] The main code of the random reading algorithm for sequential files is as follows: For rs0 = rtxt0 To rtxt1 Step drtxt For rs = rs0 To rs0 + ZhuLeng Step WenLeng If (ki Mod 2000) = 0 Then Me.Label_Memo = "Updating data, No."&Format(rs tleng + Val(Me.Tf_time start point), fstr)&""&Me.Tf_time unit: DoEvents If open rcount - 1 Then Exit For freeid = FreeFile Open AnalyArr_tem(i, 0)&AnalyArr_tem(i, 1) For Input As #freeid openi = i: isEOF = 0: oldrs = rs 'If Option_FromPram = True Or (Me.Check data append = True And Me.Option whole process = True) Then ' Request the title row and unit row from the parameter file seek0 = IIf(AnalyArr_tem(i, 7)>1, AnalyArr_tem(i, 7) - 1, AnalyArr_tem(i, 7)) tiarry1 = Get_TitleTemArray(freeid, seek0) GetfuleC tiarry1, 1 'Get fuelC and fuelPi For c0 = HeadC + 1 To Ccount'For each file, find the ID corresponding to the title and title array TitleArray0 For c1 = UBound(tiarry1, 2) To HeadC + 1 Step -1 If LCase(Tit_tArry(1, c0)) = LCase(tiarry1(1, c1)) Then IdTitle(c0) = c1: tiarry1(1, c1) = "": Exit For End If Next If Tit_tArry(1, c0) = "Engine speed" Then SpeedId = c1'Find the position of the speed SpeedId Next 'End If End If Speedmin = Val(T_specified speed 0) - Val(T_specified speed 1): SpeedMax = Val(T_specified speed 0) + Val(T_specified speed 1) dr = rs - olden + 1 pos1 = Int(AnalyArr_tem(i, 8) + IIf(dr>1, AnalyArr_tem(i, 9) (dr - 0.5), 0)) If rs - oldrs<>1 Then If rs - oldrs = 2 Then Line Input #freeid, b pos1 = Seek(1) Else If AnalyArr_tem(i, 3)>pos1 - 2 Then If pos1>2 Then Seek #freeid, pos1 - 2 Line Input #freeid, b pos1 = Seek(1) End If Else isEOF = 1 End If End If End If If EOF(1) Or isEOF = 1 Then Close #freeid i = i + 1 Do While AnalyArr_tem(i, 8) = ""' If the file has no data, skip it i = i + 1 If i>rcount Then Exit Do Loop If i>rcount - 1 Then Exit For olden = en en = en + AnalyArr_tem(i, 10) Else Line Input #freeid, strA StrColumnOneR = Split(Replace(strA, """", ""), DivStr) If UBound(StrColumnOneR, 1)>4 Then If IsNumeric(StrColumnOneR(3)) Then' Only valid if the number of data is greater than 4 and the 4th is a number readTrue = 1 'Whether to read in If Check_ReadSpeed And Me.OptionThen Speed0 = Val(StrColumnOneR(SpeedId - HeadC - 1)) If Speed 0<Speedmin Or Speed0> SpeedMax Then readTrue = 0 End If If readTrue = 1 Then ki = ki + 1: ks = ks + 1 For c = HeadC + 1 To Ccount If IdTitle(c)<>"" Then tArry(ki, c) = StrColumnOneR(IdTitle(c) - HeadC - 1) If fuelC>0 And IdTitle(c) = fuelC Then tArry(ki, c) = tArry(ki, c) fuelPi '"Fuel consumption" according to unit conversion End If End If Next tArry(ki, 1) = rs If ki>= kimax Then If Check data appendThen Rows(rj_sou + 1&":"&rj_sou + ki).Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove Range(Cells(rj_sou + 1, c0_Sou), Cells(rj_sou + ki, c1_Sou)) = tArry' array is written into Cell rj_sou = rj_sou + ki: ki = 0 End If End If End If End If End If oldrs = rs Next In some embodiments of the present invention, extracting the target test data from the test data file based on the file sequence number and the byte address includes: Based on the file sequence number and the byte address, extracting row data corresponding to the target test data in the test data file; Splitting the row data corresponding to the target test data to obtain an array corresponding to the test data file; Based on the array, establishing a correspondence between the title parameters of the test data file and the title parameters of the preset template; Based on the corresponding relationship, the target test data is extracted.
[0044] According to the file sequence number and byte address, extract the row data corresponding to the target test data in the test data file. After the row data is read in, split the row data into arrays to obtain the array corresponding to the test data file. Figure 4 The row data splitting diagram provided by the present invention is as follows: Figure 4 As shown, the function Da=Split(str1) can be used to split the row data st1r into the data Da. It is not necessary to split all the data, only the row data that needs to be read can be split.
[0045] Then, according to the array, the corresponding relationship between the title parameter Pt(n) of the test data file and the title parameter Ps(i) of the preset template is established. Optionally, a circular comparison can be used to find the corresponding relationship n=B(i) between n and i in Pt(n) and Ps(i). Figure 5 The schematic diagram of the test data provided by the present invention derived according to the template is as follows: Figure 5 As shown, through the corresponding relationship n=B(i) between n and i in Pt(n) and Ps(i), the test data can be exported according to the template.
[0046] Therefore, when reading any row of data, the data Da (B (i)) can be extracted according to the corresponding relationship n = B (i), and the value corresponding to any test time and any title parameter, that is, the target test data, can be obtained.
[0047] That is, an embodiment of the present invention provides a data fixed-point extraction method. Exemplarily, the following is the code of the data fixed-point extraction method provided by the present invention. Through the data fixed-point extraction method, column values in row data can be extracted.
[0048] The main code of the data fixed-point extraction algorithm is as follows: Seek #freeid, starPos Line Input #freeid, strA''Header line If DivStr = "" Or InStr(1, strA, DivStr) = 0 Then div0 = Array(Chr(9), ",", ";") For i = 0 To UBound(div0) If InStr(1, strA, div0(i))>0 Then DivStr = div0(i): Exit For Next End If StrColumnOneR = Split(Replace(strA, """", ""), DivStr)' Split and assign to array StrColumnOneR Ccount = UBound(StrColumnOneR) + 1:'If StrColumnOneR(Ccount) = ""Then Ccount = Ccount - 1 Ccount = Ccount + HeadC ReDim tiArry(1 To 2, 1 To Ccount) tiArry(1, 1) = "row number": tiArry(2, 1) = "="&Form_ReadData.Tf_Length of each row tiArry(1, 2) = "time": tiArry(2, 2) = Form_ReadData.Tf_time unit c1 = UBound(StrColumnOneR) + 1 If c1>Ccount - HeadC Then c1 = Ccount - HeadC For c = 1 To c1 tiArry(1, c + HeadC) = StrColumnOneR(c - 1) Next Line Input #freeid, strA'Unit line StrColumnOneR = Split(Replace(strA, """", ""), DivStr)' Split and assign to array StrColumnOneR c1 = UBound(StrColumnOneR) + 1 If c1>Ccount - HeadC Then c1 = Ccount - HeadC For c = 1 To c1 tiArry(2, c + HeadC) = StrColumnOneR(c - 1) Next If aTy = 1 Then Close #freeid If ToFanYi Then LoadWordArray testPathS&"FayiRoot.fay"'Import translation vocabulary from file For c = Ccount To HeadC + 1 Step -1 tn = FanYi(tiArry(1, c), DanWei) If tiArry(1, c)<>tn Then tiArry(1, c) = tn If tn<>"Fuel consumption" Then tiArry(2, c) = DanWei End If Next End If The method for extracting engine test data provided by the present invention provides a method for quickly processing test data, and is suitable for processing various data stored in a sequential text manner, with non-uniform formats and fragmented distribution.
[0049] In addition, the method for extracting engine test data provided by the present invention includes three modules for processing data to extract data of a specified time and specified index parameters, including: S1, data structure parsing algorithm: determine the file where the required data is located; S2, random reading algorithm for sequential files: determine the address of the row where the required data is located (Byte pointer address); S3, data fixed-point extraction algorithm: determine the column position of the required data.
[0050] The prior art mainly relies on manual search, manually finds the file where the required data is located, then imports all the data in the file, and then filters the required data. The present invention automatically calculates the file where the required data is located, then locates the required data, and only imports the required data. The prior art uses manual search, which is inefficient and labor-intensive. All data must be imported, and the import speed is slow. If the file is very large, it cannot be imported at all, and the data cannot be processed and analyzed. The present invention automatically locates the data position, which is efficient. It only imports the required data, saves memory, and has a high import speed.
[0051] The data of a reliability test can reach 8 million rows. It takes about 60 minutes to import all the data with the existing technology. However, by adopting the method for extracting engine test data provided by the present invention, data can be taken at intervals as needed, and only 2,000 to 10,000 rows need to be imported, and the import time is about 10 seconds. The existing technology generally imports data into Excel for processing. After such a large amount of data is imported into Excel, it is likely to crash. Even if it does not crash, the subsequent analysis operation speed is extremely slow because it occupies too much memory. By adopting the method for extracting engine test data provided by the present invention, the data occupies less memory, the subsequent analysis operation speed is fast, and it also creates a foundation for enriching the analysis method.
[0052] Exemplarily, the engine test data extraction method provided in an embodiment of the present invention can be used for drawing a reliability test supervision curve. The supervision curve is a curve that plots the parameter data during the entire test process to reflect the changing trend. It is not necessary to plot every data. Generally, a point is taken at intervals of 1h to 20h (depending on the specific situation).
[0053] For example, a 1000-hour wear reliability test of a certain model generates 43 txt files and 5.53 million lines of data. By adopting the engine test data extraction method provided by the present invention, one line is taken every 3000 lines, and a total of about 2000 lines of data are read. It takes 5 seconds to generate a supervision curve.
[0054] In addition, the reliability test is a continuous cycle operation under different operating conditions. In order to understand the changes in engine performance at different times, it is necessary to compare and analyze the operating conditions at different times. For example, data of certain durations can be collected at 10h and 800h for comparative analysis.
[0055] Figure 6 The schematic diagram of comparative analysis of working conditions in different periods provided by the present invention is as follows: Figure 6 As shown, Figure 6 (a) is a comparison diagram in which two curves are intentionally staggered for ease of display. Figure 6 (b) in the figure is a comparison diagram after the two curves are completely overlapped.
[0056] from Figure 6 As can be seen from (b) in the figure, the engine has good operating repeatability in the cyclic working condition. However, at the circle shown, there are great differences in torque and exhaust temperature at 10h and 800h, indicating that the engine has a torque limiting fault at 800h and the fault can recover by itself. Based on this, further diagnosis and analysis of the engine can be performed.
[0057] After adopting the engine test data extraction method provided by the present invention, due to the fast processing speed and simple operation, this analysis and comparison work can be carried out repeatedly during the entire reliability test process, which helps to discover abnormal phenomena in a timely manner.
[0058] In order to better implement the method for extracting engine test data in the embodiment of the present invention, based on the method for extracting engine test data, the embodiment of the present invention further provides a device for extracting engine test data. Figure 7 A schematic diagram of the structure of an embodiment of the engine test data extraction device provided by the present invention is shown in FIG. Figure 7 As shown, the engine test data extraction device 700 includes: The first extraction module 710 is used to extract target information of the test data file when the acquired test data file is a valid file; the test data file includes a plurality of files; the test data file is determined by the test data generated in the engine reliability test; A determination module 720, configured to determine, based on the target information, a file sequence number and a byte address corresponding to the target test data at any test time in the test data file; The second extraction module 730 is used to extract the target test data from the test data file based on the file sequence number and the byte address.
[0059] The engine test data extraction device 700 provided in the above embodiment can implement the technical solution described in the above engine test data extraction method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the engine test data extraction method embodiment, which will not be repeated here.
[0060] like Figure 8 As shown, the present invention also provides an electronic device 800. The electronic device 800 includes a processor 801, a memory 802 and a display 803. Figure 8 Only some components of the electronic device 800 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0061] In some embodiments, the processor 801 may be a central processing unit (CPU), a microprocessor or other data processing chip, which is used to run program codes or process data stored in the memory 802, such as the engine test data extraction method of the present invention.
[0062] In some embodiments, the processor 801 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 801 may be local or remote. In some embodiments, the processor 801 may be implemented in a cloud platform. In some embodiments, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0063] In some embodiments, the memory 802 may be an internal storage unit of the electronic device 800, such as a hard disk or memory of the electronic device 800. In other embodiments, the memory 802 may also be an external storage device of the electronic device 800, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 800.
[0064] Furthermore, the memory 802 may include both an internal storage unit of the electronic device 800 and an external storage device. The memory 802 is used to store application software installed in the electronic device 800 and various data.
[0065] In some embodiments, the display 803 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (OLED) touch device, etc. The display 803 is used to display information on the electronic device 800 and to display a visual user interface. The components 801-803 of the electronic device 800 communicate with each other via a system bus.
[0066] In one embodiment, when the processor 801 executes the engine test data extraction program in the memory 802, the following steps may be implemented: When the acquired test data file is a valid file, extracting target information of the test data file; the test data file includes a plurality of files; the test data file is determined by test data generated in an engine reliability test; Based on the target information, determine the file sequence number and byte address corresponding to the target test data at any test time in the test data file; The target test data is extracted from the test data file based on the file sequence number and the byte address.
[0067] It should be understood that: when the processor 801 executes the engine test data extraction program in the memory 802, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0068] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 800 mentioned, and the electronic device 800 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 800 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0069] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions of the engine test data extraction method provided in the above-mentioned method embodiments.
[0070] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0071] The engine test data extraction method, device, electronic device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for extracting engine test data, characterized in that: include: When the acquired test data file is a valid file, extracting target information of the test data file; The test data file includes a plurality of files; the test data file is determined by the test data generated in the engine reliability test; Based on the target information, determine the file sequence number and byte address corresponding to the target test data at any test time in the test data file; The target test data is extracted from the test data file based on the file sequence number and the byte address.
2. The method for extracting engine test data according to claim 1, characterized in that: When the acquired test data file is a valid file, before extracting the target information of the test data file, the method further includes: Obtain the first N rows of data of the test data file; When the first N lines of data contain characteristic characters, the test data file is determined to be a valid file; the characteristic characters are characters corresponding to the test data.
3. The method for extracting engine test data according to claim 1, characterized in that: The target information includes: Parameter line, valid data start line, total number of lines, time range and file size.
4. The method for extracting engine test data according to claim 3, characterized in that: The determining, based on the target information, the file sequence number and byte address corresponding to the target test data at any test time in the test data file includes: Based on the target information, determine the first line number corresponding to any test time in the test data file, and the data length of each line of data in the test data file; Determine the first line number and the last line number of each file in the test data file based on the data length of each line of data; Determine the file sequence number, and the second line number of the file corresponding to the first line number based on the first line number, the first line sequence number and the last line sequence number of each file; Based on the second row number, the byte address is determined.
5. The method for extracting engine test data according to claim 4, characterized in that: The determining the file sequence number based on the first line number, the first line sequence number and the last line sequence number of each file includes: When LSn≤L≤LEn, n is determined as the file sequence number; Among them, L represents the first line number, LSn represents the first line number of the nth file, and LEn represents the last line number of the nth file.
6. The method for extracting engine test data according to claim 4, characterized in that: The data length of each row of data is determined by: Based on the valid data starting row, read M rows of data; The data length of each line of data is determined based on an average value of the lengths of the M lines of data.
7. The method for extracting engine test data according to claim 1, characterized in that: The extracting the target test data from the test data file based on the file sequence number and the byte address comprises: Based on the file sequence number and the byte address, extracting row data corresponding to the target test data in the test data file; Splitting the row data corresponding to the target test data to obtain an array corresponding to the test data file; Based on the array, establishing a correspondence between the title parameters of the test data file and the title parameters of the preset template; Based on the corresponding relationship, the target test data is extracted.
8. An engine test data extraction device, characterized in that: include: A first extraction module, used for extracting target information of the test data file when the acquired test data file is a valid file; The test data file includes a plurality of files; the test data file is determined by the test data generated in the engine reliability test; A determination module, used for determining, based on the target information, a file sequence number and a byte address corresponding to the target test data at any test time in the test data file; The second extraction module is used to extract the target test data from the test data file based on the file sequence number and the byte address.
9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the method for extracting engine test data as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for extracting engine test data according to any one of claims 1 to 7 is implemented.