. rsp file parsing and compiling method and device, terminal and storage medium

CN118963762APending Publication Date: 2024-11-15CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410996075.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

但其内部数据编码结构相关资料较少,给行业内部分数据处理软件二次开发读取.rsp数据带来困难和阻碍

Benefits of technology

[0036] The present invention uses the file format conversion function of the third-party software Adams to write .cmd commands and call the Adams software for execution, which can quickly realize the analysis and compilation of .rsp files and facilitate the secondary development of related software.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963762A_ABST
    Figure CN118963762A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of automobiles, and particularly relates to a. Rsp file parsing and compiling method and device, a terminal and a storage medium. Comprising the following steps of: converting a. Rsp file into a. Tab file which can be opened by a text by utilizing an Adams software file format conversion function; the method comprises the following steps of: converting a. Tab file which can be opened by a text into a. Rsp file by utilizing an Adams software file format conversion function; by means of the file format conversion function of the third-party software Adams, the. Cmd command is compiled, the Adams software is called for execution, analysis and compilation of the. Rsp file can be rapidly achieved, and secondary development work of related software is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of automobile technology, and in particular relates to a method, a device, a terminal and a storage medium for parsing and compiling .rsp files. Background Art

[0002] .rsp file is a commonly used load spectrum data file format, widely used in the automotive, railway and aerospace industries, and has the advantage of fast reading speed for large data files. However, there is little information related to its internal data encoding structure, which brings difficulties and obstacles to the secondary development of some data processing software in the industry to read .rsp data. In addition, to complete the parsing and compilation of .rsp files, professional file encoding knowledge is required, which is quite difficult. Summary of the invention

[0003] To solve the above problems, the present invention proposes a method, device, terminal and storage medium for parsing and compiling .rsp files. By using the file format conversion function of the third-party software Adams, a .cmd command is written and the Adams software is called to execute, which can quickly implement the parsing and compilation of .rsp files.

[0004] The technical solution of the present invention is described as follows in conjunction with the accompanying drawings:

[0005] In a first aspect, an embodiment of the present invention provides a method for parsing and compiling a .rsp file, comprising:

[0006] Use the file format conversion function of Adams software to convert the .rsp file into a .tab file that can be opened with text;

[0007] Use the file format conversion function of Adams software to convert the .tab file that can be opened with text into a .rsp file.

[0008] Furthermore, the specific method of using the Adams software file format conversion function to convert the .rsp file into a .tab file that can be opened with text is as follows:

[0009] 11) Use Python language to read the .rsp file line by line in binary format and record the file name and file location;

[0010] 12) Search for the string "CHANNELS" and count the total number of channels;

[0011] 13) Search for the string "DESC.CHAN_i" and obtain the channel name and channel unit in sequence;

[0012] 14) Use Python language to write the .rsp file name into the .cmd file through commands;

[0013] 15) Use Python language to repeatedly write .cmd files by channel through commands, and extract the data of each channel in Adams;

[0014] 16) Use Python language to repeatedly write .cmd files by channel through commands to write .tab files;

[0015] 17) Use Python language to write .bat file through command, and call .cmd file in the background to write .tab file;

[0016] 18) Use Python to call the .bat file and run it to write a .tab file;

[0017] 19) Use the python language pandas library to read the .tab file and complete the data analysis.

[0018] Furthermore, in said 11), the first line is the header information, in which each header name is separated by the string "\x00", and the string is separated using the split() function.

[0019] Furthermore, in said 13), i represents the channel number, i=1, 2, 3...

[0020] Furthermore, the specific method of using the file format conversion function of Adams software to convert the .tab file that can be opened with text into a .rsp file is as follows:

[0021] 21) Use Python to write the data into a .tab file in text format by column.

[0022] 22) Use Python language to write commands into .cmd file;

[0023] 23) Use Python language to write a command .bat file, and call this .bat file to compile the .rsp file.

[0024] Furthermore, in 21), the first line is the name of each channel of data, the first column is fixed to time, and the remaining columns are the data of each channel.

[0025] In a second aspect, an embodiment of the present invention further provides a device for parsing and compiling a .rsp file, comprising:

[0026] The parsing module is used to convert the .rsp file into a .tab file that can be opened with text by using the file format conversion function of the Adams software;

