Efficient lossless image segmentation method and system

By using a lossless segmentation method based on the internal MCU structure and RST identifier of JPEG images, we can quickly locate and summarize MCU pixel blocks, solving the problem of high decoding and recoding overhead in JPEG image segmentation and achieving efficient and lossless image segmentation results.

CN121962166APending Publication Date: 2026-05-01HUIZHIAN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUIZHIAN INFORMATION TECH CO LTD
Filing Date
2025-11-26
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing technologies suffer from high decoding and recoding overhead during JPEG image segmentation, leading to poor performance and potential loss of detail.

Method used

A lossless segmentation method based on the internal MCU structure and RST identifier of JPEG images is adopted. By recognizing the RST identifier, the MCU pixel blocks are quickly located and summarized into the target sub-image, avoiding the decoding and re-encoding of pixel data. The segmentation is performed by using the correspondence between fixed-size MCU pixel blocks and RST identifiers.

Benefits of technology

Fast and lossless segmentation of JPEG images was achieved, reducing computational overhead, ensuring the accuracy and universality of segmentation, and avoiding pixel-level misalignment or information loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962166A_ABST
    Figure CN121962166A_ABST
Patent Text Reader

Abstract

The invention provides an efficient lossless image segmentation method and system. The efficient lossless image segmentation method comprises the following steps: segmenting the JPEG image to obtain a plurality of MCU pixel blocks, and setting the number of the MCU pixel blocks as a target number; and the specific MCU pixel block is quickly summarized into the target sub-graph by using the RST identifier. The system comprises modules corresponding to the steps of the method.
Need to check novelty before this filing date? Find Prior Art

Description

An efficient and lossless image segmentation method and system Technical Field

[0001] This invention proposes an efficient and lossless image segmentation method and system, belonging to the field of image processing technology. Background Technology

[0002] In the upstream process, large JPEG images (1MB~3MB) are generated. Business requirements necessitate segmenting these images (e.g., into 20 blocks), and the processing flow is as follows:

[0003] 1. Read the JPEG image into memory;

