CN114327237A - Method, device and equipment for decoding real-time data by using upper computer - Google Patents

Method, device and equipment for decoding real-time data by using upper computer Download PDF

Info

Publication number
CN114327237A
CN114327237A CN202111534399.8A CN202111534399A CN114327237A CN 114327237 A CN114327237 A CN 114327237A CN 202111534399 A CN202111534399 A CN 202111534399A CN 114327237 A CN114327237 A CN 114327237A
Authority
CN
China
Prior art keywords
data
decoding
upper computer
acquisition card
real
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
CN202111534399.8A
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.)
China University of Geosciences
Original Assignee
China University of Geosciences
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 China University of Geosciences filed Critical China University of Geosciences
Priority to CN202111534399.8A priority Critical patent/CN114327237A/en
Publication of CN114327237A publication Critical patent/CN114327237A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention provides a method, a device and equipment for decoding real-time data by using an upper computer, wherein the method comprises the following steps: acquiring a coding rule; loading a control function of the data acquisition card; setting acquisition parameters according to the encoding rule; circularly acquiring target data according to the acquisition parameters and the control function; performing data grouping on target data according to an encoding rule; each group of data is converted into decimal number, and after the decoding is finished, the decoded data can be subjected to subsequent operation according to the requirement. The invention can adjust the parameters of the decoding program according to the coding rules of different data to be decoded, thereby realizing the real-time data decoding of any data to be decoded without manufacturing a hardware decoder, and solving the problems that the hardware decoder needs to be designed and manufactured in a long time and the manufactured hardware decoder has poor applicability in the prior art.

Description