[0027] The compilation module is used to convert the .tab file that can be opened with text into a .rsp file using the file format conversion function of the Adams software.

[0028] In a third aspect, a terminal is provided, including:

[0029] one or more processors;

[0030] a memory for storing the one or more processor-executable instructions;

[0031] Wherein, the one or more processors are configured to:

[0032] Execute the method described in the first aspect of the embodiment of the present invention.

[0033] In a fourth aspect, a non-temporary computer-readable storage medium is provided. When the instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the method described in the first aspect of an embodiment of the present invention.

[0034] In a fifth aspect, an application product is provided. When the application product is running on a terminal, the terminal executes the method described in the first aspect of the embodiment of the present invention.

[0035] The beneficial effects of the present invention are:

[0036] The present invention uses the file format conversion function of the third-party software Adams to write a .cmd command and call the Adams software to execute it, which can quickly implement the parsing and compilation of the .rsp file and facilitate the secondary development of related software. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0038] Figure 1 This is a schematic diagram of the .rsp file parsing process;

[0039] Figure 2 Schematic diagram of the compilation process for .rsp files;

[0040] Figure 3 It is a structural schematic diagram of a device for parsing and compiling .rsp files according to the present invention;

[0041] Figure 4 The present invention is a schematic block diagram of a terminal structure. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0044] Embodiment 1

[0045] This embodiment provides a method for parsing and compiling a .rsp file. The method can be performed by a device for parsing and compiling a .rsp file in an embodiment of the present invention. The device can be implemented in software and / or hardware, and includes the following steps:

[0046] S1. See Figure 1 , use the file format conversion function of Adams software to convert the .rsp file into a .tab file that can be opened with text, as follows:

[0047] 11) Use Python language to read the .rsp file line by line in binary format and record the file name and file location. The first line is the header information. In the header information, each header name is separated by the string "\x00". Use the split() function to split the string. The code is as follows:

[0048] fp = open (files, 'rb') # read the file in binary

[0049] dir,filename=os.path.split(files)#file address and file name

[0050] for iin fp:

[0051] self.b=i#to read the file header information

[0052] break

[0053] self.alltitles = self.b.split (b "\x00") # extract header information

[0054] self.channeltitles = []

[0055] for i in self.alltitles:

[0056] if i!=b“”:

[0057] self.channeltitles.append(i);

[0058] 12) Search for the string "CHANNELS" and count the total number of channels. The code is as follows:

[0059] for iin range(len(self.channeltitles)):

[0060] if self.channeltitles[i]==b"CHANNELS":

[0061] self.channelnum=int(self.channeltitles[i+1])

[0062] break;

[0063] 13) Search for the string "DESC.CHAN_i" (i represents the channel number, i = 1, 2, 3...), and you can get the channel name and channel unit in turn. The code is as follows:

[0064] self.channelname = []

[0065] self.channelunit = []

[0066] for iin range(len(self.channeltitles)):

[0067] for j in range(self.channelnum):

[0068] d = str(j+1).encode()

[0069] if self.channeltitles[i]==b"DESC.CHAN_"+bytes(d):

[0070] self.channelname.append(self.channeltitles[i+1].decode('utf-8','ignore'))

[0071] self.channelunit.append(self.channeltitles[i+3].decode('utf-8','ignore'));

[0072] 14) Use Python to write the .rsp file name filename into the .cmd command:

[0073] acar files rpc3 open&

[0074] files=file: / / filename.rsp

[0075] 15) Use Python to repeatedly write the following .cmd commands by channel to extract the data for each channel in Adams:

[0076] interface cmd_window display=toggle

[0077] undo begin suppress=yes

[0078] xy_plot template modify plot=.plot_1auto_title=no auto_subtitle=noauto_date=yes auto_analysis_name=yes table=no

[0079] xy_plot curve create curve = .plot_1.curve_i (i represents the channel number, i = 1, 2, 3...) create_page = no

[0080] calculate_axis_limits=no

[0081] ddata=.filename.SteeringWheelAngle auto_axis=UNITS

[0082] xy_plots template auto_zoom plot_name=.plot_1

