Data blood relationship code generation method and device, electronic equipment and readable medium
By generating and printing data lineage codes, the problem of wasted computing resources is solved, efficient full lifecycle information traceability is achieved, and the complexity of database connection operations is reduced.
Patent Information
- Application Number
- CN202510263432.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-03-06
AI Technical Summary
Using separate databases in different systems or departments to record the entire lifecycle information of objects leads to a waste of computing resources, and complex database connection operations are required for tracing.
By generating data lineage codes, including subject codes, object codes, behavior codes, and extended codes, which are printed onto labels and affixed to physical objects, database connection operations are reduced, enabling traceability of information throughout the entire lifecycle.
It reduces the waste of computer computing resources, improves the efficiency of tracing information throughout its entire lifecycle, and reduces the complexity of database connection operations.
Smart Images

Figure CN120197634B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this disclosure relate to the field of computer technology, and more specifically to a method, apparatus, electronic device, and readable medium for generating data lineage codes. Background Technology
[0002] As businesses grow and digitalization increases, the amount of data involved in enterprises or organizations is increasing dramatically, and the types and sources of data are becoming increasingly diverse. Data from different subject types (such as different product lines, different business departments, etc.) are intertwined, and each subject type contains a large number of objects (such as specific products, various links in business processes, data, etc.). These objects also undergo complex flow processes at different stages. Data lineage code generation is a technology for recording the entire lifecycle information of objects (data or physical entities) as they flow through different systems and departments. Currently, the common approach to recording the entire lifecycle information of objects flowing through different systems and departments is to use a separate database in each system or department to record relevant information about the objects, thus recording their entire lifecycle information.
[0003] However, when using the above method to record the entire lifecycle information of an object as it moves between different systems and departments, the following technical problems often arise:
[0004] Each system or department uses its own database to record relevant information about objects, in order to record the full lifecycle information of objects. When tracing the full lifecycle information of objects, the database system needs to perform complex connection operations in order to associate relevant records in different databases, which wastes computer computing resources.
[0005] The information disclosed in this background section is only intended to enhance the understanding of the background of the inventive concept, and therefore may contain information that does not form prior art known to those skilled in the art. Summary of the Invention
[0006] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0007] Some embodiments of this disclosure provide methods, apparatus, electronic devices, and computer-readable media for generating data lineage codes to address one or more of the technical problems mentioned in the background section above.
[0008] In a first aspect, some embodiments of this disclosure provide a method for generating data lineage codes. The method includes: obtaining various subject type information from a first data source; generating various subject codes based on the subject type information, wherein each subject code corresponds to a subject type information in the subject type information; for each subject type information, performing the following encoding steps: determining the subject code corresponding to the subject type information in the subject codes as a target subject code; obtaining various object information corresponding to the subject type information from a second data source, wherein each object information corresponds to an object identifier; generating various object codes corresponding to each object identifier based on the object information and the target subject code, wherein each object identifier... Corresponding to one of the object codes mentioned above, the object code includes a main body code; for each of the object identifiers mentioned above, the following steps are performed: obtaining object flow information corresponding to the object identifier from a third data source, and generating a behavior code and an extended code corresponding to the object identifier based on the object flow information, wherein the behavior code includes an object code; generating a data lineage code corresponding to the object identifier based on the behavior code and the extended code; in response to determining that the object identifier is a material entity object identifier, controlling the printing device corresponding to the object identifier to print the data lineage code onto a label; controlling the associated robotic arm to paste the label containing the data lineage code onto the material entity object corresponding to the object identifier, so that the user terminal can trace the full-cycle traceability data corresponding to the material entity object.
[0009] Secondly, some embodiments of this disclosure provide a data lineage code generation apparatus, the apparatus comprising: an acquisition unit configured to acquire various subject type information from a first data source; a generation unit configured to generate various subject codes based on the aforementioned subject type information, wherein each subject code corresponds to a subject type information in the aforementioned subject type information; and an encoding unit configured to perform the following encoding steps for each subject type information in the aforementioned subject type information: determining the subject code corresponding to the aforementioned subject type information in the various subject codes as a target subject code; acquiring various object information corresponding to the aforementioned subject type information from a second data source, wherein each object information in the aforementioned object information corresponds to an object identifier; and generating various object codes corresponding to each object identifier based on the aforementioned object information and the aforementioned target subject code, wherein... Each object identifier in the above-mentioned object identifiers corresponds to one object code in the above-mentioned object codes, and the above-mentioned object codes include a subject code; for each of the above-mentioned object identifiers, the following steps are performed: obtaining object flow information corresponding to the above-mentioned object identifier from a third data source, and generating a behavior code and an extended code corresponding to the above-mentioned object identifier based on the above-mentioned object flow information, wherein the above-mentioned behavior code includes an object code; generating a data lineage code corresponding to the above-mentioned object identifier based on the above-mentioned behavior code and the above-mentioned extended code; in response to determining that the above-mentioned object identifier is a material entity object identifier, controlling the printing device corresponding to the above-mentioned object identifier to print the above-mentioned data lineage code onto a label; controlling the associated robotic arm to paste the label containing the data lineage code onto the material entity object corresponding to the above-mentioned object identifier, so as to trace the full-cycle traceability data corresponding to the above-mentioned material entity object.
[0010] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.
[0011] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
[0012] The above embodiments of this disclosure have the following beneficial effects: the data lineage code generation method of some embodiments of this disclosure reduces the waste of computer computing resources. Specifically, the reason for the waste of computer computing resources is that each system or department uses its own database to record relevant information of objects to record the full life cycle information of objects. When tracing the full life cycle information of objects, in order to associate relevant records in different databases, the database system needs to perform complex connection operations, which wastes computer computing resources. Based on this, the data lineage code generation method of some embodiments of this disclosure first obtains various subject type information from a first data source. Thus, various subject type information of different subjects (such as different product lines, different business departments) can be obtained. Then, based on the above-mentioned subject type information, various subject codes are generated, wherein each subject code in the above-mentioned subject codes corresponds to a subject type information in the above-mentioned subject type information. Thus, various subject codes representing various subjects can be generated. Afterwards, for each subject type information in the above-mentioned subject type information, the following encoding steps are performed: the subject code corresponding to the above-mentioned subject type information in the various subject codes is determined as the target subject code. Therefore, the target subject code used to generate each object code can be obtained to achieve the inheritance of data lineage. Next, the object information corresponding to the above subject type information is obtained from the second data source, wherein each object information corresponds to an object identifier. Thus, the object information under the subject corresponding to the subject type information can be obtained. Then, based on the above object information and the above target subject code, each object code corresponding to each object identifier is generated, wherein each object identifier corresponds to a corresponding object code in the above object codes, and the object code includes the subject code. Thus, each object code of each object information can be generated, and the object code includes the subject code, that is, it inherits the subject code of the subject to which the object belongs. Then, for each object identifier, the following steps are performed: First, the object flow information corresponding to the above object identifier is obtained from the third data source, and based on the above object flow information, the behavior code and extended code corresponding to the above object identifier are generated, wherein the behavior code includes the object code. Thus, the behavior code of the object flow information can be generated, and the behavior code inherits the object code of the object. The second step involves generating a data lineage code corresponding to the object identifier based on the aforementioned behavioral encoding and extended encoding. This allows for the generation of a data lineage code that records the entire lifecycle information of the object. In response to determining that the object identifier is a physical entity object identifier, the printing device corresponding to the object identifier is controlled to print the data lineage code onto a label. Therefore, when the object is a circulating physical entity, the data lineage code can be printed onto the label.The associated robotic arm affixes a label containing a data lineage code to the physical entity corresponding to the aforementioned object identifier, allowing the user to trace the full-lifecycle traceability data corresponding to the physical entity. Thus, the user can trace the full-lifecycle traceability data of the physical entity using the data lineage code with inherited data relationships, eliminating the need for complex database connection operations and reducing the waste of computing resources. Attached Figure Description
[0013] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0014] Figure 1 This is a flowchart of some embodiments of the data lineage code generation method according to this disclosure;
[0015] Figure 2 These are schematic diagrams illustrating the structure of some embodiments of the data lineage code generation apparatus according to this disclosure;
[0016] Figure 3 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation
[0017] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0018] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0019] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0020] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0021] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0022] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0023] Figure 1 A flow 100 of some embodiments of a data lineage code generation method according to the present disclosure is shown. The data lineage code generation method includes the following steps:
[0024] Step 101: Obtain information on each subject type from the first data source.
[0025] In some embodiments, the execution entity (e.g., a computing device) of the data lineage code generation method can obtain various entity type information from a first data source. Each entity type information includes an entity type identifier and an entity type abbreviation identifier. The entity type identifier can be an entity name (e.g., production department). The entity type abbreviation identifier can be an abbreviation of the entity name (e.g., production department abbreviation: SC). The first data source can be a data source storing the various entity type information (e.g., a metadata management system, a data warehouse, etc.).
[0026] Step 102: Generate the code for each subject based on the subject type information.
[0027] In some embodiments, the executing entity may generate various entity codes based on the aforementioned entity type information. Each entity code corresponds to a specific entity type information among the aforementioned entity type information.
[0028] In some optional implementations of certain embodiments, the aforementioned execution entity may generate various entity codes based on the aforementioned entity type information through the following steps:
[0029] The first step is to obtain the encoding requirements for each of the above-mentioned subject types.
[0030] The second step is to perform the following steps for each of the above subject type information:
[0031] The first sub-step is to determine the abbreviation identifier of the subject type included in the above subject type information.
[0032] The second sub-step involves calling the globally unique serial number generator to generate a serial number.
[0033] The third step involves concatenating the aforementioned subject type abbreviation and serial number based on the coding requirements information to obtain the subject code. The subject code, subject type information, and their corresponding relationships are then entered into a pre-defined database. The coding requirements information can represent the coding format. For example, the coding requirements information can be "subject type abbreviation + serial number". The subject type abbreviation can be "SC". The serial number can be "001", then the subject code can be "SC001".
[0034] Step 103: For each subject type information in each subject type information, perform the following encoding steps:
[0035] Step 1031: Determine the subject code corresponding to the subject type information in each subject code as the target subject code.
[0036] In some embodiments, the execution entity may determine the subject code corresponding to the subject type information in each subject code as the target subject code.
[0037] Step 1032: Obtain the information of each object corresponding to the subject type information from the second data source.
[0038] In some embodiments, the executing entity may obtain object information corresponding to the entity type information from a second data source. Each object information corresponds to an object identifier. The second data source may be a repository storing object information for each object under the entity corresponding to the entity type information (e.g., a water cup manufacturing department or a data service department). The objects may be physical entities (e.g., water cups) or virtual data objects (e.g., production data for water cups to be cleaned). The second data source may be a database or data system different from the first data source. Each object information may be a detailed description and data related to the object. The object identifier may be the object's product number or data name.
[0039] Step 1033: Based on the information of each object and the target subject code, generate the object code corresponding to each object identifier.
[0040] In some embodiments, the executing entity may generate object codes corresponding to each object identifier based on the object information and the target entity code. Each object identifier corresponds to one object code among the object codes, and the object codes include the entity code.
[0041] In some optional implementations of certain embodiments, the execution entity may generate object codes corresponding to each object identifier based on the object information and the target entity code through the following steps:
[0042] The first step is to perform the following encoding process for each of the above object information:
[0043] The first sub-step is to determine the object identifier corresponding to the above object information as the target object identifier.
[0044] The second sub-step involves converting the aforementioned object information according to the preset object coding specification information to obtain the initial object code. The preset object coding specification information may include various object specification sub-information. Each of these object specification sub-information includes: object information and object mapping code. In practice, firstly, the executing entity can identify the aforementioned object information as the object information to be retrieved. Then, the executing entity can identify the object specification sub-information containing the object information to be retrieved as the target object specification sub-information. Afterward, the executing entity can identify the object mapping code included in the target object specification sub-information as the initial object code. For example, if the object information is "Item Raw Material Classification: Plastic", the various object specification sub-information can be "{Item Raw Material Classification: Plastic, PL}, {Item Raw Material Classification: Metal, ME}". Then, the initial object code can be "PL".
[0045] The third sub-step involves concatenating the target entity code and the initial object code to obtain the concatenated code. In practice, the executing entity can concatenate the target entity code and the initial object code according to a first preset concatenation order and a preset concatenation symbol. The first preset concatenation order can be target entity code first, followed by initial object code. The preset concatenation symbol can be " / ". As an example, the target entity code can be "SC001". The initial object code can be "PL". Then the concatenated code can be "SC001 / PL".
[0046] The second step is to determine the above-mentioned splicing code as the object code corresponding to the above-mentioned target object identifier, and to enter the above-mentioned initial object code and the above-mentioned object information and their correspondence into the preset database.
[0047] Step 1034, for each object identifier in each object identifier, perform the following steps:
[0048] Step 10341: Obtain object flow information corresponding to the object identifier from the third data source, and generate behavior code and extended code corresponding to the object identifier based on the object flow information.
[0049] In some embodiments, the executing entity can obtain object flow information corresponding to the object identifier from a third data source, and generate behavior codes and extended codes corresponding to the object identifier based on the object flow information. The behavior codes include object codes. The third data source can be a database or data system used to store and manage object flow information. The third data source can be different from the first and second data sources. The object flow information records various states and changes experienced by the object during its lifecycle, such as object creation, modification, deletion, transfer, and use. The object flow information includes: state change information, state change time information, and extended information, where the extended information includes custom codes. The state change information can represent the state changes experienced by the object during its lifecycle. The state change time information can represent the time when the state change occurred. For example, the state change information can be "packaged" changed to "shipped". The state change time can be "2025.02.27".
[0050] In some optional implementations of certain embodiments, the execution entity can generate behavior codes and extended codes corresponding to the object identifier based on the object flow information through the following steps:
[0051] The first step is to obtain the preset behavior coding specification information. This preset behavior coding specification information includes a state coding mapping information set and time specification information. Each state coding mapping information in the state coding mapping information set includes state change information and a state mapping code. The state mapping code can be a preset code representing the state change information. For example, the state change information included in the state coding mapping information could be "packed to shipped". The state mapping code corresponding to "packed to shipped" could be "SHIPPED".
[0052] The second step is to determine the object code corresponding to the above object identifier as the target object code.
[0053] The third step is to identify the status change information included in the above object flow information as the status change information to be queried.
[0054] The fourth step is to identify the state change information in the above state coding mapping information set that is the same as the state change information to be queried as the target state change information.
[0055] The fifth step is to determine the state coding mapping information that includes the target state change information in the above state coding mapping information set as the target state coding mapping information.
[0056] The sixth step is to determine the state mapping code included in the above target state coding mapping information as the target state mapping code.
[0057] Step 7: Based on the aforementioned time specification information, convert the state change time information into a timestamp. The aforementioned time specification information can represent a standardized method of time representation. For example, the aforementioned time specification information can represent the ISO 8601 standard. The aforementioned state change time information can be "2025.02.27". The converted timestamp can be "2025-02-27".
[0058] Step 8: Concatenate the target state mapping code and the timestamp to obtain the initial behavior code. In practice, the executing entity can concatenate the target state mapping code and the timestamp according to the second preset concatenation order and the second preset concatenation symbol to obtain the initial behavior code. For example, the second preset concatenation order can be target state mapping code first, followed by timestamp. The preset concatenation symbol can be ".". As an example, the target state mapping code can be "SHIPPED". The timestamp can be "2025-02-27", then the initial behavior code can be "SHIPPED.2025-02-27".
[0059] Step nine involves concatenating the target object code and the initial behavior code to obtain the behavior code corresponding to the object identifier. In practice, the executing entity can concatenate the target object code and the initial behavior code according to a third preset concatenation order and preset concatenation symbols. The third preset concatenation order can be target object code first, followed by initial behavior code. As an example, if the target object code is "SC001 / PL" and the initial behavior code is "SHIPPED.2025-02-27", then the behavior code can be "SC001 / PL / SHIPPED.2025-02-27".
[0060] Step 10: Determine the extended information, including the custom code, as the extended code, and input the initial behavior code, the extended code, and the object flow information and their correspondence into the preset database. The custom code can be a code preset by business personnel. For example, the extended code can be AAA.
[0061] Step 10342: Based on behavior encoding and extended encoding, generate the data lineage code corresponding to the object identifier.
[0062] In some embodiments, the execution entity may generate a data lineage code corresponding to the object identifier based on the behavior encoding and the extended encoding.
[0063] In some optional implementations of certain embodiments, the aforementioned executing entity can generate a data lineage code corresponding to the aforementioned object identifier based on the aforementioned behavior encoding and the aforementioned extended encoding through the following steps:
[0064] The first step is to concatenate the aforementioned behavior code and the aforementioned extended code to obtain the concatenated code. In practice, the executing entity can concatenate the aforementioned behavior code and the aforementioned extended code according to the fourth preset concatenation order and preset concatenation symbols. The aforementioned fourth preset concatenation order can be behavior code first, followed by extended code. As an example, the aforementioned behavior code can be "SC001 / PL / SHIPPED.2025-02-27", and the aforementioned extended code can be "AAA", then the concatenated code can be "SC001 / PL / SHIPPED.2025-02-27 / AAA".
[0065] The second step is to determine the above-mentioned spliced code as the data lineage code with the above-mentioned object identifier.
[0066] Step 10343: In response to determining that the object identifier is a material entity object identifier, control the printing device corresponding to the object identifier to print the data lineage code onto the label paper.
[0067] In some embodiments, the executing entity may, in response to determining that the object identifier is a physical entity object identifier, control the printing device corresponding to the object identifier to print the data lineage code onto a label. In practice, the executing entity can query the location information of the physical entity object corresponding to the object identifier from a preset supply chain management system. Then, the executing entity can control the printing device responsible for the area corresponding to the location information to print the data lineage code onto a label. The location information may represent a warehouse location.
[0068] Step 10344: Control the associated robotic arm to affix a label containing the data lineage code to the material entity object corresponding to the object identifier, so that the user terminal can trace the full life cycle traceability data corresponding to the material entity object.
[0069] In some embodiments, the executing entity can control an associated robotic arm to affix a label containing a data lineage code to the physical object corresponding to the object identifier, allowing the user to trace the full-cycle traceability data corresponding to the physical object. In practice, the executing entity can query the storage location information of the physical object corresponding to the object identifier from a preset warehouse management system. Then, the executing entity can control the robotic arm associated with the printing device to affix the label containing the data lineage code to the physical object at the storage location.
[0070] In some optional implementations of certain embodiments, after generating the data lineage code corresponding to the object identifier based on the above-described behavioral encoding and extended encoding, the execution entity may further perform the following steps:
[0071] In response to determining that the aforementioned object identifier is a virtual data object identifier, the aforementioned data lineage code is bound to the virtual data object in the preset data repository corresponding to the object identifier. In practice, the aforementioned executing entity can determine the aforementioned data lineage code as a tag for the aforementioned virtual data to bind the data lineage code to the aforementioned virtual data object. The aforementioned virtual data object can refer to the data itself after being processed through various processes (e.g., cleaning, deduplication, etc.).
[0072] In the process of adopting technical solutions to address the problems mentioned in the background section, the following issues often arise:
[0073] When receiving a data lineage code image from the user terminal for full-cycle data tracing, it is necessary to identify the data lineage code image to obtain the data lineage code used for tracing. However, since the location of the code in the acquired data lineage code image may change due to factors such as image content and shooting angle, identifying data lineage code images with unidentified code locations requires searching for coding features throughout the entire image, increasing the complexity and computational load of the identification. Furthermore, the background outside the coding area in the image may interfere with the identification, resulting in lower accuracy of data lineage code recognition.
[0074] Faced with the above-mentioned technical problems, the inventors decided to adopt the following solution:
[0075] In some optional implementations of certain embodiments, the aforementioned execution entity may further perform the following steps:
[0076] The first step is to identify the data tracing request information, which includes a data lineage code image, sent by the user terminal.
[0077] The second step involves performing the following processing on each pixel in the image to be identified:
[0078] The first sub-step involves determining the three primary color values of the aforementioned pixels. These three primary color values can refer to the numerical values of the red, green, and blue channels in the pixel. For example, the three primary color values could be (26, 15, 90).
[0079] The second sub-step involves generating the average color value corresponding to the aforementioned pixels based on the three primary color values. This average color value can refer to the average of the red, green, and blue values among the three primary colors. For example, if the three primary color values are (4, 5, 6), then the average color value is 5.
[0080] The third sub-step involves determining the number of color channels for the aforementioned pixels as a first preset value. For example, the first preset value could be "1".
[0081] The fourth sub-step is to determine the average color value as the color value of the pixel.
[0082] The third step is to determine the preprocessed image as the image whose pixels in the image to be identified have been processed by the above pixel processing steps.
[0083] The fourth step is to denoise the preprocessed image to obtain a denoised image to be recognized. In practice, the execution entity can use a Gaussian filtering algorithm to denoise the preprocessed image to obtain the denoised image to be recognized.
[0084] The fifth step involves binarizing the denoised image to be recognized to obtain a binarized image to be recognized. In practice, the executing entity can use an adaptive threshold binarization algorithm to binarize the denoised image to be recognized, thus obtaining a binarized image to be recognized. The binarized image to be recognized can be the image after binarizing the denoised image to be recognized.
[0085] Step 6: Perform the following encoding and localization processing on the above binarized image to be identified:
[0086] Sub-step one involves performing edge detection processing on the aforementioned binarized image to be identified, obtaining an edge image. In practice, the executing entity can use the Sobel edge detection algorithm to perform edge detection processing on the aforementioned binarized image to be identified. The aforementioned edge image can be an image marked with edge pixels after the binarized image has been processed by the edge detection algorithm.
[0087] Sub-step two involves performing a dilation operation on the aforementioned edge image to obtain a dilated image. In practice, the executing entity can use morphological dilation techniques to perform the dilation operation on the edge image to obtain the dilated image. The dilated image can be the image obtained after performing a dilation operation on the edge image.
[0088] Sub-step three involves performing an erosion operation on the aforementioned dilated image to obtain an eroded image. In practice, the executing entity can use morphological erosion techniques to perform the erosion operation on the aforementioned dilated image to obtain an eroded image. The eroded image can be the image obtained after the aforementioned dilated image has undergone an erosion operation.
[0089] Sub-step four involves performing contour extraction processing on the aforementioned eroded image to obtain a contour position information set. In practice, the aforementioned execution entity can perform contour extraction processing on the aforementioned eroded image using a boundary tracking algorithm. Each contour position information in the aforementioned contour position information set can represent the position of the extracted contour. The aforementioned contour position information can include the coordinates of each pixel point.
[0090] Sub-step five involves determining the location information of the bounding rectangle region corresponding to the contour position information set in the binarized image to be recognized as the bounding rectangle position information. This bounding rectangle position information can be the coordinates of the four vertices of the bounding rectangle. In practice, the executing entity can execute a preset function (e.g., the `boundingRect` function) to determine the upper-left corner coordinates (x, y), width w, and height h of the bounding rectangle corresponding to the contour position information set in the binarized image to be recognized. Then, the executing entity can determine (x + width w, y) as the upper-right corner coordinate of the bounding rectangle. Next, the executing entity can determine (x + width w, y + height h) as the lower-right corner coordinate of the bounding rectangle. Then, the executing entity can determine (x, y + height h) as the lower-left corner coordinate of the bounding rectangle. Finally, the executing entity can determine the upper-left, upper-right, lower-right, and lower-left corner coordinates as the bounding rectangle position information.
[0091] Step 7: Determine the location information of the circumscribed rectangle as the location information of the encoding region.
[0092] Step 8: Based on the aforementioned coded region location information, the binarized image to be identified is subjected to coded recognition processing to obtain the data lineage code. In practice, firstly, the executing entity can use image cropping technology to retain the image within the coded region location information in the binarized image to be identified, and crop away the image outside the coded region location information, to obtain the coded positioning image. Then, the executing entity can use OCR technology to recognize the coded positioning image to obtain the recognition code as the data lineage code.
[0093] Step nine involves identifying and splitting the aforementioned data lineage code to obtain a traceability link coding sequence. This sequence includes, in sequence, an extended code, an initial behavior code, an initial object code, and a subject code. In practice, the executing entity can identify the position of a preset concatenation symbol within the data lineage code. Then, using this preset concatenation symbol as a dividing marker, the executing entity can split the data lineage code from back to front. For example, the data lineage code could be “SC001 / PL / SHIPPED.2025-02-27 / AAA”. The resulting traceability link coding sequence could be “{AAA、SHIPPED.2025-02-27、PL、SC001}”. The codes in this traceability link coding sequence are as follows: “AAA” is the extended code, “PL” is the initial behavior code, “SHIPPED.2025-02-27” is the initial object code, and “SC001” is the subject code.
[0094] Step 10: Based on the aforementioned traceability link coding sequence, generate full-cycle traceability data corresponding to the aforementioned data lineage code. In practice, the executing entity can query the object flow information, object information, and entity type information corresponding to the initial behavior code, initial object code, and entity code from a preset database. Then, the executing entity can determine the queried object flow information, object information, and entity type information as the full-cycle traceability data.
[0095] Step 11: Send the aforementioned full-cycle traceability data to the aforementioned user terminal.
[0096] The above technical solution and its related content, as an inventive point of this disclosure, solve the technical problem of "low accuracy in data lineage code recognition". Factors leading to low accuracy in data lineage code recognition often include: the coding position in the acquired data lineage code image may change due to image content, shooting angle, and other factors. Recognizing data lineage code images with unidentified coding positions requires searching for coding features throughout the entire image, increasing the complexity and computational load. Simultaneously, the background outside the coding area in the image may interfere with recognition, resulting in low accuracy. Solving these factors can improve the accuracy of data lineage code recognition. To achieve this, firstly, in response to receiving a data tracing request information including a data lineage code image sent by the user terminal, the aforementioned data lineage code image is identified as the image to be recognized. Then, for each pixel in the image to be recognized, the following processing is performed: First, the three primary color values of the aforementioned pixel are determined. This yields the three primary color values used to generate the average color value of the pixel. Second, based on the aforementioned three primary color values, the average color value corresponding to the aforementioned pixel is generated. The third step is to determine the number of color channels of the aforementioned pixels as a first preset value. This allows for the modification of the number of pixel channels. Then, the average color value is determined as the color value of the aforementioned pixels. Next, the image to be recognized, processed by the aforementioned pixel processing steps, is determined as a preprocessed image. This process converts the image to be recognized into a grayscale image, i.e., the preprocessed image. Then, denoising is performed on the preprocessed image to obtain a denoised image to be recognized. This removes noise from the preprocessed image. Next, binarization is performed on the denoised image to obtain a binarized image to be recognized. This converts the denoised image to a binarized image with more prominent key features, such as edges and textures. Then, the following encoding and localization processing is performed on the binarized image to be recognized: First, edge detection is performed on the binarized image to obtain an edge image. This provides an edge image with marked edge pixels for subsequent contour extraction. Second, dilation is performed on the edge image to obtain a dilated image. Therefore, dilation can be used to fill in small breaks or gaps in the edges, making the edges more complete and continuous, thus enhancing edge features. The third step involves performing an erosion operation on the dilated image to obtain an eroded image. This erosion operation removes small noise points or isolated pixels from the image. The fourth step involves contour extraction processing on the eroded image to obtain a set of contour position information. This yields a set of contour position information for each contour, potentially including data lineage codes.The fifth step involves determining the location information of the bounding rectangle region corresponding to the contour location information set in the binarized image to be recognized as the bounding rectangle location information. This yields the bounding rectangle location information of the rectangular region containing the data lineage code. Next, the bounding rectangle location information is determined as the coding region location information. This yields the coding region location information of the area containing the data lineage code. The location information of the data lineage code in the binarized image to be recognized, i.e., the coding region location information, is determined through the above coding location processing. Then, based on the coding region location information, the binarized image to be recognized is processed for coding recognition to obtain the data lineage code. This further narrows the recognition range and eliminates interference from non-coding regions (i.e., background), thereby improving the accuracy of coding recognition. Then, the data lineage code is identified and decomposed to obtain the traceability link coding sequence, which sequentially includes extended coding, initial behavior coding, initial object coding, and subject coding. This yields the traceability link coding sequence used to generate full-cycle traceability data. Next, based on the aforementioned traceability link coding sequence, full-cycle traceability data corresponding to the aforementioned data lineage code is generated. Finally, the aforementioned full-cycle traceability data is sent to the aforementioned user terminal. This is because, before recognizing the data lineage code image, the location information of the data lineage code in the binarized image to be recognized, i.e., the location information of the coding region, is determined through coding and positioning processing. Based on the location information of the coding region, the image to be recognized is subjected to coding recognition processing, further narrowing the recognition range and eliminating interference from non-coding regions (i.e., background), thereby improving the accuracy of coding recognition.
[0097] The above embodiments of this disclosure have the following beneficial effects: the data lineage code generation method of some embodiments of this disclosure reduces the waste of computer computing resources. Specifically, the reason for the waste of computer computing resources is that each system or department uses its own database to record relevant information of objects to record the full life cycle information of objects. When tracing the full life cycle information of objects, in order to associate relevant records in different databases, the database system needs to perform complex connection operations, which wastes computer computing resources. Based on this, the data lineage code generation method of some embodiments of this disclosure first obtains various subject type information from a first data source. Thus, various subject type information of different subjects (such as different product lines, different business departments) can be obtained. Then, based on the above-mentioned subject type information, various subject codes are generated, wherein each subject code in the above-mentioned subject codes corresponds to a subject type information in the above-mentioned subject type information. Thus, various subject codes representing various subjects can be generated. Afterwards, for each subject type information in the above-mentioned subject type information, the following encoding steps are performed: the subject code corresponding to the above-mentioned subject type information in the various subject codes is determined as the target subject code. Therefore, the target subject code used to generate each object code can be obtained to achieve the inheritance of data lineage. Next, the object information corresponding to the above subject type information is obtained from the second data source, wherein each object information corresponds to an object identifier. Thus, the object information under the subject corresponding to the subject type information can be obtained. Then, based on the above object information and the above target subject code, each object code corresponding to each object identifier is generated, wherein each object identifier corresponds to a corresponding object code in the above object codes, and the object code includes the subject code. Thus, each object code of each object information can be generated, and the object code includes the subject code, that is, it inherits the subject code of the subject to which the object belongs. Then, for each object identifier, the following steps are performed: First, the object flow information corresponding to the above object identifier is obtained from the third data source, and based on the above object flow information, the behavior code and extended code corresponding to the above object identifier are generated, wherein the behavior code includes the object code. Thus, the behavior code of the object flow information can be generated, and the behavior code inherits the object code of the object. The second step involves generating a data lineage code corresponding to the object identifier based on the aforementioned behavioral encoding and extended encoding. This allows for the generation of a data lineage code that records the entire lifecycle information of the object. In response to determining that the object identifier is a physical entity object identifier, the printing device corresponding to the object identifier is controlled to print the data lineage code onto a label. Therefore, when the object is a circulating physical entity, the data lineage code can be printed onto the label.The associated robotic arm affixes a label containing a data lineage code to the physical entity corresponding to the aforementioned object identifier, allowing the user to trace the full-lifecycle traceability data corresponding to the physical entity. Thus, the user can trace the full-lifecycle traceability data of the physical entity using the data lineage code with inherited data relationships, eliminating the need for complex database connection operations and reducing the waste of computing resources.
[0098] Further reference Figure 2 As an implementation of the methods shown in the figures, this disclosure provides some embodiments of a data lineage code generation apparatus, which are similar to... Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0099] like Figure 2 As shown, a data lineage code generation apparatus 200 in some embodiments includes: an acquisition unit 201, a generation unit 202, and an encoding unit 203. The acquisition unit 201 is configured to acquire various subject type information from a first data source; the generation unit 202 is configured to generate various subject codes based on the aforementioned subject type information, wherein each subject code corresponds to a subject type information in the aforementioned subject type information; the encoding unit 203 is configured to perform the following encoding steps for each subject type information: determining the subject code corresponding to the aforementioned subject type information as the target subject code; acquiring various object information corresponding to the aforementioned subject type information from a second data source, wherein each object information corresponds to an object identifier; and generating various object codes corresponding to each object identifier based on the aforementioned object information and the target subject code, wherein each object identifier... Corresponding to one of the object codes mentioned above, the object code includes a main body code; for each of the object identifiers mentioned above, the following steps are performed: obtaining object flow information corresponding to the object identifier from a third data source, and generating a behavior code and an extended code corresponding to the object identifier based on the object flow information, wherein the behavior code includes an object code; generating a data lineage code corresponding to the object identifier based on the behavior code and the extended code; in response to determining that the object identifier is a material entity object identifier, controlling the printing device corresponding to the object identifier to print the data lineage code onto a label; controlling the associated robotic arm to paste the label containing the data lineage code onto the material entity object corresponding to the object identifier, so that the user terminal can trace the full-cycle traceability data corresponding to the material entity object.
[0100] It is understandable that the units described in the device 200 are related to the reference. Figure 1 The steps in the method described above correspond to each other. Therefore, the operations, features, and beneficial effects described above for the method also apply to the device 200 and the units contained therein, and will not be repeated here.
[0101] The following is for reference. Figure 3 It shows a schematic diagram of the structure of an electronic device 300 suitable for implementing some embodiments of the present disclosure. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0102] like Figure 3 As shown, the electronic device 300 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. The RAM 303 also stores various programs and data required for the operation of the electronic device 300. The processing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0103] Typically, the following devices can be connected to I / O interface 305: input devices 306 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 307 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 308 including, for example, magnetic tapes, hard disks, etc.; and communication devices 309. Communication device 309 allows electronic device 300 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 An electronic device 300 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 3 Each box shown can represent a device or multiple devices as needed.
[0104] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 309, or installed from storage device 308, or installed from ROM 302. When the computer program is executed by processing device 301, it performs the functions defined in the methods of some embodiments of this disclosure.
[0105] It should be noted that, in some embodiments of this disclosure, the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0106] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0107] A computer-readable medium may be contained within an electronic device or may exist independently, not assembled into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: obtain various subject type information from a first data source; generate various subject codes based on the subject type information, wherein each subject code corresponds to a subject type information in the subject type information; for each subject type information, perform the following encoding steps: determine the subject code corresponding to the subject type information in the subject codes as a target subject code; obtain various object information corresponding to the subject type information from a second data source, wherein each object information corresponds to an object identifier; generate various object codes corresponding to each object identifier based on the object information and the target subject code, wherein each object identifier corresponds to an object identifier. Each object identifier corresponds to one of the object codes mentioned above, whereby the object codes include a main body code. For each of the object identifiers, the following steps are performed: obtaining object flow information corresponding to the object identifier from a third data source, and generating a behavior code and an extended code corresponding to the object identifier based on the object flow information, wherein the behavior code includes an object code; generating a data lineage code corresponding to the object identifier based on the behavior code and the extended code; in response to determining that the object identifier is a material entity object identifier, controlling the printing device corresponding to the object identifier to print the data lineage code onto a label; controlling the associated robotic arm to paste the label containing the data lineage code onto the material entity object corresponding to the object identifier, so that the user terminal can trace the full-cycle traceability data corresponding to the material entity object.
[0108] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0109] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0110] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including an acquisition unit, a generation unit, and an encoding unit. The names of these units do not necessarily limit the unit itself; for example, the generation unit may also be described as "a unit that generates encodings for each subject based on the aforementioned subject type information."
[0111] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0112] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of technical features, but should also cover other technical solutions formed by arbitrary combinations of technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A data blood relationship code generation method, comprising: obtaining each subject type information from a first data source; generating each subject code based on the each subject type information, wherein each subject code in the each subject code corresponds to a corresponding subject type information in the each subject type information; for each subject type information in the each subject type information, performing the following coding steps: determining the subject code corresponding to the subject type information in the each subject code as a target subject code; obtaining each object information corresponding to the subject type information from a second data source, wherein each object information in the each object information corresponds to an object identifier; generating each object code corresponding to each object identifier based on the each object information and the target subject code, wherein each object identifier in the each object identifier corresponds to a corresponding object code in the each object code, and the object code comprises a subject code; for each object identifier in the each object identifier, performing the following steps: obtaining object flow information corresponding to the object identifier from a third data source, and generating behavior code and extension code corresponding to the object identifier based on the object flow information, wherein the behavior code comprises an object code; generating a data blood relationship code corresponding to the object identifier based on the behavior code and the extension code; in response to determining that the object identifier is a material entity object identifier, controlling a printing device corresponding to the object identifier to print the data blood relationship code on a label paper; controlling an associated mechanical arm to paste the label paper containing the data blood relationship code to a material entity object corresponding to the object identifier, so that a user end can trace full-cycle traceability data corresponding to the material entity object.
2. The method of claim 1, wherein, After the data blood relationship code corresponding to the object identifier is generated based on the behavior code and the extension code, the method further comprises: in response to determining that the object identifier is a virtual data object identifier, binding the data blood relationship code with a virtual data object in a preset data sink corresponding to the object identifier.
3. The method of claim 1, wherein, The generation of the data blood relationship code corresponding to the object identifier based on the behavior code and the extension code comprises: splicing the behavior code and the extension code to obtain a spliced splicing code; determining the splicing code as the data blood relationship code corresponding to the object identifier.
4. The method of claim 1, wherein, The subject type information comprises a subject type identifier and a subject type abbreviation identifier; and the generation of the each subject code based on the each subject type information comprises: obtaining coding requirement information corresponding to the each subject type information; for each subject type information in the each subject type information, performing the following steps: determining the subject type abbreviation identifier included in the subject type information; calling a globally unique serial number generator to generate a serial number; based on the coding requirement information, splicing the subject type abbreviation identifier and the serial number to obtain a subject code, and entering the subject code, the subject type information and the correspondence therebetween into a preset database.
5. The method of claim 1, wherein, The generating, based on the respective object information and the target principal code, of respective object codes corresponding to respective object identifiers comprises: For each of the respective object information, the following encoding processing is performed: An object identifier corresponding to the object information is determined as a target object identifier; The object information is converted according to preset object encoding specification information to obtain an initial object code; The target principal code and the initial object code are spliced to obtain a spliced spliced code; The spliced code is determined as an object code corresponding to the target object identifier, and the initial object code and the object information and the corresponding relationship therebetween are entered into a preset database.
6. The method of claim 1, wherein, The object flow information includes state change information, state change time information and extension information, the extension information includes a custom code; and the generating, based on the object flow information, of a behavior code corresponding to the object identifier and an extension code comprises: Obtaining preset behavior encoding specification information, wherein the preset behavior encoding specification information includes a set of state encoding mapping information and time specification information, each state encoding mapping information in the set of state encoding mapping information includes state change information and a state mapping code; The object code corresponding to the object identifier is determined as a target object code; The state change information included in the object flow information is determined as to-be-queried state change information; The state change information in the set of state encoding mapping information that is the same as the to-be-queried state change information is determined as target state change information; The state encoding mapping information in the set of state encoding mapping information that includes the target state change information is determined as target state encoding mapping information; The state mapping code included in the target state encoding mapping information is determined as a target state mapping code; The state change time information is converted into a timestamp based on the time specification information; The target state mapping code and the timestamp are spliced to obtain an initial behavior code; The target object code and the initial behavior code are spliced to obtain a behavior code corresponding to the object identifier; The extension information including the custom code is determined as an extension code, and the initial behavior code, the extension code and the corresponding relationship therebetween are entered into a preset database.
7. A data blood relationship code generation apparatus, comprising: An acquisition unit configured to acquire respective principal type information from a first data source; A generation unit configured to generate respective principal codes based on the respective principal type information, wherein each principal code in the respective principal codes corresponds to a corresponding one of the respective principal type information. The encoding unit is configured to, for each of the subject type information, perform the following encoding steps: determining a subject encoding corresponding to the subject type information in each of the subject encodings as a target subject encoding; obtaining each object information corresponding to the subject type information from a second data source, wherein each of the object information corresponds to an object identifier; generating each object encoding corresponding to each object identifier based on the each object information and the target subject encoding, wherein each of the object identifiers corresponds to a corresponding one of the object encodings, and the object encoding includes the subject encoding; for each of the object identifiers, performing the following steps: obtaining object flow information corresponding to the object identifier from a third data source, and generating behavior encoding and extension encoding corresponding to the object identifier based on the object flow information, wherein the behavior encoding includes the object encoding; generating data blood relationship code corresponding to the object identifier based on the behavior encoding and the extension encoding; in response to determining that the object identifier is a material entity object identifier, controlling a printing device corresponding to the object identifier to print the data blood relationship code on a label paper; and controlling an associated mechanical arm to paste the label paper containing the data blood relationship code to a material entity object corresponding to the object identifier, so as to enable a user end to trace full-cycle trace data corresponding to the material entity object. 8.An electronic device, comprising: one or more processors; storage having stored thereon one or more programs; when the one or more programs are executed by the one or more processors, the one or more programs cause the one or more processors to carry out the method of any one of claims 1-6.
9. A computer readable medium having stored thereon a computer program, wherein, the program, when executed by a processor, causes the processor to carry out the method of any one of claims 1-6.
Citation Information
Patent Citations
Entity relationship extraction method and device, electronic equipment and storage medium
CN115357723A
Data blood relationship model generation method and device, electronic equipment and readable medium
CN118779317A