Material lot tracking method and device, electronic equipment and storage medium

CN122597255APending Publication Date: 2026-08-18CHENGDE JIANLONG SPECIAL STEEL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610401553.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-30
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0008]本发明实施方式提供了一种物料逐支跟踪方法、装置、电子设备及存储介质,用于解决现有技术中物理标识跟踪方法易受生产条件影响而导致物料跟踪失败的问题

Benefits of technology

本发明实施方式公开了一种物料逐支跟踪方法,其首先获取标识区图像,其中,钢管通过标识区记录有钢管跟踪标识码;然后对所述标识区图像进行图像处理,并对获得的边缘图进行识别,获得钢管的第一标识;接着根据多个钢管的位置以及钢管生产顺序,对当前钢管标识进行估计,获得第二标识;最后根据所述第一标识以及所述第二标识,确定当前钢管的标识。本发明通过图像识别标识与位置估算标识相结合的方式,对钢管标识进行确认,确保了钢管标识追溯的连续性和准确性,同时保障了生产的流畅性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122597255A_ABST
    Figure CN122597255A_ABST
Patent Text Reader

Abstract

This invention relates to the field of online material tracking technology for production lines, and particularly to a method, apparatus, electronic device, and storage medium for tracking materials one by one. The method first acquires an image of an identification area, where each steel pipe has a tracking identification code recorded within the identification area. Then, image processing is performed on the identification area image, and the obtained edge map is identified to obtain a first identification of the steel pipe. Next, based on the positions of multiple steel pipes and their production sequence, the current steel pipe identification is estimated to obtain a second identification. Finally, based on the first and second identifications, the current steel pipe identification is determined. This invention combines image recognition identification with position estimation identification to confirm steel pipe identification, ensuring the continuity and accuracy of steel pipe identification traceability while guaranteeing smooth production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of online material tracking technology for production lines, and in particular to a method, apparatus, electronic device, and storage medium for tracking materials item by item. Background Technology

[0002] In the hot-rolled seamless steel pipe production line, from billet heating, piercing, rolling, sizing, cooling, straightening, sawing, flaw detection to finished product warehousing, the material flows through many processes, has a long path, high temperature, harsh working conditions, and a fast production pace with frequent batch changes.

[0003] To achieve full lifecycle quality traceability of products, bind individual pipe process parameters and quality data one by one, and meet the mandatory traceability requirements of classification societies, nuclear power, and other standards, it is necessary to establish a pipe-by-pipe material tracking system. However, achieving stable, accurate, and low-cost unique identification and tracking of individual pipes under environments of high temperature, high speed, water spray, oxidation, vibration, and cross-process transfer has always been a challenge for the industry.

[0004] Currently, the mainstream material tracking technology usually uses physical identification for tracking (hard tracking). The methods include high-temperature inkjet printing, steel stamping, laser marking, and online QR code / 1D barcode printing + machine vision recognition. Its advantages are unique identification, intuitiveness, and the ability to be manually verified.

[0005] Meanwhile, physical markings are prone to failure under high temperatures. Rolling exit temperatures reach 800–1000℃, making ordinary inkjet printing and labels susceptible to burning, detachment, and blurring. Oxide scale, cooling water, and oil stains can obscure QR codes, leading to unstable visual recognition and a high error rate.

[0006] When physical identification fails, it is usually verified manually, which makes it difficult to ensure the smoothness of the process.

[0007] Therefore, it is necessary to develop and design a method for tracking materials item by item. Summary of the Invention

[0008] The present invention provides a method, apparatus, electronic device and storage medium for tracking materials item by item, which solves the problem that material tracking failure is easily affected by production conditions in the prior art physical identification tracking method.

[0009] In a first aspect, embodiments of the present invention provide a method for tracking materials item by item, comprising: Obtain an image of the marked area, in which the steel pipe is recorded with a steel pipe tracking identification code; The image of the marked area is processed, and the obtained edge map is identified to obtain the first mark of the steel pipe; Based on the location of multiple steel pipes and their production sequence, the current steel pipe identification is estimated to obtain a second identification. The current steel pipe is identified based on the first identifier and the second identifier.

[0010] In one possible implementation, the step of performing image processing on the identified area image and recognizing the obtained edge map to obtain the first identifier of the steel pipe includes: Multiple difference operators are used to perform difference processing on the identified region image to obtain multiple difference maps; A gradient map representing pixel gradients is constructed based on the multiple difference maps, and non-maximum gradient suppression and binarization are performed on the gradient map with a preset radius to obtain an edge map; The edge map is identified to obtain the first identifier.

[0011] In one possible implementation, the step of performing differential processing on the identified region image using multiple differential operators to obtain multiple difference maps includes: Obtain the horizontal difference operator and the vertical difference operator; Data block extraction step: Extract the first data block by sliding from the identified area image; The first data block is multiplied by the horizontal difference operator and the vertical difference operator to obtain the horizontal difference value and the vertical difference value. The horizontal difference value and the vertical difference value are added to the horizontal difference plot and the vertical difference plot, respectively; If the traversal of the identified area image is not completed, proceed to the data block extraction step.

[0012] In one possible implementation, the step of constructing a gradient map representing pixel gradients based on the plurality of difference maps, and performing non-maximum gradient suppression and binarization on the gradient map with a preset radius to obtain an edge map includes: The plurality of difference plots includes a horizontal difference plot and a vertical difference plot. A gradient plot is constructed based on a first formula, the horizontal difference plot, and the vertical difference plot, wherein the first formula is:

[0013] In the formula, For pixel gradient, For pixel gradient direction, The horizontal difference between pixels. The vertical difference value of the pixel; For each pixel, find the maximum value within the preset radius region along the pixel gradient direction and the opposite direction of the pixel gradient, with the pixel as the center, and keep the other values ​​as 0 to obtain the extreme value map; The extreme value map is binarized to obtain the edge map.

[0014] In one possible implementation, estimating the current steel pipe identifier based on the positions of multiple steel pipes and the steel pipe production sequence to obtain a second identifier includes: Obtain the coordinates of the current steel pipe inspection point; Retrieve the position data of all tracked steel pipes in the current production line to obtain multiple tracking positions; Based on the first distance threshold and the coordinates of the current detection point, multiple target locations are selected from the multiple tracking locations; Based on the production sequence of the steel pipes, calculate the positional difference between any two adjacent steel pipes among the plurality of target locations; Based on multiple position differences and the coordinates of the current detection point, the current steel pipe identifier is estimated to obtain the second identifier.

[0015] In one possible implementation, estimating the current steel pipe identifier based on multiple position differences and the coordinates of the current detection point to obtain the second identifier includes: Determine whether there is a positional gap based on the multiple positional differences; If it exists, the markings of the steel pipes in front of the vacant position are summed to obtain the estimated markings; Otherwise, the steel pipe identifier that is closest to the coordinates of the current detection point among the multiple target locations is used as the estimated identifier; If the location of the estimated identifier matches the steel pipe production sequence, then the estimated identifier is used as the second identifier; Otherwise, a verification failure message is generated.

[0016] In one possible implementation, determining the identifier of the current steel pipe based on the first identifier and the second identifier includes: If the first identifier is the same as the second identifier, then the first identifier shall be used as the identifier of the current steel pipe; Otherwise, the coordinates of the current steel pipe's detection points are obtained multiple times, the current steel pipe's identifier is estimated using the obtained coordinates of multiple detection points, and the accuracy of the first identifier is verified using the obtained identifier estimate. If the first identifier is inaccurate, the second identifier will be used as the identifier of the current steel pipe, and a message indicating that the first identifier recognition failed will be generated.

[0017] Secondly, embodiments of the present invention provide a material tracking device for implementing the material tracking method as described in the first aspect or any possible implementation thereof, the material tracking device comprising: The identification image acquisition module is used to acquire the image of the identification area, in which the steel pipe has a steel pipe tracking identification code recorded in the identification area; The image identification module is used to process the image of the identification area and identify the obtained edge map to obtain the first identification of the steel pipe. The software identification module is used to estimate the current steel pipe identifier based on the location of multiple steel pipes and the steel pipe production sequence, and obtain a second identifier; as well as, The identification confirmation module is used to determine the identification of the current steel pipe based on the first identification and the second identification.

[0018] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the computer program to implement the steps of the method as described in the first aspect or any possible implementation of the first aspect.

[0019] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in the first aspect or any possible implementation thereof.

[0020] The beneficial effects of the embodiments of the present invention compared with the prior art are as follows: This invention discloses a method for tracking materials one by one. First, an image of an identification area is acquired, wherein each steel pipe has a tracking identification code recorded in the identification area. Then, image processing is performed on the identification area image, and the obtained edge map is identified to obtain a first identification of the steel pipe. Next, based on the positions of multiple steel pipes and the production sequence of the steel pipes, the current steel pipe identification is estimated to obtain a second identification. Finally, based on the first and second identifications, the current steel pipe identification is determined. This invention confirms steel pipe identification by combining image recognition identification with position estimation identification, ensuring the continuity and accuracy of steel pipe identification traceability while guaranteeing smooth production. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart of the material tracking method provided by the embodiments of the present invention; Figure 2 This is a functional block diagram of the material tracking device provided in the embodiments of the present invention; Figure 3 This is a functional block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0023] In the following description, specific details such as particular system structures and techniques are set forth for illustrative purposes and not for limitation, so as to provide a thorough understanding of embodiments of the invention. However, those skilled in the art will understand that the invention can be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, and methods are omitted so as not to obscure the description of the invention with unnecessary detail.

[0024] To make the objectives, technical solutions, and advantages of the present invention clearer, specific embodiments will be described below in conjunction with the accompanying drawings.

[0025] The embodiments of the present invention will be described in detail below. This example is implemented based on the technical solution of the present invention, and provides detailed implementation methods and specific operation processes. However, the protection scope of the present invention is not limited to the following embodiments.

[0026] Figure 1 A flowchart of a material tracking method for each item provided in an embodiment of the present invention.

[0027] like Figure 1 The diagram illustrates the implementation flowchart of the material tracking method provided by the embodiments of the present invention, which is described in detail below: In step 101, an image of the marked area is obtained, wherein the steel pipe is recorded with a steel pipe tracking identification code in the marked area.

[0028] In step 102, the image of the marked area is processed, and the obtained edge map is identified to obtain the first mark of the steel pipe.

[0029] In some embodiments, the step of performing image processing on the image of the marked area and recognizing the obtained edge map to obtain the first mark of the steel pipe includes: Multiple difference operators are used to perform difference processing on the identified region image to obtain multiple difference maps; A gradient map representing pixel gradients is constructed based on the multiple difference maps, and non-maximum gradient suppression and binarization are performed on the gradient map with a preset radius to obtain an edge map; The edge map is identified to obtain the first identifier.

