Movatterモバイル変換


[0]ホーム

URL:


CN112559470A - File format conversion method and device, storage medium and electronic equipment - Google Patents

File format conversion method and device, storage medium and electronic equipment
Download PDF

Info

Publication number
CN112559470A
CN112559470ACN202011412759.2ACN202011412759ACN112559470ACN 112559470 ACN112559470 ACN 112559470ACN 202011412759 ACN202011412759 ACN 202011412759ACN 112559470 ACN112559470 ACN 112559470A
Authority
CN
China
Prior art keywords
information
file
message
converted
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011412759.2A
Other languages
Chinese (zh)
Inventor
李彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing CHJ Automobile Technology Co Ltd
Original Assignee
Beijing CHJ Automobile Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing CHJ Automobile Technology Co LtdfiledCriticalBeijing CHJ Automobile Technology Co Ltd
Priority to CN202011412759.2ApriorityCriticalpatent/CN112559470A/en
Publication of CN112559470ApublicationCriticalpatent/CN112559470A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本公开涉及一种文件格式转换方法、装置、存储介质及电子设备,可以获取待转换的目标LIN通信文件;从所述目标LIN通信文件中读取待转换信息;按照预设LDF文件格式将所述待转换信息写入预设文本文件,得到转换后的目标LDF文件。

Figure 202011412759

The present disclosure relates to a file format conversion method, device, storage medium and electronic device, which can acquire a target LIN communication file to be converted; read the information to be converted from the target LIN communication file; The information to be converted is written into a preset text file to obtain a converted target LDF file.

Figure 202011412759

Description

