A data transmission state monitoring method and system based on FPGA
By monitoring the previous data transmission status, the compression coding parameters of the FPGA data transmission system are dynamically adjusted. By utilizing McAdam elliptic and multi-connected chain code techniques, the problem of balancing compression effect and image quality in the data transmission system is solved, thereby improving data transmission efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU SEMIDE SEMICON TECH CO LTD
- Filing Date
- 2025-01-22
- Publication Date
- 2026-05-12
AI Technical Summary
In existing FPGA-based data transmission systems, the data compression parameters are fixed and cannot adapt to changing data characteristics and transmission environments, resulting in an inability to balance compression performance and image quality.
By monitoring the status of the previous data transmission, the compression coding parameters are dynamically adjusted. Taking advantage of the fact that the color differences of the McAdam ellipse on the chromaticity map are not easily perceived by the human eye, the image data is converted into a color feature sequence and compressed by combining it with multi-connected chain codes to adapt to the current data characteristics and transmission environment.
This approach achieves improved compression of data transmission while maintaining image quality, reduces the amount of data in the compressed encoding result, and enhances data transmission efficiency.
Smart Images

Figure CN119835427B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology. More specifically, this invention relates to a data transmission status monitoring method and system based on FPGA. Background Technology
[0002] A Field-Programmable Gate Array (FPGA) is a reconfigurable hardware platform that allows users to configure logic blocks, memory, and input / output systems as needed to achieve specific functions. FPGAs are used in fields such as communications, computing, military, and aerospace, especially in scenarios that require high-performance computing and fast data processing, such as high-definition video streaming and sensor data processing.
[0003] In related technologies, for example, Chinese patent application CN113365016A discloses a real-time map image data acquisition system, comprising: a CPU, at least one FPGA connected to each CPU, and at least one image acquisition device connected to each FPGA; the image acquisition device is used to acquire geographic environment images and send them to the FPGA; the FPGA is used to receive the geographic environment images sent by the connected image acquisition devices in parallel, perform color mixing and interpolation processing on the geographic environment images to obtain RGB format image data, perform color space conversion on the RGB format image data to obtain YUV format image data and output it in channels, perform data compression on the image data of each channel in sequence, and transfer the compressed image data to memory; the CPU is used to store the compressed image data in memory in real time into the storage device; this scheme realizes real-time compression of image data and improves the stability of data storage.
[0004] Communication systems based on FPGA design need to balance compression performance and image quality. However, the data compression parameters in related technologies are fixed and cannot adapt to changing data characteristics and transmission environments, thus making it impossible to balance compression performance and image quality. Summary of the Invention
[0005] To address the technical problem that fixed data compression parameters cannot adapt to changing data characteristics and transmission environments, thus leading to an inability to balance compression effectiveness and image quality, this invention provides solutions in the following aspects.
[0006] In a first aspect, the present invention provides a data transmission status monitoring method based on FPGA, comprising: after receiving image data transmitted from the FPGA end each time, the data receiving end feeds back the data reception time and data attention level as status monitoring results to the FPGA end; the FPGA end sets the order of the McAdam ellipse for the current data transmission based on the status monitoring results of the previous data transmission and records it as . ; through all the distributions on the chromaticity diagram Using McAdam ellipses, select the fewest possible combinations that completely cover the entire chromaticity diagram. The image data to be transmitted is obtained by: first, constructing a McAdam ellipse and using it as multiple color features; second, scanning all pixels in the image data to obtain a pixel sequence; third, obtaining the color features of each pixel based on its color value, and recording the sequence of color features as a color feature sequence; fourth, setting a multi-connected chain code for each color feature, which provides multiple adjacent color features and a direction symbol for each adjacent color feature; fifth, combining the multi-connected chain codes of each color feature to convert the color feature sequence into multiple chain codes, where the first element of each chain code is a color feature and the other elements are direction symbols; and finally, compressing and encoding all chain codes to obtain the compressed encoding result of the image data to be transmitted. The end sends the compressed encoding result of the image data to be transmitted to the data receiving end.
[0007] This invention monitors the state of the previous data transmission to understand data characteristics and the transmission environment, thereby dynamically adjusting the compression coding parameters during the current data transmission to adapt to the current data characteristics and transmission environment, balancing compression effect and image quality. Specifically, it utilizes the characteristic that the color differences of the McAdam ellipse color points distributed on the chromaticity map are not easily perceived by the human eye, converting the image data to be transmitted into a color feature sequence, ensuring the image quality of the compressed encoding result. Furthermore, it leverages the spatial proximity of the color features corresponding to pixels in the image data to be transmitted in the chromaticity map, combining multiple adjacent color features of each color feature in the multi-connected chain code of each color feature, as well as the direction sign of each adjacent color feature, to convert the color feature sequence into multiple chain codes. This reduces the data volume of the compressed encoding result of the image data to be transmitted, thereby improving the compression effect of the image data to be transmitted while ensuring the image quality of the received compressed encoding result.
[0008] Preferably, the data reception time refers to the moment when the data receiving end receives the image data transmitted from the FPGA end; the data attention level is given by the data receiving end after analyzing the received image data, and the value range of the data attention level is [missing value]. .
[0009] Preferably, the method for obtaining the order of the McAdam ellipse during the current data transmission is as follows: the FPGA stores the data transmission time of each data transmission; after the FPGA receives the status monitoring result of the previous data transmission from the data receiver, it calculates the duration of the previous data transmission based on the data reception time and data transmission time, where the duration is equal to the difference between the data reception time and the data transmission time; it calculates the transmission speed of the previous data transmission based on the data volume and duration, where the transmission speed is equal to the data volume divided by the duration; and it calculates the order of the McAdam ellipse during the current data transmission based on the transmission speed and data attention of the previous data transmission. , , These are the preset first and second coefficients, respectively. To find the minimum value function, The transmission speed of the last data transmission. As a baseline value for transmission speed, Based on the data attention received during the last data transmission, This is the baseline value for the order. This indicates rounding up to the nearest integer.
[0010] This invention monitors the status of the previous data transmission to obtain the transmission speed and data attention of the previous data transmission. Based on the amount of data that can be transmitted within a fixed time and the image quality requirements of the received compressed encoding result from the data receiver, the compression encoding parameters during the current data transmission are dynamically adjusted to adapt to the current data characteristics and transmission environment, thereby balancing compression effect and image quality.
[0011] Preferably, the setting of the multi-connected chain code for each color feature includes: setting... Any integer within the range is used as the preselected quantity. Equal to the preset value; based on the pre-selected quantity, set the multi-connected chain code for each color feature, including: taking any color feature as the center color feature, calculating the distance between all color features and the center color feature, and selecting the one with the smallest distance to the center color feature. A color feature, and adjacent color features as the central color feature. To pre-select the quantity, and in order of increasing distance from the central color feature, set the direction sign of each adjacent color feature sequentially to 0 to... The central color feature is used as the multi-connected chain code of all adjacent color features and the direction symbols of all adjacent color features.
[0012] This invention utilizes the spatial proximity of color features corresponding to pixels in the chromaticity map of the image data to be transmitted. Multiple color features with the smallest distance from the central color feature are taken as adjacent color features of the central color feature, and corresponding direction symbols are assigned. This facilitates the subsequent combination of the direction symbols of multiple adjacent color features of each color feature to convert the color feature sequence into multiple chain codes, thereby reducing the amount of data in the compressed encoding result of the image data to be transmitted and improving the compression effect of the image data to be transmitted.
[0013] Preferably, the setting of the multi-connected chain code for each color feature includes: setting... Any integer within the range is used as the preselected quantity. The value is equal to the preset value; the optimization degree of the pre-selected quantity as the target quantity is calculated, and the integer with the highest optimization degree is taken as the target quantity; according to the target quantity, the multi-connected chain code of each color feature is set, including: taking any color feature as the center color feature, calculating the distance between all color features and the center color feature, and selecting the one with the smallest distance to the center color feature. A color feature, and adjacent color features as the central color feature. To determine the target number, and in order of increasing distance from the center color feature, set the direction sign of each adjacent color feature sequentially to 0 to... The central color feature is used as the multi-connected chain code of all adjacent color features and the direction symbols of all adjacent color features.
[0014] This invention calculates different pre-selected quantities The optimality is used to determine the number of targets, thereby maximizing the transmission efficiency of the image data to be transmitted.
[0015] Preferably, the calculation of the pre-selected quantity as the optimization degree of the target quantity includes: taking any color feature in the color feature sequence as the target color feature, and calculating the pre-selected quantity... To obtain the previous color feature of the target color feature Given a set of adjacent color features, determine whether the target color feature belongs to the adjacent color features of the preceding color feature: if the target color feature belongs to the adjacent color features of the preceding color feature, then classify the target color feature into the pre-selected number of adjacent color features. In the first category, otherwise, the target color feature is divided into a pre-selected number. In the second category; based on the pre-selected quantity The number of color features in the first and second categories, calculate the number of pre-selected features. As a measure of the optimality of the target quantity, the pre-selected quantity Preferredness as the target quantity The calculation formula is: In the formula, The number of pre-selected items The number of color features in the first and second categories, This represents the number of all types of color features.
[0016] Preferably, the step of converting the color feature sequence into multiple chain codes includes: converting the first chain code into multiple chain codes. The color feature is used as the first The first element of the chain code is obtained to get the first... The chain code includes: the first chain code from the color feature sequence. Starting with a set of color features, sequentially determine whether each color feature is an adjacent color feature of its preceding color feature, until a color feature is no longer an adjacent color feature of its preceding color feature. At this point, record the index of that color feature as _____. , will the The color feature to the first The direction symbol of the color feature is added as an element to the first... In the chain code, obtain the first... One chain code; where, when hour, That is, the first in the color feature sequence The color feature is used as the first The first element of each chain code is used; this process continues until the last color feature in the color feature sequence is determined, thereby converting the color feature sequence into multiple chain codes.
[0017] Preferably, the direction symbol of a color feature can only be obtained when a certain color feature is an adjacent color feature of its predecessor color feature. The method for obtaining the direction symbol of the color feature is as follows: the direction symbol of the adjacent color feature corresponding to the color feature among all the adjacent color features of the preceding color feature is used as the direction symbol of the color feature.
[0018] Preferably, the step of compressing and encoding all chain codes to obtain the compressed encoding result of the image data to be transmitted includes: for any chain code, the process of compressing and encoding that chain code is as follows: for the first chain code... an element, when At that time, the first The element belongs to the color feature, thus obtaining the first... The index of an element in all color characteristics , serial number The corresponding length is equal to binary data, as the first The compressed encoding result of each element, The number of all types of color features; when At that time, the first The element belongs to the direction symbol, and the first element is the direction symbol. The length corresponding to each element is equal to binary data, as the first The compressed encoding result of each element, The number of all types of direction symbols; the compressed encoding results of all elements in the chain code are combined to form the compressed encoding result of the chain code; the compressed encoding results of all chain codes are used as the compressed encoding result of the image data to be transmitted.
[0019] This invention uses fewer types of directional symbols to replace more types of color features, thereby reducing the amount of data in the compressed encoding result of the image data to be transmitted and improving the compression effect of the image data to be transmitted.
[0020] Secondly, the present invention provides a data transmission status monitoring system based on FPGA, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned data transmission status monitoring method based on FPGA is implemented.
[0021] By adopting the above technical solution, a computer program is generated from the above-mentioned FPGA-based data transmission status monitoring method and stored in the memory so that it can be loaded and executed by the processor. In this way, a terminal device can be made based on the memory and the processor for convenient use.
[0022] The beneficial effects of this invention are as follows:
[0023] This invention monitors the state of the previous data transmission to understand data characteristics and the transmission environment, thereby dynamically adjusting the compression coding parameters during the current data transmission to adapt to the current data characteristics and transmission environment, balancing compression effect and image quality. Specifically, it utilizes the characteristic that the color differences of the McAdam ellipse color points distributed on the chromaticity map are not easily perceived by the human eye, converting the image data to be transmitted into a color feature sequence, ensuring the image quality of the compressed encoding result. Furthermore, it leverages the spatial proximity of the color features corresponding to pixels in the image data to be transmitted in the chromaticity map, combining multiple adjacent color features of each color feature in the multi-connected chain code of each color feature, as well as the direction sign of each adjacent color feature, to convert the color feature sequence into multiple chain codes. This reduces the data volume of the compressed encoding result of the image data to be transmitted, thereby improving the compression effect of the image data to be transmitted while ensuring the image quality of the received compressed encoding result. Attached Figure Description
[0024] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. In the drawings, several embodiments of the invention are illustrated by way of example and not limitation, and like or corresponding reference numerals denote like or corresponding parts, wherein:
[0025] Figure 1 This is a flowchart illustrating an FPGA-based data transmission status monitoring method according to the present invention.
[0026] Figure 2 This is a schematic diagram illustrating a third-order McAdam ellipse;
[0027] Figure 3 This is a schematic representation of the 3rd order. A schematic diagram of the curve. Detailed Implementation
[0028] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0030] This invention discloses a data transmission status monitoring method based on FPGA, referring to... Figure 1 This includes steps S1-S4:
[0031] S1. Based on the status monitoring results of the previous data transmission, set the order of the McAdam ellipse for the current data transmission and denote it as . ; through all the distributions on the chromaticity diagram Using McAdam ellipses, select the fewest possible combinations that completely cover the entire chromaticity diagram. The McAdam ellipse is used as a feature for various colors.
[0032] It should be noted that by monitoring the status of the previous data transmission, we can understand the data characteristics and transmission environment, and thus dynamically adjust the compression coding parameters to adapt to the current data characteristics and transmission environment, balancing compression effect and image quality.
[0033] Specifically, each time the data receiver receives data from... After transmitting image data from the terminal, the data reception time and data attention level are fed back as status monitoring results to the system. End; wherein, the data reception time of the data transmission refers to the time when the data receiving end receives data from... The data reception time must be accurate to the second, specifying the time of image data transmission from the receiving end. The data attention level is determined by the receiving end after analyzing the received image data, and its value range is [range missing]. .
[0034] The data attention level of the image data is equal to the product of the attention level of the monitored area to which the image data belongs and the time attention level of the time period to which the image data belongs.
[0035] The traffic monitoring scenario includes various types of monitoring areas: those at traffic intersections, those on main roads, and those on secondary roads. Each monitoring area has at least one FPGA, and each FPGA is connected to at least one image acquisition device to collect image data of the monitoring area. Different monitoring areas have different traffic flows and accident risks; therefore, the level of attention required for different monitoring areas varies. Based on the traffic flow and accident risk of each monitoring area, a regional attention level is set for each area, and the value range for the regional attention level is [range missing]. Traffic intersections are where vehicles and pedestrians meet, resulting in high traffic volume and a high risk of accidents. Therefore, the area of concern for monitoring at traffic intersections is set to a specific level. , Main roads are the main traffic arteries in the city, with high vehicle volume and a high risk of accidents. Therefore, the area of concern for monitoring areas belonging to main roads is set to [specific level]. Secondary arterial roads have relatively low traffic volume and relatively low accident risk; therefore, the area of concern for monitoring areas belonging to secondary arterial roads is set to [specific level]. ;Will , , They were set to 0.8, 0.5, and 0.2 respectively.
[0036] In traffic monitoring scenarios, traffic flow and accident risk vary at different times of the day. Therefore, the level of attention paid to different times of the day differs. Based on the traffic flow and accident risk at different times, the day is divided into multiple time periods, and a time attention level is assigned to each time period. The value range of the time attention level is as follows: The morning rush hour is from 7:00 to 9:00, and the evening rush hour is from 17:00 to 19:00. Traffic volume is high and the risk of accidents is also high during these periods. Therefore, the time focus for these two peak hours is set as follows: , Traffic flow is heavier and the risk of accidents is higher during the morning hours (9:00 AM to 12:00 PM) and afternoon hours (4:00 PM to 5:00 PM). Therefore, the time focus for the morning and afternoon hours is set as follows: , and The lunch break period is from 12:00 to 14:00, and the evening period is from 19:00 to 22:00. Traffic flow is lower and the risk of accidents is lower during these periods; therefore, the time focus for these two periods is set as [specific timeframe]. , and The period from 10 PM to 7 AM the following day is the nighttime period. Traffic flow is low and the risk of accidents is low during this time; therefore, the time focus for the nighttime period is set as... , and ;Will , , , They were set to 0.7, 0.5, 0.3, and 0.1 respectively.
[0037] in addition, The terminal stores the data transmission time and data volume of the last data transmission, and the data transmission time needs to be accurate to the second, and the data volume is in MB (Megabyte).
[0038] Furthermore, in After receiving the status monitoring result of the last data transmission from the data receiving end, the terminal calculates the duration of the last data transmission based on the data reception time and data transmission time. The duration is equal to the difference between the data reception time and the data transmission time, and the unit is seconds. Based on the data volume and duration of the last data transmission, the terminal calculates the transmission speed of the last data transmission. The transmission speed is equal to the data volume divided by the duration, and the unit is MB / second.
[0039] It should be noted that color tolerance is a measure of the human eye's ability to perceive color differences within a specific color space, based on the degree to which the human eye can tolerate the differences between different colors. The McAdam ellipse of each color point in the CIE xyz chromaticity diagram is a graphic used to measure color tolerance. Color points located inside the McAdam ellipse are indistinguishable to the human eye. Therefore, this invention uses the McAdam ellipse to compress and encode the image data to be transmitted.
[0040] It's important to further clarify that the parameter determining the size of the McAdam ellipse is its order, which essentially refers to the standard deviation. A smaller order results in a smaller McAdam ellipse. A first-order McAdam ellipse refers to the standard deviation of the color matching result at a distance of one unit from the target color point, while a third-order McAdam ellipse refers to the standard deviation of the color matching result at a distance of three units from the target color point. A schematic diagram of a third-order McAdam ellipse is shown below. Figure 2As shown; if the coordinates of two colored points fall within a first-order McAdam ellipse, the human eye can hardly see any difference between them. However, the difference between the colored points corresponding to the boundary of a third-order McAdam ellipse is the color difference that the human eye can just perceive. In other words, the smaller the order, the less likely the color difference of the colored points represented by the McAdam ellipse is to be perceived by the human eye.
[0041] It should be further noted that the smaller the order of the McAdam ellipse, the smaller the McAdam ellipse, and the more types of McAdam ellipses that can completely cover the entire chromaticity map after subsequent selection. When encoding all types of McAdam ellipses using a fixed-length binary number, the longer the fixed length of the binary number, the worse the compression effect. The smaller the order of the McAdam ellipse, the less likely the color difference of the color points represented by the McAdam ellipse is to be perceived by the human eye, and the higher the image quality of the compressed encoding result.
[0042] Furthermore, based on the transmission speed and data attention level of the previous data transmission, the order of the McAdam ellipse during the current data transmission is calculated. The formula for calculating the order of the McAdam ellipse during the current data transmission is:
[0043] ;
[0044] In the formula, Let the order of the McAdam ellipse be the order during the current data transmission. These are the preset first and second coefficients, respectively. To find the minimum value function, The transmission speed of the last data transmission. As a baseline value for transmission speed, Based on the data attention received during the last data transmission, This is the baseline value for the order. This indicates rounding up to the nearest integer.
[0045] Among them, the baseline value of transmission speed Baseline value of order The transmission speed can be set according to the actual application scenario and requirements. This invention sets the baseline value for transmission speed. Set to 4, and the unit is MB / s, to set the baseline value of the order. Set to 3; first coefficient Second coefficient It can be set according to the actual application scenario and requirements. and All are greater than 0, therefore the present invention will use the first coefficient. If set to 0.3, then the second coefficient... It is 0.7.
[0046] It should be noted that the order of the McAdam ellipse obtained through the calculation formula during the current data transmission is an integer, and it is one of 1, 2, or 3; for example, when the transmission speed of the last data transmission... And the attention given to the data transmitted last time At that time, the order of the McAdam ellipse during the current data transmission. When the transmission speed of the last data transmission And the attention given to the data transmitted last time At that time, the order of the McAdam ellipse during the current data transmission. When the transmission speed of the last data transmission And the attention given to the data transmitted last time At that time, the order of the McAdam ellipse during the current data transmission. .
[0047] It should be noted that the higher the transmission speed of the last data transmission, the more data can be transmitted within a fixed time. Therefore, the order of the McAdam ellipse can be appropriately reduced during the current data transmission. Conversely, the greater the data attention in the last data transmission, the higher the image quality requirements of the received compressed encoding result at the data receiving end. Therefore, the order of the McAdam ellipse should be appropriately reduced during the current data transmission.
[0048] It should be further explained that this invention obtains the transmission speed and data attention of the previous data transmission by monitoring the status of the previous data transmission. Based on the amount of data that can be transmitted within a fixed time and the image quality requirements of the received compressed encoding result by the data receiving end, the compression encoding parameters during the current data transmission are dynamically adjusted to adapt to the current data characteristics and transmission environment, and to balance the compression effect and image quality.
[0049] In the CIE xyz color space, a color point has two chromaticity values and one luminance value. The two chromaticity values are the first chromaticity value and the second luminance value. Second chromaticity value Brightness is The CIE xyz chromaticity diagram is based on the first chromaticity value. Second chromaticity value Composed of.
[0050] Finally, by distributing all orders equal to on the CIE xyz chromaticity diagram... The McAdam ellipses are selected, and the fewest number of McAdam ellipses that completely cover the entire chromaticity diagram are identified. These are denoted as the target McAdam ellipse and used as multiple color features. The total number of all color features is denoted as... And the indices of all color features are sequentially from 0 to... .
[0051] S2. Scan all pixels in the image data to be transmitted to obtain a pixel sequence, and combine the color features of each pixel in the pixel sequence into a color feature sequence.
[0052] Specifically, when applying FPGA to high-definition video stream transmission, the image data to be transmitted is a color image in the high-definition video stream. The color space to which the color image belongs is the CIE xyz color space. Therefore, each pixel in the color image has two chromaticity values and one luminance value. The two chromaticity values are the first chromaticity value and the second chromaticity value. Second chromaticity value Brightness is .
[0053] It should be noted that the Hilbert curve is a one-dimensional curve that can fill a two-dimensional space. In other words, there is a one-to-one correspondence between the Hilbert curve and the points in the two-dimensional space. Furthermore, using the Hilbert curve to scan a two-dimensional image can better preserve many visual characteristics of the image and the spatial proximity between image pixel values.
[0054] In one embodiment, according to The curve scans all pixels in the image data to be transmitted to obtain a pixel sequence. The curve technique is well-known and will not be elaborated upon here. The order of the curve can be set according to the actual application scenario and requirements. This invention will... The order of the curve is set to 3, 3rd order. A schematic diagram of the curve is shown below. Figure 3 As shown.
[0055] In other embodiments, the scanning methods for all pixels in the image data to be transmitted include, but are not limited to, Z-order curves, serpentine scanning, etc.; wherein, Z-order curves are a sorting algorithm that maps multi-dimensional space to one-dimensional space, and serpentine scanning (Snake or Zigzag Scan) is a commonly used data arrangement method in image and video compression. Z-order curves and serpentine scanning are well-known technologies and will not be described in detail here.
[0056] Further, based on the color values of each pixel in the pixel sequence, the color features of each pixel are obtained, and the sequence of color features of each pixel in the pixel sequence is recorded as the color feature sequence; the step of obtaining the color features of each pixel based on the color values of each pixel in the pixel sequence includes: based on the color values of each pixel in the pixel sequence, where the color values refer to the two chromaticity values of the pixel, determining the color point corresponding to each pixel in the chromaticity map, and taking the color feature corresponding to the target McAdam ellipse where the color point corresponding to each pixel is located as the color feature of each pixel.
[0057] S3. Set multi-connected chain codes with various color features.
[0058] It should be noted that this invention utilizes the spatial proximity of color features corresponding to pixels in the chromaticity map of the image data to be transmitted. Multiple color features with the smallest distance from the central color feature are taken as adjacent color features of the central color feature, and corresponding direction symbols are assigned. This facilitates the subsequent combination of the direction symbols of multiple adjacent color features of each color feature to convert the color feature sequence into multiple chain codes, thereby reducing the amount of data in the compressed encoding result of the image data to be transmitted, and thus improving the compression effect of the image data to be transmitted.
[0059] Specifically, a multi-connected chain code is set for various color features, which gives multiple adjacent color features for each color feature and the direction symbol for each adjacent color feature.
[0060] In one embodiment, Any integer within the range is used as the preselected quantity. It equals the preset value, and the preset value can be set according to the actual application scenario and needs, with a range of values. This invention sets the preset value to 8; based on the pre-selected quantity, it sets multi-connected chain codes for various color features, including: taking any color feature as the center color feature, calculating the distance between all color features and the center color feature, and selecting the one with the smallest distance from the center color feature. If there are 16 color features, and the adjacent color features are considered as the central color feature, then the total number of adjacent color features of the central color feature is 16. indivual, To pre-select the quantity, and in order of increasing distance from the central color feature, set the direction sign of each adjacent color feature sequentially to 0 to... Then the total number of all types of direction signs is equal to Take all adjacent color features of the central color feature and the direction symbols of all adjacent color features as the multi-connected chain codes of the central color feature; further obtain the multi-connected chain codes of various color features.
[0061] For any given color feature, the formula for calculating the distance between that color feature and the central color feature is:
[0062] ;
[0063] In the formula, This is the distance between the color feature and the center color feature. These are the first and second chromaticity values of the color feature, respectively. These are the first and second chromaticity values of the central color feature, respectively.
[0064] It should be noted that the number of pre-selected items... If the numbers are different, then the number of all adjacent color features for each color feature will be different, resulting in different lengths of the compressed encoding results of the direction symbols of all adjacent color features; at the same time, the number of preselected features will also differ. The number of adjacent color features in the multi-connected chain codes of each color feature differs, and when the color feature sequence is converted into chain codes by combining the adjacent color features of each color feature, the number of all chain codes obtained after the conversion is different, thus affecting the length of the compressed coding result. Therefore, in order to maximize the transmission efficiency of the image data to be transmitted, this invention calculates different pre-selected numbers... The optimality is used to determine the target quantity.
[0065] In another embodiment, the calculation will Any integer within the range is used as the preselected quantity. The value is equal to a preset value. The optimization degree of using the pre-selected quantity as the target quantity is calculated, and the integer with the highest optimization degree is taken as the target quantity. Based on the target quantity, various multi-connected chain codes for different color features are set, including: using any color feature as the central color feature, calculating the distance between all color features and the central color feature, and selecting the color feature with the smallest distance from the central color feature. If there are 16 color features, and the adjacent color features are considered as the central color feature, then the total number of adjacent color features of the central color feature is 16. indivual, To determine the target number, and in order of increasing distance from the center color feature, set the direction sign of each adjacent color feature sequentially to 0 to... Then the total number of all types of direction signs is equal to Take all adjacent color features of the central color feature and the direction symbols of all adjacent color features as the multi-connected chain codes of the central color feature; further obtain the multi-connected chain codes of various color features.
[0066] The method for calculating the optimality of the pre-selected quantity as the target quantity is as follows: any color feature in the color feature sequence is taken as the target color feature; the pre-selected quantity is denoted as... According to the number of pre-selected To obtain the previous color feature of the target color feature The system considers adjacent color features; it then determines whether the target color feature belongs to the adjacent color features of the previous color feature: if the target color feature belongs to the adjacent color features of the previous color feature, then the target color feature is assigned to a pre-selected number of adjacent color features. In the first category, if the target color feature is not an adjacent color feature of the previous color feature, then the target color feature is assigned to a pre-selected number. In the second category; based on the pre-selected quantity The number of color features in the first and second categories, calculate the number of pre-selected features. As a measure of the optimality of the target quantity, the pre-selected quantity will be... The formula for calculating the optimality of the target quantity is:
[0067] ;
[0068] In the formula, To preselect the number As a measure of the optimality of the target quantity For the number of pre-selected items The number of color features in the first category, For the number of pre-selected items The number of color features in the second category, For the pre-selected quantity, each color feature has There are n adjacent color features, each with a direction indicator; therefore, there are a total of n adjacent color features. The number of species of directional symbols, that is, the total number of species of directional symbols, is equal to... , This represents the number of all types of color features.
[0069] For color features in the first category, during compression encoding, the object of compression encoding is the direction symbol corresponding to the color feature; when the direction symbol corresponding to the color feature is used as the object of compression encoding, the length of the compressed encoding result is... For color features in the second category, the object of compression encoding is the color feature itself; when the color feature itself is the object of compression encoding, the length of the compressed encoding result is... Therefore, the number of pre-selected items will be... When the target quantity is used, the data size of the compressed encoding result of the image data to be transmitted is equal to... The smaller the data volume, the better the compression effect; correspondingly, the pre-selected quantity... The greater the degree of preference for the target quantity.
[0070] S4. Combining the multi-connected chain codes of each color feature, the color feature sequence is converted into multiple chain codes; all chain codes are compressed and encoded to obtain the compressed encoding result of the image data to be transmitted and then transmitted.
[0071] It should be noted that chain code is a sequence of numbers formed by adding several direction symbols to the starting point of a line segment; this invention utilizes the spatial proximity of the color features corresponding to pixels in the image data to be transmitted in the chromaticity map, and combines the multi-connected chain codes of each color feature to convert the color feature sequence into multiple chain codes.
[0072] Specifically, by combining the multi-connected chain codes of each color feature, the color feature sequence is converted into multiple chain codes; the first element of each chain code is a color feature, and the other elements are direction symbols, specifically including:
[0073] 1. Initially, the first color feature in the sequence is... The color feature is used as the first The first element of the chain code, i.e. ; will the first The color feature is used as the first The first element of the chain code is obtained to get the first... The chain code includes: the first chain code from the color feature sequence. Starting with a set of color features, sequentially determine whether each color feature is an adjacent color feature of its preceding color feature, until a color feature is no longer an adjacent color feature of its preceding color feature. At this point, record the index of that color feature as _____. , will the The color feature to the first The direction symbol of the color feature is added as an element to the first... In the chain code, obtain the first Chaincode.
[0074] Specifically, the direction symbol of a color feature can only be obtained when a certain color feature is an adjacent color feature of its predecessor color feature. The method for obtaining the direction symbol of a color feature is as follows: the direction symbol of the adjacent color feature corresponding to the color feature among all the adjacent color features of the preceding color feature is used as the direction symbol of the color feature.
[0075] 2. The first The color feature is used as the first The first element of the chain code is obtained to get the first... The chain code includes: the first chain code from the color feature sequence. Starting with a set of color features, sequentially determine whether each color feature is an adjacent color feature of its preceding color feature, until a color feature is no longer an adjacent color feature of its preceding color feature. At this point, record the index of that color feature as _____. , will the The color feature to the first The direction symbol of the color feature is added as an element to the first... In the chain code, obtain the first... Each chain code.
[0076] 3. Continue in this manner until the judgment of the last color feature in the color feature sequence is completed, thereby converting the color feature sequence into multiple chain codes.
[0077] Furthermore, for any one of the chain codes, the process of compressing and encoding the chain code is as follows: For the first chain code... an element, when At that time, the first The index of an element in all color characteristics , serial number The corresponding length is equal to binary data, as the first The compressed encoding result of each element, The number of all types of color features; when At that time, the first The length corresponding to each element is equal to binary data, as the first The compressed encoding result of each element, The number of all types of direction symbols; the compressed encoding results of all elements in the chain code are combined to form the compressed encoding result of the chain code.
[0078] It should be noted that the number of all types of directional symbols is less than the number of all types of color features. This invention uses directional symbols with fewer types to replace color features with more types, thereby reducing the amount of data in the compressed encoding result of the image data to be transmitted and improving the compression effect of the image data to be transmitted.
[0079] Furthermore, the compression encoding results of all chain codes are used as the compression encoding results of the image data to be transmitted and transmitted accordingly. Additionally, the order of the McAdam ellipse and the compression encoding results of the brightness sequence during the current data transmission are added as supplementary information to the compression encoding results of the image data to be transmitted, so that the data receiving end can decompress the compressed encoding results of the image data to be transmitted to obtain complete and clear image data. Finally... The end sends the compressed encoding result of the image data to be transmitted to the data receiving end.
[0080] The brightness sequence is composed of the brightness of all pixels in the pixel sequence. The compressed encoding result of the brightness sequence is obtained by compressing and encoding the brightness sequence. The compression and encoding methods of the brightness sequence include, but are not limited to, arithmetic encoding and Huffman encoding.
[0081] It should be noted that this invention monitors the state of the previous data transmission to understand the data characteristics and transmission environment, thereby dynamically adjusting the compression coding parameters during the current data transmission to adapt to the current data characteristics and transmission environment, balancing compression effect and image quality. Specifically, by leveraging the characteristic that the color differences of the McAdam ellipse color points distributed on the chromaticity map are not easily perceived by the human eye, the image data to be transmitted is converted into a color feature sequence, ensuring the image quality of the compressed encoding result of the image data to be transmitted. Utilizing the spatial proximity of the color features corresponding to the pixels in the image data to be transmitted in the chromaticity map, and combining multiple adjacent color features of each color feature in the multi-connected chain code of each color feature, as well as the direction sign of each adjacent color feature, the color feature sequence is converted into multiple chain codes, thereby reducing the data volume of the compressed encoding result of the image data to be transmitted, thus improving the compression effect of the image data to be transmitted, while ensuring the image quality of the received compressed encoding result.
[0082] This invention also discloses an FPGA-based data transmission status monitoring system, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement an FPGA-based data transmission status monitoring method according to the present invention.
[0083] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0084] In the description of this specification, "multiple" or "several" means at least two, such as two, three or more, unless otherwise expressly and specifically defined.
[0085] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.
Claims
1. A data transmission status monitoring method based on FPGA, characterized in that, include: Each time the data receiver receives data from After transmitting image data from the terminal, the data reception time and data attention level are fed back as status monitoring results to the system. end; The data reception time refers to the moment when the data receiver receives data from... The time of image data transmission from the receiving end; data attention is given by the receiving end after analyzing the received image data, and the value range of the data attention is [missing information]. ; Based on the status monitoring results of the previous data transmission, the endpoint sets the order of the McAdam ellipse for the current data transmission and records it as . ; through all the distributions on the chromaticity diagram Using McAdam ellipses, select the fewest possible combinations that completely cover the entire chromaticity diagram. The McAdam ellipse is used as a feature for multiple colors; Scan all pixels in the image data to be transmitted to obtain a pixel sequence; obtain the color features of each pixel based on the color value of each pixel in the pixel sequence, and record the sequence of color features of all pixels as the color feature sequence. A multi-connected chain code is set for each color feature, which gives multiple adjacent color features for each color feature and a direction symbol for each adjacent color feature; By combining the multi-connected chain codes of each color feature, the color feature sequence is converted into multiple chain codes. The first element of each chain code belongs to the color feature, and the other elements belong to the direction symbol. All chain codes are compressed and encoded to obtain the compressed encoding result of the image data to be transmitted. The end sends the compressed encoding result of the image data to be transmitted to the data receiving end.
2. The FPGA-based data transmission status monitoring method according to claim 1, characterized in that, The method for obtaining the order of the McAdam ellipse during the current data transmission is as follows: The FPGA terminal stores the data transmission time for each data transmission. exist After receiving the status monitoring result of the last data transmission from the data receiving end, the terminal calculates the duration of the last data transmission based on the data reception time and data transmission time of the last data transmission. The duration is equal to the difference between the data reception time and the data transmission time. Based on the amount of data and duration of the last data transmission, calculate the transmission speed of the last data transmission, whereby the transmission speed is equal to the amount of data transmitted divided by the duration. Based on the transmission speed and data attention level of the previous data transmission, calculate the order of the McAdam ellipse during the current data transmission. , , These are the preset first and second coefficients, respectively. To find the minimum value function, The transmission speed of the last data transmission. As a baseline value for transmission speed, Based on the data attention received during the last data transmission, This is the baseline value for the order. This indicates rounding up to the nearest integer.
3. The FPGA-based data transmission status monitoring method according to claim 1, characterized in that, The multi-connected chain code that sets each color feature includes: Will Any integer within the range is used as the preselected quantity. Equal to the preset value; based on the pre-selected quantity, set the multi-connected chain code for each color feature, including: taking any color feature as the center color feature, calculating the distance between all color features and the center color feature, and selecting the one with the smallest distance to the center color feature. A color feature, and adjacent color features as the central color feature. To pre-select the quantity, and in order of increasing distance from the center color feature, set the direction sign of each adjacent color feature sequentially to 0 to... The central color feature is used as the multi-connected chain code of all adjacent color features and the direction symbols of all adjacent color features.
4. The FPGA-based data transmission status monitoring method according to claim 1, characterized in that, The multi-connected chain code that sets each color feature includes: Will Any integer within the range is used as the preselected quantity. The value is equal to the preset value; the optimization degree of the pre-selected quantity as the target quantity is calculated, and the integer with the highest optimization degree is taken as the target quantity; according to the target quantity, the multi-connected chain code of each color feature is set, including: taking any color feature as the center color feature, calculating the distance between all color features and the center color feature, and selecting the one with the smallest distance to the center color feature. A color feature, and adjacent color features as the central color feature. To determine the target number, and in order of increasing distance from the center color feature, set the direction sign of each adjacent color feature sequentially to 0 to... The central color feature is used as the multi-connected chain code of all adjacent color features and the direction symbols of all adjacent color features.
5. The FPGA-based data transmission status monitoring method according to claim 4, characterized in that, The calculation, which uses the pre-selected quantity as the degree of preference for the target quantity, includes: Take any one color feature from the color feature sequence as the target color feature, and determine the target color feature based on the pre-selected quantity. To obtain the previous color feature of the target color feature Given a set of adjacent color features, determine whether the target color feature belongs to the adjacent color features of the preceding color feature: if the target color feature belongs to the adjacent color features of the preceding color feature, then classify the target color feature into the pre-selected number of adjacent color features. In the first category, otherwise, the target color feature is divided into a pre-selected number. In the second category; based on the pre-selected quantity The number of color features in the first and second categories, calculate the number of pre-selected features. As a measure of the optimality of the target quantity, the pre-selected quantity Preferredness as the target quantity The calculation formula is: ; In the formula, The number of pre-selected items The number of color features in the first and second categories, This represents the number of all types of color features.
6. The FPGA-based data transmission status monitoring method according to claim 1, characterized in that, The process of converting the color feature sequence into multiple chain codes includes: The first The color feature is used as the first The first element of the chain code is obtained to get the first... The chain code includes: the first chain code from the color feature sequence. Starting with a set of color features, sequentially determine whether each color feature is an adjacent color feature of its preceding color feature, until a color feature is no longer an adjacent color feature of its preceding color feature. At this point, record the index of that color feature as _____. , will the The color feature to the first The direction symbol of the color feature is added as an element to the first... In the chain code, obtain the first... One chain code; Among them, when hour, That is, the first in the color feature sequence The color feature is used as the first The first element of the chain code; This process continues until the last color feature in the color feature sequence is determined, thereby converting the color feature sequence into multiple chain codes.
7. The FPGA-based data transmission status monitoring method according to claim 1, characterized in that, The direction symbol of a color feature can only be obtained when it is an adjacent color feature to the preceding color feature. The method for obtaining the direction symbol of a color feature is as follows: The direction sign of the adjacent color feature of the preceding color feature is used as the direction sign of the color feature.
8. The FPGA-based data transmission status monitoring method according to claim 1, characterized in that, The process of compressing and encoding all chain codes to obtain the compressed encoding result of the image data to be transmitted includes: For any chain code, the process of compressing and encoding the chain code is as follows: For the first chain code... an element, when At that time, the first The element belongs to the color feature, thus obtaining the first... The index of an element in all color characteristics , serial number The number of binary bits is set to , serial number binary bits The corresponding binary data is used as the first The compressed encoding result of each element, The number of all types of color features; when At that time, the first The element belongs to the direction symbol, and the first element is the direction symbol. The number of binary bits for each element is set to , will the Number of binary bits of each element The corresponding binary data is used as the first The compressed encoding result of each element, The number of all types of direction symbols; the compressed encoding results of all elements in the chain code are combined to form the compressed encoding result of the chain code; The compressed encoding results of all chain codes are used as the compressed encoding results of the image data to be transmitted.
9. A data transmission status monitoring system based on FPGA, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement an FPGA-based data transmission status monitoring method according to any one of claims 1-8.