[0030] In some implementations, the step of performing differential processing on the identified region image using multiple differential operators to obtain multiple difference maps includes: Obtain the horizontal difference operator and the vertical difference operator; Data block extraction step: Extract the first data block by sliding from the identified area image; The first data block is multiplied by the horizontal difference operator and the vertical difference operator to obtain the horizontal difference value and the vertical difference value. The horizontal difference value and the vertical difference value are added to the horizontal difference plot and the vertical difference plot, respectively; If the traversal of the identified area image is not completed, proceed to the data block extraction step.

[0031] In some implementations, the step of constructing a gradient map representing pixel gradients based on the plurality of difference maps, and performing non-maximum gradient suppression and binarization on the gradient map with a preset radius to obtain an edge map includes: The plurality of difference plots includes a horizontal difference plot and a vertical difference plot. A gradient plot is constructed based on a first formula, the horizontal difference plot, and the vertical difference plot, wherein the first formula is:

[0032] In the formula, For pixel gradient, For pixel gradient direction, The horizontal difference between pixels. The vertical difference value of the pixel; For each pixel, find the maximum value within the preset radius region along the pixel gradient direction and the opposite direction of the pixel gradient, with the pixel as the center, and keep the other values ​​as 0 to obtain the extreme value map; The extreme value map is binarized to obtain the edge map.

[0033] For example, in the entire process of steel pipe production, storage, transportation and use, the steel pipe tracking code is the core carrier for realizing the traceability of the entire life cycle of steel pipes. Its accurate identification is directly related to the standardization of production management, the efficiency of warehousing scheduling and the traceability of product quality.

[0034] The steel pipe has a tracking code recorded in the identification area. Specifically, the identification area is a pre-designated region on the steel pipe surface used to carry the tracking code. This area is usually specially treated (such as grinding or pre-treatment with inkjet printing) to ensure the clarity and stability of the code and to prevent factors such as oxidation, rust, or stains on the steel pipe surface from affecting the identification effect. The steel pipe tracking code contains key data such as the steel pipe's production batch, specifications, manufacturer, production date, and quality inspection information, and is printed or engraved in the identification area using specific encoding rules (such as QR codes, barcodes, character encoding, etc.).

[0035] Since the acquired images of the marked area may contain noise, uneven lighting, background interference, etc., direct recognition is difficult to guarantee accuracy. Therefore, it is necessary to optimize the images through a series of standardized image processing procedures, highlight the edge features of the identification code, and then extract the first identifier through the edge recognition algorithm to ensure the reliability of the recognition results.

[0036] Image processing is performed on the image of the marked area, and the resulting edge map is identified, including the following steps: The first step involves using multiple difference operators to process the labeled area image, resulting in multiple difference maps. The core principle of the difference operator is to calculate the difference in grayscale values ​​between adjacent pixels in the image, highlighting areas with dramatic grayscale changes (i.e., edge regions) and suppressing background regions with gradual grayscale changes. Multiple difference operators are used here to overcome the limitations of a single operator in edge extraction—different difference operators have varying sensitivities to edges of different directions and widths. The collaborative processing of multiple operators comprehensively captures various edge features in the labeled area image, reducing edge omissions or mis-extractions, and providing more comprehensive and accurate difference data for subsequent gradient map construction.

[0037] After the difference processing, each difference operator generates a difference map. The gray value of the pixel in the difference map directly reflects the intensity of the pixel gray value change at that location. The higher the gray value, the more obvious the edge features at that location.

[0038] The second step involves constructing a gradient map representing pixel gradients based on the multiple difference maps. This gradient map is then subjected to non-maximum gradient suppression and binarization with a preset radius to obtain an edge map. Pixel gradient is a key parameter reflecting the strength and direction of pixel grayscale changes in an image. The gradient map presents the gradient information of each pixel in image form, where the magnitude of the gradient value corresponds to the intensity of the pixel grayscale change, and the gradient direction corresponds to the direction of the pixel grayscale change. The core of constructing the gradient map is to integrate the information from multiple difference maps and comprehensively calculate the gradient parameters of each pixel to ensure the integrity and accuracy of the gradient information. The subsequent non-maximum gradient suppression is to remove redundant edge information from the gradient map, retaining the clearest and most accurate edge contours. Using a preset radius as a range, the gradient values ​​of each pixel are filtered, retaining only the maximum value in the gradient direction and setting other non-maximum values ​​to 0, thereby avoiding "coarsening" or "blurring" of edges and making the edge contours sharper. The preset radius needs to be reasonably set according to parameters such as the resolution of the identification area image and the size of the identification code, typically ranging from 1 to 3 pixels, to ensure effective removal of redundant information without losing key edge features. After nonmaximum gradient suppression is completed, the resulting extreme value map is binarized to convert the image into a black and white binary image, where the edge region corresponds to white pixels (grayscale value of 255) and the background region corresponds to black pixels (grayscale value of 0), further highlighting the edge features and obtaining a clear and concise edge map, providing a clear image foundation for subsequent label recognition.

[0039] The third step involves recognizing the edge map to obtain the first identifier. The edge map contains the complete edge contour of the identifier code. At this point, an edge recognition algorithm is used to extract, analyze, and match the edge contours in the edge map to identify the specific content of the identifier code. During the recognition process, the algorithm first extracts the contours of the edge map, filtering out areas that match the contour features of the identifier code and eliminating interfering contours in the background. Then, morphological processing (such as dilation and erosion) is performed on the extracted contours to repair breaks, gaps, and other issues, ensuring the integrity of the contours. Finally, specific algorithms such as character recognition and QR code recognition are used to convert the encoded information corresponding to the contours into readable numbers, characters, or QR code data, which is the first identifier. After recognition, the completeness and accuracy of the first identifier are initially verified. If problems such as blurred recognition or missing information exist, the process returns to the previous image processing steps for further optimization.

[0040] Multiple difference operators are used to perform difference processing on the identified region image to obtain multiple difference maps. The specific steps include the following detailed steps: First, obtain the horizontal and vertical difference operators. Horizontal and vertical difference operators are the two most commonly used difference operators. They are used to capture edge features in the horizontal and vertical directions of the image, respectively. Using them together can comprehensively cover edge information in different directions in the marker area image, providing difference data in both horizontal and vertical dimensions for subsequent gradient calculation. Commonly used horizontal difference operators include the Prewitt horizontal operator and the Sobel horizontal operator, while commonly used vertical difference operators include the Prewitt vertical operator and the Sobel vertical operator. The specific operator to choose depends on practical factors such as the noise level and edge sharpness of the marker area image—for example, the Sobel operator has a certain noise suppression capability and is suitable for marker area images with high noise levels; the Prewitt operator is computationally simple and suitable for images with clear edges and low noise.

[0041] Next, the data block extraction step is performed: a first data block is extracted from the identified area image by sliding. The first data block refers to a local pixel block selected from the identified area image for calculation with the difference operator, and its size is consistent with the size of the selected difference operator (for example, if a 3×3 Sobel operator is used, the size of the first data block is 3×3 pixels). "Sliding extraction" means that the data block starts from the upper left corner of the identified area image and slides sequentially in the horizontal and vertical directions with a preset step size (usually 1 pixel). Each slide extracts a new first data block until the entire identified area image has been traversed. This sliding extraction method ensures that every pixel is included in the data block for calculation, avoiding pixel omissions and guaranteeing the integrity of the difference map.

[0042] Then, the first data block is multiplied by both the horizontal and vertical difference operators to obtain the horizontal and vertical difference values. Dot product calculation is the core operation of differential processing. Its principle is to multiply the grayscale value of each pixel in the first data block by the coefficient at the corresponding position in the difference operator, and then sum all the product results to obtain the difference value corresponding to that data block. Specifically, the dot product with the horizontal difference operator yields the horizontal difference value, reflecting the intensity of pixel grayscale change in the horizontal direction at the location of the data block; the dot product with the vertical difference operator yields the vertical difference value, reflecting the intensity of pixel grayscale change in the vertical direction at the location of the data block. During the dot product calculation, it is necessary to ensure that the dimensions of the data block and the difference operator are perfectly matched to avoid calculation errors.

[0043] Next, the horizontal and vertical difference values ​​are added to the horizontal and vertical difference maps, respectively. The horizontal and vertical difference maps are images used to record the horizontal and vertical difference information of the entire marker area image, and their dimensions are the same as the marker area image. After extracting each first data block and calculating the corresponding horizontal and vertical difference values, the horizontal difference value is assigned to the position corresponding to the center pixel of that data block in the horizontal difference map, and the vertical difference value is assigned to the position corresponding to the center pixel of that data block in the vertical difference map. As the data blocks continue to slide and be calculated, the pixel values ​​in the horizontal and vertical difference maps will gradually fill in completely, ultimately forming a difference map that clearly reflects the horizontal and vertical edge features of the marker area image.

[0044] Finally, it is determined whether the traversal of the labeled area image is complete: if the traversal is not complete, data block extraction, dot product calculation, and difference score filling continue; if the traversal is complete, sliding extraction stops, and the horizontal and vertical difference maps are now fully constructed and can be used for subsequent gradient map construction. The criterion for determining whether the traversal is complete is: when the data block slides to the lower right corner of the labeled area image, all pixels are included in the data block for calculation, and no pixels are missed.

[0045] A gradient map representing pixel gradients is constructed based on multiple difference maps. Non-maximum gradient suppression and binarization are then performed on the gradient map with a preset radius to obtain an edge map. The detailed steps outlined below clarify the principles of gradient map construction, the operational details of non-maximum gradient suppression, and the binarization process, ensuring the clarity and accuracy of the edge map: First, multiple difference plots, including horizontal and vertical difference plots, are used to construct a gradient plot based on the first formula, the horizontal and vertical difference plots.

[0046] In the horizontal difference map, the grayscale value of each pixel is the horizontal difference value of that pixel. In the vertical difference image, the grayscale value of each pixel is the vertical difference value of that pixel. The first formula is used according to and The gradient parameters for each pixel are calculated using the following formula:

[0047] In the formula, Pixel gradient, used to represent the degree of drastic change in the grayscale of a pixel. The larger the value, the more obvious the edge features at the location of the pixel, and the more likely it is to be the edge of the identifier code; The pixel gradient direction is used to represent the direction of grayscale change of the pixel. Its value range is [0,π], which reflects the direction of the edge and provides a directional basis for subsequent non-maximum gradient suppression. The horizontal difference between pixels is determined by the grayscale value of the corresponding pixel in the horizontal difference map; The vertical difference value of a pixel is determined by the grayscale value of the corresponding pixel in the vertical difference map.

[0048] When constructing the gradient map, it is necessary to calculate the gradient for each pixel in the labeled region image one by one. and The value will The value is used as the grayscale value of that pixel in the gradient map. The value is used as the gradient direction parameter of the pixel, and finally a gradient map is formed. In the gradient map, the higher the gray value, the more obvious the corresponding edge features, which provides a clear basis for subsequent edge extraction.

[0049] Secondly, perform non-maximum gradient suppression: for each pixel, find the maximum value within a preset radius region along the pixel gradient direction and the opposite direction of the pixel gradient, and keep the other values ​​as 0 to obtain the extreme value map.

[0050] The core purpose of nonmaximum gradient suppression is to "slim down" the edges, remove redundant pixels on the edge contours, make the edges sharp and clear, and avoid errors in subsequent recognition caused by edge coarsening.

[0051] In practice, first determine the gradient direction of the current pixel. Then, taking that pixel as the center, along the gradient direction and the opposite direction of the gradient (i.e. and The gradient values ​​of all pixels within a preset radius (usually 1-3 pixels) are selected, and the maximum value is chosen as the retained value. The gradient value of the current pixel is then set to this retained value. If the gradient value of the current pixel is not the maximum value within this range, its gradient value is set to 0. In this way, only the pixels with the largest gradient values ​​on the edge contour are retained, while redundant pixels on both sides of the edge are removed, making the edge contour clearer and more delicate. The value of the preset radius needs to be adjusted according to the resolution of the identification area image and the edge width of the identification code. A value that is too small may cause edge breakage, while a value that is too large will not effectively remove redundant pixels, affecting edge clarity.

[0052] Finally, the extreme value map is binarized to obtain the edge map. After non-maximum gradient suppression, the edge contours of the extreme value map are optimized, but it is still a grayscale image, which is not conducive to subsequent edge recognition and label extraction. Therefore, it needs to be converted into a black and white binary image through binarization. The core of the binarization process is a threshold of 1, which sets pixels with a grayscale value greater than 1 in the extreme value map to white (grayscale value of 255) and pixels with a grayscale value less than or equal to 1 to black (grayscale value of 0).

[0053] In step 103, the current steel pipe identifier is estimated based on the location of multiple steel pipes and the steel pipe production sequence to obtain a second identifier.

[0054] In some embodiments, estimating the current steel pipe identifier based on the location of multiple steel pipes and the steel pipe production sequence to obtain a second identifier includes: Obtain the coordinates of the current steel pipe inspection point; Retrieve the position data of all tracked steel pipes in the current production line to obtain multiple tracking positions; Based on the first distance threshold and the coordinates of the current detection point, multiple target locations are selected from the multiple tracking locations; Based on the production sequence of the steel pipes, calculate the positional difference between any two adjacent steel pipes among the plurality of target locations; Based on multiple position differences and the coordinates of the current detection point, the current steel pipe identifier is estimated to obtain the second identifier.

[0055] In some implementations, estimating the current steel pipe identifier based on multiple position differences and the coordinates of the current detection point to obtain the second identifier includes: Determine whether there is a positional gap based on the multiple positional differences; If it exists, the markings of the steel pipes in front of the vacant position are summed to obtain the estimated markings; Otherwise, the steel pipe identifier that is closest to the coordinates of the current detection point among the multiple target locations is used as the estimated identifier; If the location of the estimated identifier matches the steel pipe production sequence, then the estimated identifier is used as the second identifier; Otherwise, a verification failure message is generated.

[0056] In step 104, the identifier of the current steel pipe is determined based on the first identifier and the second identifier.

[0057] In some implementations, determining the identifier of the current steel pipe based on the first identifier and the second identifier includes: If the first identifier is the same as the second identifier, then the first identifier shall be used as the identifier of the current steel pipe; Otherwise, the coordinates of the current steel pipe's detection points are obtained multiple times, the current steel pipe's identifier is estimated using the obtained coordinates of multiple detection points, and the accuracy of the first identifier is verified using the obtained identifier estimate. If the first identifier is inaccurate, the second identifier will be used as the identifier of the current steel pipe, and a message indicating that the first identifier recognition failed will be generated.

[0058] For example, the second identifier is an auxiliary estimation result of the current steel pipe identifier based on the regularity of the steel pipe production process and the correlation of the steel pipe position. Its core function is to verify and supplement the first identifier. When the extracted first identifier has problems such as fuzziness, missing, or misidentification, the second identifier can provide a reliable reference, reduce the error rate of identifier recognition, and ensure the continuity and accuracy of steel pipe identifier traceability.

[0059] Steel pipe production follows a strict sequence; pipes within the same production line flow sequentially according to their production order, and the markings on adjacent pipes are typically continuous (e.g., increasing in sequence number). Furthermore, the distribution of pipes within the production line follows a certain regularity, avoiding random or chaotic placement. These two characteristics provide a solid logical foundation for estimating the second identifier. It is important to note that the second identifier is not a direct result of identification but rather an estimate derived through location analysis and production sequence deduction. Its accuracy depends on the precision of the location data and the completeness of the production sequence records.

[0060] The estimation of the current steel pipe identification is based on the location of multiple steel pipes and their production sequence, and includes the following five steps: The first step is to obtain the coordinates of the current steel pipe inspection point. The inspection point is a pre-set specific location within the production line used to capture the position of the steel pipe. It is usually collected in real time by position sensors (such as position switches, laser sensors, etc.) to obtain the position information of the steel pipe.

[0061] The second step involves retrieving the position data of all tracked steel pipes within the current production line to obtain multiple tracking positions. Tracked steel pipes refer to those currently on the production line that have not yet completed the entire processing cycle and are undergoing position tracking. Their position data is recorded and updated in real time by the production line's position tracking system. The retrieved position data must include key information such as the unique identifier (often a confirmed identifier) ​​of each tracked steel pipe, its real-time position coordinates, and the time it entered the detection area. These multiple tracking positions constitute the current dataset of steel pipe position distribution within the production line.

[0062] The third step involves filtering multiple target locations from the multiple tracking positions based on the first distance threshold and the coordinates of the current detection point. The first distance threshold is a preset critical value used to determine the correlation between steel pipe positions. Its value needs to be determined based on actual parameters such as the width of the production line, the spacing between steel pipes, and the coverage area of ​​the detection point. It is typically set as the maximum steel pipe length × N + 0.5 - 2 meters (N is an integer and can be adaptively adjusted according to the actual situation of the production line). The filtering logic is as follows: calculate the distance between each tracking position and the coordinates of the current detection point. If this distance is less than or equal to the first distance threshold, the steel pipe corresponding to that tracking position is considered to be in the same area as the current steel pipe and is included in the target location; if the distance is greater than the first distance threshold, it is discarded. This filtering step can eliminate steel pipe positions that are too far away or unrelated to the current steel pipe, avoiding interference from irrelevant location data with the estimation results.

[0063] The fourth step is to calculate the positional difference between any two adjacent steel pipes at multiple target locations based on the steel pipe production sequence. The steel pipe production sequence refers to the order in which the steel pipes are processed on the production line, recorded in real-time by the production line's control system. Each steel pipe's identifier usually corresponds to its production sequence (e.g., the identifier number matches the production sequence number). Adjacent steel pipes are two consecutive steel pipes in the production sequence (e.g., in a production sequence of 1, 2, 3, pipes 1 and 2 are adjacent, and pipes 2 and 3 are adjacent). The positional difference is the coordinate difference between two adjacent steel pipes in the same coordinate system. By calculating the positional difference, the distribution pattern of steel pipes within the target location can be determined, and it can be judged whether there are any positional gaps (i.e., steel pipes corresponding to a certain production sequence are missing).

[0064] The fifth step involves combining the distribution pattern of the steel pipes reflected by the positional differences with the current location of the inspection point to determine the approximate position of the current steel pipe in the production sequence, and then deduce its identifier. If the positional difference between two adjacent steel pipes is much greater than other positional differences, it indicates that there is a positional gap, and the current steel pipe is likely to fill that gap, thus estimating its identifier.

[0065] Based on multiple position differences and the coordinates of the current detection point, the current steel pipe identifier is estimated to obtain the second identifier, specifically including the following steps: First, determine whether a position gap exists based on the multiple position differences. A position gap refers to a situation where, in a continuous production sequence of steel pipes, a particular pipe is not in its target position, resulting in an abnormal positional difference between adjacent pipes. The judgment criterion is as follows: a preset second distance threshold is used (usually 2-3 times the normal position difference, which can be adjusted according to the actual pipe spacing on the production line). If any position difference among the multiple position differences is greater than the second distance threshold, a position gap is determined to exist; if all position differences are less than or equal to the second distance threshold and are evenly distributed, a position gap is determined not to exist. For example, if the normal position difference between adjacent steel pipes is 8 meters, and the second distance threshold is set to 17 meters, if the position difference between two adjacent steel pipes is 18 meters, which is greater than 17 meters, then a position gap can be determined between these two steel pipes, and the current steel pipe is highly likely to be in the position of the gap.

[0066] Secondly, depending on whether there is a positional gap, the identification estimation is performed in two cases: If a positional gap exists, the identifications of the steel pipes preceding the gap position are accumulated to obtain the estimated identification. The steel pipe preceding the gap position refers to the steel pipe located before the gap position in the production sequence, whose identification has been confirmed to be correct; identification accumulation means that according to the incremental rule of the production sequence, the identification sequence number of the preceding steel pipe is increased by 1 (if the identification is in the form of character + sequence number, such as A001, then the accumulated number is A002), and the resulting sequence number is the estimated identification of the current steel pipe. For example, if the identification of the steel pipe preceding the gap position is A015, and the production sequence is incremental, then the estimated identification of the current steel pipe is A016. If there is no positional gap, the identification of the steel pipe with the closest distance to the coordinates of the current detection point among the multiple target positions is used as the estimated identification. At this point, the steel pipes within the target location are distributed in an orderly manner with no gaps. The steel pipe closest to the current detection point has the production sequence closest to the current steel pipe, and its marking is the most relevant. Therefore, its marking is directly used as the estimation marking, which simplifies the estimation process while ensuring the rationality of the estimation results.

[0067] Then, the estimated identifier is verified for production sequence: if the position of the estimated identifier matches the steel pipe production sequence, the estimated identifier is used as the second identifier; otherwise, a verification failure message is generated.

[0068] The core of production sequence verification is to determine whether the production sequence corresponding to the estimated identifier matches the current position of the steel pipe—that is, based on the production sequence of the estimated identifier, to determine whether its corresponding theoretical position is consistent with the coordinates of the current detection point (or within a reasonable error range).

[0069] For example, if the estimated identifier is A016, its theoretical production sequence should be after A015 and before A017, and the corresponding theoretical position should be between A015 and A017. If the current detection point coordinates are within this theoretical position range, then it conforms to the production sequence, and A016 is used as the second identifier. If the detection point coordinates deviate too much from the theoretical position and do not conform to the production sequence, it indicates that there is an error in the estimated identifier, and a verification failure message is generated, prompting staff to conduct further investigation (such as position sensor failure, production sequence record error, etc.).

[0070] The first identifier obtained in step 102 is a direct result of image recognition, while the second identifier obtained in step 103 is an estimation result based on location and production sequence. Each has its advantages and disadvantages: the accuracy of the first identifier depends on image quality and the recognition algorithm; if the image is clear and free of interference, its accuracy is high, but it is easily affected by noise, reflection, and other factors. The accuracy of the second identifier depends on location data and production sequence, and there is a possibility of estimation error. Therefore, by combining the two and performing cross-validation, the accuracy of the current steel pipe identification can be maximized, avoiding the limitations of a single identification method and ensuring the reliability of steel pipe identification traceability.

[0071] Based on the first and second identifiers, the identifier of the current steel pipe is determined, which includes the following four steps: cross-validation and secondary verification are used to clarify the identifier of the current steel pipe, and abnormal identification situations are handled simultaneously. The first step is to determine whether the first identifier and the second identifier are consistent.

[0072] The extracted first identifier is compared with the estimated second identifier. The comparison includes all characters, serial numbers, and other details of the identifier to ensure no omissions or deviations. If the two are completely identical, it indicates that the image recognition result and the location estimation result corroborate each other, and the identification accuracy is extremely high. At this point, the first identifier (or the second identifier, if they are identical) is directly used as the current identifier of the steel pipe, completing the identification process. The identification information is then entered into the steel pipe traceability system for subsequent production, warehousing, and traceability management.

[0073] The second step is to obtain the coordinates of the current steel pipe's detection points multiple times if the first and second identifiers are inconsistent. The current steel pipe identifier is estimated using the obtained multiple detection point coordinates, and the accuracy of the first identifier is verified using the obtained identifier estimate.

[0074] When the two are inconsistent, it is impossible to directly determine which identifier is the correct result. Therefore, it is necessary to verify through secondary estimation: collect the coordinates of the detection point of the current steel pipe multiple times (usually 3-5 times), with a preset time interval between each collection (such as 1-2 seconds) to avoid the coordinate deviation of a single collection affecting the estimation result; then, based on the detection point coordinates collected each time, repeat the estimation process of step 103 to obtain multiple identifier estimates (i.e., multiple secondary estimated identifiers); finally, count the consistency of multiple secondary estimated identifiers. If most secondary estimated identifiers are consistent with the first identifier, it means that the first identifier is accurate; if most secondary estimated identifiers are inconsistent with the first identifier, it means that the first identifier has been misidentified.

[0075] The third step is to determine the current steel pipe's identification based on the secondary verification results: If the first identifier is inaccurate (i.e., most secondary estimated identifiers are inconsistent with the first identifier), the second identifier is used as the identifier of the current steel pipe, and a message indicating that the first identifier recognition failed is generated. At this time, the second identifier has been verified by multiple position estimations and is more accurate, so it can be used as the final identifier of the current steel pipe; the message indicating that the first identifier recognition failed is generated to prompt staff to investigate the problem (such as blurry image of the identifier area, unreasonable image processing algorithm parameters, etc.).

[0076] Follow-up processing: After receiving the message that the first identification failed, staff need to manually verify the correct identification of the steel pipe in a timely manner. This step achieves both automatic identification and verification of the identification, and also properly handles abnormal situations, balancing identification efficiency and accuracy.

[0077] The present invention provides a method for tracking materials one by one. First, it acquires an image of an identification area, where each steel pipe has a tracking identification code recorded within the identification area. Then, it performs image processing on the identification area image and identifies the resulting edge map to obtain a first identification for the steel pipe. Next, based on the positions of multiple steel pipes and their production sequence, it estimates the current steel pipe identification to obtain a second identification. Finally, based on the first and second identifications, it determines the current steel pipe's identification. This invention combines image recognition identification with position estimation identification to confirm steel pipe identification, ensuring the continuity and accuracy of steel pipe identification traceability while guaranteeing smooth production.

[0078] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0079] The following are embodiments of the apparatus of the present invention. For details not described in detail, please refer to the corresponding method embodiments described above.

[0080] Figure 2 This is a functional block diagram of the material tracking device provided in the embodiments of the present invention, with reference to... Figure 2 The material tracking device includes: an image acquisition module 201, an image identification module 202, a software identification module 203, and an identification confirmation module 204, wherein: The identification image acquisition module 201 is used to acquire the identification area image, wherein the steel pipe has a steel pipe tracking identification code recorded in the identification area; The image identification module 202 is used to perform image processing on the image of the identification area and to identify the obtained edge map to obtain the first identification of the steel pipe; The software identification module 203 is used to estimate the current steel pipe identifier based on the position of multiple steel pipes and the steel pipe production sequence to obtain a second identifier; as well as, The identification confirmation module 204 is used to determine the identification of the current steel pipe based on the first identification and the second identification.

[0081] Figure 3 This is a functional block diagram of the electronic device provided in an embodiment of the present invention. For example... Figure 3 As shown, the electronic device 3 of this embodiment includes a processor 300 and a memory 301, wherein the memory 301 stores a computer program 302 that can run on the processor 300. When the processor 300 executes the computer program 302, it implements the steps of the above-described material tracking methods and embodiments, for example... Figure 1 Steps 101 to 104 are shown.

[0082] For example, the computer program 302 may be divided into one or more modules / units, which are stored in the memory 301 and executed by the processor 300 to complete the present invention.

[0083] The electronic device 3 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. The electronic device 3 may include, but is not limited to, a processor 300 and a memory 301. Those skilled in the art will understand that... Figure 3 This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 3 may also include input / output devices, network access devices, buses, etc.

[0084] The processor 300 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0085] The memory 301 can be an internal storage unit of the electronic device 3, such as a hard disk or memory. The memory 301 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 3. Furthermore, the memory 301 can include both internal and external storage units of the electronic device 3. The memory 301 is used to store the computer program 302 and other programs and data required by the electronic device 3. The memory 301 can also be used to temporarily store data that has been output or will be output.

[0086] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the aforementioned method embodiments, and will not be repeated here.

[0087] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0088] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0089] In the embodiments provided by this invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0090] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0091] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0092] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-described embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various methods and apparatus embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.

[0093] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for tracking materials item by item, characterized in that, include: Obtain an image of the marked area, in which the steel pipe is recorded with a steel pipe tracking identification code; The image of the marked area is processed, and the obtained edge map is identified to obtain the first mark of the steel pipe; Based on the location of multiple steel pipes and their production sequence, the current steel pipe identification is estimated to obtain a second identification. The current steel pipe is identified based on the first identifier and the second identifier.

2. The material tracking method according to claim 1, characterized in that, The step of performing image processing on the image of the marked area and recognizing the obtained edge map to obtain the first mark of the steel pipe includes: Multiple difference operators are used to perform difference processing on the identified region image to obtain multiple difference maps; A gradient map representing pixel gradients is constructed based on the multiple difference maps, and non-maximum gradient suppression and binarization are performed on the gradient map with a preset radius to obtain an edge map; The edge map is identified to obtain the first identifier.

3. The material tracking method according to claim 2, characterized in that, The process involves using multiple difference operators to perform difference processing on the identified region image to obtain multiple difference maps, including: Obtain the horizontal difference operator and the vertical difference operator; Data block extraction step: Extract the first data block by sliding from the identified area image; The first data block is multiplied by the horizontal difference operator and the vertical difference operator to obtain the horizontal difference value and the vertical difference value. The horizontal difference value and the vertical difference value are added to the horizontal difference plot and the vertical difference plot, respectively; If the traversal of the identified area image is not completed, proceed to the data block extraction step.

4. The material tracking method according to claim 2, characterized in that, The step of constructing a gradient map representing pixel gradients based on the plurality of difference maps, and performing non-maximum gradient suppression and binarization on the gradient map with a preset radius to obtain an edge map includes: The plurality of difference plots includes a horizontal difference plot and a vertical difference plot. A gradient plot is constructed based on a first formula, the horizontal difference plot, and the vertical difference plot, wherein the first formula is: In the formula, For pixel gradient, For pixel gradient direction, The horizontal difference between pixels. The vertical difference value of the pixel; For each pixel, find the maximum value within the preset radius region along the pixel gradient direction and the opposite direction of the pixel gradient, with the pixel as the center, and keep the other values ​​as 0 to obtain the extreme value map; The extreme value map is binarized to obtain the edge map.

5. The material tracking method for each item according to claim 1, characterized in that, The step of estimating the current steel pipe identifier based on the location of multiple steel pipes and the steel pipe production sequence to obtain a second identifier includes: Obtain the coordinates of the current steel pipe inspection point; Retrieve the position data of all tracked steel pipes in the current production line to obtain multiple tracking positions; Based on the first distance threshold and the coordinates of the current detection point, multiple target locations are selected from the multiple tracking locations; Based on the production sequence of the steel pipes, calculate the positional difference between any two adjacent steel pipes among the plurality of target locations; Based on multiple position differences and the coordinates of the current detection point, the current steel pipe identifier is estimated to obtain the second identifier.

6. The material tracking method according to claim 5, characterized in that, The step of estimating the current steel pipe identifier based on multiple position differences and the coordinates of the current detection point to obtain the second identifier includes: Determine whether there is a positional gap based on the multiple positional differences; If it exists, the markings of the steel pipes in front of the vacant position are summed to obtain the estimated markings; Otherwise, the steel pipe identifier that is closest to the coordinates of the current detection point among the multiple target locations is used as the estimated identifier; If the location of the estimated identifier matches the steel pipe production sequence, then the estimated identifier is used as the second identifier; Otherwise, a verification failure message is generated.

7. The material tracking method according to any one of claims 1-6, characterized in that, Determining the identifier of the current steel pipe based on the first identifier and the second identifier includes: If the first identifier is the same as the second identifier, then the first identifier shall be used as the identifier of the current steel pipe; Otherwise, the coordinates of the current steel pipe's detection points are obtained multiple times, the current steel pipe's identifier is estimated using the obtained coordinates of multiple detection points, and the accuracy of the first identifier is verified using the obtained identifier estimate. If the first identifier is inaccurate, the second identifier will be used as the identifier of the current steel pipe, and a message indicating that the first identifier recognition failed will be generated.

8. A material tracking device for each item, characterized in that, For implementing the material tracking method as described in any one of claims 1-7, the material tracking device comprises: The identification image acquisition module is used to acquire the image of the identification area, in which the steel pipe has a steel pipe tracking identification code recorded in the identification area; The image identification module is used to process the image of the identification area and identify the obtained edge map to obtain the first identification of the steel pipe. The software identification module is used to estimate the current steel pipe identifier based on the location of multiple steel pipes and the steel pipe production sequence, and obtain a second identifier; as well as, The identification confirmation module is used to determine the identification of the current steel pipe based on the first identification and the second identification.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7 above.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7 above.