File format conversion method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computers, and in particular, to a method and an apparatus for converting a file format, a storage medium, and an electronic device.
Background
LIN (local interconnect network ) is a low-cost vehicle-mounted internal interconnect network, and is a supplement to the existing vehicle-mounted complex network, and when a vehicle LIN bus communication protocol is designed, a LIN communication protocol file is usually stored in the form of an Excel file after the design of the LIN communication protocol is completed, but in an actual application scenario, the simulation and test of LIN communication need to be performed based on an LDF database file.
In the related art, a LIN communication protocol file stored in the form of an Excel file can be converted into an LDF (Log data files) database file by means of special LIN communication database file editing software (such as LIN Explorer of Vector corporation), but the information of nodes, messages, signals, scheduling tables and the like needs to be established one by one according to the LIN communication protocol.
Disclosure of Invention
The invention aims to provide a file format conversion method, a file format conversion device, a storage medium and electronic equipment.
In a first aspect, a file format conversion method is provided, where the method includes: acquiring a target LIN communication file to be converted; reading information to be converted from the target LIN communication file; and writing the information to be converted into a preset text file according to a preset LDF file format to obtain a converted target LDF file.
Optionally, the information to be converted includes schedule information and at least one piece of message information, and reading the information to be converted from the target LIN communication file includes: and reading the information in the target LIN communication file line by line from a first preset initial line to obtain the scheduling list information and at least one piece of message information.
Optionally, the first preset start line includes a message definition start line corresponding to a target message or a schedule information start line corresponding to the schedule information, where the target message includes any one message.
Optionally, the method further comprises: determining whether a sleep instruction message is read or not under the condition that the first preset starting line is the scheduling table information starting line; and under the condition that the sleep instruction message is determined to be read, determining that the information to be converted is read completely.
Optionally, the determining whether the sleep instruction packet is read includes: determining whether the identifier of the corresponding message in the currently read message information is a preset identifier; and under the condition that the identifier of the message is determined to be the preset identifier, determining to read the sleep instruction message.
Optionally, the method further comprises: and determining that the information to be converted is completely read under the condition that the information is not read from the target LIN communication file.
Optionally, the information to be converted includes schedule information and at least one piece of message information, and reading the information to be converted from the target LIN communication file includes: acquiring a second preset initial line corresponding to each message information in the target LIN communication file and a third preset initial line corresponding to the scheduling table information; and reading each piece of message information and the scheduling table information in parallel according to the second preset initial line and the third preset initial line.
Optionally, the method further comprises: determining whether reading ending indication information returned by the reading process is acquired or not aiming at each reading process in a plurality of reading processes for reading the information to be converted in parallel; and under the condition that the plurality of reading processes return the reading ending indication information, determining that the information to be converted is completely read.
Optionally, the packet information includes node information, packet definition information, and signal information.
Optionally, the writing the information to be converted into a preset text file according to a preset LDF file format includes: determining a preset field corresponding to the information to be converted defined by the preset LDF file format for each acquired information to be converted in the node information, the message definition information, the signal information and the scheduling table information; and writing the information to be converted into the corresponding preset field in the preset text file.
Optionally, the acquiring the target LIN communication file to be converted includes: receiving a file format conversion request sent by a user, wherein the file format conversion request comprises a file identifier of the target LIN communication file; and acquiring the target LIN communication file according to the file identifier.
Optionally, the target LIN communication file comprises a file edited according to a preset format.
In a second aspect, there is provided a file format conversion apparatus, the apparatus comprising: the acquisition module is used for acquiring a target LIN communication file to be converted; the reading module is used for reading information to be converted from the target LIN communication file; and the file writing module is used for writing the information to be converted into a preset text file according to a preset LDF file format to obtain a converted target LDF file.
In a third aspect, a computer readable storage medium is provided, on which a computer program is stored, which program, when being executed by a processor, carries out the steps of the method according to the first aspect of the disclosure.
In a fourth aspect, an electronic device is provided, comprising: a memory having a computer program stored thereon; a processor for executing the computer program in the memory to implement the steps of the method of the first aspect of the disclosure.
By the technical scheme, the target LIN communication file to be converted can be obtained, the information to be converted is read from the target LIN communication file, the information to be converted can be written into the preset text file according to the preset LDF file format, and the converted target LDF file is obtained.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flow diagram illustrating a first method of file format conversion in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a second method of file format conversion in accordance with an exemplary embodiment;
FIG. 3 is a block diagram illustrating a file format conversion device in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Firstly, an application scenario of the present disclosure is introduced, and the present disclosure is mainly applied to a process of automatically converting an LIN communication protocol file stored in the form of an Excel file into an LDF database file after the design of an LIN communication protocol of a vehicle is completed.
In the related art, a special LIN communication database file editing software (such as LIN Explorer of Vector company) can be used for converting an LIN communication protocol file stored in an Excel file form into an LDF database file, but the information such as nodes, messages, signals, scheduling tables and the like needs to be established one by one according to the LIN communication protocol.
In order to solve the existing problems, the present disclosure provides a file format conversion method, which may acquire a target LIN communication file to be converted, then read information to be converted from the target LIN communication file, and then write the information to be converted into a preset text file according to a preset LDF file format to obtain a converted target LDF file.
Specific embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a file format conversion method according to an exemplary embodiment, as shown in fig. 1, the method including the steps of:
in step S101, a target LIN communication file to be converted is acquired.
The target LIN communication file is a file selected by a user and storing a designed LIN communication protocol file, and the target LIN communication file may include a file edited according to a preset format, such as an Excel file or a Word table file.
In step S102, the information to be converted is read from the target LIN communication file.
The information to be converted may include schedule information and at least one piece of message information, where the message information includes node information, message definition information, and signal information, where the schedule information is used to define information such as a transmission cycle, a transmission interval, a message transmission length, and the like of the message information, for example, it is defined in the schedule information that a message may be transmitted every 100ms (i.e., a transmission cycle) and 4 messages are transmitted every time, and a transmission interval between every 2 messages in the 4 messages is 10ms, which is only an example and is not limited by this disclosure.
In general, an LIN network is composed of a master node and one or more slave nodes, where one node may correspond to at least one message, each message also has a node corresponding to the message, and each message includes at least one signal, where the node information may include node attribute information and/or node identification information of the node corresponding to the message, for example, for a vehicle door control LIN network, the vehicle door control LIN network may include a master node, a rearview mirror slave node, a window lifter slave node, and a door lock slave node, where the node attribute information is used to indicate whether the node corresponding to the message is the master node or the slave node, and the node identification information indicates which node specifically is, for example, node name information or node ID information, etc.; the message definition information may include information such as a message name, a message ID, a message sending period, and a message length of the message; the signal information may include information such as a signal name, a signal start position, a signal length, a signal code, a unit, precision, an offset, a signal range, an initial value, a default value, a transceiving node, and the like of a signal included in the message.
In this step, the information to be converted may be read from the target LIN communication file in any one of the following two ways:
mode one, serial read mode
Reading the information in the target LIN communication file line by line from a first preset start line, so as to obtain the schedule table information and at least one piece of message information, wherein the first preset start line may include a message definition start line corresponding to a target message or a schedule table information start line corresponding to the schedule table information, the target message includes any one message, and the first preset start line may include a preset line whose line identifier is a first identifier.
Mode two, parallel read mode
In this step, in order to improve the efficiency of data reading, the information to be converted may also be read in parallel from the target LIN communication file, specifically, a second preset start line corresponding to each piece of message information in the target LIN communication file and a third preset start line corresponding to the scheduling table information are first obtained; and then reading each piece of message information and the scheduling table information in parallel according to the second preset initial line and the third preset initial line.
In step S103, the information to be converted is written into a preset text file according to a preset LDF file format, so as to obtain a converted target LDF file.
The LDF database file is used as a configuration information description file of the LIN bus, all defined elements have a specific standard format, the preset LDF file format is the specific standard format corresponding to the LDF database file, and specific preset fields are correspondingly arranged for different information to be converted in the preset LDF file format.
In this step, a preset field corresponding to the to-be-converted information defined by the preset LDF file format may be determined for each obtained to-be-converted information in the node information, the message definition information, the signal information, and the scheduling table information, then the to-be-converted information is written into the preset field corresponding to the preset text file, and the written preset text file is stored according to a preset storage policy to obtain the target LDF file, where the preset storage policy may be a storage path, a storage file name, and a stored file type for storing the target LDF file selected by a user.
By adopting the method, the target LIN communication file can be automatically converted into the LDF database file without manual editing of a user, the compiling efficiency of the LDF database file is improved, and the condition that the LDF file is edited wrongly can be effectively prevented.
Fig. 2 is a flowchart illustrating a file format conversion method according to an exemplary embodiment, as shown in fig. 2, the method including the steps of:
in step S201, a file format conversion request issued by a user is received, where the file format conversion request includes a file identifier of the target LIN communication file.
The target LIN communication file is a file selected by a user and storing a designed LIN communication protocol file, the target LIN communication file may include a file edited according to a preset format, such as an Excel file or a Word table file, and the file identifier may include a file name or a file storage path of the target LIN communication file.
In an actual application scenario, a user may automatically convert the target LIN communication file into an LDF database file by using file format conversion software, for example, the user may manually load the target LIN communication file on the file format conversion software, then select a saving path, a file name, and a saving format (generally, an LDF file) of the LDF database file after conversion, then may start file format conversion by triggering a "conversion" button, and after obtaining a triggering operation of triggering the conversion button by the user, the terminal may obtain the file format conversion request.
In step S202, the target LIN communication file is acquired according to the file identifier.
In step S203, the information to be converted is read from the target LIN communication file.
The information to be converted may include schedule information and at least one piece of message information, where the message information includes node information, message definition information, and signal information, where the schedule information is used to define information such as a transmission cycle, a transmission interval, a message transmission length, and the like of the message information, for example, it is defined in the schedule information that a message may be transmitted every 100ms (i.e., a transmission cycle) and 4 messages are transmitted every time, and a transmission interval between every 2 messages in the 4 messages is 10ms, which is only an example and is not limited by this disclosure.
In general, an LIN network is composed of a master node and one or more slave nodes, where one node may correspond to at least one message, each message also has a node corresponding to the message, and each message includes at least one signal, where the node information may include node attribute information and/or node identification information of the node corresponding to the message, for example, for a vehicle door control LIN network, the vehicle door control LIN network may include a master node, a rearview mirror slave node, a window lifter slave node, and a door lock slave node, where the node attribute information is used to indicate whether the node corresponding to the message is the master node or the slave node, and the node identification information indicates which node specifically is, for example, node name information or node ID information, etc.; the message definition information may include information such as a message name, a message ID, a message sending period, and a message length of the message; the signal information may include information such as a signal name, a signal start position, a signal length, a signal code, a unit, precision, an offset, a signal range, an initial value, a default value, a transceiving node, and the like of a signal included in the message.
In this step, the information to be converted may be read from the target LIN communication file in either of the following two ways.
Mode one, serial read mode
In a first mode, in an actual application scenario, a designed LIN communication protocol file may be edited and stored according to a preset format (or understood as being edited by using a fixed template), and schedule information and all message information included in the LIN communication file may be stored in the same table, where a first preset start line for storing the information may be predefined in the table, and then the schedule information and the message information may be stored line by line from the first preset start line in the table.
For example, assuming that the target LIN communication file is an Excel file, the first behavior in the Excel file may be preset to the first preset start line, and node information and message definition information for storing a first message in the first preset start line may be predefined, signal information included in the first message is stored in a line next to the first preset start line, and then other message information and schedule information are stored line by line.
Thus, when the information to be converted is read from the target LIN communication file, the information in the target LIN communication file may be read line by line from a first preset start line, so that the schedule table information and at least one piece of the message information may be obtained, where the first preset start line may include a message definition start line corresponding to a target message or a schedule table information start line corresponding to the schedule table information, the target message includes any one message, and the first preset start line may include a preset line whose line identifier is a first identifier.
It should be noted that, when the designed target LIN communication protocol file is edited and stored according to a preset format, the schedule table information may be stored first, and after the schedule table information is stored, the message information is stored continuously, in this case, the schedule table information start line corresponds to the first preset start line; if the message information is stored first, and the scheduling table information is stored continuously after the message information is stored, the first preset initial line corresponding to the situation is the message definition initial line.
In addition, a description is also needed for a judging mode of reading end of serially reading the information to be converted from the target LIN communication protocol file, in the present disclosure, whether the information to be converted is read can be determined by any one of the following two modes, in one possible implementation mode, the last message in the target LIN communication file to be converted can be predefined as a sleep instruction message, so that in one mode, under the condition that the first preset starting line is the starting line of the scheduling table information, whether the sleep instruction message is read is determined; under the condition that the sleep instruction message is determined to be read, the currently read message can be determined to be the last message, so that the information to be converted can be further determined to be read from the target LIN communication file; in another way, it can also be determined that the information to be converted has been read out, if no information has been read out from the target LIN communication file.
Here, whether or not the sleep instruction message is read may be determined by: determining whether the identifier of the corresponding message in the currently read message information is a preset identifier; in a case that the identifier of the message is determined to be the preset identifier, it is determined that the sleep instruction message is read, for example, if it is determined that the message ID of the corresponding message in the currently read message information is 0x3C, it may be determined that the sleep instruction message is read, which is only an example and is not limited by the present disclosure.
A specific implementation of the serial reading of the information to be converted from the target LIN communication file in the present disclosure is described below by way of example.
For example, assuming that the target LIN communication file is an Excel file, and a message corresponding to a first message of the first preset initiation behavior defines an initiation line, a process of serially reading the information to be converted from the Excel file at this time is as follows:
1. reading the definition of a first message from the message definition initial line, and retrieving node attribute, node name, message ID, message period and message length information;
2. reading the signal information in the first message line by line from the signal definition cell at the next line of the message definition initial line, and reading out the information such as signal name, signal initial position, signal length, signal coding, unit, precision, offset, signal range, initial value, default value, transceiving node and the like;
3. after the first message and the signal information contained in the first message are read, if other messages exist, the information is continuously read according to the steps 1 and 2, and whether the currently read message is the last message can be judged by judging whether the message is a sleep instruction message (namely the message with the message ID of 0x 3C) when the message definition information is read;
4. when the sleep instruction message is determined to be read, the schedule table information can be read line by line from the next line of the sleep instruction message, and when the read information is determined to be empty (i.e., the information is not read from the target LIN communication file), the information to be converted in the target LIN communication file can be determined to be completely read.
The information to be converted can be read from the target LIN communication file in series by executing the four steps, and the above example is also only illustrative and the disclosure does not limit the information.
Mode two, parallel read mode
In another possible implementation manner of this step, to improve the efficiency of data reading, the information to be converted may also be read in parallel from the target LIN communication file, and specifically, a second preset start line corresponding to each piece of message information in the target LIN communication file and a third preset start line corresponding to the scheduling table information are first obtained; and then reading each piece of message information and the scheduling table information in parallel according to the second preset initial line and the third preset initial line.
Exemplarily, assuming that the target LIN communication file stores schedule information of a corresponding LIN network and two pieces of message information, and a row identifier of the second preset start row corresponding to a first piece of message information is a, a row identifier of the second preset start row corresponding to a second piece of message information is B, and a row identifier of the third preset start row corresponding to the schedule information is C, three mutually independent reading processes may be started simultaneously in a process of reading the to-be-converted information in parallel from the target LIN communication file, where a first reading process is used to read a first piece of message information line by line from the row a to obtain node information, message definition information, and signal information corresponding to the first piece of message information; the second reading process is used for reading the second message information line by line from the B line to obtain node information, message definition information and signal information corresponding to the second message information; the third reading process is used to read the schedule information line by line starting from line C, and the above example is only illustrative and the present disclosure does not limit this.
In addition, for each reading process in the plurality of reading processes for reading the information to be converted in parallel, if it is determined that the reading end indication information returned by the reading process is received, it is determined that the reading process is ended, and therefore, it can be determined whether the information to be converted is completely read in the following manner in the process of reading the information to be converted in parallel:
and for each reading process in a plurality of reading processes for reading the information to be converted in parallel, acquiring reading ending indication information returned by the reading process, and determining that the information to be converted is read under the condition that the reading ending indication information is returned by all the reading processes.
When reading message information, if reading a sleep instruction message, returning the reading ending indication information; when the schedule information is read, if the read information is determined to be empty, the read end instruction information may be returned.
It should be further noted that, in the above description, a specific implementation manner of reading the to-be-converted information from the target LIN communication file in a row unit is introduced, and if the target LIN communication file sequentially stores the schedule table information and each piece of message information in a column unit, in another possible implementation manner of the present disclosure, the to-be-converted information may also be read from the target LIN communication file in a column unit, which is similar to the manner of reading in a row unit, and is not described herein again.
In step S204, for each to-be-converted information in the acquired node information, the message definition information, the signal information, and the scheduling table information, a preset field corresponding to the to-be-converted information defined in the preset LDF file format is determined.
The LDF database file is used as a configuration information description file of the LIN bus, wherein all defined elements have a specific standard format, the preset LDF file format is the specific standard format corresponding to the LDF database file, and specific preset fields are corresponding to different information to be converted in the preset LDF file format.
For example, the preset field corresponding to the node information includes a master node name >, < slave1_ name >, < slave2_ name >, < master _ name > in which a master node name can be written, and slave node names in < slave1_ name >, < slave2_ name > in which a slave node name can be written; the preset fields corresponding to the message definition information may include < frame _ name >, < frame _ ID >, < node _ name >, < frame _ size > and the like, and the message name, the message ID, the node name corresponding to the message, and the message length may be written in the preset fields respectively; the preset field corresponding to the signal information comprises < scale _ signal _ name >, < signal _ size > and the like, and the signal name and the signal length can be written in the preset field respectively; the preset field corresponding to the schedule information includes < schedule _ table _ name >, and the schedule name may be written in the preset field.
In step S205, the information to be converted is written into the corresponding predetermined field in the predetermined text file.
In this step, reading and writing may be performed while taking a row (or a column) as a unit, for example, after reading the definition of the first packet from the packet definition start row, the read information such as the node attribute, the node name, the packet ID, the packet cycle, the packet length information, and the like may be written in the corresponding preset field in the preset text file; after reading the signal information in the first message line by line from the signal definition cell starting from the next line of the message definition start line, the read information such as the signal name, the signal start position, the signal length, the signal code, the unit, the precision, the offset, the signal range, the initial value, the default value, the transceiving node, and the like may be written into the corresponding preset field in the preset text file.
In step S206, the written preset text file is stored according to a preset storage policy, so as to obtain the target LDF file.
The preset storage policy may be a storage path, a storage file name, and a stored file type for storing the target LDF file, which are selected by a user.
By adopting the method, the target LIN communication file can be automatically converted into the LDF database file without manual editing of a user, the compiling efficiency of the LDF database file is improved, and the condition that the LDF file is edited wrongly can be effectively prevented.
Fig. 3 is a block diagram illustrating a file format conversion apparatus according to an exemplary embodiment, as shown in fig. 3, the apparatus including:
an obtainingmodule 301, configured to obtain a target LIN communication file to be converted;
areading module 302, configured to read information to be converted from the target LIN communication file;
thefile writing module 303 is configured to write the information to be converted into a preset text file according to a preset LDF file format, so as to obtain a converted target LDF file.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
By adopting the device, the target LIN communication file can be automatically converted into the LDF database file without manual editing of a user, the compiling efficiency of the LDF database file is improved, and the condition that the LDF file is edited wrongly can be effectively prevented.
Fig. 4 is a block diagram illustrating anelectronic device 400 according to an example embodiment. As shown in fig. 4, theelectronic device 400 may include: aprocessor 401 and amemory 402. Theelectronic device 400 may also include one or more of amultimedia component 403, an input/output (I/O)interface 404, and acommunications component 405.
Theprocessor 401 is configured to control the overall operation of theelectronic device 400, so as to complete all or part of the steps in the file format conversion method. Thememory 402 is used to store various types of data to support operations at theelectronic device 400, such data including, for example, instructions for any application or method operating on theelectronic device 400 and application-related data
In another exemplary embodiment, there is also provided a computer-readable storage medium including program instructions which, when executed by a processor, implement the steps of the file format conversion method described above. For example, the computer readable storage medium may be thememory 402 described above including program instructions that are executable by theprocessor 401 of theelectronic device 400 to perform the file format conversion method described above.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (15)