[0083] xy_plot template calculate_axis_limits plot_name=.plot_1

[0084] interface plot window update_toolbar;

[0085] 16) Use Python to repeatedly write the following .cmd commands by channel to write out the .tab file:

[0086] file table write&

[0087] file_name=filename&

[0088] plot_name = .plot_1&

[0089] format = spreadsheet;

[0090] 17) Use Python to write the following command in the .bat file, and call the .cmd file in the background to write the .tab file:

[0091] @echo off

[0092] cd / d D: / / (locate the .bat file to the folder location)

[0093] call C:\MSC.Software\Adams\2018\common\mdi.bat (Adams file location, software version can be changed) acar ru-st b***.cmd (.cmd file name ***);

[0094] 18) Use Python to call the .bat file and run it to write the .tab file. The code is as follows:

[0095] subprocess.run(batpath);

[0096] 19) Use the Python language pandas library to read the .tab file and complete the data analysis. The code is as follows:

[0097] fp=pd.read_table(myfile,sep='\t')

[0098] for j in range(len(self.channelname)):

[0099] data[j].append(fp.iloc[:,j+1].tolist());

[0100] S2. See Figure 2 , use the file format conversion function of Adams software to convert the .tab file that can be opened with text into a .rsp file, as follows:

[0101] 21) Use Python language to write the data into a .tab file in text format, where the first line is the name of each channel, the first column is fixed as time, and the remaining columns are the data of each channel;

[0102] 22) Use Python to write the following .cmd command:

[0103]

[0104] 23) Use Python language to write the following command in .bat file, and call this .bat file to compile the .rsp file;

[0105] @echo off

[0106] cd / d D: / *** / *** (locate the .bat file to the folder location)

[0107] call C:\MSC.Software\Adams\2018\common\mdi.bat acar ru-st b***.cmd(.cmd file name ***).

[0108] In summary, the present invention uses the file format conversion function of the third-party software Adams to write .cmd commands and call Adams software to execute, which can quickly implement the parsing and compilation of .rsp files and facilitate the secondary development of related software.

[0109] Embodiment 2

[0110] See also Figure 3 This embodiment provides a device for parsing and compiling a .rsp file, including:

[0111] The parsing module is used to convert the .rsp file into a .tab file that can be opened with text by using the file format conversion function of the Adams software;

[0112] The compilation module is used to convert the .tab file that can be opened with text into a .rsp file using the file format conversion function of the Adams software.

[0113] Embodiment 3

[0114] Figure 4 1 is a block diagram of a terminal provided in an embodiment of the present application, and the terminal may be a terminal in the above embodiment. The terminal may be a portable mobile terminal, such as a smart phone or a tablet computer. The terminal may also be referred to as a user device, a portable terminal, or other names.

[0115] Typically, the terminal includes: a processor 301 and a memory 302 .

[0116] The processor 301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 301 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0117] The memory 302 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 302 is used to store at least one instruction, which is used to be executed by the processor 301 to implement a method for parsing and compiling a .rsp file provided in this application.

[0118] In some embodiments, the terminal may further include: a peripheral device interface 303 and at least one peripheral device. Specifically, the peripheral device includes: at least one of a radio frequency circuit 304 , a touch display screen 305 , a camera 306 , an audio circuit 307 , a positioning component 308 and a power supply 309 .

[0119] The peripheral device interface 303 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 301 and the memory 302. In some embodiments, the processor 301, the memory 302, and the peripheral device interface 303 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 301, the memory 302, and the peripheral device interface 303 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0120] The radio frequency circuit 304 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 304 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 304 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 304 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 304 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 304 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0121] The touch display screen 305 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. The touch display screen 305 also has the ability to collect touch signals on the surface or above the surface of the touch display screen 305. The touch signal can be input to the processor 301 as a control signal for processing. The touch display screen 305 is used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the touch display screen 305 can be one, and the front panel of the terminal is set; in other embodiments, the touch display screen 305 can be at least two, which are respectively set on different surfaces of the terminal or are folded; in some other embodiments, the touch display screen 305 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal. Even, the touch display screen 305 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The touch display screen 305 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0122] The camera assembly 306 is used to capture images or videos. Optionally, the camera assembly 306 includes a front camera and a rear camera. Typically, the front camera is used to realize video calls or selfies, and the rear camera is used to realize the shooting of photos or videos. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, and a wide-angle camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, and the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting functions. In some embodiments, the camera assembly 306 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0123] The audio circuit 307 is used to provide an audio interface between the user and the terminal. The audio circuit 307 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 301 for processing, or input them into the radio frequency circuit 304 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 301 or the radio frequency circuit 304 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 307 may also include a headphone jack.