[0004] 2. Use an image library to decode it into pixel data (Python: PIL / cv2, C: libjpeg-turbo, C#: BitMap);

[0005] 3. Divide the data into 20 blocks based on the location of the pixel;

[0006] 4. For each block of data, re-encode it into a new JPEG using the image library;

[0007] The performance of the aforementioned naive method falls short of expectations; specific performance comparisons are mentioned below. Specifically, the method suffers from the following problems:

[0008] 1. Re-decoding JPEG images using an image library is extremely costly: For a 3MB JPEG image, decoding one image takes about 0.1 seconds, which cannot meet business requirements.

[0009] 2. Re-encoding a JPEG image 20 times is also costly: JPEG is a lossy compression format, and re-encoding will cause loss of detail in the original JPEG image. Summary of the Invention

[0010] This invention provides an efficient and lossless image segmentation method and system to solve the aforementioned technical problems in the prior art. The technical solution adopted is as follows:

[0011] An efficient and lossless image segmentation method, the efficient and lossless image segmentation method comprising:

[0012] The JPEG image is segmented to obtain multiple MCU pixel blocks, and the number of MCU pixel blocks is set to the target number.

[0013] Using the RST identifier, specific MCU pixel blocks can be quickly grouped into the target sub-image.

[0014] Furthermore, the size of the MCU pixel block is a fixed size of 8x8 pixels, and the data representation length in the JPEG encoding corresponding to one MCU pixel block is not fixed, wherein the data representation length ranges from 1 bit to 16 bits.

[0015] Furthermore, the number of MCU pixel blocks between RSTs in each JPEG image is fixed, and the fixed number of MCU pixel blocks between RSTs is considered as a specific number.

[0016] Furthermore, the method of quickly grouping specific MCU pixel blocks into the target sub-image using RST identifiers includes:

[0017] Treat the JPEG image file as a byte array and iterate through it once;

[0018] A specific number of MCU pixel blocks are obtained by using RST markers;

[0019] Determine the position of each MCU pixel block within a specific number of MCU pixel blocks corresponding to a target number of MCU pixel blocks;

[0020] Construct multiple sub-byte arrays and append a specific number of MCU pixel blocks to the sub-byte arrays, wherein the number of the sub-byte arrays is the same as the target number;

[0021] If a key identifier is generated during the appending process, append the MCU pixel block corresponding to the key identifier to the subbyte array.

[0022] A sub-image corresponding to each MCU pixel block is constructed using a sub-byte array.

[0023] Furthermore, the efficient and lossless image segmentation method also includes:

[0024] Real-time monitoring of the number of concurrent JPEG image segmentations per unit time;

[0025] The number of concurrent requests is compared with a preset concurrent request threshold;

[0026] When the number of concurrent requests exceeds a preset concurrency threshold, the resource usage parameters corresponding to JPEG image segmentation are retrieved. These resource usage parameters include memory utilization, CPU utilization, network bandwidth utilization, and image storage data volume.

[0027] The resource utilization coefficient is obtained by using the memory utilization rate, CPU utilization rate, network bandwidth utilization rate, and image storage data volume.

[0028] The resource utilization coefficient is obtained by the following formula:

[0029]

[0030] Where K represents the resource utilization coefficient; n represents the number of unit time intervals taken for the JPEG image segmentation operation; P ni and P ci P represents the memory utilization and CPU utilization corresponding to the i-th unit of time, respectively; wi Let R represent the network bandwidth utilization rate corresponding to the i-th unit of time; R represents the adjustment coefficient, which is obtained by the following formula:

[0031]

[0032] Where R represents the adjustment coefficient; P ni This represents the memory utilization rate corresponding to the i-th unit of time; C i C represents the amount of image data stored in the i-th unit of time; i+1 This represents the amount of image data stored in the (i+1)th unit of time.

[0033] The resource utilization coefficient is compared with a preset coefficient threshold.

[0034] When the resource utilization coefficient exceeds the preset coefficient threshold, the system is determined to be overloaded and an overload warning is issued.

[0035] A high-efficiency, lossless image segmentation system, the high-efficiency, lossless image segmentation system comprising:

[0036] The segmentation module is used to segment the JPEG image, obtain multiple MCU pixel blocks, and set the number of MCU pixel blocks to a target number;

[0037] The summarization module is used to quickly summarize specific MCU pixel blocks into the target sub-graph using RST identifiers.

[0038] Furthermore, the size of the MCU pixel block is a fixed size of 8x8 pixels, and the data representation length in the JPEG encoding corresponding to one MCU pixel block is not fixed, wherein the data representation length ranges from 1 bit to 16 bits.

[0039] Furthermore, the number of MCU pixel blocks between RSTs in each JPEG image is fixed, and the fixed number of MCU pixel blocks between RSTs is considered as a specific number.

[0040] Furthermore, the segmentation module includes:

[0041] The traversal module is used to traverse a JPEG image file as a byte array.

[0042] The pixel block acquisition module is used to acquire a specific number of MCU pixel blocks via RST markers.

[0043] Determine the position of each MCU pixel block within a specific number of MCU pixel blocks corresponding to a target number of MCU pixel blocks;

[0044] An array construction module is used to construct multiple sub-byte arrays and append a specific number of MCU pixel blocks to the sub-byte arrays, wherein the number of the sub-byte arrays is the same as the target number;

[0045] The first append module is used to detect whether a key identifier is generated during the append process, and append the MCU pixel block corresponding to the key identifier to the subbyte array.

[0046] The second additional module is used to construct a sub-image corresponding to each MCU pixel block using a sub-byte array.

[0047] Furthermore, the efficient and lossless image segmentation system also includes:

[0048] The real-time monitoring module is used to monitor the number of concurrent JPEG image segmentations per unit time in real time.

[0049] The quantity comparison module is used to compare the number of concurrent requests with a preset concurrent request threshold.

[0050] The resource usage parameter acquisition module is used to retrieve the resource usage parameters corresponding to JPEG image segmentation when the number of concurrent processes exceeds a preset concurrency threshold. The resource usage parameters include memory utilization, CPU utilization, network bandwidth utilization, and image storage data volume.

[0051] The resource utilization coefficient acquisition module is used to acquire the resource utilization coefficient using the memory utilization rate, CPU utilization rate, network bandwidth utilization rate, and image storage data volume;

[0052] The resource utilization coefficient is obtained by the following formula:

[0053]

[0054] Where K represents the resource utilization coefficient; n represents the number of unit time intervals taken for the JPEG image segmentation operation; P ni and P ci P represents the memory utilization and CPU utilization corresponding to the i-th unit of time, respectively; wi Let R represent the network bandwidth utilization rate corresponding to the i-th unit of time; R represents the adjustment coefficient, which is obtained by the following formula:

[0055]

[0056] Where R represents the adjustment coefficient; P ni This represents the memory utilization rate corresponding to the i-th unit of time; C i C represents the amount of image data stored in the i-th unit of time; i+1 This represents the amount of image data stored in the (i+1)th unit of time.

[0057] The coefficient comparison module is used to compare the resource utilization coefficient with a preset coefficient threshold.

[0058] The load warning module is used to determine overload and issue an overload warning when the resource utilization coefficient exceeds a preset coefficient threshold.

[0059] Beneficial effects of this invention:

[0060] This invention provides a highly efficient and lossless image segmentation method and system. Compared with existing technologies, it can achieve JPEG segmentation faster while ensuring lossless JPEG image quality. This represents a significant improvement for JPEG segmentation applications. Furthermore, segmentation is based on the MCU structure and RST identifiers within JPEG, avoiding pixel data decoding and recoding, thus fully preserving the original image information and achieving truly lossless segmentation. Utilizing the correspondence between RST identifiers and a fixed number of MCUs avoids complex parsing of variable-length encoded data, significantly reducing computational overhead and greatly improving segmentation speed. The fixed 8x8 size of the MCU pixel blocks ensures the consistency of segmentation units, and combined with the accurate positioning of RST identifiers, results in clear sub-image boundaries and precise segmentation, avoiding pixel-level misalignment or information loss. Addressing the variable length of MCU data representation (1 bit to 16 bits), by relying on the fixed interval characteristics of RST markers, it eliminates the need to adapt to encoded data of different lengths, improving the method's universality for various JPEG images. Attached Figure Description

[0061] Figure 1 is a flowchart of the method described in this invention;

[0062] Figure 2 is a system block diagram of the system described in this invention. Detailed Implementation

[0063] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0064] This invention proposes an efficient and lossless image segmentation method, as shown in Figure 1. The efficient and lossless image segmentation method includes:

[0065] The JPEG image is segmented to obtain multiple MCU pixel blocks, and the number of MCU pixel blocks is set to the target number.

[0066] Using the RST identifier, specific MCU pixel blocks can be quickly grouped into the target sub-image.

[0067] The MCU pixel block has a fixed size of 8x8 pixels, and the data representation length in the JPEG encoding corresponding to one MCU pixel block is not fixed, ranging from 1 bit to 16 bits. The number of MCU pixel blocks between RSTs in each JPEG image is fixed, and this fixed number of MCU pixel blocks between RSTs is considered a specific quantity.

[0068] The working principle of the above technical solution is as follows: A structured segmentation of the JPEG image is performed to extract multiple basic coding units (MCU pixel blocks). Each MCU pixel block is fixed at 8x8 pixels in size, and the total number of extracted MCUs is set to a preset target number. The RST (Reset) identifier inherent in JPEG encoding is used as a segmentation marker. Since the number of MCU pixel blocks contained between RST identifiers in each JPEG image is fixed (i.e., a specific number), the MCU pixel blocks within a specific range can be quickly located and grouped into the corresponding target sub-image by directly identifying the position of the RST identifier. Although the data representation length of a single MCU pixel block in JPEG encoding is not fixed (1 bit-16 bits), the accurate division of MCU blocks can still be achieved by relying on the correspondence between the RST identifier and a fixed number of MCUs, without the need to parse the specific encoded data content.

[0069] The advantages of the above technical solution are as follows: Compared with existing technologies, this embodiment can achieve JPEG segmentation faster while ensuring lossless JPEG image processing. It represents a significant improvement for JPEG segmentation. Segmentation is based on the MCU structure and RST identifiers within JPEG, without involving pixel data decoding and recoding, completely preserving the original image information and achieving truly lossless segmentation. Utilizing the correspondence between RST identifiers and a fixed number of MCUs avoids complex parsing of variable-length encoded data, significantly reducing computational overhead and greatly improving segmentation speed. The fixed 8x8 size of the MCU pixel blocks ensures the consistency of segmentation units, and combined with the accurate positioning of RST identifiers, makes sub-image boundaries clear and division precise, avoiding pixel-level misalignment or information loss. Regarding the variable length of MCU data representation (1 bit to 16 bits), by relying on the fixed interval characteristics of RST markers, there is no need to adapt to encoded data of different lengths, improving the method's universality for various JPEG images.

[0070] In one embodiment of the present invention, the method of quickly grouping specific MCU pixel blocks into a target sub-image using RST identifiers includes:

[0071] Treat the JPEG image file as a byte array and iterate through it once;

[0072] A specific number of MCU pixel blocks are obtained by using RST markers;

[0073] Determine the position of each MCU pixel block within a specific number of MCU pixel blocks corresponding to a target number of MCU pixel blocks;

[0074] Construct multiple sub-byte arrays and append a specific number of MCU pixel blocks to the sub-byte arrays, wherein the number of the sub-byte arrays is the same as the target number;

[0075] If a key identifier is generated during the appending process, append the MCU pixel block corresponding to the key identifier to the subbyte array.

[0076] A sub-image corresponding to each MCU pixel block is constructed using a sub-byte array.

[0077] The working principle of the above technical solution is as follows: JPEG image files are converted into byte arrays, and the entire file byte stream is scanned in a single traversal, avoiding the overhead of repeated reading; during the traversal, RST identifiers are identified, and based on their fixed correspondence with a specific number of MCU pixel blocks, all MCU pixel blocks within that range are accurately extracted; the positions of these specific number of MCU pixel blocks within a preset target number of MCU blocks are determined, establishing a mapping relationship between individuals and the whole; a sub-byte array equal to the target number is constructed, and the extracted specific number of MCU pixel blocks are appended to the corresponding sub-byte array according to their positional correspondence; key identifiers appearing during the appending process (such as control information necessary for encoding) are simultaneously detected to ensure that their corresponding MCU pixel blocks are correctly included in the sub-byte array, guaranteeing the integrity of the sub-byte array; using each sub-byte array as the data basis, a sub-graph corresponding to each MCU pixel block is directly constructed, completing the conversion from byte stream to sub-graph.

[0078] The above technical solution achieves the following effects: It extracts and processes all key information (RST identifier, MCU pixel blocks, and key identifiers) through a single byte array traversal, significantly reducing I / O operations and data scanning times, thus lowering time complexity; it directly locates target MCU pixel blocks by relying on the fixed association between the RST identifier and a specific number of MCUs, avoiding segmented parsing of the entire byte stream and reducing positioning errors; the number of sub-byte arrays strictly matches the target number, and MCU pixel blocks are appended according to their positions, ensuring a high degree of consistency between the sub-image and the preset target segmentation structure, guaranteeing the standardization of segmentation; the detection of key identifiers and the forced appending of corresponding MCUs avoid the omission of encoding control information, ensuring that the sub-byte array contains all the data required to construct a valid sub-image, guaranteeing the decodeability and integrity of the sub-image; the entire process is based on byte stream operations and identifier matching, eliminating the need for complex decoding and re-encoding processes, achieving efficient conversion from the original JPEG to the sub-image with minimal computational overhead.

[0079] In one embodiment of the present invention, the efficient and lossless image segmentation method further includes:

[0080] Real-time monitoring of the number of concurrent JPEG image segmentations per unit time;

[0081] The number of concurrent requests is compared with a preset concurrent request threshold;

[0082] When the number of concurrent requests exceeds a preset concurrency threshold, the resource usage parameters corresponding to JPEG image segmentation are retrieved. These resource usage parameters include memory utilization, CPU utilization, network bandwidth utilization, and image storage data volume.

[0083] The resource utilization coefficient is obtained by using the memory utilization rate, CPU utilization rate, network bandwidth utilization rate, and image storage data volume.

[0084] The resource utilization coefficient is obtained by the following formula:

[0085]

[0086] Where K represents the resource utilization coefficient; n represents the number of unit time intervals taken for the JPEG image segmentation operation; P ni and P ci P represents the memory utilization and CPU utilization corresponding to the i-th unit of time, respectively; wi Let R represent the network bandwidth utilization rate corresponding to the i-th unit of time; R represents the adjustment coefficient, which is obtained by the following formula:

[0087]

[0088] Where R represents the adjustment coefficient; P ni This represents the memory utilization rate corresponding to the i-th unit of time; C i C represents the amount of image data stored in the i-th unit of time; i+1 This represents the amount of image data stored in the (i+1)th unit of time.

[0089] The resource utilization coefficient is compared with a preset coefficient threshold.

[0090] When the resource utilization coefficient exceeds the preset coefficient threshold, the system is determined to be overloaded and an overload warning is issued.

