Containerized material retrieval method, system, and medium based on bidirectional traceability
By establishing a two-way mapping relationship between component barcodes and container identifiers in the material management system, and using hash tables and bitmap indexes to achieve fast location and query, and implementing conflict detection and self-healing mechanisms, the problems of low query efficiency and poor data consistency in the material management system are solved, improving the system's response speed and reliability. It is suitable for scenarios such as intelligent manufacturing and logistics warehousing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2026-04-10
AI Technical Summary
Existing material management systems face problems such as low query efficiency, poor data consistency, insufficient concurrency, and limited scalability when dealing with large-scale component management. In particular, in complex product traceability and quality control scenarios, forward traceability suffers from high latency, reverse traceability is unreliable, and data inconsistency seriously affects the efficient operation of smart manufacturing and logistics warehousing.
A containerized material retrieval method based on bidirectional traceability is adopted. By establishing a bidirectional mapping relationship between component barcodes and container identifiers, hash tables and bitmap indexes are used to achieve fast location and query. Conflict detection and self-healing mechanisms are implemented to ensure data consistency. The forward mapping relationship is used for the unique correspondence between components and containers, and the reverse mapping relationship is used for the fast acquisition of container to component sets. Consistency verification and conflict repair are performed when adding or migrating component barcodes.
It improves the response speed and data consistency of material retrieval, reduces time complexity, enhances query efficiency and system reliability, and is suitable for fields such as smart manufacturing and logistics warehousing. It also supports efficient data management and rapid fault analysis.
Smart Images

