Express sheet compression method and system based on information extraction and reconstruction

By intelligently reconstructing the vertical layout and compressing the row height, combined with optimizing the multi-column layout of the express waybill, the problem of vertical blank redundancy in the express waybill is solved, and the waybill height is significantly reduced while maintaining information integrity. It is suitable for the generation and optimization of waybills for various express companies.

CN121328463APending Publication Date: 2026-01-13ZHANGZHOU JINGHUA SURFACE FINISHING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511461640.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing express waybills have blank spaces and redundancy in their vertical layout, resulting in larger sizes, increased logistics costs, and environmental problems. Current technologies have not been able to effectively solve this problem through layout optimization.

Method used

The method of optimizing express waybills by intelligent vertical layout reconstruction and row height compression, combined with multi-column layout, includes data extraction, vertical layout reconstruction, row height compression and multi-column layout, dynamically adjusting element arrangement and line spacing to optimize waybill height.

Benefits of technology

Without altering the information content, it significantly reduces the vertical height of express delivery waybills by 25%-40%, reducing paper consumption, maintaining information integrity and readability, and adapting to various express delivery company API interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121328463A_ABST
    Figure CN121328463A_ABST
Patent Text Reader

Abstract

An express sheet compression method based on information extraction and reconstruction belongs to the technical field of logistics information, and comprises the following steps: S1, data extraction; s2, longitudinal layout reconstruction; s3, performing row height compression; and S4, carrying out multi-column layout. An express sheet compression system based on information extraction and reconstruction comprises a data extraction module, a longitudinal layout reconstruction module, a row height compression module, a multi-column layout module and a height evaluation module which are installed in a PC. According to the method, high reduction is realized on the premise of not merging or deleting any information express sheet content; through longitudinal layout reconstruction and row height compression, the longitudinal height of the surface sheet can be reduced by 25%-40%; all original information elements are completely reserved, so that the accuracy of logistics information is ensured; the longitudinal space is further compressed through intelligent splitting; and the method can support various API interfaces of express companies without changing the original data format. According to the method, the technical problem of longitudinal blank redundancy of the express sheet is solved, the paper and logistics cost is reduced, and the method is more environment-friendly.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of logistics information technology, in particular to a kind of express waybill compression method and system based on information extraction and reconstruction. BACKGROUND

[0002] Traditional express waybill usually adopts fixed format, which mainly includes recipient information, sender information, commodity information, bar code / QR code and other modules. In order to ensure readability and facilitate manual operation, there is usually a large blank between these modules, resulting in a large overall size of the waybill. Larger waybills not only consume more paper and increase logistics costs, but also are not environmentally friendly.

[0003] There are some methods in the prior art to try to reduce the size of the waybill, but they are mostly limited to using smaller fonts, more compact pre-made templates or reducing information content. These methods may compromise the readability or integrity of the waybill. Currently applied technology has not yet had a solution that can dynamically and intelligently reconstruct the layout according to the actual content of each waybill information to achieve precise compression of the size. The standard waybill templates generated by various express companies through API interfaces (standard protocols for communication between different software systems) have the following obvious technical defects in vertical layout: (1) fixed line height setting: traditional waybills use a uniform fixed line height that cannot be dynamically adjusted according to content height, resulting in excessive interline blank space. (2) conservative vertical spacing: to ensure readability, a large safety spacing is set between lines, causing vertical space waste. (3) single-column layout limitation: information elements are strictly arranged in a single column, and the overall height cannot be reduced by using multi-column layout. (4) inefficient paragraph segmentation: long text content is displayed in a single paragraph without reasonable column or segment optimization. In summary, existing technology mainly focuses on the integrity of waybill content and involves limited layout adjustments, but none of them systematically solves the problem of vertical blank redundancy. How to reduce the height of the waybill through pure layout optimization is still a technical gap. Therefore, it is necessary to provide a technical solution that can automatically compress the size of the express waybill without losing any effective information through intelligent analysis. SUMMARY

[0004] To overcome the technical limitations of existing express waybill compression, which has obvious technical defects in vertical layout, the present application provides a kind of express waybill compression method and system based on information extraction and reconstruction, which significantly reduces the vertical height of the express waybill through intelligent vertical layout reconstruction and line height compression without changing the information content under the joint action of related technical solutions.

[0005] The technical solution adopted by the present application to solve its technical problems is: A kind of express sheet compression method based on information extraction and reconstruction, comprising the following steps, S1: data extraction, receiving the express sheet information of generated template from the API interface of express company, API response data is parsed by data extraction module, and the key express information element is extracted;S2: longitudinal layout reconstruction, by longitudinal layout reconstruction module, using intelligent vertical arrangement algorithm, the extracted information is recombined, and longitudinal blank redundancy is eliminated;S3: line height compression, by line height compression module, the invalid space between information lines is reduced by compression algorithm;S4: multi-column layout, the optimized compact express sheet is generated by multi-column layout module, and the content suitable for implementation is displayed by column, the height of sheet overall is reduced, and the height change of express sheet is displayed by height evaluation module.

[0006] Further, in the step S2, the longitudinal layout reconstruction module has vertical stacking unit, and the vertical stacking unit is used to optimize the vertical arrangement order of elements under the premise of maintaining information integrity by its algorithm.

[0007] Further, in the step S2, the following three sub-steps are included, S2-1: analyzing the height characteristics and correlation level of each information element in step S1;S2-2: dynamically adjusting the vertical arrangement order according to the element height;S2-3: reducing the overall occupied height by using compact vertical stacking mode.

[0008] Further, in the step S3, the line height compression module has dynamic line spacing adjustment unit, and the dynamic line spacing adjustment unit is used to automatically adjust the line spacing size according to the line content type by its algorithm.

[0009] Further, in the step S3, the following three sub-steps are included, S3-1: dynamically adjusting the line spacing size according to the line content type;S3-2: eliminating the reserved vertical blank area in fixed template;S3-3: optimizing paragraph spacing and block spacing.

[0010] Further, in the step S4, the multi-column layout module can automatically segment long content into multi-column display to reduce overall height, including the following three sub-steps, S4-1: segmenting long address information into multi-column display;S4-2: using parallel arrangement for additional information;S4-3: optimizing column spacing balance.

[0011] The application discloses a delivery slip compression system based on information extraction and reconstruction, which comprises a data extraction module, a longitudinal layout reconstruction module, a line height compression module, a multi-column layout module and a height evaluation module.

[0012] Further, the data extraction module can keep the integrity and independence of original information, and the longitudinal layout reconstruction module can keep the readability of information and maximize the utilization of longitudinal space.

[0013] Further, the line height compression module can verify the readability of compressed information, and the multi-column layout module can manage the spacing and alignment between columns.

[0014] Compared with the prior art, the application has the following beneficial effects: (1) pure longitudinal optimization: the height of a delivery slip is reduced without merging or deleting any information; (2) significant height reduction: through longitudinal layout reconstruction and line height compression, the longitudinal height of the delivery slip can be reduced by 25%-40%; (3) keeping information integrity: all original information elements are kept intact, ensuring the accuracy of logistics information; (4) multi-column layout advantage: the longitudinal space is further compressed through intelligent column division; (5) strong adaptability: the system can support API interfaces of various express companies without changing the original data format. BRIEF DESCRIPTION OF DRAWINGS

[0015] Figure 1 is the architecture block diagram of the delivery slip compression method based on information extraction and reconstruction. DETAILED DESCRIPTION

[0016] Figure 1As shown, a kind of express sheet compression method based on information extraction and reconstruction, including the following steps, 1: data extraction, receive the express sheet information of generated template from the API interface of express company, API response data is parsed by data extraction module, and the key express information element is extracted.2: longitudinal layout reconstruction, the extracted information is rearranged and combined by longitudinal layout reconstruction module using intelligent vertical arrangement algorithm, and longitudinal blank redundancy is eliminated;Longitudinal layout reconstruction module has vertical stacking unit, and vertical stacking unit is used to optimize the vertical arrangement order of element under the premise of maintaining information integrity by its algorithm;Specifically, including the following steps, 2-1: analyze the height characteristics and correlation level of each information element in step S1;2-2: according to the element height, dynamically adjust the vertical arrangement order;2-3: use compact vertical stacking mode to reduce the overall occupied height.3: line height compression, the invalid space between information lines is reduced by line height compression module through compression algorithm;Line height compression module has dynamic line spacing adjustment unit, and dynamic line spacing adjustment unit is used to automatically adjust the line spacing size according to the line content type by its algorithm;Specifically, including the following steps, 3-1: dynamically adjust the line spacing size according to the line content type;3-2: eliminate the reserved vertical blank area in fixed template;3-3: optimize paragraph spacing and block spacing.4: multi-column layout, the optimized compact express sheet is generated by multi-column layout module, the content suitable for content is displayed by column, the height of the whole sheet is reduced, and the height change of express sheet is displayed by height evaluation module;Multi-column layout module can automatically divide long content into multi-column display to reduce the overall height, specifically, including the following three steps, 4-1: long address information is divided into multi-column display;4-2: additional information is arranged in parallel;4-3: optimize the column spacing balance.

[0017] A kind of express sheet compression system based on information extraction and reconstruction, including data extraction module, longitudinal layout reconstruction module, line height compression module, multi-column layout module, height evaluation module installed in PC machine.Data extraction module can uniformly parse the API response format of different express companies, extract complete structured express information, maintain the integrity and independence of original information.Longitudinal layout reconstruction module can realize vertical intelligent arrangement algorithm, dynamically calculate the optimal longitudinal layout scheme, maintain the readability of information while maximizing the utilization rate of longitudinal space.Line height compression module can analyze the vertical blank distribution in existing express sheet layout, implement line spacing compression strategy, and verify the readability of compressed. Multi-column layout module can identify the content suitable for multi-column display, automatically calculate the optimal column division scheme, and manage column spacing and alignment.Height evaluation module is used to calculate and feed back the height change of sheet before and after longitudinal optimization in real time.

[0018] The following is a kind of express sheet compression method based on information extraction and reconstruction, wherein the implementation process of several modules (by software programming) is specifically implemented.

[0019] (1) The function of the vertical layout reconstruction module is implemented as follows: python class VerticalLayoutReconstructor: def __init__(self): self.vertical_priority = { 'barcode': 1, # Barcode - highest priority, usually at the top 'receiver_address': 2, # Receiver address 'receiver_info': 3, # Receiver information 'sender_address': 4, # Sender address 'sender_info': 5, # Sender information 'order_info': 6, # Order information 'additional_info': 7 # Additional information } self.line_height_config = { 'compact': 1.0, # Compact line height 'normal': 1.2, # Normal line height 'spacious': 1.5 # Spacious line height } def reconstruct_vertical_layout(self, express_data): """Reconstruct vertical layout""" # Analyze vertical characteristics of elements vertical_analysis = self._analyze_vertical_elements(express_data) # Generate optimized vertical layout scheme optimized_layout = self._generate_optimized_vertical_layout(vertical_analysis) # Apply line height compression compressed_layout = self._apply_line_height_compression(optimized_layout) return compressed_layout def _analyze_vertical_elements(self, data): """Analyze the vertical characteristics of each element""" analysis = {} for element_type, content in data.items(): content_str = str(content) line_count = self._estimate_line_count(content_str) analysis[element_type] = { 'line_count': line_count, 'content_length': len(content_str), 'priority': self.vertical_priority.get(element_type, 99), 'is_multiline': line_count > 1, 'suitable_for_columns': self._is_suitable_for_columns(content_str,line_count) } return analysis def _generate_optimized_vertical_layout(self, analysis): """Generate an optimized vertical layout""" # Sort by priority and number of lines sorted_elements = sorted(analysis.items(), key=lambda x: (x[1]['priority'], x[1]['line_count'])) layout_plan = {} current_vertical_position = 0 for element_type, props in sorted_elements: # Calculate the optimal vertical position and occupied height of the element optimal_height = self._calculate_optimal_height(props) layout_plan[element_type] = { 'vertical_position': current_vertical_position, 'allocated_height': optimal_height, 'line_height_type': self._determine_line_height_type(props['priority']), 'use_columns': props['suitable_for_columns'] and props['line_count']> 2 } current_vertical_position += optimal_height return layout_plan def _estimate_line_count(self, content, max_chars_per_line=30): """Estimated number of lines""" if len(content) <= max_chars_per_line: return 1 else: return (len(content) + max_chars_per_line - 1) / / max_chars_per_line (2) The functionality of the line compression module is implemented as follows: Python class LineHeightCompressor: def __init__(self): self.compression_rules = { 'single_line': 0.8, # Single-line compression ratio 'multi_line': 0.9, # Multiline compression ratio 'barcode': 1.0, # Barcode not compressed 'address': 0.85 # Address content compression ratio } def compress_vertical_layout(self, layout_data, content_data): "Compressing the vertical layout" compressed_data = layout_data.copy() # Analyze the existing vertical blank distribution vertical_whitespace = self._analyze_vertical_whitespace(layout_data,content_data) # Apply compression strategy for element_type, element_info in compressed_data.items(): content = content_data.get(element_type, "") compression_ratio = self._get_compression_ratio( element_type, element_info['line_height_type'], content ) # Adjust element row height compressed_data[element_type]['allocated_height'] = int( element_info['allocated_height'] * compression_ratio ) # Apply multi-column layout if applicable if element_info.get('use_columns', False): compressed_data[element_type] = self._apply_multi_column_layout( compressed_data[element_type], content ) return compressed_data def _analyze_vertical_whitespace(self, layout, content_data): """Analyze vertical whitespace distribution""" total_height = sum(item['allocated_height'] for item in layout.values()) used_height = self._calculate_used_height(layout, content_data) return { 'total_whitespace': total_height - used_height, 'whitespace_ratio': (total_height - used_height) / total_height, 'compression_potential': 'high' if (total_height - used_height) / total_height > 0.3 else'medium' } (3)The functions of the multi-column layout module are implemented as follows: python class MultiColumnLayout: def __init__(self): self.column_configs = { 'two_columns': { 'column_count': 2, 'gutter_width': 2, 'max_chars_per_column': 20 }, 'three_columns': { 'column_count': 3, 'gutter_width': 1, 'max_chars_per_column': 15 } } def apply_multi_column(self, content, layout_info): """Apply multi-column layout""" if not layout_info.get('use_columns', False): return {'content': content, 'layout':'single_column'} content_length = len(content) line_count = layout_info.get('line_count', 1) # Select the number of columns based on the content length if content_length > 60 or line_count > 3: column_config = self.column_configs['three_columns'] elif content_length > 30 or line_count > 2: column_config = self.column_configs['two_columns'] else: return {'content': content, 'layout':'single_column'} # Split the content into multiple columns columns = self._split_content_to_columns(content, column_config) return { 'content': columns, 'layout': f"{column_config['column_count']}_columns", 'height_reduction': self._calculate_height_reduction(line_count,column_config['column_count']) } def _split_content_to_columns(self, content, config): """Split the content into multiple columns""" words = content.split() columns = [[] for _ in range(config['column_count'])] current_column = 0 current_length = 0 for word in words: if current_length + len(word) > config['max_chars_per_column'] and current_column < config['column_count'] - 1: current_column += 1 current_length = 0 columns[current_column].append(word) current_length += len(word) + 1 # +1 for space # Convert the list of words in each column to a string column_texts = [] for column in columns: if column: # Ensure the column is not empty column_texts.append(' '.join(column)) return column_texts (4) The functions of the height evaluation module are implemented as follows: Python class ExpressLabelVerticalOptimizer: def __init__(self): self.vertical_reconstructor = VerticalLayoutReconstructor() self.line_compressor = LineHeightCompressor() self.column_layout = MultiColumnLayout() def optimize_label_vertical_layout(self, api_response): "Optimize the vertical layout of waybills" try: # 1. Extract Data express_data = self.extract_express_data(api_response) # 2. Reconstruct the vertical layout reconstructed = self.vertical_reconstructor.reconstruct_vertical_layout(express_data) # 3. Compress line height compressed = self.line_compressor.compress_vertical_layout(reconstructed, express_data) # 4. Apply multi-column layout column_optimized = self.apply_multi_column_layout(compressed,express_data) # 5. Generate the final shipping label final_label = self.generate_final_vertical_label(column_optimized, express_data) # 6. Calculate optimization effect optimization_metrics = self.calculate_vertical_optimization_metrics( express_data, final_label ) return { 'success': True, 'optimized_label': final_label, 'metrics': optimization_metrics, 'original_layout': express_data, 'optimized_layout': column_optimized } except Exception as e: return {'success': False, 'error': str(e)} def calculate_vertical_optimization_metrics(self, original, optimized): """Calculate vertical optimization metrics""" original_height = self.estimate_layout_height(original) optimized_height = self.estimate_layout_height(optimized) reduction = (original_height - optimized_height) / original_height * 100 return { 'original_height': original_height, 'optimized_height': optimized_height, 'height_reduction': f"{reduction:.1f}%", 'line_count_reduction': self.calculate_line_count_reduction(original,optimized), 'multi_column_applications': self.count_multi_column_applications(optimized) } def apply_multi_column_layout(self, layout_data, content_data): """Apply multi - column layout to suitable elements""" optimized_layout = layout_data.copy() for element_type, layout_info in optimized_layout.items(): if layout_info.get('use_columns', False): content = content_data.get(element_type, "") column_result = self.column_layout.apply_multi_column(content,layout_info) # Update layout information to reflect multi - column optimization optimized_layout[element_type].update({ 'multi_column_data': column_result, 'allocated_height': layout_info['allocated_height'] * column_result.get('height_reduction', 0.7) }) return optimized_layout This invention verifies its technical effectiveness through actual testing (comparing express waybills processed by this invention with those not processed by this invention). The test samples are as follows: (1) The sample size of the specific test environment was 600 waybills from different express companies. The test content was pure vertical layout optimization without changing the information content. (2) Test results: The average height of the original waybill was 15.8cm; the average height of the waybill after optimization by this invention was 10.2cm, the average height was reduced by 35.4%, the maximum height was reduced by 48.7%, and the minimum height was reduced by 22.3%. (3) Multi-column layout effect: The proportion of content applicable to multi-column layout was 42.3%, the average height of multi-column layout was reduced by 28.5%, and the readability retention score was 4.3 / 5.0. Quality indicators: Information integrity retention rate was 100%, barcode recognition rate was 99.1%, and printing quality score was 4.5 / 5.0. With industrial applicability, this invention can be widely applied to e-commerce logistics system waybill generation, courier company internal waybill optimization, thermal printer waybill format optimization, cloud printing service vertical space optimization, mobile courier application waybill display optimization, and fixed-length label space optimization. Through pure vertical layout optimization technology innovation, this invention effectively solves the technical problem of vertical blank redundancy on courier waybills while maintaining information integrity. This not only reduces paper and logistics costs but is also more environmentally friendly, demonstrating significant economic benefits and widespread application value.

[0020] The foregoing has shown and described the basic principles and main features of the present invention, as well as its advantages. It will be apparent to those skilled in the art that the present invention is limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or basic characteristics. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, it is intended that all variations falling within the meaning and scope of equivalents of the claims be included within the present invention.

[0021] Furthermore, it should be understood that although this specification describes the embodiments, the embodiments do not necessarily contain only one independent technical solution. This way of describing the specification is only for clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in the embodiments can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A method for compressing express waybills based on information extraction and reconstruction, characterized in that, The process includes the following steps: S1: Data extraction, receiving pre-generated template express waybill information from the express company's API interface, parsing the API response data through the data extraction module to extract key express information elements; S2: Vertical layout reconstruction, using an intelligent vertical arrangement algorithm, rearranging and combining the extracted information through the vertical layout reconstruction module to eliminate vertical blank redundancy; S3: Row height compression, using a compression algorithm through the row height compression module to reduce invalid space between information rows; S4: Multi-column layout, generating an optimized compact express waybill through the multi-column layout module, displaying suitable content in separate columns to reduce the overall height of the waybill, and displaying the height changes of the express waybill through the height evaluation module.

2. The method for compressing express waybills based on information extraction and reconstruction according to claim 1, characterized in that, In step S2, the vertical layout reconstruction module has a vertical stacking unit, which uses its algorithm to optimize the vertical arrangement order of elements while maintaining information integrity.

3. The method for compressing express waybills based on information extraction and reconstruction according to claim 1, characterized in that, Step S2 includes the following three sub-steps: S2-1: Analyze the height characteristics and correlation level of each information element in step S1; S2-2: Dynamically adjust the vertical arrangement order according to the element height; S2-3: Reduce the overall occupied height using a compact vertical stacking mode.

4. The method for compressing express waybills based on information extraction and reconstruction according to claim 1, characterized in that, In step S3, the line height compression module has a dynamic line spacing adjustment unit, which uses its algorithm to automatically adjust the line spacing size according to the line content type.

5. The method for compressing express waybills based on information extraction and reconstruction according to claim 1, characterized in that, Step S3 includes the following three sub-steps: S3-1: Dynamically adjust the line spacing based on the line content type; S3-2: Eliminate the reserved vertical blank areas in the fixed template; S3-3: Optimize paragraph spacing and block spacing.

6. The method for compressing express waybills based on information extraction and reconstruction according to claim 1, characterized in that, In step S4, the multi-column layout module can automatically divide long content into multiple columns to reduce the overall height. This includes the following three sub-steps: S4-1: Divide long address information into multiple columns for display; S4-2: Arrange additional information in parallel; S4-3: Optimize the balance of column spacing.

7. A courier waybill compression system based on information extraction and reconstruction, characterized in that, The system includes a data extraction module, a vertical layout reconstruction module, a row height compression module, a multi-column layout module, and a height evaluation module. The data extraction module can uniformly parse the API response formats of different courier companies and extract complete structured courier information. The vertical layout reconstruction module can implement a vertical intelligent arrangement algorithm and dynamically calculate the optimal vertical layout scheme. The row height compression module can analyze the vertical blank distribution in the existing courier waybill layout and implement a row spacing compression strategy. The multi-column layout module can identify content suitable for multi-column display and automatically calculate the optimal column arrangement scheme. The height evaluation module is used to calculate and provide feedback on the change in waybill height before and after vertical optimization in real time.

8. A courier waybill compression system based on information extraction and reconstruction according to claim 7, characterized in that, The data extraction module maintains the integrity and independence of the original information; the vertical layout reconstruction module maintains information readability while maximizing the utilization of vertical space.

9. A courier waybill compression system based on information extraction and reconstruction according to claim 7, characterized in that, The row height compression module can verify the readability of the compressed data; the multi-column layout module can manage column spacing and alignment.