CN115604365B - Data encoding and decoding method and device, electronic equipment and readable storage medium - Google Patents

Data encoding and decoding method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115604365B
CN115604365B CN202211427602.6A CN202211427602A CN115604365B CN 115604365 B CN115604365 B CN 115604365B CN 202211427602 A CN202211427602 A CN 202211427602A CN 115604365 B CN115604365 B CN 115604365B
Authority
CN
China
Prior art keywords
data
module
processed
icd
decoding
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.)
Active
Application number
CN202211427602.6A
Other languages
Chinese (zh)
Other versions
CN115604365A (en
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.)
Xinchuanhui Electronic Technology Co ltd
Original Assignee
Xinchuanhui Electronic 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 Xinchuanhui Electronic Technology Co ltd filed Critical Xinchuanhui Electronic Technology Co ltd
Priority to CN202211427602.6A priority Critical patent/CN115604365B/en
Publication of CN115604365A publication Critical patent/CN115604365A/en
Application granted granted Critical
Publication of CN115604365B publication Critical patent/CN115604365B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure provides a data coding and decoding method, a data coding and decoding device, electronic equipment and a readable storage medium, relates to a communication technology, and particularly relates to a universal onboard system formatted data coding and decoding method. The specific implementation scheme comprises the following steps: when the data to be processed is binary data, splitting the data to be processed according to a data frame format provided by the interface control file ICD configuration management module, and acquiring frame identifiers and split data to be processed corresponding to each frame identifier. And sending the frame identification and the split data to be processed corresponding to each frame identification to a data decoding module. The invention supports processing real-time data stream and stored data file through good module division and architecture design, can deal with various use scenes, can improve the execution efficiency of the system through distributed deployment of each module, and shortens the time of the formatted data coding and decoding of the airborne system.

Description