Translated fromChinese
1.一种文件格式转换方法,其特征在于,所述方法包括:1. a file format conversion method, is characterized in that, described method comprises:获取待转换的目标LIN通信文件;Get the target LIN communication file to be converted;从所述目标LIN通信文件中读取待转换信息;Read the information to be converted from the target LIN communication file;按照预设LDF文件格式将所述待转换信息写入预设文本文件,得到转换后的目标LDF文件。Write the to-be-converted information into a preset text file according to a preset LDF file format to obtain a converted target LDF file.2.根据权利要求1所述的方法,其特征在于,所述待转换信息包括调度表信息以及至少一条报文信息,所述从所述目标LIN通信文件中读取待转换信息包括:2. The method according to claim 1, wherein the information to be converted comprises scheduling table information and at least one piece of message information, and the reading of the information to be converted from the target LIN communication file comprises:从第一预设起始行开始逐行读取所述目标LIN通信文件中的信息,得到所述调度表信息以及至少一条所述报文信息。The information in the target LIN communication file is read line by line starting from the first preset start line, to obtain the schedule information and at least one piece of the message information.3.根据权利要求2所述的方法,其特征在于,所述第一预设起始行包括目标报文对应的报文定义起始行或者所述调度表信息对应的调度表信息起始行,所述目标报文包括任意一条报文。3 . The method according to claim 2 , wherein the first preset start line comprises a message definition start line corresponding to the target message or a schedule information start line corresponding to the schedule information. 4 . , the target message includes any message.4.根据权利要求3所述的方法,其特征在于,所述方法还包括:4. The method according to claim 3, wherein the method further comprises:在所述第一预设起始行为所述调度表信息起始行的情况下,确定是否读取到休眠指令报文;In the case that the first preset starting line is the starting line of the scheduling table information, determining whether a sleep command message is read;在确定读取到所述休眠指令报文的情况下,确定读取完所述待转换信息。If it is determined that the sleep command message is read, it is determined that the information to be converted has been read.5.根据权利要求4所述的方法,其特征在于,所述确定是否读取到休眠指令报文包括:5. The method according to claim 4, wherein the determining whether the sleep command message is read comprises:确定当前读取的报文信息中对应的报文的标识是否为预设标识;Determine whether the identifier of the corresponding message in the currently read message information is a preset identifier;在确定所述报文的标识为所述预设标识的情况下,确定读取到所述休眠指令报文。When it is determined that the identifier of the message is the preset identifier, it is determined that the sleep instruction message is read.6.根据权利要求2所述的方法,其特征在于,所述方法还包括:6. The method according to claim 2, wherein the method further comprises:在从所述目标LIN通信文件中未读取到信息的情况下,确定读取完所述待转换信息。In the case that no information is read from the target LIN communication file, it is determined that the to-be-converted information has been read.7.根据权利要求1所述的方法,其特征在于,所述待转换信息包括调度表信息以及至少一条报文信息,所述从所述目标LIN通信文件中读取待转换信息包括:7. The method according to claim 1, wherein the information to be converted comprises scheduling table information and at least one piece of message information, and the reading of the information to be converted from the target LIN communication file comprises:获取所述目标LIN通信文件中每条所述报文信息分别对应的第二预设起始行,以及所述调度表信息对应的第三预设起始行;Obtain the second preset start line corresponding to each piece of message information in the target LIN communication file, and the third preset start line corresponding to the schedule information;根据所述第二预设起始行、所述第三预设起始行并行读取每条所述报文信息以及所述调度表信息。Each piece of the message information and the schedule information is read in parallel according to the second preset starting line and the third preset starting line.8.根据权利要求7所述的方法,其特征在于,所述方法还包括:8. The method according to claim 7, wherein the method further comprises:针对并行读取所述待转换信息的多个读取进程中的每个读取进程,确定是否获取到该读取进程返回的读取结束指示信息;For each reading process in the multiple reading processes that read the information to be converted in parallel, determine whether to obtain the reading end indication information returned by the reading process;在确定多个所述读取进程均返回所述读取结束指示信息的情况下,确定读取完所述待转换信息。In a case where it is determined that multiple reading processes all return the reading end indication information, it is determined that the to-be-converted information has been read.9.根据权利要求2至8任一项所述的方法,其特征在于,所述报文信息包括节点信息、报文定义信息以及信号信息。9 . The method according to claim 2 , wherein the message information includes node information, message definition information and signal information. 10 .10.根据权利要求9所述的方法,其特征在于,所述按照预设LDF文件格式将所述待转换信息写入预设文本文件包括:10. The method according to claim 9, wherein the writing the information to be converted into a preset text file according to a preset LDF file format comprises:针对获取到的所述节点信息、所述报文定义信息、所述信号信息以及所述调度表信息中的每种待转换信息,确定所述预设LDF文件格式定义的该待转换信息对应的预设字段;For each kind of information to be converted in the acquired node information, the message definition information, the signal information and the schedule information, determine the corresponding information to be converted defined by the preset LDF file format. default field;将该待转换信息写入所述预设文本文件中对应的所述预设字段下。Write the information to be converted into the corresponding preset field in the preset text file.11.根据权利要求1所述的方法,其特征在于,所述获取待转换的目标LIN通信文件包括:11. The method according to claim 1, wherein the acquiring the target LIN communication file to be converted comprises:接收用户发出的文件格式转换请求,所述文件格式转换请求包括所述目标LIN通信文件的文件标识;Receive the file format conversion request sent by the user, and the file format conversion request includes the file identifier of the target LIN communication file;根据所述文件标识获取所述目标LIN通信文件。Acquire the target LIN communication file according to the file identifier.12.根据权利要求1所述的方法,其特征在于,所述目标LIN通信文件包括按照预设格式编辑的文件。12. The method according to claim 1, wherein the target LIN communication file comprises a file edited according to a preset format.13.一种文件格式转换装置,其特征在于,所述装置包括:13. A file format conversion device, wherein the device comprises:获取模块,用于获取待转换的目标LIN通信文件;The acquisition module is used to acquire the target LIN communication file to be converted;读取模块,用于从所述目标LIN通信文件中读取待转换信息;A reading module is used to read the information to be converted from the target LIN communication file;文件写入模块,用于按照预设LDF文件格式将所述待转换信息写入预设文本文件,得到转换后的目标LDF文件。The file writing module is used for writing the information to be converted into a preset text file according to a preset LDF file format to obtain a converted target LDF file.14.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1-12中任一项所述方法的步骤。14. A computer-readable storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the steps of the method according to any one of claims 1-12 are implemented.15.一种电子设备,其特征在于,包括:15. An electronic device, characterized in that, comprising:存储器,其上存储有计算机程序;a memory on which a computer program is stored;处理器,用于执行所述存储器中的所述计算机程序,以实现权利要求1-12中任一项所述方法的步骤。A processor for executing the computer program in the memory to implement the steps of the method of any one of claims 1-12.
CN202011412759.2A2020-12-042020-12-04File format conversion method and device, storage medium and electronic equipmentPendingCN112559470A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011412759.2ACN112559470A (en)2020-12-042020-12-04File format conversion method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011412759.2ACN112559470A (en)2020-12-042020-12-04File format conversion method and device, storage medium and electronic equipment