Figure CN121032386B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of product material management, and in particular to a containerized material retrieval method, system and medium based on bidirectional tracing. BACKGROUND
[0002] Material management systems play a key role in the field of industrial Internet of Things, by efficiently managing the association of product material components, ensuring data consistency and the convenience of tracing, thereby supporting precise control and optimization of intelligent manufacturing. However, existing material management systems face some challenges, including low query efficiency, high time complexity due to reliance on multi-table JOIN operations, especially high positive tracing delay and unreliable reverse tracing during complex product tracing; poor data consistency, prone to errors and data inconsistency windows during component movement and high concurrency access; these problems jointly constrain the performance and reliability of material management systems in handling large-scale component management, affecting the efficient operation of intelligent manufacturing, logistics and warehousing, etc. SUMMARY
[0003] The purpose of the present application is to provide a containerized material retrieval method, system and medium based on bidirectional tracing, to solve one or more technical problems existing in the prior art, and at least to provide a beneficial choice or create conditions.
[0004] The solution to the technical problem of the present application is: on the one hand, the present application provides a containerized material retrieval method based on bidirectional tracing, comprising the following steps:
[0005] establishing a bidirectional mapping relationship between component barcodes and container identifiers; the bidirectional mapping relationship includes a positive mapping relationship from component barcodes to container identifiers, and a reverse mapping relationship from the container identifiers to the component barcodes;
[0006] wherein the positive mapping relationship is used to correspond each component barcode to at most one container identifier, and the reverse mapping relationship is used to correspond each container identifier to a set including all component barcodes within the container;
[0007] based on the bidirectional mapping relationship, performing a bidirectional tracing algorithm to retrieve product materials;
[0008] the bidirectional tracing algorithm comprises:
[0009] inputting a component barcode and locating the container identifier corresponding to the component barcode through the positive mapping relationship;
[0010] inputting a container identifier and obtaining the set of component barcodes corresponding to the container identifier through the reverse mapping relationship;
[0011] A conflict detection algorithm is executed when the component barcode is added to the component set of the target container identifier or migrated from the component set of the original container identifier to the component set of the target container identifier, if no conflict is detected, the bidirectional mapping relationship is updated and consistency check is performed, if the check passes, the addition and migration of the component barcode is completed, if the check fails, a self-healing mechanism is triggered, if a conflict is detected, a self-healing mechanism is triggered.
[0012] The self-healing mechanism is used to repair the bidirectional mapping relationship.
[0013] Further, the forward mapping relationship is implemented by a hash table, the key is the component barcode, and the value is the container identifier; the reverse mapping relationship is implemented by a bitmap index, the key is the container identifier, and the value is a compressed bitmap; wherein the bit offset of the compressed bitmap is calculated by the hash value of the component barcode.
[0014] Further, the conflict detection algorithm includes the following steps:
[0015] When the component barcode is added to the component set of the target container identifier or migrated from the component set of the original container identifier to the component set of the target container identifier, it is checked whether the component barcode is currently mapped to other container identifiers; if it is mapped to other container identifiers different from the target container identifier, it is determined as a conflict, and a conflict information including the target container identifier, the container identifier currently mapped by the component barcode and the component barcode is generated.
[0016] Further, in the process of adding the component barcode to the component set of the target container identifier, the conflict detection algorithm is executed, if no conflict is detected, the bidirectional mapping relationship is updated and consistency check is performed, including the following steps:
[0017] Update the forward mapping relationship from the component barcode to the target container identifier, and uniquely correspond the component barcode to the target container identifier;
[0018] Update the reverse mapping relationship from the target container identifier to the component barcode, and add the component barcode to the component barcode set corresponding to the target container identifier;
[0019] Perform consistency check on the bidirectional mapping relationship of the target container identifier, if the check passes, the addition of the component barcode is completed, if the check fails, a self-healing mechanism is triggered.
[0020] Further, in the process of migrating the component barcode from the component set of the original container identifier to the component set of the target container identifier, the conflict detection algorithm is executed, if no conflict is detected, the bidirectional mapping relationship is updated and consistency check is performed, including the following steps:
[0021] updating a forward mapping relationship from the component barcode to the original container identifier, deleting the unique correspondence of the component barcode to the original container identifier;
[0022] updating a reverse mapping relationship from the original container identifier to the component barcode, removing the component barcode from the set of component barcodes of the original container identifier;
[0023] updating a forward mapping relationship from the component barcode to the target container identifier, uniquely corresponding the component barcode to the target container identifier,
[0024] updating a reverse mapping relationship from the target container identifier to the component barcode, adding the component barcode to the set of component barcodes corresponding to the target container identifier;
[0025] performing a consistency check on the bidirectional mapping relationship of the original container identifier and the target container identifier, if the check passes, completing the migration of the component barcode, if the check fails, triggering a self-healing mechanism.
[0026] Further, the consistency check comprises the following steps:
[0027] traversing all component barcodes, determining their corresponding container identifiers through the forward mapping relationship, and counting the set of component barcodes corresponding to each container identifier as the real component set;
[0028] obtaining the set of component barcodes corresponding to the container identifier to be checked as the theoretical component set through the reverse mapping relationship;
[0029] comparing the real component set and the theoretical component set of the container identifier to be checked, if the comparison result is consistent, the check passes, otherwise the check fails.
[0030] Further, the self-healing mechanism comprises the following steps:
[0031] for the container identifier whose check fails and conflict is detected, calling its corresponding real component set and theoretical component set;
[0032] performing set difference operation on the real component set and the theoretical component set to obtain missing component barcodes and redundant component barcodes;
[0033] wherein the missing component barcode refers to a component barcode that exists in the real component set but does not exist in the theoretical component set, and the redundant component barcode refers to a component barcode that exists in the theoretical component set but does not exist in the real component set;
[0034] updating a reverse mapping relationship from the container identifier to the missing component barcode, adding the missing component barcode to a theoretical component set of the container identifier;
[0035] updating a forward mapping relationship from the redundant component barcode to the container identifier, deleting a unique corresponding relationship of the redundant component barcode to the container identifier;
[0036] updating a reverse mapping relationship from the container identifier to the redundant component barcode, removing the redundant component barcode from the theoretical component set of the container identifier;
[0037] performing a consistency check on the bidirectional mapping relationship of the container identifier, if the check passes, completing the repair of the bidirectional mapping relationship, otherwise triggering a manual intervention process.
[0038] Further, when a certain component barcode corresponds to multiple container identifiers due to system abnormalities, the forward mapping relationship of the latest timestamp is retained, and the historical conflict records are cleared.
[0039] In another aspect, the application provides a containerized material retrieval system based on bidirectional tracing, which is used to execute the aforementioned containerized material retrieval method based on bidirectional tracing.
[0040] In another aspect, the application provides a computer storage medium, which stores a processor executable program, and the processor executable program is used to implement the aforementioned containerized material retrieval method based on bidirectional tracing when executed by a processor.
[0041] The application provides a containerized material retrieval method based on bidirectional tracing, which establishes a bidirectional mapping relationship between component barcodes and container identifiers, and uses the relationship to execute an efficient bidirectional tracing algorithm to realize the rapid retrieval of product materials. Specifically, the forward mapping ensures that each component barcode corresponds to only one container identifier, and the reverse mapping associates each container identifier to all component barcode sets it includes. When adding or migrating component barcodes, the system performs conflict detection to ensure data consistency, and if a problem is detected, a self-healing mechanism is triggered to automatically repair the mapping relationship, thereby ensuring the accuracy and reliability of the system. This method effectively reduces the response delay and time complexity of material retrieval, improves query efficiency and data consistency, and to some extent, alleviates the problems of tracing difficulty and data inconsistency commonly found in traditional material management systems. The application also provides corresponding systems and media, and the beneficial effects of the systems and media are similar to those of the method, which will not be repeated here.
[0042] Other features and advantages of the present application will be set forth in the description that follows, and in part will be apparent from the description, or can be learned by practice of the application. The purposes and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS
[0043] The accompanying drawings are included to provide a further understanding of the technical solutions of the present application, and constitute a part of the specification, and are used to explain the technical solutions of the present application together with the embodiments of the present application, and do not constitute a limitation on the technical solutions of the present application.
[0044] Figure 1 is a flowchart of a containerized material retrieval method based on bidirectional tracing provided by the present application;
[0045] Figure 2 is a flowchart of a bidirectional tracing algorithm provided by the present application. DETAILED DESCRIPTION
[0046] In order to make the purposes, technical solutions and advantages of the present application more clear, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and do not limit the present application.
[0047] The present application is further described below in combination with the drawings and specific embodiments of the present application. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by those skilled in the art without making creative efforts fall within the scope of protection of the present application.
[0048] In the following description, "some embodiments" are related to a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
[0050] The application scenarios of the material management system are mainly concentrated in the field of industrial Internet of Things, especially in the fields of intelligent manufacturing, logistics and warehousing, and product traceability. With the development of manufacturing industry towards intelligence and automation, higher requirements are put forward for the management of product material components, including efficient query performance, accurate data consistency and reliable migration process, etc.
[0051] In traditional material association relationships, materials often present a hierarchical nested or meshed dependent structure (such as the parent-child part, component and assembly attribution relationship), when a material needs to be queried for other related materials, it often needs to be traversed layer by layer through recursive mode. For example, when querying all sub-components of a product, the direct child material needs to be found first, and then the sub-materials of each child material are recursively queried in turn, until the bottom layer of the basic parts is traversed; conversely, when tracing back to the upper assembly to which a part belongs, it also needs to recursively find its parent material and higher level assembly unit. This recursive query mode relies on multiple table association or hierarchical traversal, which is prone to long query link and high time complexity due to the increase of data size, especially in the full-link tracing scenario of complex products, which is inefficient and prone to data inconsistency problems.
[0052] Existing material management systems usually rely on relational databases, and multiple table JOIN operations are usually required when processing material component association relationships, which leads to high time complexity. Especially in the complex product traceability and quality control scenario, the forward traceability delay is high, and it takes an average of 4 table queries to locate the container information from the component barcode; the reverse traceability is unreliable, and the entire set of barcodes in the container needs to be scanned. In addition, the traceability chain is broken across systems, and the enterprise needs to manually switch between MES / WMS systems to complete the complete traceability link.
[0053] Moreover, multiple records need to be updated when the component moves, and the error rate is high, especially in concurrent access situations, the race condition of the transcoding interface leads to high hash collision rate, causing data inconsistency problems, and the lack of atomicity makes the error rate of multi-table update high during component migration. These factors have seriously affected the consistency and accuracy of the data.
[0054] In addition, single-machine systems are not up to the challenge of high-concurrency access brought by 5G Internet of Things devices. The limitation of concurrent capability directly restricts the scalability and application range of the system. When the component size exceeds 1 million, the response time of the system increases exponentially, and the real-time relationship query of millions of components is particularly difficult, such as response time exceeding 1.5 seconds, low efficiency of cascading query, high CPU peak, unsustainable resource consumption, and frequent memory overflow. This limitation of scalability cannot meet the needs of large-scale applications.
[0055] Further, in the automated job environment, real-time conflict awareness is lacking, the average discovery delay of barcode conflicts is high, repair relies on downtime maintenance, single barcode mapping repair takes a long time, and there is a high probability of causing permanent loss of association relationship. The lack of effective conflict detection and self-healing mechanism greatly reduces the success rate and reliability of migration transactions.
[0056] In summary, the prior art faces multiple problems such as low query efficiency, difficulty in bidirectional tracing, poor data consistency, insufficient migration reliability, and limited scalability when dealing with large-scale component management. These problems seriously restrict the development needs of intelligent manufacturing, logistics and warehousing industries, and new solutions are urgently needed to address these challenges.
[0057] To address these technical bottlenecks, the embodiments of the present application provide a containerized material retrieval method, system and medium based on bidirectional tracing, which to some extent alleviates the problems of low query efficiency, poor data consistency, insufficient concurrency, and limited scalability in traditional material management systems, providing strong technical support for the fields of intelligent manufacturing, logistics and warehousing.
[0058] The method establishes a forward mapping relationship from component barcodes to container identifiers, and a reverse mapping relationship from container identifiers to a set of component barcodes. This bidirectional mapping relationship ensures that each component barcode corresponds to at most one container identifier, and each container identifier is associated with a set of all component barcodes inside it. Using the above bidirectional mapping relationship, the method realizes fast positioning and querying. When inputting a component barcode, the corresponding container identifier can be directly found through forward mapping; conversely, when inputting a container identifier, all component barcode sets inside the container can be quickly obtained. This greatly improves the query efficiency and reduces the time complexity to O(1). During the process of adding or migrating component barcodes, conflict detection is performed to avoid data inconsistency problems. If no conflict is detected, the bidirectional mapping relationship is updated and consistency verification is performed. Once the verification fails or a conflict is detected, a self-healing mechanism is triggered to repair the bidirectional mapping relationship, ensuring the stability of the system and the accuracy of the data.
[0059] First, the containerized material retrieval method based on bidirectional tracing provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0060] Referring to Figure 1 The implementation process of the containerized material retrieval method based on bidirectional tracing provided by the embodiments of the present application includes but is not limited to the following steps.
[0061] Step S110, a bidirectional mapping relationship between component barcodes and container identifiers is established.
[0062] The bidirectional mapping relationship includes a forward mapping relationship from component barcodes to container identifiers, and a reverse mapping relationship from container identifiers to component barcodes. The forward mapping relationship is used to map each component barcode to at most one container identifier, and the reverse mapping relationship is used to map each container identifier to a set of all component barcodes inside the container.
[0063] It should be noted that the container and the component are virtual logical concepts built in the system, where the component refers to a material unit (such as electronic components, parts, etc.) identified by a unique barcode, and the container is a virtual management unit (such as a logical material collection, a production unit, or a storage unit) for collecting components. The two are digitally associated through a bidirectional mapping relationship: each component barcode corresponds to at most one container identifier (forward mapping), and each container identifier is associated with the set of all component barcodes it contains (reverse mapping). This virtual association mechanism does not rely on the binding of physical entities, but builds an efficient traceability and management framework at the system level through data structures such as relational databases, hash tables, and bitmap indexes, supporting dynamic addition, migration, and conflict self-healing of components, and is suitable for digital material management needs in intelligent manufacturing, logistics and warehousing, etc.
[0064] In step S110, a bidirectional mapping relationship between the component barcode and the container identifier is established. This relationship includes a forward mapping relationship from the component barcode to the container identifier and a reverse mapping relationship from the container identifier to the set of component barcodes. The forward mapping ensures that each component barcode corresponds to at most one container identifier, which helps to accurately track the location and status of materials; and the reverse mapping allows the set of all component barcodes in the container to be quickly obtained through the container identifier, thereby supporting efficient data retrieval and management. This bidirectional mapping relationship not only improves query efficiency, but also enhances data consistency and reliability, laying a foundation for subsequent bidirectional traceability algorithms.
[0065] In step S120, based on the bidirectional mapping relationship, a bidirectional traceability algorithm is executed to retrieve product materials.
[0066] In step S120, based on the established bidirectional mapping relationship, a bidirectional traceability algorithm is executed to achieve efficient retrieval of product materials. Specifically, when a component barcode is input, the corresponding container identifier can be quickly located through forward mapping, thereby understanding the specific location of the component; conversely, when a container identifier is input, the set of all component barcodes in the container can be immediately obtained through reverse mapping, helping users to fully grasp the material information in the container. This method not only greatly improves the query speed and reduces the time complexity to O(1), but also ensures the consistency and accuracy of data. In addition, in actual application scenarios, such as the manufacturing process of electronic products, this bidirectional traceability capability has important significance for quality control, fault diagnosis, and production scheduling, etc., and can significantly improve production efficiency and management level. For example, in the production of smartphone mainboards, the bidirectional traceability algorithm can be used to quickly locate the mainboard number where a specific chip is located and obtain information about other chips on the same mainboard, thereby speeding up the fault analysis and repair process.
[0067] In some embodiments of the present application, the forward mapping relationship from the component barcode to the container identifier is established wherein, represents a set of component barcodes, represents a set of container identifiers; a reverse mapping relationship from the container identifiers to the component barcodes is established ; for , forward mapping relationship and reverse mapping relationship satisfy the following constraint formula (1):
[0068] (1).
[0069] Constraint formula (1) ensures strict consistency of the association between the component barcode and the container identifier by explicitly defining the bidirectional mapping rules: on the one hand, it stipulates that each component barcode can only correspond to a unique container identifier, avoiding ambiguity in component attribution; on the other hand, it requires that the set of component barcodes corresponding to a container identifier must consist entirely of components that are mapped to the container by the forward mapping, and conversely, any component barcode that appears in the set of a container must be mapped to the container by the forward mapping. This bidirectional binding relationship fundamentally eliminates the data contradiction of "component mapping container and container containing component mismatch", providing a logical foundation for subsequent bidirectional tracing, conflict detection and self-healing mechanism - when the system needs to locate the container through the component or aggregate the components through the container, accurate results can be obtained based on consistent mapping relationship; in component addition, migration and other operations, this constraint can be used as a check standard to timely discover and correct abnormal data, thereby ensuring the reliability and data integrity of the containerized material management system, especially suitable for scenarios such as electronic product manufacturing that require high precision material tracking.
[0070] In some embodiments of the present application, the implementation process of the bidirectional tracing algorithm includes but is not limited to the following steps.
[0071] Step S210, input the component barcode, and locate the container identifier corresponding to the component barcode through the forward mapping relationship.
[0072] In step S210, the container identifier to which the known component barcode belongs is quickly found. In the industrial Internet of Things scenario, each material component (such as electronic components, mechanical parts, etc.) will be assigned a unique barcode identifier, and these components will usually be placed in a physical or logical container for management and circulation. By establishing a forward mapping relationship from the component barcode to the container identifier, the system can achieve a millisecond-level response and directly locate the container location to which the component belongs.
[0073] This function is essential for real-time tracking in manufacturing sites. For example, in an electronic product assembly line, if a batch of chips has quality problems, you can quickly locate the whole machine module or production batch by inputting the barcode number of the chip, providing efficient support for quality control and problem troubleshooting. Compared with the traditional multi-table association query method, this step can complete the positioning through a single search, reducing the time complexity to O(1) and significantly improving the retrieval efficiency.
[0074] In step S220, the container identifier is input, and the component barcode set corresponding to the container identifier is obtained through the reverse mapping relationship.
[0075] In step S220, all component barcode sets included in the known container identifier are quickly obtained. In intelligent manufacturing and warehouse management, containers often exist as carrying units, such as boxes, pallets, workstations, and production line segments. Through the reverse mapping mechanism, the system can return the information of all components in the container at a very low time cost, thereby supporting business operations such as inventory checking, material scheduling, and process path optimization.
[0076] The significance of this step is to break the inefficient mode of traditional database full scan. For example, in a logistics and warehousing system, if you want to know which specific models of capacitors, resistors, and other components are stored on a shelf, you do not need to traverse the entire database, but can directly retrieve the corresponding component set through the container identifier, greatly improving query speed and system response ability. In addition, reverse mapping also provides a data basis for subsequent migration operations, ensuring accurate identification of content changes in source and target containers when components are moved.
[0077] In step S230, when a component barcode is added to the component set of the target container identifier or migrated from the component set of the original container identifier to the component set of the target container identifier, a conflict detection algorithm is executed. If no conflict is detected, the bidirectional mapping relationship is updated and consistency verification is performed. If the verification is passed, the addition and migration of the component barcode are completed. If the verification fails, a self-healing mechanism is triggered. If a conflict is detected, a self-healing mechanism is triggered.
[0078] The self-healing mechanism is used to repair the bidirectional mapping relationship.
[0079] In step S230, the most critical data consistency guarantee mechanism in the entire bidirectional tracing algorithm is provided, covering conflict detection, consistency verification, and exception recovery in the component addition and migration process:
[0080] (1) Conflict detection algorithm
[0081] In practical applications, multiple systems may concurrently operate on the same component, such as different production lines attempting to place materials with the same barcode number into different containers at the same time. At this time, the conflict detection algorithm will identify this potential data inconsistency behavior and prevent incorrect writing. Conflict types include but are not limited to: duplicate barcodes, container capacity overruns, illegal state changes, etc.
[0082] (2) Bidirectional mapping relationship update and consistency check
[0083] After confirming that there is no conflict, the system will update the forward and reverse mapping relationship between the component barcode and the container identifier, and further perform a consistency check to verify whether the current mapping meets the integrity constraints (such as each component can only belong to one container, and the number of components in each container matches, etc.). Only in the case of passing the check, the operation is truly submitted, ensuring that the system is always in a consistent state.
[0084] (3) Self-healing mechanism
[0085] Once a conflict is found or a consistency check fails, the system will automatically trigger a self-healing mechanism. This mechanism will diagnose and repair the current mapping relationship, such as rolling back incorrect operations, reassigning barcodes, synchronizing distributed node data, etc. This mechanism greatly improves the robustness and availability of the system, avoiding data confusion or even loss due to human error or system failure.
[0086] Step S230 acts as a "safety valve" and "error corrector" in the entire system, ensuring that even under high concurrency and large-scale data operations, data consistency and integrity can be maintained, providing a solid data foundation support for automated production, intelligent warehousing, and other scenarios.
[0087] In some embodiments of the present application, the forward mapping relationship is implemented through a hash table, with the key being the component barcode and the value being the container identifier. The significance of this design is to provide an efficient and direct method to store and retrieve mapping information from components to their containers. As a data structure, a hash table can complete lookup operations in constant time (O(1)), which means that regardless of the size of the data set, the system can quickly find the corresponding container identifier based on the given component barcode. This is particularly important for industrial application scenarios that require fast response, such as real-time material tracking on electronic product production lines or real-time inventory management in logistics warehouses.
[0088] Moreover, using hash tables can effectively avoid the performance bottleneck caused by multi-table JOIN queries in traditional databases, thereby greatly improving the overall efficiency and response speed of the system. At the same time, in order to ensure the efficiency of the hash table, it is also necessary to reasonably set the hash function and the conflict handling strategy, such as using the quadratic probing method to solve hash conflicts, to ensure the stability and reliability of the system. In this way, not only the precise association between components and containers is realized, but also a solid foundation is provided for the subsequent bidirectional tracing algorithm.
[0089] In some embodiments of the present application, the reverse mapping relationship is implemented through a bitmap index, with the key being the container identifier and the value being a compressed bitmap. The bit offset of the compressed bitmap is calculated through the hash value of the component barcode.
[0090] The main role of this design is to efficiently store and retrieve the mapping information from the container to all the component barcode sets inside it. Specifically, each container identifier serves as a key in the bitmap index, and the corresponding value is a compressed bitmap. Each bit of this bitmap represents whether a possible component barcode exists in this container. Since a compressed bitmap (such as the RoaringBitmap algorithm) is used, this method not only saves storage space but also significantly improves query efficiency, enabling the operation of obtaining all component barcodes within a container to be completed in constant time (time complexity O(1)). This is particularly important for large-scale data sets, as it avoids the performance bottlenecks caused by full scanning or complex queries in traditional databases.
[0091] To further optimize the implementation of the reverse mapping relationship, the bit offset of the compressed bitmap is calculated through the hash value of the component barcode. This means that each component barcode is first converted into a unique hash value, and then its specific position in the compressed bitmap (i.e., the bit offset) is determined based on this hash value. Such a design has several key advantages: first, the hash function ensures that even if the amount of input data is very large, the output hash value can still be uniformly distributed, thereby reducing the likelihood of collisions; second, using the hash value to calculate the bit offset allows quick positioning of a specific component in the bitmap, greatly improving search speed; finally, this approach supports parallel processing and pipelining, allowing the system to perform query and update operations simultaneously on multiple processors, further enhancing the system's concurrency and response speed. In summary, calculating the bit offset through the hash value of the component barcode not only ensures data consistency and accuracy but also greatly improves the overall performance and scalability of the system.
[0092] In some embodiments of the present application, the implementation process of the conflict detection algorithm includes but is not limited to the following steps.
[0093] When a component barcode is added to the component set of a target container identifier or migrated from the component set of an original container identifier to the component set of a target container identifier, it is checked whether the component barcode is currently mapped to other container identifiers; if it is mapped to other container identifiers different from the target container identifier, it is determined to be a conflict, and conflict information including the target container identifier, the container identifier to which the component barcode is currently mapped, and the component barcode is generated.
[0094] Specifically, when a component barcode is added to the component set of a target container identifier or migrated from the component set of an original container to the component set of a target container, a conflict detection is first performed. This process aims to ensure that each component barcode is only uniquely mapped to one specific container identifier, thereby maintaining the consistency and accuracy of data. Specifically, before attempting to add a certain component barcode to a target container, the system checks whether the component barcode has been mapped to other containers. If it is found that the component barcode has been mapped to another container different from the target container, it is determined that there is a conflict. At this time, the system not only needs to prevent this operation to avoid data inconsistency, but also needs to generate detailed conflict information including the target container identifier, the container identifier to which the component barcode is currently actually mapped, and the component barcode itself. This helps to quickly locate the root cause of the problem and provides accurate information support for subsequent manual or automatic repair. In this way, the conflict detection mechanism effectively prevents data confusion caused by repeated mapping, ensuring the robustness and reliability of the system.
[0095] Once a conflict is detected, the system automatically generates a set of detailed conflict information. This set of information includes three key elements: the target container identifier, the container identifier to which the component barcode is currently mapped, and the component barcode itself that causes the conflict. These information are crucial for understanding the reason and location of the conflict. For example, the target container identifier indicates the target location where the component is attempted to be added or migrated; the currently mapped container identifier reveals to which container the component barcode actually belongs; and the specific component barcode helps to accurately identify which component causes the conflict. By integrating these information, system administrators or automated repair tools can quickly take action to resolve the conflict, such as reversing the wrong operation or adjusting the mapping relationship, to restore the consistency of data. In addition, such detailed conflict report also facilitates auditing and tracking, so that any abnormal situation can be discovered and handled in a timely manner.
[0096] In some embodiments of the present application, for a component barcode and a target container identifier , a conflict detection algorithm is implemented by a conflict detection function , the value of the conflict detection function is 0 or 1, indicating that no conflict is detected, indicates that a conflict is detected, and the conflict detection function satisfies the following calculation formula (2):
[0097] (2);
[0098] In formula (2), indicates an effectiveness function of a mapping relationship, indicates a component barcode has been mapped to a valid container identifier , and indicates a component barcode has been mapped to another container identifier different from the target container identifier .
[0099] The core role of the conflict detection function is to identify potential conflicts by judging the current attribution state of the component when the component barcode is added to the target container or migrated from the original container to the target container. When the function returns 1, it indicates that the component barcode to be operated has been mapped to a valid container identifier, and the container is different from the target container, that is, the component has been allocated to other containers, and at this time the system determines that there is a conflict. When the function returns 0, it indicates that the component has not been mapped to any container or the mapped container is the target container, and at this time there is no conflict. The function provides a quantitative basis for the conflict detection algorithm by clearly defining the judgment standard of “unique attribution of the component”, ensures that there will be no data contradiction of “the same component belonging to multiple containers” in the component flow process, is a key pre-checking step for maintaining the consistency of the bidirectional mapping relationship, and directly guarantees the accurate execution of the subsequent bidirectional tracing, mapping updating and self-healing mechanism.
[0100] In some embodiments of the present application, in the process of adding the component barcode to the component set of the target container identifier, the conflict detection algorithm is executed, and if no conflict is detected, the implementation process of updating the bidirectional mapping relationship and performing consistency checking includes but is not limited to the following steps.
[0101] Step S310, updating the positive mapping relationship from the component barcode to the target container identifier, and uniquely corresponding the component barcode to the target container identifier;
[0102] In step S310, before the component barcode is successfully added to the target container, the system first performs an update operation of the forward mapping relationship. Specifically, the mapping relationship between the component barcode and the target container identifier is written into the hash table structure, ensuring that each component barcode can correspond to at most one container identifier. The key role of this design is to prevent data confusion caused by repeated mapping, and to ensure the clarity and uniqueness of the component ownership relationship. For example, in the electronic manufacturing process, if a certain batch of chips is mistakenly allocated to multiple different modules, it will cause serious production errors and quality traceability problems. Through this step, the system can ensure that each component barcode always belongs to only one container, thereby providing accurate data basis for subsequent material tracking, production scheduling and quality control.
[0103] In step S320, the reverse mapping relationship from the target container identifier to the component barcode is updated, and the component barcode is added to the set of component barcodes corresponding to the target container identifier.
[0104] In step S320, the reverse mapping relationship is updated, that is, according to the target container identifier, the newly added component barcode of the container is written into the component set corresponding to the container. This mechanism is based on bitmap indexing, in which the container identifier is used as the key, and the corresponding value is a compressed bitmap used to efficiently record the existence status of all component barcodes in the container. By converting the hash value of the new component barcode into a bit offset, and setting the corresponding bit, the system can quickly complete the update operation of the component set. This process not only has high efficiency (time complexity close to O(1)), but also saves storage space, and is suitable for real-time management requirements in large-scale data scenarios. For example, in an intelligent warehousing system, when a new electronic component is placed in a certain bin, the system can immediately reflect the complete material composition in the bin, facilitating subsequent inventory checking, path planning and other operations.
[0105] In step S330, consistency check is performed on the bidirectional mapping relationship of the target container identifier, and if the check passes, the addition of the component barcode is completed, and if the check fails, the self-healing mechanism is triggered.
[0106] In step S330, after the forward and reverse mapping updates are completed, the system will immediately perform a consistency check process to ensure that the data state after this operation meets the preset consistency constraint condition. Specifically, the system will verify whether the component barcode in the forward mapping indeed points to the current target container, and confirm whether the component barcode is also contained in the reverse mapping set of the target container. Only when the mapping relationship in both directions is completely consistent, is this operation considered successful, and the component barcode addition process is finally committed.
[0107] If the consistency check fails, it indicates that the system may be in an abnormal state, such as data inconsistency caused by concurrent write conflicts, network interruptions, or node failures. At this time, the system automatically triggers a self-healing mechanism to attempt to repair the mapping relationship, such as rolling back erroneous operations, recalculating the position information of component barcodes, synchronizing distributed node data, etc. This mechanism greatly improves the robustness and fault tolerance of the system, ensuring that data integrity and reliability can be maintained even in complex industrial environments.
[0108] In some embodiments of the present application, during the process of migrating component barcodes from the component set identified by the original container to the component set identified by the target container, a conflict detection algorithm is executed, and if no conflict is detected, the implementation process of updating the bidirectional mapping relationship and performing consistency check includes but is not limited to the following steps.
[0109] Step S410, updating the positive mapping relationship from the component barcode to the original container identifier, and deleting the unique correspondence of the component barcode pointing to the original container identifier.
[0110] In step S410, when the component barcode migration operation starts, the system first needs to remove the positive mapping relationship between the component and its current "original container" to which it belongs. Specifically, the key-value pair corresponding to the component barcode (i.e., component barcode → original container identifier) is deleted in the hash table structure. The significance of this operation is to ensure that the component barcode does not belong to two different containers at the same time, thereby avoiding data redundancy and logical confusion. For example, in the assembly process of electronic products, if a chip is mistakenly considered to exist in both motherboard A and motherboard B, it will lead to ineffective quality traceability and even production process confusion. Therefore, this step is a basic operation of the migration process, preparing for the establishment of a new mapping relationship, while maintaining the data consistency and uniqueness of the system.
[0111] Step S420, updating the reverse mapping relationship from the original container identifier to the component barcode, and removing the component barcode from the component barcode set of the original container identifier.
[0112] In step S420, after completing the deletion of the forward mapping, the system continues to update the reverse mapping relationship, that is, removes the component barcode from the component set of the original container. The reverse mapping is usually implemented based on bitmap index, and each container identifier corresponds to a compressed bitmap, which is used to record the existence state of all component barcodes inside. By calculating the hash value of the component barcode and locating the bit offset, the system can quickly clear the bit, indicating that the component no longer belongs to the original container. The significance of this operation is to maintain the real-time accuracy of the container material information, preventing the occurrence of "removed but not updated" situations. For example, in an intelligent warehousing system, if a component has been dispatched out of the warehouse but the system still shows that it exists in the inventory, it may cause subsequent scheduling errors or inventory data distortion. Therefore, this step ensures the accuracy and real-time nature of the component set in the container.
[0113] In step S430, the forward mapping relationship from the component barcode to the target container identifier is updated, and the component barcode is uniquely corresponded to the target container identifier,
[0114] In step S430, the system remaps the component barcode to the target container identifier, and completes the reconstruction of the forward mapping relationship. This step is the core of the entire migration operation, meaning that the component formally belongs to the new container. Through the write operation of the hash table, the system inserts the key-value pair of (component barcode → target container identifier) into the forward mapping table, and ensures that each component barcode can only correspond to one container identifier, in order to maintain the uniqueness of the mapping. This design not only improves the query efficiency (time complexity close to O(1)), but also effectively avoids the data conflict problem caused by repeated mapping. For example, in electronic product manufacturing, when a capacitor is migrated from bin A to bin B, it must be ensured that it is only visible in B, otherwise it may cause misuse or quality traceability errors. Therefore, this step provides a guarantee for the accurate attribution of components.
[0115] In step S440, the reverse mapping relationship from the target container identifier to the component barcode is updated, and the component barcode is added to the component barcode set corresponding to the target container identifier.
[0116] In step S440, after completing the forward mapping update, the system synchronously updates the reverse mapping relationship, and adds the component barcode to the component set of the target container. Similarly, using the bitmap index method, the corresponding bit offset is calculated through the hash value of the component barcode, and the corresponding bit position is set to 1, indicating that the component has been added to the target container. The significance of this operation is to ensure that the target container can correctly reflect all the component information it currently contains, providing accurate data support for subsequent business such as retrieval, inventory, scheduling, etc. For example, in an automated production line, the equipment needs to perform the next assembly action based on the component composition in the container, and if a component information is missed, it may cause process path errors or equipment downtime. Therefore, this step is crucial for building a complete container-component view.
[0117] In step S450, consistency check is performed on the bidirectional mapping relationship between the original container identifier and the target container identifier. If the check passes, the migration of the component barcode is completed. If the check fails, a self-healing mechanism is triggered.
[0118] In step S450, the system performs a comprehensive consistency check on the bidirectional mapping relationship between the original container and the target container involved in this migration operation. The check content includes but is not limited to: whether the component barcode only points to the target container in the forward mapping, whether the target container's reverse mapping set indeed contains the component, whether the original container's reverse mapping set has been removed, etc. Only when all mapping relationships completely match and meet the integrity constraints, the migration operation is confirmed to be successfully completed.
[0119] In some embodiments of the present application, the implementation process of the consistency check includes but is not limited to the following steps.
[0120] In step S510, all component barcodes are traversed, the corresponding container identifier is determined through the forward mapping relationship, and the component barcode set corresponding to each container identifier is counted as the real component set.
[0121] In step S510, the real component set is constructed in the consistency check process, that is, the component ownership relationship in the entire system is globally counted based on the forward mapping relationship (component barcode → container identifier). Specifically, the system traverses all component barcodes, quickly finds the container identifier to which each component belongs through the hash table structure, and puts the component barcode into the corresponding container set. Finally, the system can obtain a component set list in the unit of container, which is the real component set.
[0122] The real component set reflects the "real" container ownership recorded by the system from the perspective of component barcodes, and is the baseline data for subsequent comparison. For example, in the electronic manufacturing process, if the barcodes of a batch of chips are incorrectly mapped to multiple containers, or are not correctly attributed to the mainboard container they belong to, it will be reflected in the real component set. Through this global scanning and counting operation, the system can obtain the most basic and original component ownership information, providing a basis for subsequent checks.
[0123] In step S520, the component barcode set corresponding to the container identifier to be checked is obtained as the theoretical component set through the reverse mapping relationship.
[0124] In step S520, a theoretical component set is constructed, i.e., all component barcodes that should be contained in a certain container in theory are obtained based on the reverse mapping relationship (container identifier → component barcode set). The reverse mapping is usually implemented based on a compressed bitmap index, and the system quickly reads the bitmap structure corresponding to the container identifier, and reversely deduces the component barcode set represented by the set bit in the bitmap according to the set bit.
[0125] The theoretical component set represents the component composition information recorded by the system from the perspective of the container, and is another data source for comparison with the "real component set". For example, in a logistics and warehousing system, a certain box may record that it contains 100 capacitors of a certain model, but through forward mapping, it is found that only 99 capacitors are actually mapped to the box, which means that there is a deviation between the theory and the reality. Therefore, the theoretical component set provides an "expected value" for the system, and after comparison with the real value, it can be determined whether the current mapping is consistent.
[0126] In step S530, the real component set and the theoretical component set of the container identifier to be verified are compared. If the comparison result is consistent, the verification is passed, otherwise the verification is failed.
[0127] In step S530, the real component set and the theoretical component set generated in the previous two steps are compared piece by piece to verify whether they are completely consistent. If they are consistent, it means that there is no conflict between the forward mapping and the reverse mapping, and the current mapping state of the system is reliable. If they are not consistent, it means that there is a data inconsistency problem, such as repeated mapping of component barcodes, omission or redundancy of container component sets, etc.
[0128] Step S530 provides a final verification mechanism for the data consistency of the system. In high-precision scenarios such as industrial Internet of Things and intelligent manufacturing, any slight data inconsistency may cause serious production accidents or quality traceability failure. For example, in the process of assembling electronic products, if a chip is shown to belong to mainboard A in the reverse mapping, but the forward mapping points to mainboard B, then in the subsequent quality analysis, the attribution of the chip cannot be accurately determined, which affects the quality evaluation of the whole machine. Through this step, the system can timely find such problems and trigger a self-healing mechanism when the consistency verification fails to automatically repair the mapping error and ensure that the data of the system is always consistent and reliable.
[0129] In some embodiments of the present application, the implementation process of the self-healing mechanism includes but is not limited to the following steps.
[0130] In step S610, for the container identifier whose verification is failed and conflict is detected, the real component set and the theoretical component set corresponding thereto are called.
[0131] In step S610, the problem container is identified and its current state information is obtained. When the consistency check fails (e.g., the component ownership is inconsistent) or the conflict detection finds illegal mapping, the system performs this operation for the involved container identifier, extracting the real component set and the theoretical component set from the forward mapping and the reverse mapping, respectively.
[0132] The real component set is derived from the ownership of all component barcodes through the forward mapping system, representing the components that should actually belong to the container; while the theoretical component set is the expected component set recorded by the reverse mapping of the container. By calling these two sets, the system can clearly grasp the deviation range existing in the current container mapping, providing basic data support for subsequent difference set operation.
[0133] In step S620, the real component set and the theoretical component set are subjected to set difference operation to obtain missing component barcodes and redundant component barcodes.
[0134] Among them, the missing component barcode refers to the component barcode that exists in the real component set but does not exist in the theoretical component set, and the redundant component barcode refers to the component barcode that exists in the theoretical component set but does not exist in the real component set.
[0135] In step S620, after obtaining the two component sets, the system performs set difference operation on them to find two types of abnormal component barcodes. Among them, the missing component barcode exists in the real component set but does not appear in the theoretical component set, indicating that these components are incorrectly recorded as belonging to other containers; the redundant component barcode exists in the theoretical component set but does not appear in the real component set, indicating that these components may have been migrated or deleted, but the original container still retains its mapping record.
[0136] The significance of this step is to accurately locate the problem point and provide a clear direction for subsequent repair operations. For example, in the electronic manufacturing scenario, if a chip has been migrated to motherboard B, but the component list of motherboard A still contains it, then the chip is a redundant component barcode and needs to be removed from motherboard A.
[0137] In step S630, the reverse mapping relationship from the container identifier to the missing component barcode is updated, and the missing component barcode is added to the theoretical component set of the container identifier.
[0138] In step S630, the problem of missing components is repaired, that is, those component barcodes that should actually belong to the container but are missing in the reverse mapping are re-added to the component set of the container. Specifically, the system calculates the bit offset corresponding to the missing component barcode according to its hash value, and sets the corresponding bit in the compressed bitmap of the container to indicate that the component has been correctly attributed. This operation ensures that the theoretical component set of the container accurately reflects the actual component barcodes it contains, thereby restoring data consistency. For example, on an automated assembly line, if a capacitor is not recorded in the bin due to system failure, it can be supplemented through this step to avoid subsequent problems such as material shortage or misplacement caused by incomplete data.
[0139] In step S640, the forward mapping relationship from redundant component barcodes to container identifiers is updated, and the unique correspondence of redundant component barcodes to container identifiers is deleted.
[0140] In step S640, the error mapping relationship of redundant component barcodes is cleaned up. For those redundant component barcodes that exist in the theoretical component set but do not appear in the real component set, the system needs to remove their forward mapping relationship with the current container. The specific operation is to delete the (component barcode → container identifier) key-value pair in the hash table, indicating that the component no longer belongs to the container. This repair action is crucial to prevent data confusion, for example, during logistics scheduling, if a component has been dispatched out of the warehouse but is still in the mapping of the original warehouse, it may cause repeated delivery or false high inventory.
[0141] In step S650, the reverse mapping relationship from container identifiers to redundant component barcodes is updated, and redundant component barcodes are removed from the theoretical component set of the container identifier.
[0142] In step S650, after completing the cleaning of the forward mapping, the system further performs the update operation of the reverse mapping, that is, removing redundant component barcodes from the theoretical component set of the container. Based on the bitmap index structure again, the system sets the bit offset position of the redundant component barcode to 0, indicating that the component no longer belongs to the container.
[0143] This step ensures that the component composition information from the container perspective is consistent with the actual situation, avoiding errors in subsequent query, inventory, scheduling, and other business logic caused by the existence of redundant data. For example, in intelligent warehousing, if a component has been removed from the bin but is still displayed in the component list of the bin, it may cause robot grabbing failure or path planning error.
[0144] In step S660, consistency verification is performed on the bidirectional mapping relationship of the container identifier, and if the verification is passed, the repair of the bidirectional mapping relationship is completed, otherwise manual intervention process is triggered.
[0145] In step S660, after the above repair operation is completed, the system performs consistency check on the bidirectional mapping relationship of the container again to confirm whether the repair is successful. Specifically, the real component set generated by the forward mapping is compared with the theoretical component set generated by the reverse mapping to determine whether they are completely consistent. If the consistency check passes, it means that the repair is successful and the mapping relationship of the container has returned to normal; if it is still inconsistent, it means that the system cannot completely solve the problem in an automatic manner, at which time the manual intervention process will be triggered to notify the operation and maintenance personnel to intervene in processing.
[0146] On the one hand, the self-healing ability of the system is ensured, and the data anomaly can be automatically repaired in most cases, reducing the cost of manual intervention; on the other hand, a manual processing channel is reserved for complex or unpredictable abnormal situations, ensuring the overall reliability and maintainability of the system.
[0147] In some embodiments of the present application, taking the assembly of a circuit board component in the production process of a smartphone motherboard as an example, it is assumed that the binding relationship of a certain mobile phone factory management motherboard (container) and chip (component) is: the component barcode set B = {IC-987654321, IC-987654322, IC-987654323} (chip serial number), and the container identification set C = {MB-A22, MB-A23} (motherboard number); the forward mapping relationship from the chip (component) to the motherboard (container) is established as follows: , The reverse mapping relationship from the motherboard (container) to the chip (component) is established as follows: ,
[0148] When the chip IC-987654323 is attached to the motherboard MB-A23, the constraint condition formula (1) needs to be met, that is: and .
[0149] When the new chip IC-888888888 is attached to the motherboard MB-A22, the conflict detection algorithm is executed, and the conflict detection function is used for detection according to formula (2);
[0150] If it is detected that the chip IC-888888888 is bound to the maintenance standby motherboard MB-B15, a conflict code is generated, and the system responds: the SMT chip mounter automatically pauses and the screen displays an alarm "Chip IC-888888888 is bound to MB-B15!".
[0151] Suppose that the new chip IC-999999999 is attached to the motherboard MB-A22 for the first time, and the forward mapping relationship is updated as follows: Map the new chip IC-999999999 to the motherboard MB-A22 uniquely; and reverse the mapping relationship Add the new chip IC-999999999 to the chip set of the motherboard MB-A22;
[0152] Then, perform consistency check: If the check fails, trigger the self-healing function Call the real component set corresponding to the motherboard MB-A22 , and the theoretical component set .
[0153] Determine that the chip IC-777777777 is a redundant component barcode, delete the unique correspondence between the chip IC-777777777 and the motherboard MB-A22, and let Remove the chip IC-777777777 from the theoretical component set of the motherboard MB-A22, .
[0154] In some embodiments of the present application, all core operations including conflict detection and processing, double mapping update during component addition, container component relationship change during migration, and data repair of self-healing function are executed through atomic transaction mechanism, ensuring the integrity and consistency of each operation sequence. Any step failure will trigger a rollback mechanism to maintain the accuracy of the data state, thereby realizing transactional management of the whole process.
[0155] The atomic transaction mechanism fundamentally guarantees the integrity and consistency of data operations by ensuring that all operations "either all successfully execute or completely roll back in the event of an exception", effectively avoiding mapping relationship breakage, component state conflict and other problems caused by partial updates. At the same time, in a distributed environment, through transaction isolation and commit protocol, it realizes the reliable coordination of cross-node operations, provides strong data consistency guarantee for high concurrency and large-scale component management, and is the key technical foundation to support the stable operation of real-time tracing and dynamic migration in intelligent manufacturing.
[0156] In some embodiments of the present application, when a certain component barcode corresponds to multiple container identifiers due to system abnormalities, the forward mapping relationship with the latest timestamp is retained, and the historical conflict records are cleared.
[0157] Specifically, when a component barcode is detected to be incorrectly mapped to multiple container identifiers, the system will retain the forward mapping relationship with the latest timestamp based on the timestamp information of each mapping. This means that when handling conflicts, the system prioritizes the most recently updated or created mapping relationship as the correct attribution. For example, in an electronic product manufacturing process, if a certain chip is recorded as belonging to two different motherboards due to system failure or concurrent operations, the system will select the result of the last operation by checking the timestamps of these mappings as the final valid mapping. This strategy ensures that even in abnormal situations, adjustments can be made based on the latest operation records, maximizing data accuracy and consistency.
[0158] In addition to retaining the mapping relationship with the latest timestamp, the system will also perform an operation to clear historical conflict records. The purpose of this step is to eliminate old and incorrect mapping relationships to prevent them from continuing to interfere with the normal operation of the system in the future. Specifically, the system will delete historical records that conflict with the latest mapping relationship from the hash table structure and update the reverse mapping (i.e., bitmap index) accordingly to remove redundant information. For example, in a logistics warehouse environment, if a certain material is incorrectly marked as existing in multiple warehouse locations due to system failure, the system will clear all other location records after determining the correct location. In this way, the system can effectively clean up historical conflicts and avoid the impact of outdated or incorrect data on subsequent queries and operations, further enhancing data consistency and reliability.
[0159] The combination of these two steps not only solves the problem of data conflicts caused by system abnormalities, but also optimizes the data storage structure, ensuring efficient operation of the system and accuracy of the data. This method is particularly suitable for industrial Internet of Things scenarios that require high-precision data management and real-time monitoring, such as intelligent manufacturing, product traceability, etc., providing strong technical support and protection.
[0160] In some embodiments of the present application, when the above method embodiments are applied to a single machine environment, the single machine implementation stores component-container forward mapping by constructing a hash mapping table (CCM), realizes container-component reverse mapping by a bitmap index library (RCM), optimizes storage and retrieval efficiency using the RoaringBitmap compression algorithm, combines input validation mechanisms such as Luhn check bit verification and regular expression matching, and identifies component binding conflicts in real time through a conflict detection function; performs atomic update double mapping operations during component registration, synchronously maintains the consistency of the forward hash table and the reverse bitmap, and triggers a self-healing mechanism through real-time comparison of the number of bitmap settings and the count of forward mapping to repair data deviations of single containers, container groups, and the entire system in stages; the bidirectional tracing function realizes component-container forward positioning and container-component reverse retrieval with a time complexity of O(1) based on hash direct addressing, and a dynamic migration protocol ensures the atomicity of component migration between containers through transaction isolation, and the overall scheme meets the efficient management needs of millions of components in a single machine environment.
[0161] In some embodiments of the present application, when the above method embodiments are applied to a distributed cluster environment, the distributed cluster implementation scheme builds a distributed architecture by deploying computing nodes, storage nodes, and coordination nodes, uses a consistent hash fragmentation algorithm to distribute component barcodes and container identifiers to different nodes according to hash ranges, and realizes load balancing and dynamic scaling with virtual node technology; stores hot data in Redis cluster, manages warm data in Memcached, and archives cold data in HBase to build a three-level hybrid storage system and support automatic data lifecycle flow; realizes atomic submission and log compensation mechanism of cross-node operations based on distributed transaction protocol, guarantees the consistency of component migration, mapping update and other operations, and optimizes performance using batch transactions and pipeline confirmation; realizes automatic fault detection and transfer through heartbeat monitoring, probe services and majority decision mechanism, combines cross-machine room deployment, incremental backup and disaster recovery strategies to ensure that the system can still maintain high availability and millisecond-level response delay under the scale of 10 billion components, and meet the high concurrency and high reliability needs of large-scale intelligent manufacturing scenarios.
[0162] In summary, the containerized material retrieval method based on bidirectional tracing provided by the embodiments of the present application has the following technical effects.
[0163] The method realizes high consistency and accuracy of data by establishing and maintaining a bidirectional mapping relationship between component barcodes and container identifiers. The method introduces a conflict detection function that can automatically detect and report potential data conflicts during component addition or migration, ensuring that the system can immediately pause operations and prompt the user when encountering exceptions. In addition, the self-healing function can automatically scan physical objects and compare them with system records to correct any inconsistencies, enhancing the robustness and stability of the system. This method not only improves the speed and accuracy of product traceability, but also has important significance for quality control, fault analysis, and other aspects, and optimizes resource allocation and management decisions.
[0164] Secondly, the embodiment of the present application provides a containerized material retrieval system based on bidirectional traceability, which is used to execute the aforementioned containerized material retrieval method based on bidirectional traceability.
[0165] In addition, the embodiment of the present application provides a computer storage medium, which stores a processor-executable program. When the processor-executable program is executed by the processor, it is used to implement the aforementioned containerized material retrieval method based on bidirectional traceability.
[0166] Similarly, the technical effects of the system and medium provided by the embodiment of the present application and the technical effects of the aforementioned method embodiment are the same, and will not be repeated here.
[0167] In some alternative embodiments, the functions / operations mentioned in the block diagram can not occur in the order mentioned in the operation schematic diagram. For example, depending on the functions / operations involved, two blocks shown in succession can actually be performed substantially simultaneously or the blocks can sometimes be performed in reverse order. In addition, the embodiments presented and described in the flowcharts of the present application are provided by way of example, with the purpose of providing a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are independently executed.
[0168] Furthermore, although the present application is described in the context of functional modules, it is understood that one or more of the functions and / or features can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary to an understanding of the present application. Rather, the properties, functions and internal relationships of the various functional modules disclosed in the devices shown herein are deemed to be illustrative of the principles of the present application. Accordingly, the present application is not limited to the specific embodiments described herein, but rather only by the claims that follow. It is also understood that the specific concepts disclosed herein are merely illustrative of the principles of the present application and are not intended to limit the scope of the application, which is defined solely by the claims that follow.
[0169] If the functions are implemented in software, the functions can be stored in or implemented as one or more computer program products, which can be incorporated into a computer-readable medium for use by or in connection with an apparatus, method, or system as described herein. The computer-readable medium can be a computer- only medium, a partially software and partially hardware medium, or a medium that contains both software and hardware. The computer-readable medium can be any medium that can contain, store, or transport the program for use by or in connection with the computer. The computer-readable medium can be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, or a propagation medium. The computer-readable medium can be a computer program product that can be traded from one owner / manufacturer to another, can be bought or sold, can be transferred over a network, or can be stored or transported in some way. The computer-readable medium can be a memory, a magnetic or optical disk, a programmable gate array, an application-specific integrated circuit, or some other device(s).
[0170] The logic and / or steps represented in the flowcharts and / or otherwise described herein, for example, can be embodied in computer-readable medium, which can be executed by a processing circuitry, such as a computer-based system, server, or other processing system. The computer-readable medium can be a computer- only medium, a partially software and partially hardware medium, or a medium that contains both software and hardware. The computer-readable medium can be any medium that can contain, store, or transport the program for use by or in connection with the computer. The computer-readable medium can be a computer program product that can be traded from one owner / manufacturer to another, can be bought or sold, can be transferred over a network, or can be stored or transported in some way. The computer-readable medium can be a memory, a magnetic or optical disk, a programmable gate array, an application-specific integrated circuit, or some other device(s).
[0171] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and stored in a computer memory.
[0172] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above described embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable
[0173] In the above description of the present application, reference has been made to descriptive terms such as "one embodiment / scheme", "another embodiment / scheme" or "some embodiments / schemes" etc. It is understood that such terms are not intended to mean that a certain feature, structure, material or characteristic was included in just a single embodiment / scheme. Intermittently, such terms can refer to two or more embodiments / schemes. Furthermore, unless otherwise noted, like terms in different embodiments / schemes are intended to have the same meaning.
[0174] While the embodiments of the present application have been shown and described, it is to be understood that the embodiments described are capable of modification, and that the generic principles defined herein can be applied to other embodiments without departing from the spirit and scope of the application. Accordingly, the scope of the present application is not intended to be limited to the embodiments shown but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0175] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.
Claims
1. Containerized material search method based on bidirectional traceability, characterized in that, The method comprises the following steps: establishing a bidirectional mapping relationship between component barcodes and container identifiers; the bidirectional mapping relationship comprises a forward mapping relationship from component barcodes to container identifiers, and a reverse mapping relationship from the container identifiers to the component barcodes; wherein the forward mapping relationship is used for corresponding each component barcode to at most one container identifier, and the reverse mapping relationship is used for corresponding each container identifier to a set comprising all component barcodes in the container; based on the bidirectional mapping relationship, performing a bidirectional tracing algorithm to search for product materials; the bidirectional tracing algorithm comprises: inputting a component barcode, and locating a container identifier corresponding to the component barcode through the forward mapping relationship; inputting a container identifier, and obtaining a component barcode set corresponding to the container identifier through the reverse mapping relationship; the forward mapping relationship is realized through a hash table, the key is a component barcode, and the value is a container identifier; the reverse mapping relationship is realized through a bitmap index, the key is a container identifier, and the value is a compressed bitmap; wherein a bit offset of the compressed bitmap is calculated through a hash value of a component barcode; when the component barcode is added to a component set of a target container identifier or migrated from a component set of an original container identifier to a component set of a target container identifier, performing a conflict detection algorithm, if no conflict is detected, updating the bidirectional mapping relationship and performing a consistency check, if the check passes, completing the addition and migration of the component barcode, if the check fails, triggering a self-healing mechanism, if a conflict is detected, triggering the self-healing mechanism; wherein the self-healing mechanism is used for repairing the bidirectional mapping relationship; the consistency check comprises the following steps: traversing all component barcodes, determining container identifiers corresponding thereto through the forward mapping relationship, and counting component barcode sets corresponding to each container identifier as real component sets; obtaining component barcode sets corresponding to a container identifier to be checked as theoretical component sets through the reverse mapping relationship; comparing the real component set and the theoretical component set of the container identifier to be checked, if the comparison result is consistent, the check passes, otherwise, the check fails; the self-healing mechanism comprises the following steps: for the container identifier whose check fails and conflict is detected, calling the real component set and the theoretical component set corresponding thereto; performing set difference operation on the real component set and the theoretical component set to obtain missing component barcodes and redundant component barcodes; wherein the missing component barcode refers to a component barcode existing in the real component set but not existing in the theoretical component set, and the redundant component barcode refers to a component barcode existing in the theoretical component set but not existing in the real component set; updating the reverse mapping relationship from the container identifier to the missing component barcode, and adding the missing component barcode to the theoretical component set of the container identifier; updating the forward mapping relationship from the redundant component barcode to the container identifier, and deleting the unique corresponding relationship of the redundant component barcode to the container identifier; updating a reverse mapping relationship from the container identifier to the redundant component barcode, removing the redundant component barcode from a theoretical component set of the container identifier; performing a consistency check on the bidirectional mapping relationship of the container identifier, if the check passes, completing the repair of the bidirectional mapping relationship, otherwise triggering manual intervention process.
2. The containerized material retrieval method based on bidirectional traceability according to claim 1, characterized in that, The conflict detection algorithm includes the following steps: When the component barcode is added to the component set of the target container identifier, or migrated from the component set of the original container identifier to the component set of the target container identifier, check whether the component barcode is currently mapped to other container identifiers; if it is mapped to other container identifiers different from the target container identifier, it is determined as a conflict, and conflict information including the target container identifier, the container identifier to which the component barcode is currently mapped, and the component barcode is generated.
3. The containerized material retrieval method based on bidirectional traceability according to claim 1, characterized in that, During the process of adding the component barcode to the component set of the target container identifier, the conflict detection algorithm is executed, and if no conflict is detected, the bidirectional mapping relationship is updated and a consistency check is performed, including the following steps: updating the forward mapping relationship from the component barcode to the target container identifier, uniquely corresponding the component barcode to the target container identifier; updating the reverse mapping relationship from the target container identifier to the component barcode, adding the component barcode to the component barcode set corresponding to the target container identifier; performing a consistency check on the bidirectional mapping relationship of the target container identifier, if the check passes, completing the addition of the component barcode, if the check fails, triggering a self-healing mechanism.
4. The containerized material retrieval method based on bidirectional traceability according to claim 1, characterized in that, During the process of migrating the component barcode from the component set of the original container identifier to the component set of the target container identifier, the conflict detection algorithm is executed, and if no conflict is detected, the bidirectional mapping relationship is updated and a consistency check is performed, including the following steps: updating the forward mapping relationship from the component barcode to the original container identifier, deleting the unique correspondence of the component barcode to the original container identifier; updating the reverse mapping relationship from the original container identifier to the component barcode, removing the component barcode from the component barcode set of the original container identifier; updating the forward mapping relationship from the component barcode to the target container identifier, uniquely corresponding the component barcode to the target container identifier, updating the reverse mapping relationship from the target container identifier to the component barcode, adding the component barcode to the component barcode set corresponding to the target container identifier; performing a consistency check on the bidirectional mapping relationship of the original container identifier and the target container identifier, if the check passes, completing the migration of the component barcode, if the check fails, triggering a self-healing mechanism.
5. The bidirectional traceability-based containerized material retrieval method of claim 1, wherein, When a component barcode corresponds to multiple container identifiers due to system abnormalities, the forward mapping relationship with the latest timestamp is retained, and historical conflict records are cleared.
6. Containerized material retrieval system based on bidirectional traceability, characterized in that, A computer program product for performing the bidirectional tracing based containerized material retrieval method of any one of claims 1 to 5.
7. A computer storage medium storing a processor-executable program, characterized in that, The program executable by the processor when executed by the processor is used to implement the bidirectional tracing based containerized material retrieval method of any one of claims 1 to 5.
Citation Information
Patent Citations
System for component tracing and method for component tracing thereof
TW201015443A
Populating multi-layer technology product catalogs
US12026144B1