Data encoding and decoding method and device, electronic equipment and readable storage medium
Technical Field
The disclosure relates to communication technologies, and in particular, to a universal method for encoding and decoding formatted data of an airborne system.
Background
In a modern airplane, different data transmission buses exist in an airborne system, and Interface Control files (ICD) of different data transmission buses have different definition forms, so that the universality and flexibility of data encoding and decoding are poor, and the efficiency is low.
In the existing interface configuration file, different bus protocols often use different size end modes to store data, and conversion of the data size end modes is often required in the encoding and decoding process.
If the data size mode is different from the local machine, the data size mode can only be converted in a mode of changing the byte sequence by manual coding, and the efficiency and the performance are low.
Disclosure of Invention
The disclosure provides a data coding and decoding method, a data coding and decoding device, electronic equipment and a readable storage medium, which can improve the efficiency of the formatted data coding and decoding of an airborne system.
According to a first aspect of the present disclosure, there is provided a data encoding and decoding method, the method including: and reading the data to be processed through the data loading module, wherein the data to be processed comprises binary data or formatted data. And according to the data type of the data to be processed, the data to be processed is sent to a data encoding module or a data decoding module in a packet mode. The data coding module or the data decoding module processes the received data to be processed and sends the processed data to the data writing module. And the data writing module receives the processed data and writes the processed data into the target position.
In some embodiments, the packetizing the data to be processed to the data encoding module or the data decoding module according to the data type of the data to be processed includes: when the data to be processed is binary data, splitting the data to be processed according to a data frame format provided by the interface control file ICD configuration management module, and acquiring frame identifiers and split data to be processed corresponding to each frame identifier. And sending the frame identification and the split data to be processed corresponding to each frame identification to a data decoding module.
In some embodiments, the data encoding module or the data decoding module processes the received data to be processed and sends the processed data to the data writing module, including: and the data decoding module acquires the binary data packet from the data loading module and matches the corresponding ICD according to the frame identifier. And analyzing the binary data packet according to the ICD, and sending an analyzed result to the data writing module.
In some embodiments, parsing the binary data packet according to the ICD and sending the parsed result to the data writing module includes:
generating ICD configuration information through an ICD configuration management module, wherein the ICD configuration information comprises the attribute of each field in the ICD. And the data loading module acquires a pre-stored data packet with format information, extracts a frame identifier and matches the ICD. And acquiring a data size end conversion interface according to the matched end mode attribute in the ICD. And traversing each field in the ICD in sequence, and calling a size end conversion interface to convert binary data into a numerical value according to the attribute of each field in the ICD. The physical value is calculated from the attributes of each field in the ICD. Traversing all fields, the binary data decoding is completed.
In some embodiments, the packetizing the data to be processed to the data encoding module or the data decoding module according to the data type of the data to be processed includes: and when the data to be processed is formatted data, reading the data to be processed by taking a data packet as a unit and sending the data to be processed to the data encoding module.
In some embodiments, the data encoding module or the data decoding module processes the received data to be processed and sends the processed data to the data writing module, including: the data coding module codes the received data to be processed into a binary data stream according to a preset ICD, and sends the binary data stream to the data writing module.
In some embodiments, the data encoding module encodes the received data to be processed into a binary data stream according to a preset ICD, including: generating ICD configuration information through an ICD configuration management module, wherein the ICD configuration information comprises the attribute of each field in the ICD. And the data loading module acquires a pre-stored data packet with format information, extracts the frame identifier and matches the ICD. And acquiring a data size end conversion interface according to the matched end mode attribute in the ICD. And traversing each field in the ICD in turn, and converting the physical quantity into an original value according to the attribute of each field in the ICD. And calling an end mode conversion interface to convert the original value into binary data. Traversing all fields, generating a binary data packet.
According to a second aspect of the present disclosure, there is provided a data encoding and decoding apparatus, including: and the data loading module is used for reading the data to be processed, and the data to be processed comprises binary data or formatted data. And the data loading module is also used for sending the data to be processed to the data coding module or the data decoding module in a packet mode according to the data type of the data to be processed. And the data coding module or the data decoding module is used for processing the received data to be processed and sending the processed data to the data writing module. And the data writing module is used for receiving the processed data and writing the processed data into the target position.
In some embodiments, the data loading module is specifically configured to, when the to-be-processed data is binary data, split the to-be-processed data according to a data frame format provided by the interface control file ICD configuration management module, and acquire the frame identifiers and the to-be-processed data after splitting corresponding to each frame identifier. And sending the frame identification and the split data to be processed corresponding to each frame identification to a data decoding module.
In some embodiments, the data decoding module is specifically configured to obtain the binary data packet from the data loading module, and match the corresponding ICD according to the frame identifier. And analyzing the binary data packet according to the ICD, and sending an analyzed result to the data writing module.
In some embodiments, the data decoding module is specifically configured to generate ICD configuration information via the ICD configuration management module, the ICD configuration information including attributes of each field in the ICD. And the data loading module acquires a pre-stored data packet with format information, extracts a frame identifier and matches the ICD. And acquiring a data size end conversion interface according to the matched end mode attribute in the ICD. And traversing each field in the ICD in sequence, and calling a size end conversion interface to convert binary data into a numerical value according to the attribute of each field in the ICD. The physical value is calculated from the attributes of each field in the ICD. All fields are traversed and the binary data decoding is completed.
In some embodiments, the data loading module is specifically configured to, when the data to be processed is formatted data, read the data to be processed in units of data packets and send the data to be processed to the data encoding module.
In some embodiments, the data encoding module is specifically configured to encode the received data to be processed into a binary data stream according to a preset ICD, and send the binary data stream to the data writing module.
In some embodiments, the data encoding module is specifically configured to generate ICD configuration information through the ICD configuration management module, where the ICD configuration information includes an attribute of each field in the ICD. And the data loading module acquires a pre-stored data packet with format information, extracts the frame identifier and matches the ICD. And acquiring a data size end conversion interface according to the matched end mode attribute in the ICD. And traversing each field in the ICD in turn, and converting the physical quantity into an original value according to the attribute of each field in the ICD. And calling an end mode conversion interface to convert the original value into binary data. And traversing all the fields to generate a binary data packet.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as provided by the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform the method provided according to the first aspect.
According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the method provided according to the first aspect.
The invention constructs a universal onboard system formatted data coding and decoding method, can configure the ICD data format of the data block in a graphical mode, and can directly realize the interconversion between the physical value and the binary data by means of the data type, resolution, offset, unit and other extended attributes recorded in the ICD, thereby saving the workload of the traditional manual code conversion; the virtual computer or the physical computer in two end modes is used for converting the data of the large end and the small end respectively, so that the traditional step of manually converting the byte order is omitted, and the data processing efficiency is greatly improved; the invention supports processing real-time data stream and stored data file through good module division and architecture design, can deal with various use scenes, can improve the execution efficiency of the system through distributed deployment of each module, and shortens the time of the formatted data coding and decoding of the airborne system.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flowchart of a data encoding and decoding method according to an embodiment of the disclosure;
fig. 2 is a schematic system structure diagram of a data encoding and decoding method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart illustrating the operation of a data encoding module in a data encoding and decoding method according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart illustrating the operation of a data decoding module in a data encoding and decoding method according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of system distributed deployment of a data encoding and decoding method according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram illustrating a data encoding and decoding apparatus according to an embodiment of the disclosure;
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure.
Detailed description of the preferred embodiments
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In a modern airplane, different data transmission buses exist in an airborne system, in the data transmission process, a source node needs to encode source data into a word/byte form which can be transmitted by the buses, and after transmission of a plurality of intermediate nodes in the buses, a destination node needs to decode the data into original data volume, so that a user can conveniently check and operate the data. In the prior art, interface Control Document (ICD) definition forms of different data transmission buses are different, data encoding and decoding methods are also different, and data needs to be converted by a plurality of groups of different Interface configuration files in the whole transmission process, so that the universality and flexibility of data encoding and decoding are poor, and the efficiency is low. In the design of interface configuration files, due to the limitation of bus protocols, data representation ranges, resolutions or units, physical quantities often need to be converted in a certain form to be transmitted through a data bus, so that the conversion of the physical quantities and the data quantities also needs to be supported in the data encoding and decoding process.
In the prior art, if the data size end mode is different from the local machine, the data size end mode is usually converted in a manner of manually coding and exchanging byte sequences, and although the problem can be solved, the performance is low, and the method is particularly obvious under the condition of large data quantity.
Therefore, the application provides a data coding and decoding method, which comprises the following steps: and reading the data to be processed through a data loading module, wherein the data to be processed comprises binary data or formatted data. And according to the data type of the data to be processed, the data to be processed is sent to a data encoding module or a data decoding module in a packet mode. The data coding module or the data decoding module processes the received data to be processed and sends the processed data to the data writing module. And the data writing module receives the processed data and writes the processed data into the target position.
Compared with the prior art, the invention constructs a universal airborne system formatted data coding and decoding method, can configure the ICD data format of the data block in a graphical mode, can directly realize the interconversion of the physical value and the binary data by virtue of the data type, the resolution, the offset, the unit and other extension attributes recorded in the ICD, and saves the workload of the traditional manual code conversion; the virtual computer or the physical computer in two end modes is used for converting the data of the large end and the small end respectively, so that the traditional step of manually converting the byte order is omitted, and the data processing efficiency is greatly improved; the invention supports processing real-time data stream and stored data file through good module division and architecture design, can deal with various use scenes, can improve the execution efficiency of the system through distributed deployment of each module, and shortens the time of the formatted data coding and decoding of the airborne system.
Fig. 1 is a schematic flowchart of a data encoding and decoding method according to an embodiment of the present disclosure. Fig. 2 is a schematic system structure diagram of a data encoding and decoding method according to an embodiment of the present disclosure. The method can be applied to electronic equipment, and the electronic equipment can be a server or an onboard computer and the like. The present disclosure is not so limited.
The data coding and decoding method provided by the invention with reference to fig. 1 is a general onboard system formatted data coding and decoding method. The system applying the data coding and decoding method comprises the following steps: the ICD configuration management module, the data loading module, the data encoding module, the data decoding module, the data end mode conversion module and the data writing module.
Referring to fig. 2, the data encoding and decoding method includes:
and S110, reading data to be processed through a data loading module, wherein the data to be processed comprises binary data or formatted data.
And S120, according to the data type of the data to be processed, the data to be processed is sent to the data coding module or the data decoding module in a packet mode.
In some embodiments, the data loading module is configured to obtain a data packet in a data stream or a data file, extract a frame identifier according to a preset rule, and send the frame identifier and the data packet to the data encoding or data decoding module.
S130, the data coding module or the data decoding module processes the received data to be processed and sends the processed data to the data writing module.
In some embodiments, the data encoding module is configured to encode the configuration information according to a data format to generate a corresponding binary data stream, which is often used for data simulation and excitation of an airborne system.
In some embodiments, the data decoding module is configured to decode a binary data stream or a data record file according to the data format configuration information, generate a structural data stream with format information, and send the structural data stream to the data writing module.
S140, the data writing module receives the processed data and writes the processed data into the target position.
In some embodiments, the data writing module is configured to receive a result of the data encoding and decoding module, and write the processed result into a binary data stream as needed, and send the binary data stream to another module, or directly store the binary data stream in a data file or a database.
In this embodiment, the data loading module is used to read binary data or formatted data and send it in packets to the data encoding or data decoding module. For a binary data stream/file, the original data needs to be split according to the data frame format provided by the ICD configuration management module, a frame identifier is obtained, and then the frame identifier is sent to the data decoding module. For formatted data streams/files, data is read in data packet units and sent to a data encoding module. The data encoding module is used for encoding the raw data into a binary data stream according to the known ICD. The data decoding module is used for acquiring the binary data packet from the data loading module, matching the corresponding ICD according to the frame identifier, then analyzing the binary data packet and sending the analyzed result to the data writing module. The data end mode conversion module is used for calling a corresponding end mode computer to convert according to the size end format of the data field, and the conversion speed of different end mode data is improved by utilizing the hardware characteristic of the computer. The ICD configuration management module is used for providing the ICD configuration information for other modules to use through the information such as the data structure, the data type, the resolution and the like of the configuration data block of the graphical configuration interface and storing the information as the configuration file, and the ICD configuration management module is provided with a file adapter and can load the existing ICD file formats. The data writing module is used for receiving the data packet after data coding or decoding and writing the data packet into a data file, a database or a data stream.
In some embodiments, the packetizing the data to be processed to the data encoding module or the data decoding module according to the data type of the data to be processed includes: when the data to be processed is binary data, splitting the data to be processed according to a data frame format provided by the interface control file ICD configuration management module, and acquiring frame identifiers and the split data to be processed corresponding to each frame identifier. And sending the frame identification and the split data to be processed corresponding to each frame identification to a data decoding module.
In some embodiments, the ICD configuration management module is configured to graphically configure data structures and field attributes of data blocks, where the data blocks are organized in a form of a tree list, support multiple types such as objects, arrays, and complexes, and support basic data types (int 8_ t, unt 8_ t, int16_ t, int32_ t, int64_ t, float, and double), bit fields, character strings, and the like, and the supported attributes include names, types, lengths, offsets, end patterns, encoding modes, maximum values, minimum values, physical maximum values, physical minimum values, resolution, offsets, units, default values, and the like; the ICD configuration information can generate a data structure for other modules to use, and can also be stored in a file, and the supported file format is XML or JSON and the like.
In some embodiments, the data encoding module or the data decoding module processes the received data to be processed and sends the processed data to the data writing module, including: and the data decoding module acquires the binary data packet from the data loading module and matches the corresponding ICD according to the frame identifier. And analyzing the binary data packet according to the ICD, and sending the analyzed result to the data writing module.
In some embodiments, the packetizing the data to be processed to the data encoding module or the data decoding module according to the data type of the data to be processed includes: and when the data to be processed is formatted data, reading the data to be processed by taking a data packet as a unit and sending the data to be processed to the data encoding module.
In some embodiments, the data encoding module or the data decoding module processes the received data to be processed, and sends the processed data to the data writing module, including: the data coding module codes the received data to be processed into binary data streams according to a preset ICD, and sends the binary data streams to the data writing module.
Preferably, each module in the onboard system formatted data encoding and decoding method has a distributed deployment function, and each module can be deployed on one or more virtual machines or physical computers as required.
Preferably, message queues are used for data exchange among the modules so as to ensure ordered and efficient data transmission.
Preferably, the data loading module supports loading binary data in the form of a data file or a data stream.
Preferably, the data loading module supports loading decoded data in the form of a data file or a character stream.
Preferably, the data side mode conversion module comprises at least 2 virtual machines or physical computers with different side modes, wherein the large side mode virtual machine or physical computer provides a conversion interface of the large side mode binary data and the data value, and the small side mode virtual machine or physical computer provides a conversion interface of the small side mode binary data and the data value.
Preferably, the ICD configuration management module is provided with a graphical configuration interface and organizes data blocks in a form of a tree list, the data blocks support nesting and are used for constructing a complex data format, and the configuration information support storage in a file form and also support importing of configuration information from a file to generate a visualization page.
Preferably, the ICD configuration management module is provided with a file adapter, and can identify and load several existing ICD file formats, extract key information, and generate an ICD configuration file.
Preferably, the ICD configuration management module supports basic data types, bit fields, character strings, arrays, structures, associations and composite data types composed of the above types, and supported attributes include, but are not limited to, name, type, length, byte offset, end mode, encoding mode, maximum value, minimum value, physical maximum value, physical minimum value, resolution, offset, unit and default value.
Preferably, the data encoding module matches an ICD according to a frame identifier in the data, selects a data conversion interface according to an end mode attribute, determines a conversion rule according to information such as a data type and a resolution, traverses data blocks layer by layer in a recursive manner, encodes the data blocks into a binary byte stream, and sends the binary byte stream to the data writing module.
Fig. 3 is a schematic flowchart of the work of a data encoding module in a data encoding and decoding method according to an embodiment of the present disclosure. Fig. 4 is a schematic flowchart of the operation of a data decoding module in a data encoding and decoding method according to an embodiment of the present disclosure.
In some embodiments, referring to fig. 3, the data encoding module encodes the received data to be processed into a binary data stream according to a preset ICD, including:
s210, generating ICD configuration information through an ICD configuration management module, wherein the ICD configuration information comprises the attribute of each field in the ICD.
S220, the data loading module obtains a pre-stored data packet with format information, extracts a frame identifier and matches the ICD.
And S230, acquiring a data size end conversion interface according to the matched end mode attribute in the ICD.
S240, traversing each field in the ICD in sequence, and converting the physical quantity into an original value according to the attribute of each field in the ICD.
And S250, calling an end mode conversion interface to convert the original value into binary data.
And S260, traversing all the fields to generate a binary data packet.
In some embodiments, referring to fig. 4, parsing the binary data packet according to the ICD and sending the parsed result to the data writing module includes:
s310, ICD configuration information is generated through an ICD configuration management module, and the ICD configuration information comprises the attribute of each field in the ICD.
S320, the data loading module acquires the pre-stored data packet with format information, extracts the frame identification and matches the ICD.
And S330, acquiring a data size end conversion interface according to the matched end mode attribute in the ICD.
S340, traversing each field in the ICD in sequence, and calling a size end conversion interface to convert binary data into a numerical value according to the attribute of each field in the ICD.
And S350, calculating a physical value according to the attribute of each field in the ICD.
And S360, traversing all the fields, and finishing the decoding of the binary data.
Preferably, the data writing module receives the result data after encoding/decoding and writes the result data into a target system, and the target system may be a data stream, a data file or a database.
In some embodiments, the data end mode conversion module is used to provide a conversion interface between the big end data value and the small end data value and the binary data, and typically comprises 2 or more virtual computers or physical computers with different end modes. The computer in the big-end mode provides a conversion interface of big-end data and binary data, and the computer in the small-end mode provides a conversion interface of small-end data and binary data, so that the conversion process is simplified into an assignment process, the overhead of byte order conversion is saved, and the efficiency is improved more obviously when the data volume is larger.
Fig. 5 is a schematic diagram of system distributed deployment of a data encoding and decoding method according to an embodiment of the present disclosure.
As shown in fig. 5, all modules shown in fig. 1 may be independently deployed to support the coding and decoding requirements of a large data flow or a large file, and may also be deployed in one computer, which saves cost; the two computers with different end modes required by the data end mode conversion module can adopt two physical computers, and also can deploy two virtual machines with different end modes in one physical computer.
The invention constructs a universal airborne system formatted data coding and decoding method by matching the processes, can configure the data format of the data block in a graphical mode, can directly realize the interconversion of the physical value and the binary data by virtue of the data type, the resolution, the offset, the unit and other extension attributes recorded in the data format, and saves the workload of the traditional manual code conversion; the virtual computer or the physical computer in two end modes is used for converting the data of the large end and the small end respectively, so that the traditional step of manually converting the byte order is omitted, and the data processing efficiency is greatly improved; the invention supports processing real-time data stream and stored data file through good module division and architecture design, can deal with various use scenes, can improve the execution efficiency of the system through distributed deployment of each module, and shortens the time of the formatted data coding and decoding of the airborne system.
In an exemplary embodiment, an embodiment of the present disclosure further provides a data encoding and decoding apparatus, which can be used to implement the data encoding and decoding method provided in the foregoing embodiment.
Fig. 6 is a schematic composition diagram of a data encoding and decoding apparatus according to an embodiment of the disclosure.
As shown in fig. 6, the apparatus may include:
and the data loading module 61 is configured to read data to be processed, where the data to be processed includes binary data or formatted data. The data loading module 61 is further configured to send the data to be processed to the data encoding module 62 or the data decoding module 63 in packets according to the data type of the data to be processed. And the data coding module or the data decoding module is used for processing the received data to be processed and sending the processed data to the data writing module. And a data writing module 64, configured to receive the processed data and write the processed data into the target location.
In some embodiments, the data loading module 61 is specifically configured to, when the data to be processed is binary data, split the data to be processed according to a data frame format provided by the interface control file ICD configuration management module, and acquire the frame identifier and the split data to be processed corresponding to each frame identifier. And sending the frame identification and the split data to be processed corresponding to each frame identification to a data decoding module.
In some embodiments, the data decoding module 63 is specifically configured to obtain the binary data packet from the data loading module, and match the corresponding ICD according to the frame identifier. And analyzing the binary data packet according to the ICD, and sending an analyzed result to the data writing module.
In some embodiments, the data decoding module 63 is specifically configured to generate ICD configuration information through the ICD configuration management module, the ICD configuration information including attributes of each field in the ICD. And the data loading module acquires a pre-stored data packet with format information, extracts the frame identifier and matches the ICD. And acquiring a data size end conversion interface according to the matched end mode attribute in the ICD. And traversing each field in the ICD in sequence, and calling a size end conversion interface to convert the binary data into numerical values according to the attribute of each field in the ICD. The physical value is calculated from the attributes of each field in the ICD. All fields are traversed and the binary data decoding is completed.
In some embodiments, the data loading module 61 is specifically configured to, when the data to be processed is formatted data, read the data to be processed in units of data packets and send the data to be processed to the data encoding module.
In some embodiments, the data encoding module 62 is specifically configured to encode the received data to be processed into a binary data stream according to a preset ICD, and send the binary data stream to the data writing module.
In some embodiments, the data encoding module 62 is specifically configured to generate ICD configuration information through the ICD configuration management module, where the ICD configuration information includes attributes of each field in the ICD. And the data loading module acquires a pre-stored data packet with format information, extracts the frame identifier and matches the ICD. And acquiring a data size end conversion interface according to the matched end mode attribute in the ICD. And traversing each field in the ICD in turn, and converting the physical quantity into an original value according to the attribute of each field in the ICD. And calling an end mode conversion interface to convert the original value into binary data. Traversing all fields, generating a binary data packet.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
An electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method as provided in the above embodiments.
In an exemplary embodiment, the readable storage medium may be a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method according to the above embodiments.
In an exemplary embodiment, the computer program product comprises a computer program which, when executed by a processor, implements a method according to the provision in the above embodiments.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure.
Electronic devices are intended to represent various forms of digital computers, such as, for example, in-car computers, laptop computers, tablet computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the electronic device 700 includes a computing unit 701, which may perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic device 700 can be stored. The calculation unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
A number of components in the electronic device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the electronic device 700 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The computing unit 701 performs the respective methods and processes described above, such as a page rendering method. For example, in some embodiments, the page rendering method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 700 via the ROM 702 and/or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the page rendering method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the data codec method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server combining a blockchain.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (7)

1. A method for encoding and decoding data, the method comprising:
reading data to be processed through a data loading module, wherein the data to be processed comprises binary data or formatted data;
according to the data type of the data to be processed, the data to be processed is sent to a data coding module or a data decoding module in a packet mode;
the data coding module or the data decoding module processes the received data to be processed and sends the processed data to the data writing module;
the data writing module receives the processed data and writes the processed data into a target position;
the sending the data to be processed to a data encoding module or a data decoding module in packets according to the data type of the data to be processed includes:
when the data to be processed is binary data, splitting the data to be processed according to a data frame format provided by an interface control file ICD configuration management module, and acquiring frame identifications and split data to be processed corresponding to each frame identification;
sending the frame identification and the split data to be processed corresponding to each frame identification to the data decoding module;
the data coding module or the data decoding module processes the received data to be processed and sends the processed data to the data writing module, and the data coding module or the data decoding module comprises:
the data decoding module acquires a binary data packet from the data loading module and matches a corresponding ICD according to the frame identifier;
analyzing the binary data packet according to the ICD, and sending an analyzed result to a data writing module;
the parsing the binary data packet according to the ICD and sending a parsed result to a data writing module includes:
generating ICD configuration information through an ICD configuration management module, wherein the ICD configuration information comprises the attribute of each field in the ICD;
the data loading module acquires a pre-stored data packet with format information, extracts a frame identifier and matches an ICD;
acquiring a data size end conversion interface according to the matched end mode attribute in the ICD;
sequentially traversing each field in the ICD, and calling a size end conversion interface to convert binary data into a numerical value according to the attribute of each field in the ICD;
calculating a physical value according to the attribute of each field in the ICD;
traversing all fields, the binary data decoding is completed.
2. The method according to claim 1, wherein the packetizing the data to be processed to a data encoding module or a data decoding module according to the data type of the data to be processed comprises:
and when the data to be processed is formatted data, reading the data to be processed by taking a data packet as a unit and sending the data to be processed to the data coding module.
3. The method according to claim 2, wherein the data encoding module or the data decoding module processes the received data to be processed and sends the processed data to a data writing module, and the method comprises:
and the data coding module codes the received data to be processed into binary data streams according to a preset ICD, and sends the binary data streams to a data writing module.
4. The method according to claim 2, wherein the data encoding module encodes the received data to be processed into a binary data stream according to a preset ICD, comprising:
generating ICD configuration information through an ICD configuration management module, wherein the ICD configuration information comprises the attribute of each field in the ICD;
the data loading module acquires a pre-stored data packet with format information, extracts a frame identifier and matches an ICD;
acquiring a data size end conversion interface according to the matched end mode attribute in the ICD;
sequentially traversing each field in the ICD, and converting the physical quantity into an original value according to the attribute of each field in the ICD;
calling an end mode conversion interface to convert the original value into binary data;
and traversing all the fields to generate the binary data packet.
5. An apparatus for encoding and decoding data, the apparatus comprising:
the data loading module is used for reading data to be processed, and the data to be processed comprises binary data or formatted data;
the data loading module is further configured to send the to-be-processed data to a data encoding module or a data decoding module in packets according to the data type of the to-be-processed data;
the data coding module or the data decoding module is used for processing the received data to be processed and sending the processed data to the data writing module;
the data writing module is used for receiving the processed data and writing the processed data into a target position;
the data loading module is specifically configured to split the data to be processed according to a data frame format provided by an interface control file ICD configuration management module when the data to be processed is binary data, and acquire frame identifiers and the split data to be processed corresponding to each frame identifier;
sending the frame identification and the split data to be processed corresponding to each frame identification to the data decoding module;
the data decoding module is specifically used for acquiring a binary data packet from the data loading module by the data decoding module and matching the corresponding ICD according to the frame identifier;
analyzing the binary data packet according to the ICD, and sending an analyzed result to a data writing module;
the data decoding module is specifically configured to generate ICD configuration information through the ICD configuration management module, where the ICD configuration information includes an attribute of each field in the ICD;
the data loading module acquires a pre-stored data packet with format information, extracts a frame identifier and matches the ICD;
acquiring a data size end conversion interface according to the matched end mode attribute in the ICD;
sequentially traversing each field in the ICD, and calling a size end conversion interface to convert binary data into a numerical value according to the attribute of each field in the ICD;
calculating a physical value according to the attribute of each field in the ICD;
traversing all fields, the binary data decoding is completed.
6. An electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
7. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method according to any one of claims 1-4.
CN202211427602.6A 2022-11-15 2022-11-15 Data encoding and decoding method and device, electronic equipment and readable storage medium Active CN115604365B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211427602.6A CN115604365B (en) 2022-11-15 2022-11-15 Data encoding and decoding method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211427602.6A CN115604365B (en) 2022-11-15 2022-11-15 Data encoding and decoding method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN115604365A CN115604365A (en) 2023-01-13
CN115604365B true CN115604365B (en) 2023-03-10

