Two-dimensional graphic encoding and reading methods
By partitioning the two-dimensional graphic code into independent coding partitions and configuring self-descriptive information, combined with hierarchical recovery coding, the problems of occlusion and contamination in the reading of overhead contact line equipment identification are solved, and efficient data recovery is achieved in complex environments.
Patent Information
- Application Number
- CN202611576946.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-13
- Publication Date
- 2026-11-10
AI Technical Summary
Existing two-dimensional graphic codes are easily affected by factors such as occlusion, dirt, and tilted shooting when reading contact network equipment identification codes, resulting in a lack of uniform information in some areas, leading to reading failures, and there is a lack of processing mechanism for multiple collection results.
The two-dimensional graphic code is divided into multiple physical coding partitions, each of which is configured with self-descriptive information. Through the scatter mapping of logical data fragments and hierarchical recovery methods, it supports independent parsing of local partitions and progressive recovery through multiple acquisitions. It also utilizes local and global recovery coding to reduce the impact of occlusion.
It enables independent judgment of partition data under partial occlusion and contamination conditions, adapts to partial reading in complex environments, reduces the probability of continuous occlusion damaging data segments, and gradually recovers device identification data through multiple acquisitions.
Smart Images

Figure CN123070156A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of two-dimensional graphic code encoding and recognition technology, and in particular to a self-describing partitioned two-dimensional graphic encoding and progressive reading method for overhead contact line equipment identification. Background Technology
[0002] With the continuous expansion of high-speed railway and urban rail transit operations, the overhead contact system is gradually adopting digital inspection, mobile terminal operations, drone inspection, and intelligent operation and maintenance platforms to identify and manage information on components such as supports, cantilever arms, positioners, droppers, and insulators. QR codes, two-dimensional barcodes, matrix codes, and other machine-readable two-dimensional graphic codes have become important carriers for identifying overhead contact equipment, indexing ledgers, and associating inspection information. Overhead contact equipment identification is usually set on signs near supports, cantilever arm bases, positioning devices, insulators, equipment casings, or other visible locations. In on-site environments with high installation heights, dense structural components, large variations in shooting distances, and limited observation angles, inspection vehicles, drones, handheld terminals, or trackside imaging equipment often only capture a portion of the graphic code area in a single image acquisition during the motion acquisition process.
[0003] Existing two-dimensional graphic codes typically map data content, format information, positioning information, and error correction information into regularly arranged graphic units. Reading devices rely on the overall positioning structure and need to acquire a complete or relatively complete graphic code image at once to complete positioning, sampling, error correction, and data decoding. When the graphic code is obstructed by clues or metal components, covered by dust or oil, corroded or worn, affected by strong light reflection, oblique perspective, or field-of-view clipping, local areas lack unified information for determining ownership, direction, and location. Logically continuous data segments and data segments from the same error correction group may be excessively concentrated in physical space and simultaneously lost. Furthermore, there is a lack of a processing mechanism to continuously accumulate multiple acquisition results, leading to failure in reading contact network equipment identification tags. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a two-dimensional graphic encoding and reading method that supports independent identification of local partitions, data scatter mapping, hierarchical recovery, and progressive recovery through multiple acquisitions.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a two-dimensional graphic encoding and reading method, wherein the encoding end divides the data to be encoded into multiple logical data segments and the two-dimensional graphic code into multiple physical encoding partitions, and configures self-descriptive information for each physical encoding partition, including at least graphic code identification, partition coordinates and segment number, so that the partition can be parsed independently of the complete graphic code; according to the spatial adjacency relationship between the physical encoding partitions, the logical data segments are distributed and mapped to the physical encoding partitions, and recovery information is generated for the physical encoding partitions and written into the two-dimensional graphic code; the reading end parses the self-descriptive information of the visible physical encoding partitions in the acquired image, merges the valid partitions obtained at different acquisition times into a cumulative valid partition set according to the identification and coordinates, performs recovery when the recovery conditions are met, and restores the data to be encoded according to the segment number.
[0006] The beneficial effects of this invention are as follows: By configuring self-describing information for each physical coding partition, this method enables single or several visible partitions to independently determine their affiliation, location, and the data segments they carry, even without a complete graphic code, thus adapting to the local reading needs under structural occlusion, surface contamination, and tilted shooting conditions. By distributing and mapping data segments according to the spatial adjacency relationship between partitions, the probability of continuous occlusion or contamination areas simultaneously destroying multiple related data segments can be reduced. By merging effective partitions at different acquisition times into a cumulative set, device identification data can be gradually recovered using complementary information from multiple frames, without needing to obtain a complete graphic code in a single step. As a preferred approach, the encoding end divides logical data segments into local recovery groups and generates local recovery information. Simultaneously, it jointly generates cross-partition global recovery information from at least two local recovery groups. The reading end first determines the local recovery conditions; if insufficient, it then calls global recovery, ensuring that different damage or occlusion ranges correspond to different recovery paths.
[0007] Furthermore, when generating recovery information, some logical data fragments are divided into multiple local recovery groups. Local recovery information is generated for each local recovery group, and global recovery information is jointly generated from logical data fragments in at least two local recovery groups. During reading, it is first determined whether the cumulative valid partition set meets the local recovery conditions. If it does, local recovery is performed. If missing fragments still exist after local recovery and the global recovery conditions are met, global recovery is performed. By prioritizing local recovery and supplementing with global recovery, small-scale contamination or partial invisibility can be processed quickly, while retaining the ability to recover data lost due to cross-regional or large-scale occlusion, balancing recovery efficiency and recovery coverage. As a preferred approach, local recovery groups are divided according to a preset number, and the data fragments and their local recovery fragments in each group are distributed in a spatially dispersed location, reducing the probability that local reflections, contamination, or small-scale occlusion will simultaneously violate constraints within multiple groups.
[0008] Furthermore, local recovery information is generated using at least one of XOR checksum, Reed-Solomon coding, low-density parity check coding, or erasure coding, while global recovery information is generated using at least one of systematic erasure coding, Reed-Solomon coding, rate-free fountain coding, or random linear network coding. All of these recovery coding methods can solve for missing content based on the remaining fragments and the recovered fragments when some segments are missing. Local recovery information addresses small-scale missing segments within a group, while global recovery information addresses large-scale missing segments across groups. The combination of these two methods can cover missing scenarios of different scales, improving the adaptability of the recovery mechanism to different degrees of occlusion. As a preferred approach, global recovery fragments are written into physical coding partitions that are not adjacent to each other or have large graph distances, and are identified with different payload types than local recovery fragments to avoid simultaneously destroying multiple global recovery fragments in the same continuously damaged area.
[0009] Furthermore, the self-describing information also includes the encoding version of the two-dimensional graphic code, the orientation information of the physical encoding partition, the payload type, and the recovery group number. The encoding version describes the partition field structure, mapping rules, and recovery rules; the orientation information and payload type indicate the partition's standard orientation and the type of data it carries; and the recovery group number identifies the local recovery group to which the partition belongs. This allows the reader to perform cross-frame matching, orientation normalization, and recovery scheduling based on the self-describing information, further improving the completeness of independent partition parsing. As a preferred approach, the self-describing information uses a fixed field order, including graphic code identification, version identification, row coordinates, column coordinates, orientation information, payload type, fragment number, recovery group number, payload length, and header checksum. A payload checksum is set after the partition payload, thus completing self-checking within the partition.
[0010] Furthermore, each physical coding partition is equipped with non-rotationally symmetric local positioning and orientation markers. When parsing visible physical coding partitions, perspective correction and rotation normalization are first performed on the local positioning and orientation markers. Through the non-rotationally symmetric graphic structure, even if the reading device acquires a single partition from an inclined direction or different orientations, it can still determine the standard orientation based on its 90-degree, 180-degree, or 270-degree rotation after perspective correction, ensuring that the orientation information of the partition can be obtained independently. This is beneficial for the correct parsing of local partitions when they are separated from the overall positioning graphic. As a preferred approach, the orientation markers are mapped to graphic units along with the partition loads. During parsing, the sampling order of the partition loads is determined based on the orientation of the orientation markers, achieving rotationally normalized reading of the partition loads.
[0011] Furthermore, when distributing logical data segments to physical coding partitions based on their spatial adjacency relationships, a partition adjacency graph is established, with physical coding partitions as nodes and spatial adjacency relationships between partitions as edges. Logically adjacent logical data segments are mapped to physical coding partitions with a graph distance not less than a preset threshold, and logical data segments belonging to the same local recovery group are mapped to different rows, columns, or quadrants. By characterizing the spatial relationships between partitions and calculating graph distances through the partition adjacency graph, the degree of dispersion between partitions can be quantified, thereby placing strongly correlated segments in spatially distant locations and reducing the probability of multiple strongly correlated segments being simultaneously damaged by band-like occlusions or continuous contamination areas formed by tendons, cues, etc. As a preferred approach, two partitions sharing a boundary are defined as first-order adjacency, and two partitions sharing only vertices are defined as second-order adjacency. Weighted adjacency edges are set in conjunction with common occlusion directions, easily worn areas on sign edges, rainwater runoff directions, or reflective strip distributions, with the minimum cumulative risk used as the partition distance.
[0012] Furthermore, when merging visible physical code partitions obtained at different acquisition times into a cumulative valid partition set, the system determines whether the acquired physical code partition belongs to the currently read 2D graphic code based on its identity and encoding version. Physical code partitions belonging to different identity identifiers are established into independent cumulative sets. Physical code partitions that already exist in the cumulative valid partition set and have the same identity, encoding version, coordinates, and fragment number are not added again. By matching the identity identifier and encoding version, the system avoids confusion between graphic code partitions with different device identifiers or different versions. The deduplication rules ensure that each partition in the cumulative valid partition set is unique, providing accurate input for subsequent recovery condition determination. As a preferred approach, partitions that fail verification but have high image quality are marked as pending review and re-evaluated in subsequent repeated acquisitions before being added to the cumulative set.
[0013] Furthermore, the recovery conditions include direct decoding conditions, local recovery conditions, global recovery conditions, and continued acquisition conditions, determined sequentially. When the direct decoding condition is met, deinterleaving is performed directly. If the direct decoding condition is not met but the local recovery condition is met, local recovery is performed. If missing segments still exist after local recovery and the global recovery condition is met, global recovery is performed. If none of the above conditions are met, the cumulative valid partition set is retained and acquisition continues. By determining the recovery conditions in a tiered manner, the reader can select the most economical recovery path based on the current degree of missing data. This avoids unnecessary computation caused by calling global recovery for small-scale missing data and avoids recovery failure due to insufficient local recovery constraints for large-scale missing data, thus improving the convergence efficiency of incremental reading. As a preferred approach, the direct decoding condition is that all necessary logical data segments have been obtained and the information required for segment verification and overall integrity verification is valid. The local recovery condition is that the data segments obtained in the local recovery group of the missing segment and the locally recovered segments can form independent constraints sufficient to uniquely recover the missing segment. The global recovery condition is that the rank of the global recovery equation system is not less than the number of segments to be recovered.
[0014] Furthermore, a data header is added to the data to be encoded before segmentation. The data header records the original valid length and integrity check value of the data to be encoded. When restoring the data to be encoded, the restored logical data segments are reverse-mapped according to the segment number, padding bits are removed, and an overall check is performed based on the integrity check value before outputting. By recording the original valid length in the data header, it can be ensured that even if the last logical data segment is not long enough, it can still be accurately restored after padding. The overall check of the reconstruction result by the integrity check value can prevent erroneous recovery results from being output as device identification data, thus improving the reliability of the reading results. As a preferred method, the integrity check value adopts at least one of cyclic redundancy check value, hash value, or message authentication code. The output result includes the contact network device identification data, the number of acquisitions used, the list of partitions participating in the recovery, the recovery method, and the integrity check result.
[0015] Furthermore, the physical coding partitions are arranged according to rectangular grids, hexagonal grids, or circular areas. Quiet zones or separating units are provided between the physical coding partitions. Logical data fragments and recovery information are mapped to black-and-white, grayscale, or color graphic units. Through various partitioning arrangements and graphic unit forms, graphic codes can be flexibly arranged according to the carrying area, load capacity, and on-site printing conditions. The setting of quiet zones or separating units between partitions reduces sampling interference between adjacent partitions and improves the accuracy of independent partition resolution. As a preferred approach, the complete graphic code also includes a common border, a common identity area, or an auxiliary positioning area. However, the basic resolution of local partitions does not depend on the common area remaining intact, thus balancing overall recognition capability with local anti-occlusion capability. Attached Figure Description
[0016] Figure 1 This is an overall technical flowchart of an embodiment of the present invention; Figure 2 This is a schematic diagram of the physical encoding partition of the two-dimensional graphic code according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the data structure of a single self-describing coded partition according to an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the mapping of logical data segments to physically non-adjacent coded partitions according to an embodiment of the present invention; Figure 5 This is a schematic diagram illustrating the merging of effective encoding partitions at different acquisition times in an embodiment of the present invention; Figure 6 This is a flowchart illustrating the decision-making process for direct decoding, partial recovery, global recovery, and continued acquisition in an embodiment of the present invention. Detailed Implementation
[0017] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0018] The two-dimensional graphic encoding and reading method of this embodiment includes two parts: the encoding end processing flow and the reading end processing flow. The encoding end acquires the original data X to be encoded. X is data used to characterize the identity of overhead contact line equipment, ledger index, line location, or maintenance-related information. It may include at least one of the following: unique component identifier, line and section information, pole number or span index, component type, equipment ledger index, and maintenance information index. The encoding end performs format identification, data length recording, and integrity check value calculation on the original data. The integrity check value can be a cyclic redundancy check value, hash value, message authentication code, or other verification information that can determine the integrity of the reconstructed data. The encoding end combines the original data header, the original data, and the integrity check value to form the data stream X* to be fragmented.
[0019]
[0020] Where X is the original data to be encoded, X* is the data stream to be fragmented after adding the data header, Header is the data header constructor, type is the type or format identifier of the original data, length is the valid length of the original data, check is the integrity check value of the original data, and ∥ is the concatenation operation of fields or data sequences.
[0021] The encoding end divides the to-be-fragmented data stream into n logical data fragments D0, D1, ..., Dn-1 according to a preset fragment length, configures a unique fragment number for each logical data fragment, uses padding bits to complete the last logical data fragment if its length is insufficient, and records the original valid length in the data header; the number of the logical data fragment will not change due to subsequent physical mapping, and is used by the reading end to complete deinterleaving and logical order recovery.
[0022]
[0023] Wherein, X* represents the to-be-fragmented data stream; n represents the total number of logical data fragments; Dk represents the k-th logical data fragment; k represents the logical data fragment index, with a value range of 0≤k≤n-1; fragment_id(·) represents the fragment number function, and fragment_id(Dk)=k indicates that the number of the fragment Dk is k.
[0024] The encoding end divides the available bearing area of the two-dimensional graphic code into a plurality of physical encoding partitions, and the physical encoding partitions may be arranged in a rectangular grid, a hexagonal grid, an annular area or other manners that can establish a definite spatial position relationship. Taking the rectangular grid as an example, the complete two-dimensional graphic code is divided into M rows and N columns, a total of M×N physical encoding partitions, and B(r,c) is used to represent the physical encoding partition at row r and column c.
[0025]
[0026] Wherein, B is a set composed of all physical encoding partitions, B(r,c) is the physical encoding partition at row r and column c, M and N are the total number of rows and total number of columns of the physical encoding partitions respectively, r and c are the row index and column index of the physical encoding partitions respectively, 0≤r<M and 0≤c<N. Each physical encoding partition at least includes three parts: a local positioning and direction identifier, a self-describing header, and a partition payload, as Figure 3 shown below: the local positioning and direction identifier adopts a non-rotationally symmetric graphic structure, so that when a reading device collects a single partition from an inclined direction or different postures, it can still determine the standard direction according to its state of being rotated by 90 degrees, 180 degrees or 270 degrees after perspective correction; the self-describing header is used to record the graphic code identity identifier, encoding version, partition coordinates, payload type, fragment number, recovery group number, valid payload length and check field; the partition payload is used to store logical data fragments, local recovery fragments, global recovery fragments or auxiliary information. The graphic code identity identifier is used to distinguish the two-dimensional graphic codes corresponding to different catenary equipment, the encoding version is used to specify the partition field structure, mapping rules and recovery rules, the partition coordinates are used to determine the physical position of the partition in the complete graphic code, the payload type is used to distinguish data fragments, local recovery fragments, global recovery fragments and auxiliary partitions, and the fragment number is used to recover the logical order.
[0027] like Figure 2 As shown in the figure, this embodiment takes a 4×4 physical coding partition as an example to illustrate a spatial arrangement of data segment partition, local recovery segment partition, global recovery segment partition and auxiliary information partition, where D represents data segment, L represents local recovery segment, R represents global recovery segment, A represents auxiliary information, and the specific payload type of each partition is identified by the payload type field in the self-description header.
[0028] To ensure that the physical distribution of data fragments is adapted to the risk of continuous damage, the encoding end establishes a partition adjacency graph Gp=(V,E) based on the spatial relationship between each physical encoding partition, where node V corresponds to a physical encoding partition and edge E indicates that the two corresponding physical encoding partitions satisfy the preset adjacency conditions.
[0029]
[0030] Where Gp represents the adjacency graph of the physical coding partition; V represents the set of nodes; E represents the set of adjacent edges; m represents the total number of physical coding partitions, and in the case of an M-row N-column rectangular grid, m=M×N; Bi represents the physical coding partition node numbered i, where the value of i is 0≤i≤m-1, and Bi can be obtained by linearly numbering B(r,c) according to a preset numbering rule.
[0031] The preset adjacency conditions can be at least one of the following: shared boundary, shared vertex, center distance less than a threshold, or simultaneous impact within a preset continuous damage window. Preferably, two partitions sharing a boundary are defined as first-order adjacency, and two partitions sharing only a vertex are defined as second-order adjacency. In catenary applications, weighted adjacency edges can also be set based on common shading directions of clues or cantilever arms, easily worn areas of sign edges, rainwater runoff directions, or reflective strip distribution to represent the risk of different partitions being simultaneously invisible or simultaneously damaged under on-site inspection conditions. The partition adjacency graph is used to calculate the graph distance dGp between any two physical coding partitions. The larger the graph distance, the more dispersed the two partitions are under the preset adjacency relationship. For rectangular grids, the shortest path length can be used as the graph distance, and for weighted adjacency graphs, the minimum cumulative risk can be used as the partition distance, thereby ensuring that key associated segments in catenary equipment identification avoid locations that are easily affected simultaneously by the same structure or the same continuous contamination area.
[0032] The encoding end generates a reversible mapping π from logical data segment numbers to physical encoding partitions based on the partition adjacency graph. This mapping aims to reduce the centralized loss of associated data caused by continuous occlusion, continuous contamination, or field-of-view clipping in the contact wire field. For logically adjacent data segments Dk and Dk+1, the graph distance between their mapped partitions is required to be no less than a preset distance threshold δ.
[0033]
[0034] Where dGp(·,·) represents the graph distance between two physical coding partitions in the partition adjacency graph Gp; π represents the reversible mapping from logical data segment number to physical coding partition; k and k+1 represent the numbers of two logically adjacent data segments respectively; π(k) and π(k+1) represent the physical coding partitions to which the corresponding data segments are mapped; δ represents the preset minimum physical dispersion distance threshold.
[0035] For data segments belonging to the same local recovery group, it is also required that their mapping results be distributed in different rows, columns, quadrants, or preset damage windows, so that the number of data segments within a single continuous influence area formed by tendons, clues, stains, corrosion, or reflections does not exceed a preset upper limit. For global recovery information, it is preferable to distribute multiple global recovery segments to physical coding partitions that are not adjacent to each other or are far apart. The reversible mapping π can be obtained through a preset permutation table, partitioned cyclic shift, greedy selection, backtracking search, or combined optimization methods. In one implementation, the mapping objective function is constructed based on the minimum physical distance between logically adjacent segments, the spatial dispersion of the same recovery group, and the concentration of data within the continuous damage window.
[0036]
[0037] Wherein, J(π) represents the comprehensive evaluation objective function of mapping π, and the mapping result is preferably selected by making J(π) larger; dGp(π(k),π(k+1)) represents the graph distance between the physical coding partitions where logically adjacent segments are mapped, and min represents the minimum graph distance among all logically adjacent segment pairs; Disp(π) represents the spatial dispersion of segments in the same recovery group; Risk(π) represents the maximum number of segments in the same recovery group within any preset continuous damage window; λ1, λ2, and λ3 represent the weight coefficients of the above three evaluation items, respectively. After the mapping is generated, the mapping version or segment number is written into the self-description information, so that the reading end can perform inverse mapping according to the segment number without having to save the complete permutation table in the graphic code.
[0038] The encoding end divides several logical data segments into multiple local recovery groups Gu. Each local recovery group includes a preset number of data segments and generates one or more local recovery segments.
[0039]
[0040] Where Lu represents the local recovery segment or local recovery information corresponding to the u-th local recovery group; Flocal(·) represents the local recovery encoding function; Dk represents the k-th logical data segment; Gu represents the u-th local recovery group; k∈Gu means that only logical data segments belonging to the local recovery group Gu are selected to participate in the generation of local recovery information; u represents the local recovery group index.
[0041] Local recovery information can employ XOR verification, Reed-Solomon coding, low-density parity-check coding, erasure coding, or other coding methods capable of recovering missing segments from remaining segments. The division of local recovery groups and the interleaving of physical adjacency constraints work together to distribute data segments and local recovery segments within the same group in spatially dispersed locations, thereby reducing the probability of simultaneous violation of constraints within multiple groups when contact wire markings are affected by localized reflections, stains, small-scale occlusion, or wear. When a missing segment exists in a local recovery group, the reader determines whether the local recovery conditions are met based on the already obtained data segments, local recovery segments, and coding parameters for that group. If met, the missing segment in that group is recovered first, without needing to call all global recovery information. After local recovery is completed, the recovered data segment is added to the logical segment set corresponding to the cumulative valid partition set and re-verified.
[0042] To handle situations where multiple local recovery groups are simultaneously missing or damaged across different local recovery groups, the encoder jointly generates one or more global recovery segments Rv from data segments of at least two local recovery groups, and establishes cross-group recovery constraints for different local recovery groups.
[0043]
[0044] Where Rv represents the v-th global recovery segment; Fglobal(·) represents the cross-partition global recovery coding function; Dk represents the k-th logical data segment; G1 to Gq represent the q local recovery groups participating in global recovery coding; q represents the number of local recovery groups participating in joint coding; k represents the logical data segment index; v represents the global recovery segment index; and the symbol “∪” indicates that the data segment sets of different local recovery groups jointly participate in the generation of global recovery information.
[0045] Global recovery information can employ system erasure coding, Reed-Solomon coding, rate-free fountain coding, random linear network coding, or other cross-datagroup recovery coding. Global recovery segments are preferably written to physically coded partitions that are not adjacent to each other or have a large graph distance, and are identified with different payload types than local recovery segments. At the reading end, global recovery is only invoked when direct decoding conditions are not met, one or more local recovery groups cannot be independently recovered due to contact network structure obstruction, continuous contamination, or field-of-view clipping, and the accumulated valid information meets the global recovery conditions. By prioritizing local recovery and supplementing with global recovery, small-scale contamination or partial invisibility can be processed quickly, while retaining the ability to recover data lost due to cross-regional or large-scale obstruction.
[0046] The encoding end generates a self-describing header for each physical coding partition and uses logical data fragments, local recovery fragments, global recovery fragments, or auxiliary information as partition payloads. The self-describing header and partition payloads jointly perform partition-level verification to form independently parsable partition coding data. The partition coding data is mapped to black and white graphic units, grayscale graphic units, color graphic units, or other visual units that can be read by imaging equipment, and can be set on the contact network equipment identification carrier by printing, etching, spraying, nameplate affixing, or other methods. Each physical coding partition is set with local positioning and direction indicators. Quiet zones or separator units can be set between partitions to reduce sampling interference between adjacent partitions. The complete graphic code can also be set with a common border, common identity area, or auxiliary positioning area, but the basic parsing of local partitions does not depend on the common area to remain complete. In one embodiment, the self-describing header adopts a fixed field order, including graphic code identity identifier, version identifier, row coordinates, column coordinates, direction information, payload type, fragment number, recovery group number, payload length, and header verification. A payload verification is set after the partition payload. The number of bits of different fields is determined according to the graphic code size and payload capacity.
[0047] The reading device acquires images containing complete or partial graphic identifiers of the overhead contact line equipment through inspection vehicle-mounted cameras, drone cameras, handheld terminals, or trackside imaging equipment, and detects visible local positioning and orientation markers in the images. For detected candidate physical code partitions, the reading device performs perspective correction, rotation normalization, brightness normalization, and graphic unit sampling to adapt to long-distance, tilted shooting, motion blur, and local illumination changes, obtaining candidate partition coding data. The reading device parses the graphic code identity, version identifier, partition coordinates, payload type, segment number, recovery group number, and payload content of the candidate partitions, and checks the self-description header verification and payload verification respectively. Candidate partitions whose identity, version, or partition coordinates cannot be reliably parsed are not directly added to the cumulative set. Partitions that fail verification but have high image quality can be marked as pending review and re-evaluated in subsequent repeated acquisitions.
[0048] Let Ωt be the set of valid partitions obtained by the reading device during the t-th image acquisition, and Ω* be the set of historically accumulated valid partitions. The reading end first determines whether a new partition belongs to the currently being read contact network equipment based on the image code identification and version identification. For partitions with inconsistent identification or version, an independent accumulated set is established and not mixed with the current set. For partitions that do not yet exist in the accumulated set, new results are added according to partition coordinates and segment numbers. For partitions that already exist in the accumulated set and have the same identification, version, partition coordinates, and segment number, they are not added repeatedly, thus forming a set of accumulated valid partitions composed of valid partitions from different acquisition times.
[0049]
[0050] Where Ωt represents the set of valid partitions obtained from the t-th image acquisition; Ω* represents the current historical cumulative set of valid partitions; t represents the image acquisition count index; Merge(·) represents the partition merging operation; code_id represents the graphic code identification; version represents the encoding version; row and col represent the row and column coordinates of the physical encoded partition, respectively; fragment_id represents the payload fragment number; and the symbol "←" indicates that the cumulative set of valid partitions is updated using the results of this acquisition. Through the above merging process, the valid partitions obtained from each frame or each acquisition during the contact network inspection will not be discarded because the overall decoding cannot be completed in this instance. As the inspection vehicle approaches and passes the target equipment, the drone adjusts its perspective, or the handheld terminal changes its shooting position, the cumulative set of valid partitions gradually expands, providing input for subsequent direct decoding, local restoration, or global restoration.
[0051] The reading end, based on the data segments, locally recovered segments, and globally recovered segments already obtained in the accumulated valid partition set, sequentially determines the direct decoding condition, local recovery condition, global recovery condition, and continued acquisition condition. The direct decoding condition is that all necessary logical data segments have been obtained, and the information required for segment verification and overall integrity verification is valid. The local recovery condition is that in a local recovery group with missing segments, the obtained data segments and locally recovered segments can form independent constraints sufficient to uniquely recover the missing segments in that group. The global recovery condition is that missing segments still exist after local recovery, and the accumulated globally recovered segments can form independent constraints sufficient to uniquely recover the remaining missing segments, or the rank of the global recovery equation system is not less than the number of segments to be recovered. The continued acquisition condition is that none of the direct decoding condition, local recovery condition, or global recovery condition is met. When the direct decoding condition is met, the reading end does not perform recovery encoding solution and directly enters deinterleaving and integrity verification. When the local recovery condition is met, recovery is prioritized for recoverable local partition groups, and the obtained logical data segment set is updated. If missing segments still exist after local recovery and the global recovery condition is met, cross-partition global recovery is then performed. The results of both local and global recovery need to be verified through fragment validation, recovery equation consistency validation, or overall integrity validation. If there are multiple candidates for the recovery result or the validation fails, the original data will not be output. Instead, the current cumulative set will be retained and data collection will continue.
[0052] Once all necessary logical data segments are directly obtained or recovered, the reading end performs the reverse process of the reversible mapping π according to the segment number and encoding version of each segment, restoring the data segments in the physical encoding partition to the logical order D0 to Dn-1.
[0053]
[0054] Wherein, D0 to Dn-1 are the n recovered logical data segments, π-1 is the inverse mapping of the reversible mapping π, which restores the physically distributed data segments to their original logical order based on the segment number and encoding version in the self-description information of each partition. "Recovered partitions" represents the set of valid physical coded partitions and their payloads obtained through direct reading, local recovery, or global recovery. The inverse mapping restores the physically distributed data segments to their original logical order based on the segment number and encoding version in the self-description information of each partition. The reading end removes padding bits according to the original valid length recorded in the data header, reconstructs the original data X, and performs overall integrity verification using cyclic redundancy check values, hash values, or message authentication codes. In contact network applications, the reconstruction result can be a unique equipment identifier, ledger index, line location code, or maintenance-related information. When the integrity verification passes, the original data is output; when the integrity verification fails, it checks for failed partitions or insufficient recovery constraints, and proceeds to re-acquisition or read failure processing. The output can include contact network equipment identification data, the number of times data has been collected, the list of partitions involved in the recovery, the recovery method, and the integrity verification result, so that the inspection terminal can reliably read the results for further use in equipment ledger query, inspection task association, or subsequent operation and maintenance system processing.
[0055] The following describes the complete processing flow of this invention using the identification of overhead contact line components as an application scenario. This is not intended to limit the number of physical coding partitions, fragments, mapping methods, or recovery coding types. The two-dimensional graphic code used to carry equipment identification data is divided into 16 physical coding partitions (4×4). Eight partitions carry data fragments D0 to D7, four partitions carry local recovery fragments L0 to L3, two partitions carry global recovery fragments R0 and R1, and the remaining two partitions carry auxiliary identity or public verification information A0 and A1. One physical layout is as follows: Figure 2 As shown: the first row contains D0, L0, D2, and A0 in sequence; the second row contains R0, D6, L2, and D4 in sequence; the third row contains D3, L1, D1, and A1 in sequence; and the fourth row contains R1, D5, L3, and D7 in sequence. When the shared boundary is used as the first-order adjacency, D0 and D1, D1 and D2, D2 and D3, D3 and D4, D4 and D5, D5 and D6, and D6 and D7 are not in the first-order adjacency partition. D0, D2, D4, and D6 form the first local recovery group G0, with local recovery constraints provided by L0 and L1; D1, D3, D5, and D7 form the second local recovery group G1, with local recovery constraints provided by L2 and L3; global recovery fragments R0 and R1 are generated jointly by all data fragments; each data fragment and recovery fragment records its group, fragment number, and load type in the self-description header.
[0056] In one scenario of mobile inspection of the overhead contact line, the first acquisition obtains D0, D1, D4, D5, L0, L2, R0, and A0. The second acquisition, with changes in the inspection perspective, obtains D2, D3, D6, L1, L3, R1, and A1. The reader merges the two acquisition results based on the graphic code identity, version, and partition coordinates; at this point, only D7 is missing. The second local recovery group G1 has already obtained D1, D3, D5, and local recovery segments L2 and L3, satisfying the local recovery conditions. The reader uses this group's local recovery relationship to recover D7. In another scenario where the overhead contact line structure is continuously obstructed or the markings are partially damaged, if the second local recovery group G1 is missing both D5 and D7, and only one valid local recovery segment is obtained, the local recovery conditions are insufficient. When R0 and R1 have been obtained in the cumulative set and the global recovery constraints can uniquely determine D5 and D7, the reader performs global recovery. After recovery, de-interleaving is performed according to the segment number, D0 to D7 are sequentially spliced, filler bits are removed, and an overall integrity check is performed. After the check passes, the overhead contact line equipment identification data is output. If sufficient local or global recovery information to recover D7 is not obtained after the second acquisition, the reading end continues to save the current cumulative set of valid partitions and performs subsequent acquisitions; when a new valid partition is obtained in subsequent acquisitions, it is added to the cumulative set, and the direct decoding, local recovery, and global recovery condition determination are re-executed until the recovery conditions are met or the acquisition ends.
[0057] The above embodiments are merely one preferred embodiment of the present invention. Ordinary variations and substitutions made by those skilled in the art within the scope of the technical solution of the present invention are all included within the protection scope of the present invention.
Claims
1. A two-dimensional graphic encoding and reading method, characterized in that, include: Encoding steps: Divide the data to be encoded into multiple logical data segments, and divide the two-dimensional graphic code into multiple physical encoding partitions; configure self-description information for each physical encoding partition, the self-description information including at least the identity of the two-dimensional graphic code, the coordinates of the physical encoding partition, and the segment number of the logical data segment carried by the physical encoding partition; according to the spatial adjacency relationship between the physical encoding partitions, distribute and map the logical data segments to the physical encoding partitions; generate recovery information for the physical encoding partitions, and write the logical data segments and the recovery information into the two-dimensional graphic code; Reading steps: Parse the self-description information of the physical encoding partitions visible in the acquired image; Based on the identity identifier and the coordinates, the visible physical coding partitions obtained at different acquisition times are merged into a cumulative valid partition set; when the cumulative valid partition set meets the recovery conditions, recovery is performed, and the data to be encoded is restored according to the segment number.
2. The two-dimensional graphic encoding and reading method according to claim 1, characterized in that, The generation of recovery information includes: dividing a portion of the logical data fragments into multiple local recovery groups, generating local recovery information for each local recovery group, and jointly generating global recovery information from logical data fragments in at least two local recovery groups; in the reading step, it is first determined whether the cumulative valid partition set meets the local recovery conditions. If it does, local recovery is performed. If there are still missing fragments after local recovery and the global recovery conditions are met, global recovery is performed.
3. The two-dimensional graphic encoding and reading method according to claim 2, characterized in that, The local recovery information is generated using at least one of XOR check, Reed-Solomon coding, low-density parity check coding, or erasure coding; the global recovery information is generated using at least one of system erasure coding, Reed-Solomon coding, rateless fountain coding, or random linear network coding.
4. The two-dimensional graphic encoding and reading method according to claim 1, characterized in that, The self-describing information also includes the encoding version of the two-dimensional graphic code, the orientation information of the physical encoding partition, the payload type, and the recovery group number.
5. The two-dimensional graphic encoding and reading method according to claim 1, characterized in that, Each of the physical coding partitions is provided with non-rotationally symmetric local positioning and orientation markers to determine the standard orientation of the physical coding partition; when parsing the visible physical coding partitions, perspective correction and rotation normalization are first performed on the local positioning and orientation markers.
6. The two-dimensional graphic encoding and reading method according to claim 2, characterized in that, The step of distributing and mapping the logical data segments to the physical coding partitions according to the spatial adjacency relationship between the physical coding partitions includes: establishing a partition adjacency graph with the physical coding partitions as nodes and the spatial adjacency relationship between the partitions as edges; mapping logically adjacent logical data segments to physical coding partitions with a graph distance of not less than a preset threshold; and mapping logical data segments belonging to the same local recovery group to different rows, columns, or quadrants.
7. The two-dimensional graphic encoding and reading method according to claim 1, characterized in that, The step of merging visible physical coding partitions obtained at different acquisition times into a cumulative valid partition set includes: determining whether the acquired physical coding partition belongs to the currently read two-dimensional graphic code based on the identity identifier and coding version; establishing independent cumulative sets for physical coding partitions belonging to different identity identifiers; and not adding physical coding partitions that already exist in the cumulative valid partition set and have the same identity identifier, coding version, coordinates, and fragment number repeatedly.
8. The two-dimensional graphic encoding and reading method according to claim 1, characterized in that, The recovery conditions include direct decoding conditions, local recovery conditions, global recovery conditions, and continued acquisition conditions, which are determined sequentially. When the direct decoding condition is met, deinterleaving is performed directly. When the direct decoding condition is not met but the local recovery condition is met, local recovery is performed. When there are still missing segments after local recovery and the global recovery condition is met, global recovery is performed. When none of the above conditions are met, the cumulative valid partition set is retained and acquisition continues.
9. The two-dimensional graphic encoding and reading method according to claim 1, characterized in that, Before the data to be encoded is divided, a data header is added. The data header records the original valid length and integrity check value of the data to be encoded. When restoring the data to be encoded, the restored logical data segment is reverse mapped according to the segment number to remove padding bits, and then the overall check is performed according to the integrity check value before output.
10. The two-dimensional graphic encoding and reading method according to claim 1, characterized in that, The physical coding partitions are arranged according to a rectangular grid, a hexagonal grid, or a circular area; there are quiet zones or separating units between the physical coding partitions; the logical data fragments and the recovery information are mapped to black and white, grayscale, or color graphic units.