[0091] The working principle of the above technical solution is as follows: Real-time monitoring of the concurrent number of JPEG image segmentations per unit time serves as the initial basis for judging the load status; the real-time concurrent number is compared with a preset threshold, and further resource consumption assessment is triggered only when the concurrent number exceeds the threshold; key resource consumption parameters for the corresponding time period are retrieved, including memory utilization (Pni), CPU utilization (Pci), network bandwidth utilization (Pwi), and image storage data volume (Ci), forming a multi-dimensional assessment basis; the resource utilization coefficient (K) is calculated based on the above parameters: first, dynamic adaptation is achieved through an adjustment coefficient (R)—R integrates memory utilization (Pni) and changes in image storage data volume in adjacent unit times (Ci and Ci+1) to reflect the impact of dynamic storage on resource consumption; then, R is integrated with the memory, CPU, and network bandwidth utilization for each unit time, and K is obtained through cumulative calculation over multiple unit times (n times), realizing the quantification of resource load; the resource utilization coefficient (K) is compared with a preset threshold, and when K exceeds the threshold, the system is determined to be in an overload state and an early warning is triggered.

[0092] The effects of the above technical solution are as follows: Real-time concurrency monitoring and resource parameter acquisition enable dynamic tracking of the load status during the segmentation process, ensuring that potential overload risks are captured in a timely manner; integration of multi-dimensional resource parameters such as memory, CPU, network bandwidth, and storage data volume avoids misjudgment based on a single indicator, providing a more comprehensive reflection of the actual system load; the adjustment coefficient (R) incorporates the temporal changes in storage data volume, enabling the resource utilization coefficient (K) to adapt to the impact of storage fluctuations on overall resource usage, improving the accuracy of quantitative assessment; through a two-layer verification process of "initial screening of concurrency thresholds → refined evaluation of resource coefficients," false alarms caused by instantaneous fluctuations are reduced, ensuring that responses are triggered only in cases of substantial overload; timely overload warnings provide a basis for resource scheduling (such as dynamic allocation of computing power and limiting concurrency), preventing system performance degradation or crashes due to excessive load, and ensuring the efficient and stable operation of the JPEG image segmentation process.

[0093] This invention proposes a high-efficiency, lossless image segmentation system, as shown in Figure 2. The high-efficiency, lossless image segmentation system includes:

[0094] The segmentation module is used to segment the JPEG image, obtain multiple MCU pixel blocks, and set the number of MCU pixel blocks to a target number;

[0095] The summarization module is used to quickly summarize specific MCU pixel blocks into the target sub-graph using RST identifiers.

[0096] The MCU pixel block has a fixed size of 8x8 pixels, and the data representation length in the JPEG encoding corresponding to one MCU pixel block is not fixed, ranging from 1 bit to 16 bits. The number of MCU pixel blocks between RSTs in each JPEG image is fixed, and this fixed number of MCU pixel blocks between RSTs is considered a specific quantity.

[0097] The working principle of the above technical solution is as follows: A structured segmentation of the JPEG image is performed to extract multiple basic coding units (MCU pixel blocks). Each MCU pixel block is fixed at 8x8 pixels in size, and the total number of extracted MCUs is set to a preset target number. The RST (Reset) identifier inherent in JPEG encoding is used as a segmentation marker. Since the number of MCU pixel blocks contained between RST identifiers in each JPEG image is fixed (i.e., a specific number), the MCU pixel blocks within a specific range can be quickly located and grouped into the corresponding target sub-image by directly identifying the position of the RST identifier. Although the data representation length of a single MCU pixel block in JPEG encoding is not fixed (1 bit-16 bits), the accurate division of MCU blocks can still be achieved by relying on the correspondence between the RST identifier and a fixed number of MCUs, without the need to parse the specific encoded data content.

[0098] The advantages of the above technical solution are as follows: Compared with existing technologies, this embodiment can achieve JPEG segmentation faster while ensuring lossless JPEG image processing. It represents a significant improvement for JPEG segmentation. Segmentation is based on the MCU structure and RST identifiers within JPEG, without involving pixel data decoding and recoding, completely preserving the original image information and achieving truly lossless segmentation. Utilizing the correspondence between RST identifiers and a fixed number of MCUs avoids complex parsing of variable-length encoded data, significantly reducing computational overhead and greatly improving segmentation speed. The fixed 8x8 size of the MCU pixel blocks ensures the consistency of segmentation units, and combined with the accurate positioning of RST identifiers, makes sub-image boundaries clear and division precise, avoiding pixel-level misalignment or information loss. Regarding the variable length of MCU data representation (1 bit to 16 bits), by relying on the fixed interval characteristics of RST markers, there is no need to adapt to encoded data of different lengths, improving the method's universality for various JPEG images.

[0099] In one embodiment of the present invention, the segmentation module includes:

[0100] The traversal module is used to traverse a JPEG image file as a byte array.

[0101] The pixel block acquisition module is used to acquire a specific number of MCU pixel blocks via RST markers.

[0102] Determine the position of each MCU pixel block within a specific number of MCU pixel blocks corresponding to a target number of MCU pixel blocks;

[0103] An array construction module is used to construct multiple sub-byte arrays and append a specific number of MCU pixel blocks to the sub-byte arrays, wherein the number of the sub-byte arrays is the same as the target number;

[0104] The first append module is used to detect whether a key identifier is generated during the append process, and append the MCU pixel block corresponding to the key identifier to the subbyte array.

[0105] The second additional module is used to construct a sub-image corresponding to each MCU pixel block using a sub-byte array.

[0106] The working principle of the above technical solution is as follows: JPEG image files are converted into byte arrays, and the entire file byte stream is scanned in a single traversal, avoiding the overhead of repeated reading; during the traversal, RST identifiers are identified, and based on their fixed correspondence with a specific number of MCU pixel blocks, all MCU pixel blocks within that range are accurately extracted; the positions of these specific number of MCU pixel blocks within a preset target number of MCU blocks are determined, establishing a mapping relationship between individuals and the whole; a sub-byte array equal to the target number is constructed, and the extracted specific number of MCU pixel blocks are appended to the corresponding sub-byte array according to their positional correspondence; key identifiers appearing during the appending process (such as control information necessary for encoding) are simultaneously detected to ensure that their corresponding MCU pixel blocks are correctly included in the sub-byte array, guaranteeing the integrity of the sub-byte array; using each sub-byte array as the data basis, a sub-graph corresponding to each MCU pixel block is directly constructed, completing the conversion from byte stream to sub-graph.

[0107] The above technical solution achieves the following effects: It extracts and processes all key information (RST identifier, MCU pixel blocks, and key identifiers) through a single byte array traversal, significantly reducing I / O operations and data scanning times, thus lowering time complexity; it directly locates target MCU pixel blocks by relying on the fixed association between the RST identifier and a specific number of MCUs, avoiding segmented parsing of the entire byte stream and reducing positioning errors; the number of sub-byte arrays strictly matches the target number, and MCU pixel blocks are appended according to their positions, ensuring a high degree of consistency between the sub-image and the preset target segmentation structure, guaranteeing the standardization of segmentation; the detection of key identifiers and the forced appending of corresponding MCUs avoid the omission of encoding control information, ensuring that the sub-byte array contains all the data required to construct a valid sub-image, guaranteeing the decodeability and integrity of the sub-image; the entire process is based on byte stream operations and identifier matching, eliminating the need for complex decoding and re-encoding processes, achieving efficient conversion from the original JPEG to the sub-image with minimal computational overhead.

[0108] In one embodiment of the present invention, the efficient and lossless image segmentation system further includes:

[0109] The real-time monitoring module is used to monitor the number of concurrent JPEG image segmentations per unit time in real time.

[0110] The quantity comparison module is used to compare the number of concurrent requests with a preset concurrent request threshold.

[0111] The resource usage parameter acquisition module is used to retrieve the resource usage parameters corresponding to JPEG image segmentation when the number of concurrent processes exceeds a preset concurrency threshold. The resource usage parameters include memory utilization, CPU utilization, network bandwidth utilization, and image storage data volume.

[0112] The resource utilization coefficient acquisition module is used to acquire the resource utilization coefficient using the memory utilization rate, CPU utilization rate, network bandwidth utilization rate, and image storage data volume;

[0113] The resource utilization coefficient is obtained by the following formula:

[0114]

[0115] Where K represents the resource utilization coefficient; n represents the number of unit time intervals taken for the JPEG image segmentation operation; P ni and P ci P represents the memory utilization and CPU utilization corresponding to the i-th unit of time, respectively; wi Let R represent the network bandwidth utilization rate corresponding to the i-th unit of time; R represents the adjustment coefficient, which is obtained by the following formula:

[0116]

[0117] Where R represents the adjustment coefficient; P ni This represents the memory utilization rate corresponding to the i-th unit of time; C i C represents the amount of image data stored in the i-th unit of time; i+1 This represents the amount of image data stored in the (i+1)th unit of time.

[0118] The coefficient comparison module is used to compare the resource utilization coefficient with a preset coefficient threshold.

[0119] The load warning module is used to determine overload and issue an overload warning when the resource utilization coefficient exceeds a preset coefficient threshold.

[0120] The working principle of the above technical solution is as follows: Real-time monitoring of the concurrent number of JPEG image segmentations per unit time serves as the initial basis for judging the load status; the real-time concurrent number is compared with a preset threshold, and further resource consumption assessment is triggered only when the concurrent number exceeds the threshold; key resource consumption parameters for the corresponding time period are retrieved, including memory utilization (Pni), CPU utilization (Pci), network bandwidth utilization (Pwi), and image storage data volume (Ci), forming a multi-dimensional assessment basis; the resource utilization coefficient (K) is calculated based on the above parameters: first, dynamic adaptation is achieved through an adjustment coefficient (R)—R integrates memory utilization (Pni) and changes in image storage data volume in adjacent unit times (Ci and Ci+1) to reflect the impact of dynamic storage on resource consumption; then, R is integrated with the memory, CPU, and network bandwidth utilization for each unit time, and K is obtained through cumulative calculation over multiple unit times (n times), realizing the quantification of resource load; the resource utilization coefficient (K) is compared with a preset threshold, and when K exceeds the threshold, the system is determined to be in an overload state and an early warning is triggered.

[0121] The effects of the above technical solution are as follows: Real-time concurrency monitoring and resource parameter acquisition enable dynamic tracking of the load status during the segmentation process, ensuring that potential overload risks are captured in a timely manner; integration of multi-dimensional resource parameters such as memory, CPU, network bandwidth, and storage data volume avoids misjudgment based on a single indicator, providing a more comprehensive reflection of the actual system load; the adjustment coefficient (R) incorporates the temporal changes in storage data volume, enabling the resource utilization coefficient (K) to adapt to the impact of storage fluctuations on overall resource usage, improving the accuracy of quantitative assessment; through a two-layer verification process of "initial screening of concurrency thresholds → refined evaluation of resource coefficients," false alarms caused by instantaneous fluctuations are reduced, ensuring that responses are triggered only in cases of substantial overload; timely overload warnings provide a basis for resource scheduling (such as dynamic allocation of computing power and limiting concurrency), preventing system performance degradation or crashes due to excessive load, and ensuring the efficient and stable operation of the JPEG image segmentation process.

[0122] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A highly efficient and lossless image segmentation method, characterized in that, The efficient and lossless image segmentation method includes: segmenting the JPEG image to obtain multiple MCU pixel blocks, and setting the number of MCU pixel blocks as a target number; using the RST identifier to quickly group specific MCU pixel blocks into the target sub-image.

2. The efficient and lossless image segmentation method according to claim 1, characterized in that, The size of the MCU pixel block is a fixed 8x8 pixels, and the data representation length in the JPEG encoding corresponding to one MCU pixel block is not fixed, wherein the data representation length ranges from 1 bit to 16 bits.

3. The efficient and lossless image segmentation method according to claim 1, characterized in that, The number of MCU pixel blocks between RSTs in each JPEG image is fixed, and the fixed number of MCU pixel blocks between RSTs is regarded as a specific number.

4. The efficient and lossless image segmentation method according to claim 1, characterized in that, The method of quickly grouping specific MCU pixel blocks into a target sub-graph using RST identifiers includes: traversing the JPEG image file as a byte array; obtaining a specific number of MCU pixel blocks using RST markers; determining the position of each MCU pixel block in the specific number corresponding to the target number of MCU pixel blocks; constructing multiple sub-byte arrays and appending the specific number of MCU pixel blocks to the sub-byte arrays, wherein the number of sub-byte arrays is the same as the target number; detecting whether a key identifier is generated during the appending process, and appending the MCU pixel blocks corresponding to the key identifiers to the sub-byte arrays; and constructing a sub-graph corresponding to each MCU pixel block using the sub-byte arrays.

5. The efficient and lossless image segmentation method according to claim 1, characterized in that, The efficient and lossless image segmentation method further includes: real-time monitoring of the number of concurrent JPEG image segmentations per unit time; comparing the number of concurrent operations with a preset concurrent operation threshold; when the number of concurrent operations exceeds the preset concurrent operation threshold, retrieving the resource usage parameters corresponding to the JPEG image segmentation, wherein the resource usage parameters include memory utilization, CPU utilization, network bandwidth utilization, and image storage data volume; and obtaining a resource utilization coefficient using the memory utilization, CPU utilization, network bandwidth utilization, and image storage data volume; wherein the resource utilization coefficient is obtained by the following formula: Where K represents the resource utilization coefficient; n represents the number of unit time intervals taken for the JPEG image segmentation operation; P ni and P ci P represents the memory utilization and CPU utilization corresponding to the i-th unit of time, respectively; wi Let R represent the network bandwidth utilization rate corresponding to the i-th unit of time; R represents the adjustment coefficient, which is obtained by the following formula: Where R represents the adjustment coefficient; P ni This represents the memory utilization rate corresponding to the i-th unit of time; C i C represents the amount of image data stored in the i-th unit of time; i+1 This represents the amount of image storage data corresponding to the (i+1)th unit of time; the resource utilization coefficient is compared with a preset coefficient threshold; when the resource utilization coefficient exceeds the preset coefficient threshold, it is determined that the load is overloaded and an overload warning is issued.

6. A high-efficiency, lossless image segmentation system, characterized in that, The efficient and lossless image segmentation system includes: a segmentation module for segmenting the JPEG image, obtaining multiple MCU pixel blocks, and setting the number of MCU pixel blocks as a target number; and a summarization module for quickly summarizing specific MCU pixel blocks into the target sub-image using RST identifiers.

7. The efficient and lossless image segmentation system according to claim 6, characterized in that, The size of the MCU pixel block is a fixed 8x8 pixels, and the data representation length in the JPEG encoding corresponding to one MCU pixel block is not fixed, wherein the data representation length ranges from 1 bit to 16 bits.

8. The efficient and lossless image segmentation system according to claim 6, characterized in that, The number of MCU pixel blocks between RSTs in each JPEG image is fixed, and the fixed number of MCU pixel blocks between RSTs is regarded as a specific number.

9. The efficient and lossless image segmentation system according to claim 6, characterized in that, The segmentation module includes: a traversal module for traversing the JPEG image file as a byte array; a pixel block acquisition module for acquiring a specific number of MCU pixel blocks using RST markers; determining the position of each MCU pixel block in the specific number corresponding to a target number of MCU pixel blocks; an array construction module for constructing multiple sub-byte arrays and appending the specific number of MCU pixel blocks to the sub-byte arrays, wherein the number of sub-byte arrays is the same as the target number; a first append module for detecting whether a key identifier is generated during the appending process and appending the MCU pixel block corresponding to the key identifier to the sub-byte array; and a second append module for constructing a sub-image corresponding to each MCU pixel block using the sub-byte arrays.

10. The efficient and lossless image segmentation system according to claim 6, characterized in that, The efficient and lossless image segmentation system further includes: a real-time monitoring module for real-time monitoring of the number of concurrent JPEG image segmentations per unit time; a quantity comparison module for comparing the number of concurrent operations with a preset concurrent operation threshold; a resource usage parameter acquisition module for retrieving resource usage parameters corresponding to JPEG image segmentation when the number of concurrent operations exceeds the preset concurrent operation threshold, wherein the resource usage parameters include memory utilization, CPU utilization, network bandwidth utilization, and image storage data volume; and a resource utilization coefficient acquisition module for acquiring a resource utilization coefficient using the memory utilization, CPU utilization, network bandwidth utilization, and image storage data volume; wherein the resource utilization coefficient is obtained using the following formula: Where K represents the resource utilization coefficient; n represents the number of unit time intervals taken for the JPEG image segmentation operation; P ni and P ci P represents the memory utilization and CPU utilization corresponding to the i-th unit of time, respectively; wi Let R represent the network bandwidth utilization rate corresponding to the i-th unit of time; R represents the adjustment coefficient, which is obtained by the following formula: Where R represents the adjustment coefficient; P ni This represents the memory utilization rate corresponding to the i-th unit of time; C i C represents the amount of image data stored in the i-th unit of time; i+1 This represents the amount of image storage data corresponding to the (i+1)th unit of time; the coefficient comparison module is used to compare the resource utilization coefficient with a preset coefficient threshold; the load warning module is used to determine overload and issue an overload warning when the resource utilization coefficient exceeds the preset coefficient threshold.