Family

ID=84852758

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211427602.6A Active CN115604365B (en) 2022-11-15 2022-11-15 Data encoding and decoding method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115604365B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116932626B (en) * 2023-07-27 2024-04-02 北京和德宇航技术有限公司 Data analysis method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131403A (en) * 2019-12-06 2020-05-08 深圳猛犸电动科技有限公司 Message coding and decoding method and device for Internet of things equipment
CN113778449A (en) * 2021-08-31 2021-12-10 西南电子技术研究所(中国电子科技集团公司第十研究所) Avionics interface data adaptation conversion system
CN115237853A (en) * 2021-04-22 2022-10-25 腾讯科技(深圳)有限公司 Data query method and device, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200293528A1 (en) * 2019-03-11 2020-09-17 Examination Management Services, Inc. Systems and methods for automatically generating structured output documents based on structural rules
CN111161883A (en) * 2019-12-31 2020-05-15 杭州知盛数据科技有限公司 Disease prediction system based on variational self-encoder and electronic equipment thereof
CN111694889A (en) * 2020-06-12 2020-09-22 百度在线网络技术(北京)有限公司 Data processing method and device, electronic equipment and readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111131403A (en) * 2019-12-06 2020-05-08 深圳猛犸电动科技有限公司 Message coding and decoding method and device for Internet of things equipment
CN115237853A (en) * 2021-04-22 2022-10-25 腾讯科技(深圳)有限公司 Data query method and device, electronic equipment and storage medium
CN113778449A (en) * 2021-08-31 2021-12-10 西南电子技术研究所(中国电子科技集团公司第十研究所) Avionics interface data adaptation conversion system