[0124] The positioning component 308 is used to locate the current geographical location of the terminal to implement navigation or LBS (Location Based Service). The positioning component 308 can be a positioning component based on the US GPS (Global Positioning System) or China's Beidou system.

[0125] The power supply 309 is used to power various components in the terminal. The power supply 309 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 309 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.

[0126] Those skilled in the art will understand that Figure 4 The structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0127] Embodiment 4

[0128] In an exemplary embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When the program is executed by a processor, a method for parsing and compiling a .rsp file as provided in all the inventive embodiments of the present application is implemented.

[0129] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0130] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0131] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0132] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0133] Embodiment 5

[0134] In an exemplary embodiment, an application product is also provided, including one or more instructions, and the one or more instructions can be executed by the processor 301 of the above-mentioned device to complete the above-mentioned method of parsing and compiling a .rsp file.

[0135] Although the embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and implementation mode. It can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily realized. Therefore, without departing from the general concept defined by the claims and equivalent scope, the present invention is not limited to the specific details and the illustrations shown and described here.

Claims

1. A method for parsing and compiling a .rsp file, characterized in that: include: Use the file format conversion function of Adams software to convert the .rsp file into a .tab file that can be opened with text; Use the file format conversion function of Adams software to convert the .tab file that can be opened with text into a .rsp file.

2. The method for parsing and compiling a .rsp file according to claim 1, characterized in that: The specific method of using the Adams software file format conversion function to convert the .rsp file into a .tab file that can be opened with text is as follows: 11) Use Python language to read the .rsp file line by line in binary format and record the file name and file location; 12) Search for the string "CHANNELS" and count the total number of channels; 13) Search for the string "DESC.CHAN_i" and obtain the channel name and channel unit in sequence; 14) Use Python language to write the .rsp file name into the .cmd file through commands; 15) Use Python language to repeatedly write .cmd files by channel through commands, and extract the data of each channel in Adams; 16) Use Python language to repeatedly write .cmd files by channel through commands to write .tab files; 17) Use Python language to write .bat file through command, and call .cmd file in the background to write .tab file; 18) Use Python to call the .bat file and run it to write a .tab file; 19) Use the python language pandas library to read the .tab file and complete the data analysis.

3. The method for parsing and compiling a .rsp file according to claim 2, characterized in that: In the above 11), the first line is the header information. In the header information, each header name is separated by the string "\x00", and the string is separated using the split() function.

4. The method for parsing and compiling a .rsp file according to claim 2, characterized in that: In the above 13), i represents the channel number, i=1, 2, 3...

5. The method for parsing and compiling a .rsp file according to claim 1, characterized in that: The specific method of using the file format conversion function of Adams software to convert a .tab file that can be opened with text into a .rsp file is as follows: 21) Use Python to write the data into a .tab file in text format by column. 22) Use Python language to write commands into .cmd file; 23) Use Python language to write a command .bat file, and call this .bat file to compile the .rsp file.

6. A method for parsing and compiling .rsp files according to claim 5, characterized in that: In the above 21), the first line is the name of each channel of data, the first column is fixed to time, and the remaining columns are the data of each channel.

7. A device for parsing and compiling .rsp files, characterized in that: include: The parsing module is used to convert the .rsp file into a .tab file that can be opened with text by using the file format conversion function of the Adams software; The compilation module is used to convert the .tab file that can be opened with text into a .rsp file using the file format conversion function of the Adams software.

8. A terminal, characterized in that: include: one or more processors; a memory for storing the one or more processor-executable instructions; Wherein, the one or more processors are configured to: Execute a method for parsing and compiling a .rsp file as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by the processor of the terminal, the terminal is enabled to execute the method for parsing and compiling .rsp files as described in any one of claims 1 to 6.