A bus decoding method based on data compression

Through data compression technology, the extraction multiple is calculated and the data collected by the oscilloscope is solved, which solves the problem of long bus decoding, achieves efficient decoding, reduces hardware resource requirements and production costs, and improves user experience.

CN118093478BActive Publication Date: 2024-09-13QINGDAO HANTEK ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410210630.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-27
Publication Date
2024-09-13
Estimated Expiration
2044-02-27

AI Technical Summary

Technical Problem

When the instrument sampling rate increases with existing bus decoding technology, the sampled data increases, and the decoding process takes a long time. Systems with poor hardware resources are difficult to achieve efficient decoding, affecting user experience and increasing production costs.

Method used

Using the bus decoding method based on data compression, the collected data is divided into equal parts by calculating the extraction multiple, and the first data point of each part is extracted and decoded, which greatly improves the decoding speed and reduces the system performance requirements.

Benefits of technology

Efficient bus decoding is achieved, significantly increasing decoding speed, reducing system performance requirements and production costs, and improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118093478B
    Figure CN118093478B
Patent Text Reader

Abstract

The present invention discloses a bus decoding method based on data compression, and the steps include: step S1: reading sampled data and recording the oscilloscope sampling rate; step S2: calculating the display sampling rate of the oscilloscope according to the display buffer length and the number of channels; step S3: calculating the extraction multiple according to the actual oscilloscope sampling rate and the display sampling rate, and dividing the collected data into equal parts according to the extraction multiple length, extracting the first data point in each part, and obtaining display data; step S4: querying the initial decoding position of the display data, and decoding by using the change of the relative reference value of the data as a signal to obtain 1 or 0; step S5: obtaining the binary display data of the bus decoding, and calculating the bus result according to the bus protocol. The extraction multiple calculated by the present invention is 80, that is, the decoding efficiency of the present invention is 80 times that before compression, which greatly improves the decoding speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of bus decoding, in particular to a bus decoding method based on data compression. Background Art

[0002] At present, the basic process of bus decoding mainly includes: first reading the sampled data; secondly decoding according to the sampled data to obtain the bus data; then referring to the bus protocol, and finally obtaining the bus decoding result; finally, after the sampled data is refreshed, repeat the above steps to complete the real-time bus decoding.

[0003] However, based on the bus decoding of the above implementation process, as the instrument sampling rate increases, the sampling data becomes larger and larger, the decoding process takes longer and longer, and the instrument performance requirements become higher and higher. However, for systems with poor hardware resources, if the above bus decoding function is to be implemented, it will greatly slow down the system operation, affect the user operation experience, and increase the product production cost.

[0004] Existing technologies can no longer meet people’s needs at this stage. Based on the current situation, it is urgent to reform existing technologies. Summary of the invention

[0005] The object of the present invention is to provide a bus decoding method based on data compression to solve the problems raised in the above background technology.

[0006] The present invention provides the following technical solution: a bus decoding method based on data compression, the steps comprising:

[0007] Step S1: read the sampled data and record the oscilloscope sampling rate Sa;

[0008] Step S2: Calculate the display sampling rate Sa_dis of the oscilloscope according to the display buffer length and the number of channels; wherein the display buffer length is set to L and the number of channels is N;

[0009] Preferably, the calculation process of the display sampling rate Sa_dis is:

[0010] First calculate the display data length:

[0011] L_data = L / N;

[0012] Then calculate the corresponding display sampling rate Sa_dis according to the display data length; wherein, the data sampling time is set to T;

[0013] Sa_dis=L_data / T.

[0014] Step S3: according to the actual oscilloscope sampling rate Sa and the display sampling rate Sa_dis, the extraction multiple ext is calculated: and the collected data is divided into equal parts according to the length of the extraction multiple ext, and the first data point in each part is extracted to obtain the display data data_dis;

[0015] Preferably, the extraction multiple ext=Sa / Sa_dis.

[0016] Step S4: querying the initial decoding position edge_place of the display data data_dis, and using the change of the relative reference value of the data as a signal to obtain 1 or 0 for decoding;

[0017] Step S5: Obtain the binary display data data_bin decoded by the bus, and calculate the bus result according to the bus protocol.

[0018] The present invention has the following beneficial effects:

[0019] The decimation multiple calculated by the present invention is 80, that is, the decoding efficiency of the present invention is 80 times that before compression, which greatly improves the decoding speed, has extremely low requirements on system performance, and can complete the bus decoding function of the oscilloscope at a very low cost, thereby reducing the production and use cost of the oscilloscope and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is a schematic diagram of the working process of the present invention;

[0021] Figure 2 It is a schematic diagram of the rising edge and falling edge analysis process of the present invention;

[0022] Figure 3 A waveform diagram of the initial decoding position edge_place of the display data data_dis in the present invention;

[0023] Figure 4 The present invention obtains the decoding result according to the RS232 bus protocol. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field of the present invention without creative work are within the scope of protection of the present invention.

[0025] refer to Figure 1 The present invention provides the following technical solution: a bus decoding method based on data compression, the steps comprising:

[0026] Step S1: read the sampled data and record the oscilloscope sampling rate, wherein the data acquisition depth is set to Sum and the oscilloscope sampling rate is set to Sa;

[0027] As an optional embodiment of the present invention, taking an oscilloscope with an oscilloscope sampling rate of 2GSa / s as an example, the oscilloscope is connected to the rs232 bus signal, the signal sends data 0x56, and the baud rate is 115.2kbps;

[0028] In this embodiment, the oscilloscope runs on a single channel, the acquisition depth Sum is 2G, the oscilloscope sampling rate Sa=2GSa / s, and the time base is set to 100us. Then the sampling time of the screen display part T=1ms. In the oscilloscope, the screen display time is one large grid as one time base, with a total of 10 large grids.

[0029] Step S2: Calculate the oscilloscope display sampling rate according to the display buffer length and the number of channels; wherein the display buffer length is set to L and the number of channels is N;

[0030] In this embodiment, different oscilloscopes have different display buffer lengths. The display buffer length of the oscilloscope in this embodiment is L=25k, and the number of oscilloscope channels is single channel N=1, so the display data length is calculated first:

[0031] L_data = L / N = 25 / 1 = 25k;

[0032] Then calculate the corresponding display sampling rate Sa_dis according to the display data length;

[0033] Since the data sampling time is T = 1ms, the display sampling rate is:

[0034] Sa_dis=L_data / T=25MSa / s;

[0035] Step S3: According to the actual oscilloscope sampling rate Sa and the display sampling rate Sa_dis, the decimation multiple is calculated:

[0036] ext=Sa / Sa_dis=2G / 25M=80.

[0037] The collected data is divided into equal parts according to the extraction multiple ext length, and the first data point in each part is extracted to obtain the display data data_dis.

[0038] refer to Figure 2 and Figure 3 , step S4: querying the initial decoding position edge_place of the display data data_dis, and using the change of the relative reference value of the data as a signal to parse 1 or 0 for decoding;

[0039] The steps include:

[0040] Step S401: Read the reference value ref.

[0041] Step S402: read the bus signal source baud rate baud_rate, and calculate the data step step;

[0042] step = L_data / baud_rate

[0043] Step S403: take the first data data_dis[i], and the sequence number i=1; if data_dis[i] is greater than the reference value ref, record the initial state pre_status=1; if data_dis[i] is less than the reference value ref, record the initial state pre_status=0;

[0044] Step S404: the sequence number is increased by 1; and i=i+step; if data_dis[i] is greater than the reference value ref, the current state cur_status=1 is recorded; if data_dis[i] is less than the reference value ref, the current state cur_status=0 is recorded;

[0045] Step S405: if the initial state pre_status=0, the current state cur_status=1, that is, the data changes from less than the reference value ref to greater than the reference value ref, and the waveform is a rising edge;

[0046] Step S406: if the initial state pre_status=1, the current state cur_status=0, that is, the data changes from being greater than the reference value ref to being less than the reference value ref, the waveform is a falling edge, and the decoded data is 0; at the same time, the initial state pre_status=cur_status is re-recorded;

[0047] Step S407: If the initial state pre_status is equal to the current state cur_status, the waveform has not changed;

[0048] Step S408: Repeat steps S404, S405, S406, and S407 until the initial decoding position edge_place is found, and the decoding is terminated; or, when the sequence number i is greater than the display data length L_data, the decoding is terminated.

[0049] Step S409: Update the decoding position edge_place, i=edge_place-1;

[0050] Step S410: the serial number is increased by one: i=i+step, if the data data_dis[i] is greater than the reference value ref, the decoded value is recorded as 1; if the data data_dis[i] is less than the reference value ref, the decoded value is recorded as 0;

[0051] Step S411: Repeat step S410 until i is greater than the display data length L_data, and then end the decoding.

[0052] Step S5: Obtain the binary display data data_bin decoded by the bus, and calculate the bus result according to the bus protocol;

[0053] refer to Figure 4 In this embodiment, the bus result can be parsed according to the current bus protocol (such as RS232, IIC, etc.). In this embodiment, the decoding result value obtained according to the RS232 bus protocol is 0x56.

[0054] In this embodiment, the decoding efficiency depends on the ratio of the size of the collected data to the size of the displayed data; the present invention calculates that the extraction multiple is 80, that is, the decoding efficiency of the present invention is 80 times that before compression, which greatly improves the decoding speed, has extremely low requirements on system performance, and can complete the bus decoding function of the oscilloscope at a very low cost, thereby reducing the production and use costs of the oscilloscope, and also improving the user experience.

[0055] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A bus decoding method based on data compression, It is characterized in that the steps include: Step S1: read the sampled data and record the oscilloscope sampling rate Sa; Step S2: Calculate the display sampling rate Sa_dis of the oscilloscope according to the display buffer length and the number of channels; wherein the display buffer length is set to L and the number of channels is N; Step S3: according to the actual oscilloscope sampling rate Sa and the display sampling rate Sa_dis, the extraction multiple ext is calculated: and the collected data is divided into equal parts according to the length of the extraction multiple ext, and the first data point in each part is extracted to obtain the display data data_dis; the extraction multiple ext = Sa / Sa_dis; Step S4: querying the initial decoding position edge_place of the display data data_dis, and using the change of the relative reference value of the data as a signal to obtain 1 or 0 for decoding; The steps include: Step S401: read the reference value ref; Step S402: read the bus signal source baud rate baud_rate, and calculate the data step step; step = L_data / baud_rate; Step S403: take the first data data_dis[i], and the sequence number i=1; if data_dis[i] is greater than the reference value ref, record the initial state pre_status=1; if data_dis[i] is less than the reference value ref, record the initial state pre_status=0; Step S404: the sequence number is increased by 1; and i=i+step; if data_dis[i] is greater than the reference value ref, the current state cur_status=1 is recorded; if data_dis[i] is less than the reference value ref, the current state cur_status=0 is recorded; Step S405: if the initial state pre_status=0, the current state cur_status=1, that is, the data changes from less than the reference value ref to greater than the reference value ref, and the waveform is a rising edge; Step S406: if the initial state pre_status=1, the current state cur_status=0, that is, the data changes from being greater than the reference value ref to being less than the reference value ref, the waveform is a falling edge, and the decoded data is 0; at the same time, the initial state pre_status=cur_status is re-recorded; Step S407: If the initial state pre_status is equal to the current state cur_status, the waveform has not changed; Step S408: Repeat steps S404, S405, S406, and S407 until the initial decoding position edge_place is found, and the decoding is terminated; or, when the sequence number i is greater than the display data length L_data, the decoding is terminated; Step S409: Update the initial decoding position edge_place, i=edge_place-1; Step S410: the serial number is increased by one: i=i+step, if the data data_dis[i] is greater than the reference value ref, the decoded value is recorded as 1; if the data data_dis[i] is less than the reference value ref, the decoded value is recorded as 0; Step S411: Repeat step S410 until i is greater than the display data length L_data, and then end the decoding. Step S5: Obtain the binary display data data_bin decoded by the bus, and calculate the bus result according to the bus protocol.

2. A bus decoding method based on data compression according to claim 1, Features: The calculation process of the display sampling rate Sa_dis is: First calculate the display data length: L_data = L / N; Then calculate the corresponding display sampling rate Sa_dis according to the display data length; wherein, the data sampling time is set to T; Sa_dis=L_data / T.

3. A bus decoding method based on data compression according to claim 1, Features: The value of the decimation multiple ext is equal to the multiple of the decoding efficiency before compression.

4. A bus decoding method based on data compression according to claim 1, Features: The purpose of steps S401 to S408 is to query the initial decoding position edge_place of the compressed display data data_dis; the purpose of steps S409 to S410 is to decode the compressed data.

5. A bus decoding method based on data compression according to claim 1, Features: Step S409 causes the initial decoding position edge_place to be moved forward by one data point.

6. A bus decoding method based on data compression according to claim 1, Features: The bus protocols include RS232 protocol and IIC protocol.