Also Published As

Publication number Publication date
CN115604365A (en) 2023-01-13

Similar Documents

Publication Publication Date Title
CN111523001B (en) Method, device, equipment and storage medium for storing data
CN110263277B (en) Page data display method, page data updating device, page data equipment and storage medium
CN115604365B (en) Data encoding and decoding method and device, electronic equipment and readable storage medium
CN115208414B (en) Data compression method, data compression device, computer device and storage medium
CN112466285A (en) Offline voice recognition method and device, electronic equipment and storage medium
US9595976B1 (en) Folded integer encoding
CN115567589A (en) Compression transmission method, device, equipment and storage medium of JSON data
US11562241B2 (en) Data output method, data acquisition method, device, and electronic apparatus
CN113641829A (en) Method and device for training neural network of graph and complementing knowledge graph
CN114937478B (en) Method for training a model, method and apparatus for generating molecules
CN115904240A (en) Data processing method and device, electronic equipment and storage medium
CN113518088B (en) Data processing method, device, server, client and medium
CN114579311A (en) Method, apparatus, device and storage medium for executing distributed computing task
CN114282141A (en) Processing method and device for compression format data, electronic equipment and readable storage medium
CN116863949A (en) Communication receiving method and device thereof
CN114218313A (en) Data management method, device, electronic equipment, storage medium and product
CN113760343A (en) Method and device for processing service request
CN114528444B (en) Graph data processing method and device, electronic equipment and storage medium
CN113641520B (en) Data processing method, system, device and storage medium
CN114448802B (en) Gateway configuration method, device, electronic equipment and storage medium
CN115982206B (en) Method and device for processing data
CN113762510B (en) Data processing method and device for target model, electronic equipment and medium
CN116560847B (en) Task processing method, device, electronic equipment and storage medium
CN115965018B (en) Training method of information generation model, information generation method and device
CN115001628A (en) Data encoding method and device, data decoding method and device and data structure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant