Method, device and equipment for real-time data decoding using host computer

The upper computer obtains encoding rules and loading control functions, real-time data decoding of different encoding methods is realized, which solves the problems of cumbersome hardware encoder and lack of single applicability, and realizes efficient decoding of arbitrary encoded data.

CN114327237BActive Publication Date: 2024-12-27CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111534399.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2024-12-27
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

In the prior art, the production of hardware encoders is cumbersome and time-consuming, and the encoding method is single, and the applicability is not strong, making it difficult to realize real-time data decoding of different encoding methods.

Method used

The encoding rules are obtained through the upper computer, the control function of the data acquisition card is loaded, the acquisition parameters are set, the target data is obtained loopfully, and the data grouping and decimal conversion are carried out according to the encoding rules, real-time data decoding is realized, and redundant data is eliminated to improve decoding efficiency.

Benefits of technology

There is no need to create a hardware decoder, and data can be decoded in real time according to different encoding rules, improving decoding efficiency and applicability, simplifying the process and reducing production costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114327237B_ABST
    Figure CN114327237B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device and equipment for real-time data decoding using a host computer, the method comprising: obtaining coding rules; loading a control function of a data acquisition card; setting acquisition parameters according to the coding rules; cyclically acquiring target data according to the acquisition parameters and the control function; grouping the target data according to the coding rules; converting each group of data into decimal numbers, so that the decoding is completed, and subsequent operations can be performed on the decoded data as needed. The present invention can adjust the decoding program parameters according to different coding rules of the data to be decoded, thereby realizing real-time data decoding of any data to be decoded, without the need to produce a hardware decoder, and can solve the problem in the prior art that it takes a long time to design and produce a hardware decoder and the produced hardware decoder is not suitable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication, and in particular to a method, a device and equipment for real-time data decoding using a host computer. Background Art

[0002] In data transmission, it is very common to serially output the data collected by multiple sensors through a specific encoding method. This method generally requires a hardware decoder corresponding to the encoding method to decode, and then upload the decoded data to the host computer for subsequent use. However, since the production of hardware encoders requires a series of operations such as designing circuit diagrams, printing circuit diagrams, welding components, writing decoding programs, and burning decoding programs, the process is cumbersome and time-consuming, and one hardware decoder only corresponds to one encoding method, so it is not very applicable. Summary of the invention

[0003] In order to solve the technical problems that the production of hardware encoders is cumbersome and time-consuming and the encoding method is single, the present invention provides a method, device and equipment for real-time data decoding using a host computer.

[0004] According to a first aspect of the present invention, there is provided a method for real-time data decoding using a host computer, comprising the following steps:

[0005] Get the encoding rules;

[0006] Load the control function of the data acquisition card;

[0007] Setting acquisition parameters according to the encoding rules;

[0008] Looping to acquire target data according to the acquisition parameters and the control function;

[0009] Grouping the target data according to the encoding rule;

[0010] Convert each set of data into decimal numbers respectively. The decoding is now complete and subsequent operations can be performed on the decoded data as needed.

[0011] Preferably, the step of acquiring target data further includes:

[0012] Eliminating redundant data in the target data;

[0013] The elimination method is to take one valid data every several data.

[0014] Preferably, the control function is used to control the data acquisition card to start acquisition; to obtain the amount of data in the buffer of the data acquisition card; to retrieve the data in the buffer of the data acquisition card; and to control the data acquisition card to stop acquisition.

[0015] Preferably, the acquisition parameters include acquisition frequency and range;

[0016] The acquisition frequency is an integer multiple of 2 or more times the data transmission frequency of the data transmission device;

[0017] The data transmission frequency of the data transmission device is the number of bits of the binary number output by the data transmission device per second;

[0018] The minimum value and the maximum value of the range are the minimum value and the maximum value of the data to be decoded.

[0019] Preferably, the target data is a set of complete data between two adjacent sets of data headers.

[0020] The data header is a special binary number combination added before each group of data in order to distinguish each group of data during the encoding process.

[0021] According to a second aspect of the present invention, there is also provided a device for real-time data decoding using a host computer, the device for real-time data decoding using a host computer is used to implement any of the methods for real-time data decoding using a host computer, and the device for real-time data decoding using a host computer comprises the following modules:

[0022] A coding rule acquisition module, used to acquire coding rules;

[0023] Control function loading module, used to load the control function of the data acquisition card;

[0024] An acquisition parameter setting module, used to set acquisition parameters according to the encoding rules;

[0025] A target data acquisition module, used for cyclically acquiring target data according to the acquisition parameters and the control function;

[0026] A target data grouping module, used for grouping the target data according to the encoding rule;

[0027] The data conversion module is used for converting each set of data into decimal numbers.

[0028] According to the third aspect of the present invention, there is also provided a device for real-time data decoding using a host computer, comprising: a host computer and a data acquisition card; the data acquisition card acquires data to be decoded according to the control instructions of the host computer, and a data decoding program is stored on the host computer, and the data decoding program is used to implement the method for real-time data decoding using the host computer.

[0029] The technical solution provided by the present invention has the following beneficial effects:

[0030] The method for real-time data decoding using a host computer provided by the present invention can adjust decoding program parameters according to different encoding rules of the data to be decoded, thereby realizing real-time data decoding of any data to be decoded without the need to produce a hardware decoder. This can solve the problem in the prior art that it takes a long time to design and produce a hardware decoder and the produced hardware decoder has low applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:

[0032] Figure 1 A schematic diagram of a connection using a host computer real-time data decoding device provided by an embodiment of the present invention;

[0033] Figure 2 A data processing flow chart of a real-time data decoding method using a host computer provided in an embodiment of the present invention;

[0034] Figure 3 A structural diagram of a real-time data decoding device using a host computer provided in an embodiment of the present invention;

[0035] Explanation of symbols: 1-sensor 1, 2-sensor 2, 3-sensor 3, 4-sensor 4, 5-sensor 5, 6-encoding module, 7-data acquisition card, 8-host computer. DETAILED DESCRIPTION

[0036] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.

[0037] like Figure 1 As shown, the method for real-time data decoding using a host computer provided by the present invention is implemented based on a device for real-time data decoding using a host computer, and the device mainly includes: a data acquisition card 7 and a host computer 8;

[0038] Sensor 1 , sensor 2 , sensor 3 , sensor 4 and sensor 5 are electrically connected to the input end of the encoding module 6 , respectively; the output end of the encoding module 6 is electrically connected to the input end of the data acquisition card 7 , and the output end of the data acquisition card 7 is electrically connected to the host computer 8 .

[0039] The encoding module 6 encodes the data measured by the sensors 1, 2, 3, 4 and 5 according to a serial encoding rule, and outputs the encoded binary data in a high and low level mode; the serial encoding mode is: the data measured by the sensors 1-5 are respectively converted into 16-bit binary numbers, 1 binary number "0" is added before each group of 16-bit binary numbers to form a 17-bit binary number, 5 groups of 17-bit binary numbers are sequentially connected to obtain an 85-bit binary array, and the binary number "111111111111111" is used as a data header and placed before the 85-bit binary array to obtain a group of 100-bit binary numbers. At this point, a group of data encoding is completed; the encoding module 6 transmits through the data transmission device at a data transmission frequency of 100 bits per second, the data acquisition card 7 collects data and sends it to the host computer 8, and the host computer 8 decodes the acquired data.

[0040] The decoding program in the host computer 8 is written based on MATLAB software. The processing flow is as follows: Figure 2 As shown, including:

[0041] Loading control function; the control function can be used to control the data acquisition card 7 to start acquisition, obtain the amount of data in the data acquisition card 7 cache, take out the data in the data acquisition card 7 cache, and stop the data acquisition card 7 acquisition;

[0042] Set acquisition parameters; the acquisition parameters include acquisition frequency and 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 to ensure that each 1-bit binary data output by the encoding module 6 can be collected 10 times by the data acquisition card 7; set the range to 0-5 volts;

[0043] Determine the data volume; the data volume is determined when the data volume in the data acquisition card 7 cache is greater than 2 times the complete target data volume, it can be guaranteed that the data segment contains a complete set of target data, and the program can continue to run downward, otherwise it will loop and wait until there is sufficient data in the data acquisition card 7 cache; the complete target data volume is 1000 bits;

[0044] The target data is grouped, and the data grouping is a process of re-sequentially splitting the data of several sensors that have been arranged in series into several groups of corresponding data; since the acquisition frequency of the data acquisition card is higher than the data sending frequency of the serial data sending device, the target data contains redundant data and the redundant data needs to be eliminated; the data sending frequency of the serial data sending device is the number of bits of the binary number output by the data sending device per second; the amount 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, the more stable the data transmission and the more redundant data; the elimination method is to take one valid data every several data.

[0045] The steps for data grouping and removing redundant data are as follows:

[0046] 1) Preprocess the 2000-bit data retrieved from the data acquisition card 7 buffer, making the data above 2.5 volts equal to 1 and the data below 2.5 volts equal to 0;

[0047] 2) Find the data header in the preprocessed data and output the data header position. Since the acquisition frequency of the data acquisition card 7 is set to 1000 Hz, which is 10 times the data transmission frequency of the encoding module 6, the data header is amplified ten times, which is 150 "1"s;

[0048] 3) The 20th to 170th bits after the data header are taken as the first group of data, the 190th to 340th bits after the data header are taken as the second group of data, the 360th to 510th bits after the data header are taken as the third group of data, the 530th to 680th bits after the data header are taken as the fourth group of data, and the 700th to 850th bits after the data header are taken as the fifth group of data;

[0049] 4) Starting from the 5th bit in each group of data, take 1 bit of data every 10 bits, and obtain 5 groups of 16-bit binary data in total;

[0050] Convert binary data into decimal data and save the data locally;

[0051] The decoding program in the host computer 8 also has a termination function; the termination function can make the program jump out of the decoding loop and stop decoding.

[0052] In this embodiment, the specific operation process of decoding using the host computer real-time data decoding method provided above is as follows:

[0053] 1) Obtain the coding rule of the data to be decoded: the coding module 6 encodes the data measured by the sensor 1, sensor 2, sensor 3, sensor 4 and sensor 5 according to a serial coding rule, and outputs the encoded binary data in a high and low level mode; the serial coding mode is: the data measured by the sensors 1-5 are respectively converted into 16-bit binary numbers, and 1 binary number "0" is added before each group of 16-bit binary numbers to form a 17-bit binary number, and 5 groups of 17-bit binary numbers are sequentially connected to obtain an 85-bit binary array, and the binary number "111111111111111" is used as a data header and placed before the 85-bit binary array to obtain a group of 100-bit binary numbers. At this point, a group of data encoding is completed; the coding module 6 transmits at a data transmission frequency of 100 bits of data per second.

[0054] 2) Hardware connection: electrically connect the output end of the encoding module 6 to the input end of the data acquisition card 7 , and electrically connect the output end of the data acquisition card 7 to the host computer 8 .

[0055] 3) Start the host computer 8 and the data decoding program.

[0056] 4) Run the data decoding program.

[0057] 5) Input the acquisition parameters in the program pop-up box; the acquisition parameters include acquisition frequency and range; set the acquisition frequency of the data acquisition card 7 to 1000 Hz for data acquisition; set the range to 0-5 volts.

[0058] 6) Start real-time decoding.

[0059] 7) If you want to stop decoding, run stop decoding and jump out of the loop.

[0060] 8) To start decoding again, repeat steps 4)-7).

[0061] like Figure 3 As shown, in this embodiment, a device for real-time data decoding using a host computer is also provided, and the device for real-time data decoding using a host computer is used to implement any of the methods for real-time data decoding using a host computer, and the device for real-time data decoding using a host computer includes the following modules:

[0062] Coding rule acquisition module 001, used to acquire coding rules;

[0063] The control function loading module 002 is used to load the control function of the data acquisition card;

[0064] The acquisition parameter setting module 003 is used to set the acquisition parameters according to the encoding rules;

[0065] A target data acquisition module 004 is used to cyclically acquire target data according to the acquisition parameters and the control function;

[0066] The target data grouping module 005 is used to group the target data according to the encoding rule;

[0067] The data conversion module 006 is used to convert each set of data into a decimal number.

[0068] The method, device and equipment for real-time data decoding using a host computer provided by the present invention can adjust decoding program parameters according to different encoding rules of the data to be decoded, thereby realizing real-time data decoding of any data to be decoded without the need to produce a hardware decoder. This can solve the problem in the prior art that it takes a long time to design and produce a hardware decoder and the produced hardware decoder has low applicability.

[0069] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0070] The serial numbers of the embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments. In a unit claim that lists several means, several of these means may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order and these words may be interpreted as identifiers.

[0071] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for real-time data decoding using a host computer, characterized in that: The following steps are involved: Obtaining a coding rule; the coding module (6) encodes the data measured by the sensor (1), the sensor (2), the sensor (3), the sensor (4) and the sensor (5) according to a serial coding rule, and outputs the encoded binary data in a high-low level mode; the serial coding rule is: the data measured by the sensors (1)-(5) are respectively converted into 16-bit binary numbers, 1 binary number "0" is added before each group of 16-bit binary numbers to form a 17-bit binary number, 5 groups of 17-bit binary numbers are sequentially connected to obtain an 85-bit binary array, and the binary number "111111111111111" is used as a data header and placed before the 85-bit binary array to obtain a group of 100-bit binary numbers, so that a group of data encoding is completed; Loading a control function of the data acquisition card; the control function can be used to control the data acquisition card (7) to start acquisition, obtain the amount of data in the data acquisition card (7) cache, remove data in the data acquisition card (7) cache, and stop the data acquisition card (7) from acquiring; Setting acquisition parameters according to the coding rules; the acquisition parameters include acquisition frequency and range; Target data is acquired cyclically according to the acquisition parameters and the control function; when the amount of data in the cache of the data acquisition card (7) is greater than twice the amount of complete target data, it can be ensured that the data in the cache of the data acquisition card (7) contains a set of complete target data, and the program can continue to run downward, otherwise, the program waits cyclically until there is sufficient data in the cache of the data acquisition card (7); the amount of complete target data is 1000 bits; The target data is grouped and redundant data is removed according to the encoding rule; the removal method is to take one valid data bit every several data; the specific steps of data grouping and redundant data removal are: 1) Preprocess the 2000-bit data retrieved from the cache of the data acquisition card (7) to make the data with a range higher than the set threshold equal to 1 and the data with a range lower than the set threshold equal to 0; 2) Find the data header in the preprocessed data and output the data header position; 3) Take the 20th to 170th bits after the data header as the first group of data, take the 190th to 340th bits after the data header as the second group of data, take the 360th to 510th bits after the data header as the third group of data, take the 530th to 680th bits after the data header as the fourth group of data, and take the 700th to 850th bits after the data header as the fifth group of data; 4) Starting from the 5th bit in each group of data, take 1 bit of data every 10 bits, and get 5 groups of 16-bit binary data in total; Convert each set of data into decimal numbers and the decoding is completed.

2. The method for real-time data decoding using a host computer as claimed in claim 1, characterized in that: The acquisition parameters include acquisition frequency and range; The acquisition frequency is an integer multiple of 2 or more times the data transmission frequency of the data transmission device; The data transmission frequency of the data transmission device is the number of bits of the binary number output by the data transmission device per second; The minimum value and the maximum value of the range are the minimum value and the maximum value of the data to be decoded.

3. A device for real-time data decoding using a host computer, characterized in that: The device for real-time data decoding using a host computer is used to implement the method for real-time data decoding using a host computer as described in any one of claims 1-2, and the device for real-time data decoding using a host computer includes the following modules: A coding rule acquisition module, used to acquire coding rules; Control function loading module, used to load the control function of the data acquisition card; An acquisition parameter setting module, used to set acquisition parameters according to the encoding rules; A target data acquisition module, used for cyclically acquiring target data according to the acquisition parameters and the control function; A target data grouping module, used for grouping the target data according to the encoding rule; The data conversion module is used to convert each set of data into decimal numbers and complete the decoding.

4. A device for real-time data decoding using a host computer, characterized in that: include: A host computer and a data acquisition card; the data acquisition card collects data to be decoded according to the control instructions of the host computer, and a data decoding program is stored on the host computer, and the data decoding program is used to implement the method for real-time data decoding using a host computer as described in any one of claims 1-2.

Citation Information

Patent Citations

  • Encodable protocol processing method for intelligent equipment

    CN102624685A

  • Video decoding method with combination of software and hardware and efficient transmission

    CN113596469A