Method, device and equipment for decoding real-time data by using upper computer
Technical Field
The present invention relates to the field of communications, and in particular, to a method, an apparatus, and a device for decoding real-time data using an upper computer.
Background
In data transmission, a method of serially outputting data acquired by a plurality of sensors in a specific coding mode is very common, and the method generally needs a hardware decoder corresponding to the coding mode to decode, and then uploads the decoded data to an upper computer for subsequent use. However, since a series of operations such as designing a circuit diagram, printing a circuit diagram, welding components, writing a decoding program, burning the decoding program, and the like are required to manufacture the hardware encoder, the process is complicated and time-consuming, and one hardware decoder only corresponds to one encoding mode, so that the applicability is not strong.
Disclosure of Invention
The invention provides a method, a device and equipment for decoding real-time data by using an upper computer, and aims to solve the technical problems that a hardware encoder is complex and time-consuming to manufacture and a coding method is single.
According to a first aspect of the present invention, there is provided a method for decoding real-time data by using an upper computer, comprising the following steps:
acquiring a coding rule;
loading a control function of the data acquisition card;
setting acquisition parameters according to the encoding rule;
circularly acquiring target data according to the acquisition parameters and the control function;
performing data grouping on the target data according to the coding rule;
each group of data is converted into decimal number, and after the decoding is finished, the decoded data can be subjected to subsequent operation according to the requirement.
Preferably, the step of acquiring target data further includes:
removing redundant data in the target data;
the elimination method is to take one bit of valid data every several data.
Preferably, the control function is configured to control the data acquisition card to start acquisition; the data acquisition card is also used for acquiring the data volume in the cache of the data acquisition card; the data acquisition card is also used for taking out the data in the cache of the data acquisition card; and the data acquisition card is also used for controlling the data acquisition card to stop acquisition.
Preferably, the acquisition parameters include acquisition frequency and range;
the acquisition frequency is 2 times or integral multiple of more than 2 times of the data transmission frequency of the data transmission equipment;
the data transmission frequency of the data transmission equipment is the number of bits of binary numbers output by the data transmission equipment per second;
the minimum value and the maximum value of the measuring range are the minimum value and the maximum value of the data to be decoded.
Preferably, the target data is a complete set of data between two adjacent sets of data headers.
The data head is a special binary number combination added before each group of data in order to distinguish each group of data in the encoding process.
According to the second aspect of the present invention, there is also provided a device for real-time data decoding by using an upper computer, the device for real-time data decoding by using an upper computer being used to implement any one of the methods for real-time data decoding by using an upper computer, the device for real-time data decoding by using an upper computer comprising the following modules:
the encoding rule obtaining module is used for obtaining an encoding rule;
the control function loading module is used for loading a control function of the data acquisition card;
the acquisition parameter setting module is used for setting acquisition parameters according to the coding rule;
the target data acquisition module is used for circularly acquiring target data according to the acquisition parameters and the control function;
the target data grouping module is used for carrying out data grouping on the target data according to the coding rule;
and the data conversion module is used for converting each group of data into decimal numbers respectively.
According to a third aspect of the present invention, there is also provided an apparatus for real-time data decoding by using an upper computer, including: an upper computer and a data acquisition card; the data acquisition card acquires data to be decoded according to a control instruction of an upper computer, and a data decoding program is stored on the upper computer and used for realizing the method for decoding the data in real time by using the upper computer.
The technical scheme provided by the invention has the following beneficial effects:
the method for decoding the real-time data by using the upper computer can adjust the parameters of the decoding program according to the coding rules of different data to be decoded, thereby realizing the real-time data decoding of any data to be decoded without manufacturing a hardware decoder, and solving the problems that the design and the manufacture of the hardware decoder need to be carried out in a long time and the manufactured hardware decoder has poor applicability in the prior art.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a schematic connection diagram of a real-time data decoding device using an upper computer according to an embodiment of the present invention;
fig. 2 is a data processing flow chart of a real-time data decoding method using an upper computer according to an embodiment of the present invention;
fig. 3 is a structural diagram of a real-time data decoding device using an upper computer according to an embodiment of the present invention;
description of the symbols: 1-sensor 1, 2-sensor 2, 3-sensor 3, 4-sensor 4, 5-sensor 5, 6-coding module, 7-data acquisition card, 8-upper computer.
Detailed Description
For a more clear understanding of the technical features, objects and effects of the present invention, embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
As shown in fig. 1, the method for decoding real-time data by using an upper computer provided by the present invention is implemented based on an apparatus for decoding real-time data by using an upper computer, and the apparatus mainly includes: a data acquisition card 7 and an upper computer 8;
the sensor 1, the sensor 2, the sensor 3, the sensor 4 and the sensor 5 are respectively and electrically connected with the input end of the coding module 6, the output end of the coding module 6 is electrically connected with the input end of the data acquisition card 7, and the output end of the data acquisition card 7 is electrically connected with the upper computer 8.
The coding module 6 codes the data measured by the sensor 1, the sensor 2, the sensor 3, the sensor 4 and the sensor 5 by a serial coding rule, and outputs the coded binary data in a high-low level mode; one such serial encoding mode is: respectively converting data measured by the sensors 1-5 into 16-bit binary numbers, adding 1-bit binary number '0' in front of each group of 16-bit binary numbers to form 17-bit binary numbers, sequentially connecting 5 groups of 17-bit binary numbers to obtain 85-bit binary number groups, placing the binary numbers '111111111111111' as data heads in front of the 85-bit binary number groups to obtain a group of 100-bit binary numbers, and thus finishing one group of data coding; the encoding module 6 transmits data through data transmission equipment at a data transmission frequency of 100 bits per second, the data acquisition card 7 acquires the data and transmits the data to the upper computer 8, and the upper computer 8 decodes the acquired data.
The decoding program in the upper computer 8 is written based on MATLAB software, and the processing flow is as shown in FIG. 2 and comprises the following steps:
loading a control function; the control function can be used for controlling the data acquisition card 7 to start acquisition, acquiring the data volume in the cache of the data acquisition card 7, taking out the data in the cache of the data acquisition card 7 and stopping the acquisition of the data acquisition card 7;
setting acquisition parameters; the acquisition parameters comprise acquisition frequency and measurement range; in order to improve the stability of data transmission, the acquisition frequency of the data acquisition card 7 is set to 1000Hz for data acquisition, so as to ensure that every 1-bit binary data output by the coding module 6 can be acquired by the data acquisition card 7 for 10 times; setting the range to 0-5 volts;
judging the data volume; when the judged data volume is larger than 2 times of the complete target data volume in the cache of the data acquisition card 7, the data can be ensured to contain a group of complete target data, the program can continue to run downwards, otherwise, the program circularly waits until the cache of the data acquisition card 7 has enough data; the complete target data volume is 1000 bits;
performing data grouping on target data, wherein the data grouping is a process of splitting data of a plurality of sensors which are arranged together in series into a plurality of groups of corresponding data in sequence; because the acquisition frequency of the data acquisition card is higher than the data transmission frequency of the serial data transmission equipment, the target data contains redundant data, and the redundant data needs to be eliminated; the data transmission frequency of the serial data transmission equipment is the number of bits of binary numbers output by the data transmission equipment per second; the quantity of the redundant data is determined by the acquisition frequency of the data acquisition card, and the higher the acquisition frequency of the data acquisition card is, the more stable the data transmission is and the more redundant data is; the elimination method is to take one bit of valid data every several data.
The steps of grouping data and eliminating redundant data are as follows:
1) preprocessing 2000-bit data retrieved from the cache of the data acquisition card 7 to enable the data higher than 2.5 volts to be equal to 1 and the data lower than 2.5 volts to be equal to 0;
2) searching a data head in the preprocessed data and outputting the position of the data head, wherein the acquisition frequency of the data acquisition card 7 is set to be 1000Hz which is 10 times of the data transmission frequency of the coding module 6, so that the data head is amplified by ten times and is 150 pieces of '1';
3) the 20 th to 170 th positions of the data taking head are a first group of data, the 190 th to 340 th positions of the data taking head are a second group of data, the 360 th to 510 th positions of the data taking head are a third group of data, the 530 th to 680 th positions of the data taking head are a fourth group of data, and the 700 th to 850 th positions of the data taking head are a fifth group of data;
4) starting to fetch the 5 th bit in each group of data, fetching 1 bit of data every 10 bits, and fetching 5 groups of 16-bit binary data;
converting binary data into decimal data, and storing the data to the local;
the decoding program in the upper computer 8 also has a termination function; the termination function may cause the program to jump out of the decoding loop and stop decoding.
In this embodiment, a specific operation flow of decoding by using the above-mentioned upper computer real-time data decoding method is as follows:
1) acquiring a coding rule of data to be decoded: the coding module 6 codes the data measured by the sensor 1, the sensor 2, the sensor 3, the sensor 4 and the sensor 5 by a serial coding rule, and outputs the coded binary data in a high-low level mode; one such serial encoding mode is: respectively converting data measured by the sensors 1-5 into 16-bit binary numbers, adding 1-bit binary number '0' in front of each group of 16-bit binary numbers to form 17-bit binary numbers, sequentially connecting 5 groups of 17-bit binary numbers to obtain 85-bit binary number groups, placing the binary numbers '111111111111111' as data heads in front of the 85-bit binary number groups to obtain a group of 100-bit binary numbers, and thus finishing one group of data coding; the coding module 6 transmits at a data transmission frequency of 100 bits of data per second.
2) And hardware connection: the output end of the coding module 6 is electrically connected with the input end of the data acquisition card 7, and the output end of the data acquisition card 7 is electrically connected with the upper computer 8.
3) And starting the upper computer 8 and a data decoding program.
4) And operating the data decoding program.
5) Inputting acquisition parameters in the program bullet frame; the acquisition parameters comprise acquisition frequency and measurement range; setting the acquisition frequency of the data acquisition card 7 to 1000Hz for data acquisition; the span is set to 0-5 volts.
6) And starting real-time decoding.
7) And if the decoding is to be stopped, the decoding is stopped and the loop is skipped.
8) And if the decoding is to be started again, repeating the steps 4) -7).
As shown in fig. 3, in this embodiment, a device for real-time data decoding by using an upper computer is further provided, where the device for real-time data decoding by using an upper computer is used to implement any one of the methods for real-time data decoding by using an upper computer, and the device for real-time data decoding by using an upper computer includes the following modules:
a coding rule obtaining module 001, configured to obtain a coding rule;
the control function loading module 002 is used for loading the control function of the data acquisition card;
the acquisition parameter setting module 003 is used for setting acquisition parameters according to the coding rule;
a target data acquisition module 004, configured to cyclically acquire target data according to the acquisition parameters and the control function;
a target data grouping module 005, configured to perform data grouping on the target data according to the encoding rule;
and a data conversion module 006, configured to convert each group of data into decimal numbers respectively.
The method, the device and the equipment for decoding the real-time data by using the upper computer can adjust the decoding program parameters according to the coding rules of different data to be decoded, thereby realizing the real-time data decoding of any data to be decoded without manufacturing a hardware decoder, and solving the problems that the design and the manufacture of the hardware decoder need to be carried out in a long time and the manufactured hardware decoder has poor applicability in the prior art.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third and the like do not denote any order, but rather the words first, second and the like may be interpreted as indicating any order.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A method for decoding real-time data by using an upper computer is characterized by comprising the following steps:
acquiring a coding rule;
loading a control function of the data acquisition card;
setting acquisition parameters according to the encoding rule;
circularly acquiring target data according to the acquisition parameters and the control function;
performing data grouping on the target data according to the coding rule;
and converting each group of data into decimal numbers respectively, and finishing decoding.
2. The method of real-time data decoding by using an upper computer according to claim 1, wherein the step of cyclically acquiring the target data further comprises:
and removing redundant data in the target data.
3. The method as claimed in claim 2, wherein the step of removing redundant data in the target data comprises:
every other number of data takes one bit of valid data.
4. The method according to claim 1, wherein the control function of the data acquisition card is used to control the data acquisition card to start acquisition; the data acquisition card is also used for acquiring the data volume in the cache of the data acquisition card; the data acquisition card is also used for taking out the data in the cache of the data acquisition card; and the data acquisition card is also used for controlling the data acquisition card to stop acquisition.
5. The method for real-time data decoding by using upper computer as claimed in claim 1, wherein the collecting parameters include collecting frequency and measuring range;
the acquisition frequency is 2 times or integral multiple of more than 2 times of the data transmission frequency of the data transmission equipment;
the data transmission frequency of the data transmission equipment is the number of bits of binary numbers output by the data transmission equipment per second;
the minimum value and the maximum value of the measuring range are the minimum value and the maximum value of the data to be decoded.
6. The method as claimed in claim 1, wherein the target data is a complete set of data between two adjacent data headers.
7. The method as claimed in claim 6, wherein the header is a special binary number combination added before each set of data in order to distinguish each set of data during the encoding process.
8. The device for decoding the real-time data by using the upper computer is used for realizing the method for decoding the real-time data by using the upper computer according to any one of claims 1 to 7, and comprises the following modules:
the encoding rule obtaining module is used for obtaining an encoding rule;
the control function loading module is used for loading a control function of the data acquisition card;
the acquisition parameter setting module is used for setting acquisition parameters according to the coding rule;
the target data acquisition module is used for circularly acquiring target data according to the acquisition parameters and the control function;
the target data grouping module is used for carrying out data grouping on the target data according to the coding rule;
and the data conversion module is used for converting each group of data into decimal numbers respectively and finishing decoding.
9. An apparatus for real-time data decoding using an upper computer, comprising: an upper computer and a data acquisition card; the data acquisition card acquires data to be decoded according to a control instruction of an upper computer, wherein a data decoding program is stored on the upper computer, and the data decoding program is used for realizing the method for decoding the data in real time by using the upper computer according to any one of claims 1 to 7.
CN202111534399.8A 2021-12-15 2021-12-15 Method, device and equipment for decoding real-time data by using upper computer Pending CN114327237A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111534399.8A CN114327237A (en) 2021-12-15 2021-12-15 Method, device and equipment for decoding real-time data by using upper computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111534399.8A CN114327237A (en) 2021-12-15 2021-12-15 Method, device and equipment for decoding real-time data by using upper computer

Publications (1)

Publication Number Publication Date
CN114327237A true CN114327237A (en) 2022-04-12

Family

ID=81053185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111534399.8A Pending CN114327237A (en) 2021-12-15 2021-12-15 Method, device and equipment for decoding real-time data by using upper computer

Country Status (1)

Country Link
CN (1) CN114327237A (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5835144A (en) * 1994-10-13 1998-11-10 Oki Electric Industry Co., Ltd. Methods of coding and decoding moving-picture signals, using self-resynchronizing variable-length codes
US6263497B1 (en) * 1997-07-31 2001-07-17 Matsushita Electric Industrial Co., Ltd. Remote maintenance method and remote maintenance apparatus
CN1435058A (en) * 2000-04-07 2003-08-06 卡纳尔技术股份有限公司 Apparatus and method for testing application program
US20040233994A1 (en) * 2003-05-22 2004-11-25 Lsi Logic Corporation Reconfigurable computing based multi-standard video codec
CN102624685A (en) * 2011-11-24 2012-08-01 广东高新兴通信股份有限公司 Encodable protocol processing method for intelligent equipment
CN103365814A (en) * 2013-06-27 2013-10-23 深圳市汇顶科技股份有限公司 Serial data transmission method and system
CN103546463A (en) * 2013-09-30 2014-01-29 国家电网公司 Additional-parameter transmission method and additional-parameter transmission device of integrated information platform and application system
CN104993503A (en) * 2015-08-11 2015-10-21 华北水利水电大学 Island microgrid frequency control method
CN109104405A (en) * 2018-06-28 2018-12-28 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Binary protocol coding, coding/decoding method and device
CN110796355A (en) * 2019-10-22 2020-02-14 江苏金陵智造研究院有限公司 Flexible job shop scheduling method based on dynamic decoding mechanism
CN113032652A (en) * 2019-12-25 2021-06-25 中文在线数字出版集团股份有限公司 Docker distributed webpage crawler method and system
CN113470316A (en) * 2021-05-24 2021-10-01 电子科技大学 Debris flow monitoring and early warning method based on self-coding single classification model
CN113596469A (en) * 2021-06-23 2021-11-02 天津津航计算技术研究所 Soft-hard combined and high-efficiency transmission video decoding method

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5835144A (en) * 1994-10-13 1998-11-10 Oki Electric Industry Co., Ltd. Methods of coding and decoding moving-picture signals, using self-resynchronizing variable-length codes
US6263497B1 (en) * 1997-07-31 2001-07-17 Matsushita Electric Industrial Co., Ltd. Remote maintenance method and remote maintenance apparatus
CN1435058A (en) * 2000-04-07 2003-08-06 卡纳尔技术股份有限公司 Apparatus and method for testing application program
US20040233994A1 (en) * 2003-05-22 2004-11-25 Lsi Logic Corporation Reconfigurable computing based multi-standard video codec
CN102624685A (en) * 2011-11-24 2012-08-01 广东高新兴通信股份有限公司 Encodable protocol processing method for intelligent equipment
CN103365814A (en) * 2013-06-27 2013-10-23 深圳市汇顶科技股份有限公司 Serial data transmission method and system
CN103546463A (en) * 2013-09-30 2014-01-29 国家电网公司 Additional-parameter transmission method and additional-parameter transmission device of integrated information platform and application system
CN104993503A (en) * 2015-08-11 2015-10-21 华北水利水电大学 Island microgrid frequency control method
CN109104405A (en) * 2018-06-28 2018-12-28 武汉船舶通信研究所(中国船舶重工集团公司第七二二研究所) Binary protocol coding, coding/decoding method and device
CN110796355A (en) * 2019-10-22 2020-02-14 江苏金陵智造研究院有限公司 Flexible job shop scheduling method based on dynamic decoding mechanism
CN113032652A (en) * 2019-12-25 2021-06-25 中文在线数字出版集团股份有限公司 Docker distributed webpage crawler method and system
CN113470316A (en) * 2021-05-24 2021-10-01 电子科技大学 Debris flow monitoring and early warning method based on self-coding single classification model
CN113596469A (en) * 2021-06-23 2021-11-02 天津津航计算技术研究所 Soft-hard combined and high-efficiency transmission video decoding method

Similar Documents

Publication Publication Date Title
US5936560A (en) Data compression method and apparatus performing high-speed comparison between data stored in a dictionary window and data to be compressed
CN103346800B (en) A kind of data compression method and device
US8134483B2 (en) Data processing apparatus and method
CN108282265B (en) Error correction encoding method, apparatus, device and computer readable storage medium
CN109522454B (en) Method for automatically generating web sample data
CN111131403A (en) Message coding and decoding method and device for Internet of things equipment
CN109598334A (en) A kind of sample generating method and device
CN113778408A (en) Building block code serialization method, device, system and medium
US20120139763A1 (en) Decoding encoded data
EP3065060A1 (en) Grammar generation for simple datatypes
CN104243095A (en) Code word type blind identification method for convolutional code and linear block code
CN114327237A (en) Method, device and equipment for decoding real-time data by using upper computer
CN111428442B (en) Data conversion method, system and storage medium without dictionary table
CN115882867B (en) Data compression storage method based on big data
CN114900195A (en) Safety state monitoring system for powder tanker
CN110909256B (en) Artificial intelligence information filtering system for computer
CN110942127B (en) Method, system and storage medium for encrypting reagent two-dimensional code information of medical instrument
WO2016131554A1 (en) Method and apparatus for adaptive data compression
CN110350922A (en) A kind of binary-coded addressing method and addressing device
CN111510159B (en) Intelligent coding method and coder following general information exchange protocol specification
CN110797082A (en) Method and system for storing and reading gene sequencing data
CN117272989B (en) Character encoding compression-based mask word recognition method, device, equipment and medium
CN116614138A (en) Coding compression and testing method for periodical digital waveform of digital tester
CN111628778B (en) Lossless compression method and device based on dynamic programming
CN117880030A (en) Channel coding identification method and system

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