Publications (1)

Publication NumberPublication Date
CN112559470Atrue CN112559470A (en)2021-03-26

Family

ID=75048919

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011412759.2APendingCN112559470A (en)2020-12-042020-12-04File format conversion method and device, storage medium and electronic equipment

Country Status (1)

CountryLink
CN (1)CN112559470A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114201229A (en)*2021-11-042022-03-18智新控制系统有限公司LIN configuration code automatic generation method, system and computer readable storage medium
CN116029008A (en)*2023-02-232023-04-28昆易电子科技(上海)有限公司 A file generation method, device, terminal device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103020024A (en)*2012-12-272013-04-03北京经纬恒润科技有限公司File format converting method
CN109522284A (en)*2018-11-262019-03-26天津渤化工程有限公司Files in batch conversion method and device
CN110018984A (en)*2017-10-312019-07-16北京国双科技有限公司A kind of conversion method and device of file format
CN110377563A (en)*2019-07-232019-10-25中国工商银行股份有限公司Document handling method and device and electronic equipment and readable storage medium storing program for executing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103020024A (en)*2012-12-272013-04-03北京经纬恒润科技有限公司File format converting method
CN110018984A (en)*2017-10-312019-07-16北京国双科技有限公司A kind of conversion method and device of file format
CN109522284A (en)*2018-11-262019-03-26天津渤化工程有限公司Files in batch conversion method and device
CN110377563A (en)*2019-07-232019-10-25中国工商银行股份有限公司Document handling method and device and electronic equipment and readable storage medium storing program for executing

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114201229A (en)*2021-11-042022-03-18智新控制系统有限公司LIN configuration code automatic generation method, system and computer readable storage medium
CN114201229B (en)*2021-11-042024-04-05智新控制系统有限公司LIN configuration code automatic generation method, system and computer readable storage medium
CN116029008A (en)*2023-02-232023-04-28昆易电子科技(上海)有限公司 A file generation method, device, terminal device and storage medium

Similar Documents

PublicationPublication DateTitle
CN112751810B (en)CAN message analysis method, device and terminal
CN108763122A (en)Camera control interface is communicated from equipment to from equipment
CN112559470A (en)File format conversion method and device, storage medium and electronic equipment
CN111177182B (en)Data query method and device, storage medium and electronic equipment
CN114091383A (en)Test sequence generation method, device and system and related equipment
CN116560697A (en)DBC database synchronization method, device, electronic equipment and readable storage medium
EP4407467A1 (en)Autosar software verification method and apparatus, device, and storage medium
CN118337893A (en)Method, device, medium and electronic equipment for consulting whole vehicle message information
CN119172293A (en) Vehicle testing method, system and electronic equipment
CN113434216A (en)Scene-based command line construction method and system
CN118331628A (en) Data generation method, device and computer equipment
CN115967604B (en) Message transmission method, device, electronic device and computer-readable storage medium
CN118400288A (en) A message information consistency detection method, device, electronic device and storage medium
CN115695570B (en)Method, device, equipment and storage medium for converting medical image scanning protocol
CN115134427B (en)Communication protocol coordination method, device, computer equipment and storage medium
CN115348169B (en)Route configuration method, device, equipment and storage medium for vehicle-mounted gateway
CN113608889B (en)Message data processing method, device, equipment and storage medium
CN116775392A (en)Chip communication testing method and device, electronic equipment and storage medium
CN111104097B (en)Data writing and reading method and device
CN111125110B (en)Non-primary key field checking method, device, computer equipment and storage medium
CN114565285A (en)Flow control method and system
CN112054955A (en)Equipment communication method based on gateway
CN118364033B (en)Data processing method and device among database clusters and related equipment
CN117997673B (en)Bus testing device and bus testing method
CN118939492A (en) Method, device, electronic device and storage medium for generating bus diagnostic file

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20210326

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp