Method for storing and quickly indexing quality traceability data of cosmetic production batches
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-08-11
AI Technical Summary
但这些方案仍然存在以下不足:批次标识一旦生成后必须全链路贯穿,灵活性有限;跨工序的动态因果关系难以动态建模,只能靠人工策略配置或周期性全链路同步运算完成;当部分产线出现频繁切换或交叉生产时,系统需全量遍历历史链路,大大降低了实时响应能力;在高并发追溯请求场景下,整体数据结构膨胀占用内存和计算资源,扩展性和操作效率受到明显瓶颈
(1)本申请通过引入“事件快照”机制与基于有向无环图的因果建模结构,有效克服了传统批次管理系统中因依赖静态批次编码而导致的绑定僵化、追溯粒度粗放的问题。在现有技术中,工序间的质量关联通常通过预设BOM树或固定批次号进行线性传递,难以应对同一原料在多工序中被分段使用、跨班次接力生产等复杂场景,极易出现溯源断点或误绑定现象;而本方案采用动态生成的事件快照作为最小语义单元,结合毫秒级时间戳、工序实例ID与物料切片标识,实现了对工艺过程中质量行为的高保真离散化表征,使得每个质量观测动作均可独立携带完整上下文信息,无需预先确定归属批次即可参与后续关联分析,显著提升了系统在非稳态生产环境下的适应能力与数据采集灵活性。
Smart Images

Figure CN122547795A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cosmetic production information traceability and quality data management technology, and in particular to a method for the association, storage and rapid indexing of quality traceability data for cosmetic production batches. Background Technology
[0002] Currently, cosmetic manufacturers generally adopt traceability and data binding methods based on fixed batch numbers and hierarchical tree structures in the field of production information traceability and quality data management. Mainstream technologies largely rely on traditional batch BOM (Bill of Materials) topology chains, static mapping of production batch labels, primary and foreign key-based data modeling schemes, or limited event log splicing. These methods focus on generating quality indicator data for each stage through pre-defined batch traceability paths and process flow sequences, and binding it with a unique batch identifier to achieve process traceability and accountability.
[0003] As cosmetic production processes become increasingly complex, especially in scenarios involving multiple overlapping processes, batch reuse of raw materials, and non-linear production line switching, existing static batch number-based binding schemes are finding it increasingly difficult to meet the business needs of multi-dimensional, fine-grained, and highly dynamic traceability. For example, on a production line, the same batch of raw materials may be split and used in multiple production links at different times and shifts. Traditional BOM trees or direct mapping of batch numbers cannot accurately describe the material flow. The many-to-many relationships and dynamic switching of operating conditions between process links render the one-to-one binding of batch numbers to quality data ineffective. In addition, when dealing with multiple cross-causal relationships and sudden events (such as quality anomaly rework or partial adjustment of process parameters), tree-type or chain-type traceability structures need to introduce redundant links or virtual intermediate batches, leading to a sharp increase in data representation complexity and storage resources, affecting system response speed and maintainability.
[0004] Some industry research attempts to improve data scalability and searchability by employing relational database enhanced primary and foreign key modeling, graph database association modeling, or batch-oriented basic event log tracing methods. However, these solutions still have the following shortcomings: once batch identifiers are generated, they must be used throughout the entire process, limiting flexibility; dynamic causal relationships across processes are difficult to model dynamically, requiring manual strategy configuration or periodic full-process synchronous calculations; when some production lines experience frequent switching or cross-production, the system needs to traverse the entire historical process, significantly reducing real-time response capabilities; in high-concurrency traceability request scenarios, the overall data structure expands, consuming memory and computing resources, resulting in significant bottlenecks in scalability and operational efficiency. Furthermore, existing technologies struggle to perform contextual semantic modeling on multi-source heterogeneous data—such as quality observation points generated from different process nodes, irregularly sliced material batches, etc.—leading to a lack of assurance regarding data consistency and traceability accuracy.
[0005] Based on the above situation, the current multi-dimensional dynamic binding and rapid indexing technology for cosmetic batch quality traceability data still faces the following prominent problems: First, in complex production environments with multiple processes, reuse of raw materials, and high-frequency quality testing, static batch binding and tree-shaped traceability links are difficult to cover all process and material interaction scenarios, resulting in coarse traceability granularity and obvious blind spots. Second, the complexity of the data structure and processing logic in the dynamic binding process of quality data and production batches has increased dramatically, causing both storage expansion and limiting real-time computing capabilities. Third, existing solutions based on global static structures are difficult to achieve fine-grained, on-demand traceability request responses, lack adaptive learning and continuous optimization capabilities, and cannot balance traceability accuracy and high performance.
[0006] Therefore, the cosmetics production process urgently needs a lightweight technical solution that can break through the limitations of traditional batch static binding and tree structure, support on-demand modeling and rapid indexing of three types of entities: dynamic multi-dimensional material slices, process instances, and quality observation points, and adaptively optimize binding accuracy, in order to solve the challenges to real-time performance, scalability, and accuracy brought about by the increased complexity of dynamic binding to the production information traceability system. Summary of the Invention
[0007] This application provides a method for the association, storage, and rapid indexing of quality traceability data for cosmetic production batches, aiming to solve one of the problems or issues of the prior art mentioned in the background section.
[0008] The method for linking, storing, and quickly indexing quality traceability data for cosmetic production batches provided in this application specifically includes: The system acquires quality inspection action signals triggered at each process node during cosmetic production and generates lightweight event snapshots with contextual semantics based on NTP synchronization calibration time, dynamically generated process instance IDs, material slice identifiers, and standardized quality observation point types.
[0009] The lightweight event snapshot is structured and parsed to extract temporal causal relationship features. Based on the regression analysis results of quality deviation under the same historical working conditions, a memory-resident directed acyclic event graph containing four types of meta-information: node ID, edge type, weight, and projection label is constructed.
[0010] The system receives traceability requests for specific quality observation point types and automatically activates the corresponding subgraph projector based on the quality observation point type. It then filters out process instance nodes and associated edges related to environmental control, disinfectant addition, and contact surface material from the memory-resident directed acyclic event graph to form a simplified causal subgraph.
[0011] Based on the material slice identifiers of each node in the simplified causal subgraph, all upstream raw material slices are back-aggregated, and the contribution factor of each raw material slice to the current quality data is calculated using time proximity and process coupling degree as weighting parameters, generating multi-dimensional dynamic binding results.
[0012] The lightweight event snapshots are stored in the time-series database in a columnar structure, and the metadata of the memory-resident directed acyclic event graph is optimized for storage using a bitmap index compression strategy to generate low-memory-occupancy hierarchical compressed data, thereby reducing memory usage and achieving associated storage and fast indexing of quality traceability data.
[0013] Obtain the confirmation or rejection operation signal of the multidimensional dynamic binding result by the human, and extract the time offset, material slice matching deviation and process instance jump number features from it to generate a binding confidence feedback signal for reinforcement learning training.
[0014] Based on the binding confidence feedback signal as the reward input, the decay coefficient of the edge weights in the memory-resident directed acyclic event graph and the dimension sensitivity threshold of the subgraph projector are fine-tuned and updated to generate optimized dynamic binding model parameters.
[0015] By replacing the original configuration with the optimized dynamic binding model parameters, the entire process of generating the lightweight event snapshot and outputting the multi-dimensional dynamic binding result is re-executed when subsequent quality inspection actions are triggered, thereby achieving adaptive iterative improvement in the binding accuracy between quality data and production batches.
[0016] The method for linking, storing, and quickly indexing quality traceability data for cosmetic production batches provided in this application has the following beneficial effects: (1) This application effectively overcomes the problems of rigid binding and coarse traceability granularity caused by relying on static batch coding in traditional batch management systems by introducing an "event snapshot" mechanism and a causal modeling structure based on directed acyclic graphs. In the prior art, the quality association between processes is usually linearly transmitted through a preset BOM tree or fixed batch number, which is difficult to cope with complex scenarios such as the same raw material being used in segments in multiple processes and cross-shift relay production, and is prone to traceability breakpoints or misbinding phenomena; while this solution uses dynamically generated event snapshots as the smallest semantic unit, combined with millisecond-level timestamps, process instance IDs and material slice identifiers, to achieve high-fidelity discretization of quality behavior in the process, so that each quality observation action can independently carry complete context information and participate in subsequent association analysis without pre-determining the batch to which it belongs, which significantly improves the system's adaptability and data acquisition flexibility in non-steady-state production environments.
[0017] (2) Furthermore, by constructing a lightweight, memory-resident event graph engine and implementing a dynamic binding strategy of "on-demand projection," this application significantly optimizes the association efficiency and computational resource consumption of multi-source heterogeneous quality data. Unlike traditional graph databases that rely on full graph traversal or complex path reasoning, this solution adopts a compressed DAG structure that retains only metadata and activates a subgraph projector of a specific dimension based on the type of quality observation point. During the query, relevant process nodes and upstream material slices are aggregated in real time, avoiding storage expansion and update delay issues caused by pre-computation. At the same time, the mechanism of calculating contribution factors based on time proximity and process coupling enables the system to achieve accurate responsibility attribution without introducing a deep learning model. It is particularly suitable for quality anomaly scenarios such as excessive microorganisms and color deviations that require comprehensive analysis of environmental and process parameters, significantly improving the relevance and interpretability of traceability results.
[0018] (3) In addition, the "binding confidence feedback closed loop" mechanism designed in the system integration layer endows the entire system with the ability to continuously self-optimize, solving the technical shortcomings of existing traceability systems that lack runtime learning capabilities and are difficult to evolve with actual operational experience. By converting manual confirmation or rejection operations into reinforcement learning signals and dynamically adjusting the edge weight attenuation coefficient and projection sensitivity threshold, the system can gradually improve the accuracy and response sensitivity of multi-dimensional dynamic binding under low computing power overhead, forming a complete closed loop from data collection, causal modeling to feedback optimization. The overall architecture combines engineering feasibility with technological foresight, supporting real-time traceability response at the level of hundreds of milliseconds, and keeping memory usage below 5MB / 10,000 batches, making it particularly suitable for continuous process industries with high requirements for compliance and refined management, such as dairy products and biopharmaceuticals.
[0019] In summary, this solution, with lightweight event semantics as its core driving element, breaks through the traditional rigid binding paradigm centered on batches. It realizes fine-grained, dynamic, and evolvable multi-dimensional association between quality data and material flow and process flow. While ensuring the efficient and stable operation of the system, it significantly improves the accuracy, flexibility, and intelligence of quality traceability in complex production environments, and has good scalability and industrial promotion value. Attached Figure Description
[0020] Figure 1 This is the main flowchart of a method for linking, storing, and quickly indexing quality traceability data for cosmetic production batches.
[0021] Figure 2 This is a sub-flowchart of a method for linking and quickly indexing quality traceability data for cosmetic production batches.
[0022] Figure 3 This is another sub-flowchart for a method of linking and quickly indexing quality traceability data for cosmetic production batches. Detailed Implementation
[0023] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0024] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0025] like Figure 1 As shown, this application provides a method for the association, storage, and rapid indexing of quality traceability data for cosmetic production batches, specifically including: S1: Acquire quality inspection action signals triggered by each process node in the cosmetic production process, and generate a lightweight event snapshot with contextual semantics based on NTP synchronization calibration time, dynamically generated process instance ID, material slice identifier and standardized quality observation point type.
[0026] S2: Perform structured parsing on lightweight event snapshots, extract temporal causal relationship features, and construct a memory-resident directed acyclic event graph containing four types of meta-information: node ID, edge type, weight, and projection label, based on the regression analysis results of quality deviation under historical working conditions.
[0027] S3: Receive traceability requests for specific quality observation point types, and automatically activate the corresponding subgraph projector according to the quality observation point type. Filter out process instance nodes and associated edges related to environmental control, disinfectant addition, and contact surface material from the memory-resident directed acyclic event graph to form a simplified causal subgraph.
[0028] S4: Based on the material slice identifiers of each node in the simplified causal subgraph, all upstream raw material slices are back-aggregated, and the contribution factor of each raw material slice to the current quality data is calculated using time proximity and process coupling degree as weighting parameters, generating multi-dimensional dynamic binding results.
[0029] S5: Lightweight event snapshots are stored in the time-series database in a columnar structure, and the metadata of the memory-resident directed acyclic event graph is optimized for storage using a bitmap index compression strategy to generate low-memory-occupancy hierarchical compressed graph data, thereby reducing memory usage and achieving associated storage and fast indexing of quality traceability data.
[0030] Step S1: Acquire quality inspection action signals triggered at each process node during cosmetic production, and generate lightweight event snapshots carrying contextual semantics based on NTP synchronization calibration time, dynamically generated process instance IDs, material slice identifiers, and standardized quality observation point types. Specifically, this includes: S1.1: Collect and preprocess the raw quality detection action signals output by the sensor array deployed at process nodes such as emulsification, homogenization, and filling. Use the network time protocol synchronization mechanism to calibrate the local clocks of each distributed node to a global unified time reference at the millisecond level, and generate a synchronized detection signal stream with time consistency.
[0031] Sensor arrays deployed at key process nodes in cosmetic production lines, such as emulsification, homogenization, and filling, collect raw quality detection signals in real time, including temperature, pressure, pH value, viscosity, and microbial indicators. Due to the dispersed physical distribution of each process node and the independent drift of the hardware clock, the directly collected signals lack global consistency in the time dimension, leading to temporal misalignment in subsequent causal correlation analysis.
[0032] A high-precision clock synchronization mechanism based on Network Time Protocol (NTP) is established. NTP clients are deployed in the edge computing gateways of each process node, and time calibration requests are periodically sent to the NTP server at the plant center. By measuring the round-trip delay and local clock deviation, clock offset compensation is calculated and applied to force the local system clocks of each distributed node to be aligned to a globally unified time reference with millisecond-level precision.
[0033] The raw sensor data stream after clock calibration is preprocessed to remove abnormal jump values and null values caused by electromagnetic interference or sensor malfunction. A sliding window filtering algorithm is used to smooth the continuous quality inspection data, retaining effective signal segments that reflect the true changes in process conditions, forming standardized inspection data frames with high signal-to-noise ratio.
[0034] A globally unified timestamp is used as the primary key index and embedded into each frame of standardized detection data to ensure that each quality observation point carries an absolute time identifier accurate to milliseconds. A message queue middleware is used to reassemble the detection data frames with the globally timestamped data in chronological order, eliminating out-of-order arrival problems caused by network transmission jitter and generating a synchronized detection signal stream that strictly follows the physical occurrence sequence.
[0035] Through the above NTP synchronization calibration and signal preprocessing process, the originally discrete, heterogeneous and time-disordered multi-source sensor data is transformed into a synchronized detection signal stream with global time consistency. This provides an accurate time coordinate basis for the subsequent generation of dynamic process instance IDs and the construction of causal edges in the event graph, effectively solving the problem of time alignment when binding data in multi-process cross-scenarios.
[0036] S1.2: Based on the production line number, shift information, process code and real-time sequence number in the synchronized detection signal stream, a dynamic combination coding algorithm is executed to generate a non-static, globally unique process instance identifier, and the process instance identifier is associated and mapped with the synchronized detection signal stream to form a time-series marker signal set carrying dynamic identity attributes.
[0037] Receive a synchronized detection signal stream with timing consistency from the output of step S1.1. This signal stream contains millisecond-level timestamps calibrated by NTP and raw sensor data, which serve as the initial input data source for generating the process instance identifier.
[0038] The metadata fields in the synchronized detection signal stream are structured and parsed to extract four key dimension parameters: production line number, shift code, process type code, and real-time trigger sequence number within the current process. A basic parameter dictionary for dynamic encoding is then constructed.
[0039] A fixed-length hash mapping process is performed on the extracted production line number to convert the variable-length string production line identifier into a fixed-width hexadecimal prefix code, ensuring that different production lines are orthogonally distributed in the encoding space and eliminating the risk of encoding conflicts caused by differences in production line naming.
[0040] Based on the shift time window obtained from the current system clock, the offset in minutes relative to midnight of the day is calculated, and this offset is quantized into an integer shift index value. This index value is then embedded into the middle high-order segment of the encoding structure through bit shifting operations to achieve a linear mapping in the time dimension.
[0041] The pre-defined process type enumeration table is invoked to map specific process actions such as emulsification, homogenization, and filling to a unique two-digit decimal process feature code. This feature code directly reflects the physical attributes of the process step and serves as the core identifier to distinguish different quality observation contexts.
[0042] Maintain a high-speed memory-based counter to generate monotonically increasing real-time sequence numbers for consecutively triggered events within the same production line, shift, and process type. These sequence numbers employ a cyclic overwrite mechanism to prevent overflow and ensure unique identification capabilities under extremely high concurrency scenarios.
[0043] The dynamic combination encoding algorithm is executed to concatenate the production line prefix code, shift index value, process feature code and real-time sequence number into binary according to the preset bit width ratio to form a compact integer numerical structure, avoiding the storage redundancy and inefficient retrieval problems caused by traditional string concatenation.
[0044] A check bit generation mechanism is introduced to perform cyclic redundancy check (CRC) operation on the concatenated integer value, generate an additional check code and append it to the end of the code, forming a globally unique process instance identifier with error detection capability, ensuring the integrity of the identifier during transmission and storage.
[0045] Establish an association mapping relationship between process instance identifiers and synchronized detection signal streams. Use the generated globally unique process instance identifier as the primary key index and write it into the extended header field of the signal stream to complete the identity attribute injection operation.
[0046] The signal stream after injection of the identifier is serialized and encapsulated to form a time-series marker signal set carrying dynamic identity attributes. This signal set not only retains the physical meaning of the original quality inspection data, but also gives it a unique logical coordinate in the production topology network.
[0047] By using dynamic combination coding and associated mapping processing, the synchronized detection signal stream of the previous step is transformed into a time-series marker signal set carrying a globally unique process instance identifier. This enables refined identification of process nodes in complex production scenarios and provides high-fidelity entity anchors for subsequent material slice association and event graph construction.
[0048] For example, in the emulsification process of a cosmetic emulsion production line, a sensor detects a viscosity quality detection action. The system parses the synchronized detection signal stream, extracts the production line number "LINE-A01", and maps it to the hexadecimal prefix "0A01"; the current shift is the early shift (08:00-16:00), with an offset of 480 minutes relative to zero, quantized as the shift index "0320" (hexadecimal); the process type is "emulsification", mapped to the feature code "10"; this is the 5th time the emulsification detection has been triggered within this shift, with a real-time sequence number of "0005".
[0049] Dynamic combination encoding is performed, concatenating each part bit by bit: the production line prefix occupies 16 bits, the shift index occupies 16 bits, the process feature code occupies 8 bits, and the sequence number occupies 16 bits. The specific binary concatenation process is as follows: in, It is a globally unique process instance identifier (integer). The hexadecimal prefix code (16 bits) for the production line number. This is the shift index value (16 bits). This is the process feature code (8 bits). This is the real-time serial number (16 bits). This is a left shift operation. This is a bitwise OR operation.
[0050] The Prefix is 0x0A01, the ShiftIndex is 0x0320, the ProcCode is 0x10, and the SeqNum is 0x0005. The calculated base integer value is 0x0A010320100005. A CRC-16 check is performed on this value, generating a checksum of 0xB2C4. This checksum is then appended to form the final globally unique process instance identifier "0A010320100005B2C4".
[0051] This identifier is injected into the signal stream header, forming a timing marker signal set. If another homogenization process inspection occurs at this time, the process feature code becomes "20", the sequence number is counted independently as "0001", and the generated identifier is "0A010320200001XXXX", which is logically strictly distinguishable from the emulsification process identifier. This process ensures that in a production environment with multiple overlapping processes and high-frequency triggering, each quality inspection action has a unique and unambiguous identifier, significantly improving the accuracy and retrieval efficiency of subsequent event graph node matching, and avoiding ambiguity in traceability paths caused by the reuse of static batch numbers.
[0052] S1.3: For the raw material input records involved in the time-series marker signal set, based on the physical fact that the same batch of raw materials is used in different process segments, perform material logic slicing operation to generate material slice identifiers containing batch number and slice sequence number, and inject the material slice identifiers into the time-series marker signal set to construct an enhanced time-series signal package with material traceability granularity.
[0053] Receive a set of timing marker signals carrying dynamic identity attributes generated in step S1.2. This set of signals includes a global timestamp calibrated by NTP and a unique process instance ID, which serves as the input basis for material logic slicing operations.
[0054] The raw material input record data associated with the time-series marker signal set is analyzed, and the raw material batch number, input time point, total input amount and theoretical consumption required for the current process are extracted to construct the raw material usage context vector.
[0055] Based on the physical fact that the same batch of raw materials is used in different stages of cosmetic production, a material status tracking model based on cumulative consumption is established, and the remaining available quantity counter for the current batch is initialized.
[0056] Calculate the logical segmentation boundary of the current process instance for a specific raw material slice. By comparing the theoretical consumption of the current process with the remaining available amount of the batch of raw materials at the end of the previous process, determine whether a material switching event across batches or slices has occurred.
[0057] If the remaining available quantity is insufficient to cover the current process requirements, a slice truncation operation is performed, terminating the original material slice identifier and generating a new subsequent slice identifier to ensure that each logical slice corresponds to only a single continuous production consumption range.
[0058] The following formula is used to calculate the material slice number and slice percentage involved in the current process: in, The generated material slice number. This represents the cumulative consumption of this batch of raw materials up to the previous process. This represents the theoretical consumption for the current process. This represents the initial total input quantity of this batch of raw materials. This represents the floor function.
[0059] Based on the calculated slice number, combined with the raw material batch number and the preset separator rules, a globally unique material slice identifier is synthesized, with the format defined as 'raw material batch number#slice number'.
[0060] The generated material slice identifier is injected into the data structure of the timing mark signal set, replacing the original coarse-grained raw material batch field, forming an enhanced timing signal packet with fine material traceability granularity.
[0061] Through the above-mentioned material logic slicing operation and identifier injection processing method, the timing mark signal set of the previous step is transformed into an enhanced timing signal packet containing the precise material consumption range, realizing fine-grained dynamic binding of quality data with specific raw material usage segments, and solving the technical problem that traditional static batch binding cannot distinguish different usage stages of the same batch of raw materials.
[0062] For example, the glycerol raw material used in the emulsification process has a batch number of RAW-Gly-20240501 and an initial total input of Q_batch of 1000 kg. In the pretreatment process, this batch of glycerol has accumulated a consumption of C_cum of 300 kg. The theoretical consumption of the current emulsification process is D_cur of 400 kg. The system first determines whether the remaining 700 kg meets the requirement. If it does, no new slice is generated, but the cumulative status needs to be updated. The slice number is calculated according to the formula: S_idx=floor((300+400) / 1000)+1=floor(0.7)+1=1. Therefore, the material slice identifier used in the current process is generated as 'RAW-Gly-20240501#S1'. If the theoretical consumption of D_cur is 500 kg in the subsequent homogenization process, the accumulated consumption C_cum is updated to 700 kg. Calculate S_idx = floor((700+500) / 1000) + 1 = floor(1.2) + 1 = 2. The system detects the change in the integer part, determines that a slice switch has occurred, generates a new material slice identifier 'RAW-Gly-20240501#S2', and marks the status of the previous slice 'S1' as completed. Finally, 'RAW-Gly-20240501#S1' is injected into the quality inspection signal packet of the emulsification process, while 'RAW-Gly-20240501#S2' is injected into the signal packet of the homogenization process. This processing method allows the traceability system to accurately locate the raw material period corresponding to the 'S2' slice when the product exhibits viscosity abnormalities after homogenization, eliminating interference from the 'S1' period, and significantly improving the accuracy and efficiency of traceability.
[0063] S1.4: Based on the preset standardized quality observation point enumeration set, the pH value, microbial count, viscosity and color parameters carried in the enhanced time series signal packet are type matched and normalized to generate standardized quality observation point type labels. The standardized quality observation point type labels are then integrated into the enhanced time series signal packet as core semantic fields to produce semantically complete context-related data units.
[0064] Receive an enhanced timing signal packet with material traceability granularity constructed in the previous step. This signal packet carries the unstandardized raw quality inspection values and corresponding sensor metadata.
[0065] Call the pre-built standardized quality observation point enumeration set dictionary library, which defines the standardized names, unit systems, dimensional ranges and data type mapping rules of all key quality indicators in the entire cosmetic production chain.
[0066] Semantic parsing is performed on the original detection fields in the enhanced time-series signal packet to extract specific parameters such as pH value, microbial count, viscosity and color Lab* value, and to identify the non-standard namespace or private protocol format to which they currently belong.
[0067] The type matching algorithm is executed to perform fuzzy matching and precise comparison between the extracted parameter items and the standard templates in the enumeration set dictionary to determine the unique category of each parameter item in the standard system.
[0068] For successfully matched parameters, the normalization conversion engine is activated. Based on the preset unit conversion coefficient and dimension correction factor, the original values are converted into a unified standard unit of measurement. For example, viscosity is converted from centipoise (cP) to pascal-second (Pa·s), and color is converted from RGB space to CIELab* space.
[0069] For discrete count indicators such as microbial count, logarithmic transformation is performed to eliminate distribution skew caused by differences in magnitude, ensuring the numerical stability of subsequent map weight calculations.
[0070] Generate standardized quality observation point type labels, which include standard indicator codes, normalized numerical range identifiers, and confidence level markers, forming a structured semantic metadata object.
[0071] The generated standardized quality observation point type labels are used as core semantic fields and integrated into the specified offset address of the enhanced timing signal packet through memory pointer injection, maintaining the integrity of the original timestamp and process ID structure.
[0072] Perform consistency checks on the integrated data units to ensure logical consistency between the newly added semantic fields and the original context information, and produce semantically complete context-related data units.
[0073] By using type matching and normalization transformation, the heterogeneous and multi-source raw quality inspection data from the previous step is transformed into standardized quality observation point type labels in a unified semantic space. This enables semantic interoperability and traceability consistency of quality data in multi-process cross-scenario scenarios, providing a high-fidelity input foundation for subsequent causal edge weight calculation of event graphs.
[0074] S1.5: Perform structured encapsulation processing on semantically complete context-related data units, and integrate the global unified time base, dynamic identity attributes, material traceability granularity, and standardized quality observation point type labels into a single data object according to the lightweight event snapshot definition format, generating a lightweight event snapshot carrying contextual semantics for downstream map construction.
[0075] Step S2: Perform structured parsing on lightweight event snapshots, extract temporal causal relationship features, and construct a memory-resident directed acyclic event graph containing four types of metadata: node ID, edge type, weight, and projection label, based on the regression analysis results of quality deviations under historical working conditions. Specifically, this includes: S2.1: Obtain a lightweight event snapshot set carrying contextual semantics, and perform structured parsing on the trigger timestamp, process instance ID, material slice identifier and quality observation point type fields in the snapshot based on predefined event pattern matching rules to extract the original event feature vector sequence with temporal consistency.
[0076] S2.2: Utilize the temporal order of adjacent process instances and the material slice inheritance relationship in the original event feature vector sequence to execute the directed causal edge derivation algorithm, identify and establish logical connection relationships from the previous process instance node to the subsequent process instance node, and generate an initial set of directed edges representing the process flow topology.
[0077] The system receives the raw event feature vector sequence generated by S2.1 parsing. This sequence contains lightweight event snapshot core fields sorted by time, including trigger timestamp, process instance ID, material slice identifier, and quality observation point type. For the raw event feature vector sequence, a time-window-based sliding window traversal operation is performed. A fixed-length time sliding window is set to cover the maximum process flow interval between adjacent processes, ensuring that process pairs with potential causal relationships can be captured. Within the sliding window, the current process instance node is extracted as a predecessor node candidate, and the subsequent process instance nodes are extracted as successor node candidates, constructing a set of node pairs to be verified.
[0078] For each node pair in the node pair set, a material slice inheritance relationship check is performed. The output material slice identifier of the preceding node and the input material slice identifier of the following node are compared to see if they satisfy subset inclusion or complete matching logic. If physical flow consistency of material slices exists, the node pair is marked as a valid material association pair. For valid material association pairs, a timing logic constraint check is further performed. The time difference between the trigger timestamp of the following node and the trigger timestamp of the preceding node is calculated, and it is determined whether this difference is within the preset process standard flow time interval. Non-causal timing connections caused by data noise or abnormal delays are eliminated. Through the dual filtering of material inheritance and timing constraints, process instance node pairs with high-confidence physical flow foundations are selected, forming a preliminary causal connection candidate set. For the preliminary causal connection candidate set, directed edge attribute initialization processing is performed. Based on the process code type of the preceding and following nodes, the semantic type of the edge is determined, such as 'emulsification-homogenization', 'homogenization-filling', etc., and an initial direction identifier is assigned, establishing a unidirectional dependency relationship from the preceding process instance to the following process instance. The candidate set of causal connections, defined by type and direction, is structurally encapsulated to generate an initial directed edge object containing source node ID, target node ID, edge type identifier, and basic temporal information. Through this processing, the original event feature vector sequence from the previous step is transformed into an initial set of directed edges representing the process flow topology, achieving a logical mapping from discrete event data to a continuous causal graph structure. This provides an accurate topological skeleton for subsequent weight quantization based on historical data.
[0079] S2.3: Call the regression analysis model of quality deviation under the same working condition stored in the historical database, use the historical process parameter fluctuation data corresponding to each edge in the initial directed edge set as input variables to perform regression prediction calculation, so as to quantify the measured influence of the preceding process on the subsequent quality result, and generate an edge weight parameter set with numerical confidence.
[0080] Obtain the initial set of directed edges generated in step S2.2. The set contains the logical connection relationships from the previous process instance node to the subsequent process instance node and the corresponding material slice inheritance path information.
[0081] For each directed edge in the initial set of directed edges, extract its associated preceding process instance ID and subsequent process instance ID, and retrieve the production records under the same working conditions stored in the historical database based on the material slice identifier. Extract the historical process parameter fluctuation sequence matching the preceding process instance type from the historical database, including key process variable data such as emulsification speed deviation, homogenization pressure fluctuation amplitude, and heating temperature gradient change rate.
[0082] Simultaneously extract historical quality result deviation sequences that match the instance types of subsequent processes, including quality observation index data such as pH deviation, viscosity stability coefficient, and logarithmic difference of microbial counts. Perform time window alignment processing on the extracted historical process parameter fluctuation sequences and historical quality result deviation sequences to ensure that the causal correspondence between input and output variables is consistent in time series.
[0083] A model of the impact of fluctuations in preceding process parameters on deviations in subsequent quality results was constructed using multiple linear regression analysis. The regression coefficient matrix was solved using the least squares method. The measured influence weights of preceding process parameters on subsequent quality results were calculated using the following formula: in, This is a vector of regression coefficients, representing the weight of each process parameter on the quality result. This is a historical process parameter fluctuation data matrix, where each column represents a fluctuation sequence of a process parameter. This represents the historical quality result deviation vector; This represents the matrix transpose operation.
[0084] The calculated regression coefficient vector is standardized to eliminate numerical differences between process parameters of different dimensions, and a normalized influence intensity coefficient is generated.
[0085] A confidence assessment mechanism is introduced, calculating the statistical confidence score of each directed edge weight based on the historical sample size and the R-squared value of the goodness of fit of the regression model. The numerical confidence score of the edge weight is calculated using the following formula: in, Score the confidence level. For the number of historical samples, For the first The actual quality deviation value of each sample For the first The model predicts the quality deviation value for each sample. This represents the average of the actual quality deviations.
[0086] The normalized influence intensity coefficients and confidence scores are weighted and fused to generate the final edge weight parameters carrying numerical confidence scores. The final set of edge weight parameters is generated using the following formula: in, These are the final edge weight parameters. This is the normalized influence intensity coefficient. Score the confidence level. This is a balancing coefficient, ranging from 0 to 1, used to adjust the weight of the influence intensity and the confidence level.
[0087] Traverse all edges in the initial set of directed edges and repeat the regression prediction and weight generation process described above until all edges have obtained corresponding numerical weight parameters.
[0088] By calling the historical same-condition quality deviation regression analysis model to perform regression prediction calculations, the initial set of directed edges is transformed into a set of edge weight parameters carrying numerical confidence, realizing a quantitative characterization of the measured influence of the preceding process on the subsequent quality results, and providing a reliable causal support basis for the subsequent construction of a high-precision memory-resident directed acyclic event graph.
[0089] For example, in the emulsification-homogenization process chain of cosmetic production, historical production data of the same model of emulsifier and homogenizer were extracted over the past 30 days. The preceding process parameter fluctuation data matrix X contains three columns: emulsification speed deviation (unit: rpm), emulsification time deviation (unit: s), and heating temperature deviation (unit: ℃), with a total of 1000 valid samples collected. The subsequent process quality result deviation vector Y represents the percentage of the emulsion viscosity after homogenization that deviates from the standard value. The data matrix X is preprocessed by centering and standardization. The product of the inverse matrix XTX and XTY is calculated to obtain the regression coefficient vector w=[0.45,0.12,0.38], indicating that the emulsification speed deviation has the greatest impact on viscosity. The calculated model fit R-squared value is 0.85, and the confidence level is calculated to be C=0.85. The balance coefficient α is set to 0.7, and the final edge weight W_final=0.70.45+0.30.85=0.57 (taking speed as an example). This weight value is assigned to the directed edge from 'emulsification instance' to 'homogeneous instance', serving as the core basis for determining the strength of causal association in subsequent traceability requests. Compared to traditional fixed-weight methods, this dynamic weight can accurately reflect the real-time changes in the impact of process parameters on quality under different operating conditions, significantly improving the accuracy and reliability of traceability results.
[0090] S2.4: Based on the preset quality index dimension sensitivity threshold mapping table, perform attribute matching processing on the quality observation point type associated with each edge in the initial directed edge set, assign Boolean projection flag bits for subsequent subgraph projection filtering, and generate an enhanced edge element information object containing dimension filtering attributes.
[0091] S2.4 Based on the preset quality index dimension sensitivity threshold mapping table, attribute matching processing is performed on the quality observation point type associated with each edge in the initial directed edge set, Boolean projection flag bits are assigned for subsequent subgraph projection filtering, and an enhanced edge element information object containing dimension filtering attributes is generated.
[0092] Read the pre-built quality indicator dimension sensitivity threshold mapping table. This mapping table uses the standardized quality observation point type as the key value and stores the process sensitivity feature vector and projection activation rule of the corresponding dimension as the benchmark data source for attribute matching.
[0093] Traverse each directed edge in the initial set of directed edges, extract the quality observation point type labels carried by the starting and ending nodes of the edge, and form edge dimension feature pairs to be matched.
[0094] The quality observation point type label in the edge dimension feature pair is matched with the key value in the mapping table using a hash index. If the match is successful, the dimension sensitivity coefficient matrix corresponding to the quality indicator and the whitelist of associated process categories are obtained.
[0095] Based on the obtained dimension sensitivity coefficient matrix, the semantic relevance score of the current directed edge under a specific quality dimension is calculated, and the matching degree between the edge and the quality index is quantified by the following formula: in, Score the semantic relevance. This represents the total number of quality impact factors. For the first The preset weights of each influencing factor. For normalized mapping functions, This serves as the identifier for the process parameter type of the current edge. This is the identifier for the standard process parameter type defined in the mapping table.
[0096] Determine whether the calculated semantic relevance score S is greater than the preset dimension sensitivity threshold T. th If S≥T th If so, the directed edge is determined to have a significant causal support effect in the dimension of the current quality observation point.
[0097] For directed edges that are determined to have significant causal support, their corresponding Boolean projection is marked as True, indicating that the edge should be retained in the traceability request for this quality indicator.
[0098] For directed edges that are determined to lack significant causal support, their corresponding Boolean projection is marked as False, indicating that the edge should be filtered out in traceability requests for that quality indicator.
[0099] The calculated Boolean projection marker, dimension sensitivity coefficient matrix index, and semantic relevance score S are encapsulated into the metadata structure of the original directed edge, forming an enhanced edge information object containing node ID references, edge type identifiers, weight values, projection markers, and dimension scores.
[0100] By using the above attribute matching and threshold determination processing method, the initial set of directed edges generated in the previous step, which only contains topological connection relationships, is transformed into an enhanced edge element information object carrying multi-dimensional quality sensitivity information. This enables dimensional pre-classification of the event graph at the storage level, providing a fast filtering basis for subsequent on-demand activation of the subgraph projector and significantly reducing the graph traversal complexity during trace query.
[0101] For example, in a traceability scenario for excessive microorganisms in cosmetic production, the pre-defined quality indicator dimension sensitivity threshold mapping table includes a whitelist of associated process categories for the "microbial count" indicator, which includes "emulsification," "homogenization," "filling," and "pipeline cleaning." The dimension sensitivity threshold T... th The threshold is set to 0.75. When processing a directed edge from a "raw material preheating" process instance to a "emulsification" process instance, its quality observation point type is extracted as "temperature," and the sensitivity coefficient matrix of the "microbial count" dimension is obtained through hash matching. Since "raw material preheating" is not in the whitelist, and the direct killing effect of temperature on microorganisms has a low weight w_i in this process segment, the semantic relevance score S is calculated to be 0.42. Because 0.42 is less than 0.75, the projection position of this edge is marked as False. Conversely, for a directed edge from a "pipeline cleaning" process instance to a "filling" process instance, which involves disinfectant concentration parameters and is a high-sensitivity factor in the whitelist, the semantic relevance score S is calculated to be 0.91. Because 0.91 is greater than 0.75, the projection position of this edge is marked as True. In the final generated enhanced edge information object, the former is marked as invisible and the latter is marked as visible. This allows the system to directly skip non-critical paths such as raw material preheating in subsequent traceability requests for microbial indicators, and only load the high-confidence causal link from pipeline cleaning to filling, which greatly improves the efficiency and targeting of subgraph construction.
[0102] S2.5: Integrate the enhanced edge element information object after weight assignment and label enhancement, along with the corresponding process instance node identifier, and use a memory pointer reference mechanism to construct the physical storage mapping relationship between nodes and edges. Assemble it into a memory-resident directed acyclic event graph instance that retains only four types of element information: node ID, edge type, weight value, and projection label.
[0103] like Figure 2 As shown, step S3: Receive traceability requests for specific quality observation point types, and automatically activate the corresponding subgraph projector based on the quality observation point type. From the memory-resident directed acyclic event graph, filter out process instance nodes and associated edges related to environmental control, disinfectant addition, and contact surface materials to form a simplified causal subgraph. Specifically, this includes: S3.1: Obtain the traceability request signal initiated by the user, which contains the standardized quality observation point type identifier, and perform semantic parsing processing on the traceability request signal to extract the target quality indicator feature vector as the input condition for subsequent projection operations.
[0104] It should be noted that environmental control-related attributes refer to process instance nodes related to environmental parameters such as cleanliness, temperature, humidity, pressure difference, and air filtration system operation status in the production workshop or process area. Examples include the cleanroom HVAC operation status monitoring and the air purification unit operation records in the preparation room mentioned in the embodiments. Disinfectant addition-related attributes refer to process instance nodes related to cleaning, sterilization, and disinfection operations. Examples include the CIP cleaning procedure execution records, disinfectant concentration and contact time detection, and equipment surface wiping and disinfection logs mentioned in the embodiments. Contact surface material-related attributes refer to process instance nodes related to the material type, maintenance status, and replacement records of physical contact surfaces that directly contact the product, such as the container inner wall, pipes, filling heads, sealing rings, and conveyor belts. Examples include the liquid storage tank material and filling head material batches mentioned in the embodiments. These three types of related attributes serve as the core filtering dimensions for the subgraph projector to select process instance nodes and related edges from the memory-resident directed acyclic event graph.
[0105] The system receives traceability request signals initiated by quality traceability terminals or automated quality inspection systems. These signals carry standardized quality observation point type identifiers and associated production batch context information. Protocol parsing and payload extraction are performed on the traceability request signals to separate the target quality indicator feature vectors, which serve as the core retrieval dimension. The feature vectors include indicator category codes, numerical range constraints, and confidence threshold requirements.
[0106] Based on a predefined semantic mapping dictionary of quality indicators, the extracted feature vectors of target quality indicators are standardized and validated to confirm that they belong to valid members of a predefined enumeration set such as pH value, microbial count, viscosity, or color. If non-standard identifiers or abnormal formats are detected, an exception interception mechanism is triggered and an error code is returned to ensure the legality of input data for subsequent projection operations.
[0107] For the feature vectors of the target quality indicators that have passed the verification, a multi-dimensional attribute decomposition operation is performed, decomposing them into three orthogonal subspaces: physicochemical attribute dimension, biosafety attribute dimension, and sensory evaluation attribute dimension. For biosafety indicators such as microbial count, the focus is on extracting attribute tags that are strongly correlated with clean environment, disinfection process, and contact materials; for physicochemical indicators such as viscosity, the focus is on extracting attribute tags that are strongly correlated with temperature control, stirring rate, and raw material ratio.
[0108] The decomposed attribute labels are logically matched and pre-simulated with the projection flags of node metadata in the memory-resident directed acyclic event graph to calculate the coverage density of each attribute label in the graph. A weighted scoring algorithm is used to evaluate the sensitivity of the target quality index to nodes in different regions of the graph, generating a preliminary node screening priority queue to provide a quantitative basis for the dynamic activation of the subgraph projector.
[0109] The target quality indicator feature vector, after attribute decomposition and sensitivity assessment, is encapsulated to form a structured input object containing the original identifier, decomposed attribute set, and filtering priority. This object serves as the direct input condition for querying the dimension sensitivity threshold mapping table and activating the subgraph projector in step S3.2, ensuring that the projection operation can accurately focus on the process link highly relevant to the current quality problem.
[0110] Through the aforementioned processing methods of semantic parsing, standardized verification, multi-dimensional attribute decomposition, and sensitivity assessment, the original traceability request signal is transformed into a target quality indicator feature vector with clear causal orientation. This achieves the transformation from fuzzy business requirements to precise graph retrieval conditions, significantly reducing the computational redundancy of subsequent subgraph traversal and improving the real-time performance and accuracy of traceability response.
[0111] For example, a user initiates a traceability request for "excessive total microbial count after filling," with the request signal containing the standardized identifier 'MICRO_TOTAL' and the threshold '>100CFU / g'. The system parses this signal and confirms that 'MICRO_TOTAL' belongs to the biosafety attribute dimension. Attribute decomposition is performed, extracting three key related tags: 'clean environment control', 'disinfectant residue', and 'pipe contact material'. The coverage density of these three tags in the event graph is calculated, revealing high hit rates for the node projection markers corresponding to 'cleanroom HVAC operation status', 'CIP cleaning procedure execution record', and 'filling head material batch'. A structured input object containing the 'MICRO_TOTAL' identifier, the attribute set {'clean environment', 'disinfection', 'material'}, and a high priority is generated. This object is directly used to activate the subgraph projector for the biosafety dimension, avoiding traversing process nodes such as emulsification and homogenization, which are weakly related to microbial contamination, reducing subgraph construction time to milliseconds and significantly improving traceability efficiency.
[0112] S3.2: Based on the target quality index feature vector, query the preset dimension-sensitive threshold mapping table, execute the subgraph projector dynamic activation instruction to generate an active subgraph projector instance carrying specific filtering rules.
[0113] Receive the target quality index feature vector generated by the S3.1 step. This vector contains the standardized quality observation point type identifier and the corresponding semantic label, which serves as the input condition for the dynamic activation of the subgraph projector.
[0114] The system calls a pre-built dimension-sensitive threshold mapping table in memory. This table stores, in key-value pairs, various quality observation point types and their corresponding process-related attribute sets, confidence cutoff thresholds, and topology search depth limits.
[0115] Based on the observation point type identifier in the feature vector of the target quality indicator, an exact matching query is performed in the dimension-sensitive threshold mapping table to retrieve the set of process attributes that are strongly correlated with the specific quality indicator. For example, for the microbial exceedance indicator, key environmental control attributes such as 'cleanroom level', 'disinfectant concentration', and 'personnel contact frequency' are retrieved.
[0116] The matched set of process attributes is extracted as the core constraint of the filtering rules. At the same time, the corresponding confidence truncation threshold is read. This threshold is used to remove low-correlation causal edges in subsequent subgraph traversal to ensure the sparsity and high signal-to-noise ratio of the projection results.
[0117] Based on the retrieved topology search depth limit parameters, initialize the state machine of the subgraph projector, and set the maximum number of hops to trace upstream from the current quality observation node to prevent memory overflow and computational delay caused by infinite recursion.
[0118] The above filtering rules, confidence truncation threshold, and topology search depth limit are encapsulated into a configuration object, and an active subgraph projector object dedicated to the current quality metric type is instantiated. This object maintains an independent filtering logic stack and status register.
[0119] By encapsulating the query and configuration of the dimension-sensitive threshold mapping table, the abstract target quality indicator feature vector is transformed into an active subgraph projector instance with specific execution logic. This enables differentiated and refined traceability path filtering for different quality issues, significantly reduces interference from irrelevant process nodes, and improves the accuracy and efficiency of subsequent causal subgraph construction.
[0120] For example, when a traceability request targets the quality observation point of 'exceeding the standard for total microbial count after filling', the identifier type in the target quality indicator feature vector is 'MICRO_TOTAL'. The system queries the dimension sensitivity threshold mapping table to obtain the corresponding set of process attributes for this type: {'HVAC_Filter_Status', 'CIP_Sterilization_Time', 'Operator_Glove_Change_Freq'}. The confidence truncation threshold is set to 0.75, and the topology search depth is limited to 5 layers. Based on this, the system generates an active subgraph projector instance. This instance is configured to retain only process nodes involving HVAC filter status, CIP sterilization duration, and operator glove change frequency, and discards causal edges with a weight lower than 0.75 during traversal. If the causal edge weight between a preceding 'packaging material cleaning' process node and the current microbial indicator is 0.62, then this node and its branches will be automatically filtered by the projector and not included in the simplified causal subgraph. This process ensures that the focus of tracing is highly concentrated on the links that have a significant impact on microbial indicators, avoids the computational redundancy caused by traversing the entire map, and keeps the submap construction time within the millisecond range.
[0121] S3.3: Use active subgraph projector instances to scan and match all node metadata in the memory-resident directed acyclic event graph to identify and mark a set of candidate process instance nodes that meet the association attributes of environmental control, disinfectant addition, and contact surface material.
[0122] Receive the active subgraph projector instance generated by the previous steps. This instance encapsulates the dimension-sensitive threshold mapping rules and associated attribute filtering logic for a specific quality observation point type (such as microbial exceedance). Read the full node metadata data block stored in the memory-resident directed acyclic event graph. The data block contains the node ID, process instance identifier, material slice identifier, quality observation point type label, and pre-allocated Boolean projection flag bits.
[0123] Parallel scanning and matching operations are performed on all node metadata to extract the quality observation point type label for each node, and semantically compare it with the preset target quality indicator feature vector in the active subgraph projector. If the quality observation point type of a node belongs to the direct detection link of the target indicator, the node is marked as a directly related node, and its process instance ID is recorded in the initial list of the candidate set.
[0124] For process nodes that are not directly monitored, the contextual semantic fields of the nodes are retrieved based on three key influencing factors defined in the active subgraph projector: environmental control, disinfectant addition, and contact surface material. By parsing the process code segment in the process instance ID, nodes corresponding to specific process actions such as cleanroom environmental monitoring, CIP cleaning and disinfection, and pipe / tank contact are identified.
[0125] For specific process nodes identified, their associated projection flag status is further verified. Only nodes whose projection flags indicate a significant causal relationship with the target quality index in historical regression analysis are included in the screening scope, thereby excluding noisy nodes that, although belonging to the same type of process, have no substantial impact on the current quality problem.
[0126] Calculate the temporal proximity between candidate nodes and the triggered quality inspection actions. Calculate the difference between the trigger timestamp and the detection signal timestamp in the node to generate a time offset. Set a time window threshold to remove distant historical nodes that exceed a reasonable process response cycle, ensuring that the candidate set only includes process instances with causal probability in terms of timeliness.
[0127] Nodes that pass semantic matching, attribute validation, and time window filtering are deduplicated, and records of the same process instance that are matched multiple times under different dimensions are merged. A unique internal index pointer is assigned to each retained candidate process instance node, and a reference link pointing to the original event snapshot data in memory is constructed to form a structured set of candidate process instance nodes.
[0128] Through the above-mentioned multi-dimensional filtering and semantic matching processing methods, the abstract projection rules activated in the previous step are transformed into specific and operable candidate process instance node set data, realizing accurate dimensionality reduction and positioning from the full graph to key causal link nodes, significantly reducing the computational load of subsequent subgraph reconstruction and improving the real-time performance of traceability response.
[0129] S3.4: Based on the topological connectivity of the candidate process instance node set in the directed acyclic event graph residing in memory, perform a causal support edge weight filtering operation to extract only the associated edge data fragments with high confidence causal support relationships.
[0130] Obtain the candidate process instance node set output from step S3.3. This set contains discrete node data marked as related to environmental control, disinfectant addition, and contact surface material in the memory-resident directed acyclic event graph. Perform an adjacency edge search operation on each node in the candidate process instance node set, and quickly locate all incoming and outgoing edge metadata objects connecting the node based on the memory pointer reference mechanism to construct a local topology relational view.
[0131] The weight value carried by each directed edge in the local topological relationship view is extracted. This weight value represents the measured influence of fluctuations in preceding process parameters on subsequent quality results, serving as a quantitative confidence index for causal support relationships. The preset dynamic confidence threshold parameter in the subgraph projector is invoked. This parameter is automatically matched according to the type of quality observation point in the traceability request and is used to define the minimum confidence standard for valid causal links.
[0132] The weight values of each extracted directed edge are compared with a dynamic confidence threshold one by one to identify and filter strongly correlated edges whose weight values are greater than or equal to the dynamic confidence threshold, while weakly correlated or noisy edges whose weight values are lower than the threshold are removed. A connectivity check is performed on the filtered strongly correlated edges to ensure that the retained edges can maintain the logical coherence between candidate nodes and prevent the formation of isolated nodes due to the breakage of causal links caused by over-filtering.
[0133] The strongly correlated edge data fragments that have passed connectivity verification are restructured and reassembled with the original candidate process instance node set to generate a simplified edge set containing only high-confidence causal support relationships.
[0134] By performing the aforementioned causal support edge weight filtering operation, the broad set of candidate nodes obtained in the previous step is transformed into related edge data fragments with high-confidence topological connections, thereby achieving accurate removal of non-critical interference factors in the tracing path and significantly reducing the data scale and complexity of subsequent reverse aggregation calculations.
[0135] S3.5: Integrate the candidate process instance node set and associated edge data fragments for structured reorganization to construct and output a simplified causal subgraph data structure containing only key causal links.
[0136] Receive the associated edge data fragments after the causal support edge weight filtering operation, as well as the candidate process instance node set that meets the associated attributes of environmental control, disinfectant addition and contact surface material identified and marked in the previous steps.
[0137] Perform topological connectivity checks on the candidate process instance node set, traverse the unique identifier of each node in the set, retrieve its in-degree and out-degree connection relationship in the adjacency list structure of the directed acyclic event graph residing in memory, remove isolated nodes or redundant nodes with only unidirectional invalid links, and ensure that the retained nodes are all in the valid process causal chain.
[0138] Based on the verified candidate process instance node set, a node index mapping table is constructed to map each process instance ID to its local index position in the simplified subgraph. This mapping table is stored in a hash table structure to support fast node location with O(1) time complexity, providing an addressing basis for subsequent edge reorganization.
[0139] Traverse the associated edge data fragments, parse the source node ID and target node ID in each edge element information, and use the above node index mapping table to determine whether the source node and target node both exist in the verified candidate process instance node set.
[0140] If both the source node and the target node exist in the candidate set, the associated edge and its weight value, projection label, and edge type metadata are extracted and used as valid edge elements of the simplified causal subgraph. If neither node exists, the edge data is discarded to prevent the introduction of noise interference from irrelevant processes.
[0141] The extracted valid edge elements are grouped and aggregated according to the source node ID to construct a list of directed edges in a simplified causal subgraph. At the same time, the globally unique edge ID of each edge in the original full event graph is recorded so as to establish bidirectional reference links when it is necessary to backtrack the original data.
[0142] Based on the source and target node IDs contained in the list of valid edges, the final subset of nodes that actually participate in causal connections is filtered out from the candidate process instance node set. Idle nodes that meet the attribute matching but have not generated actual data interaction in the current trace path are removed, further compressing the size of the subgraph.
[0143] The final subset of nodes and the list of directed edges are encapsulated in a structured manner to generate a hierarchical data structure containing node attribute blocks and edge attribute blocks. The node attribute blocks store the process instance ID, material slice identifier, trigger timestamp, and quality observation point type, while the edge attribute blocks store the source node local index, the target node local index, causal weight, and projection label.
[0144] Memory alignment optimization is performed on this hierarchical data structure. Fixed-length fields are stored in a compact arrangement, while variable-length fields are referenced by offset pointers. This reduces memory fragmentation and improves CPU cache hit rate, resulting in a simplified causal subgraph data structure for downstream reverse aggregation calculations.
[0145] Through the above-mentioned methods of topological connectivity verification, index mapping construction, effective edge filtering, and memory alignment optimization, the discrete node set and edge data fragments obtained in the previous step are transformed into a compact and logically coherent simplified causal subgraph data structure, achieving the expected technical effect of efficient storage and fast access for tracing paths.
[0146] For example, in a post-filling microbial contamination traceability scenario, the system receives a set of 35 candidate process instance nodes (covering processes such as ingredient preparation, emulsification, homogenization, pipeline cleaning, filling, and packaging), and 42 remaining related edge data fragments after weight filtering. During topology connectivity verification, it is found that the cleaning process node 'CLEAN-009', while meeting the disinfectant addition attribute, is only connected to the already removed 'IDLE-002' idle node in the full graph and does not form a valid causal edge with any candidate production process. Therefore, it is removed from the candidate set, leaving 34 valid nodes. A node index mapping table is constructed, mapping the 34 node IDs to local indices from 0 to 33. The 42 edge data fragments are traversed; 38 edges, whose source and target nodes are both located within the set of 34 valid nodes, are extracted as valid edges; the remaining 4 edges are discarded because they involve removed nodes or irrelevant processes. Based on reverse filtering using 38 valid edges, it was confirmed that all 34 nodes have at least one incoming or outgoing edge, eliminating the need for further elimination. The 34 node attributes (each node occupying 128 bytes, including ID, timestamp, material slice pointer, etc.) and 38 edge attributes (each edge occupying 64 bytes, including source / target index, weight floating-point number, and flag bit) are encapsulated into a hierarchical data structure. The total size of the node attribute block is 4352 bytes, and the total size of the edge attribute block is 2432 bytes, totaling 6784 bytes. Compared to unoptimized loose object storage (estimated to occupy more than 20KB), memory usage is significantly reduced. This simplified causal subgraph data structure is directly input into the reverse aggregation module of step S4, reducing the number of traversals for upstream raw material slice retrieval from thousands across the entire graph to a local traversal of only 34 nodes. The traceability response time is shortened from seconds to milliseconds, significantly improving the system's high availability under concurrent traceability requests.
[0147] like Figure 3 As shown, step S4: Based on the material slice identifiers of each node in the simplified causal subgraph, all upstream raw material slices are back-aggregated, and the contribution factor of each raw material slice to the current quality data is calculated using time proximity and process coupling degree as weighting parameters, generating a multi-dimensional dynamic binding result. Specifically, this includes: S4.1: Parse the material slice identifiers carried by each process instance node in the simplified cause-effect subgraph to extract the target material slice set directly associated with the current quality observation point, and input the target material slice set as the starting anchor point for reverse tracing to the upstream link retrieval module.
[0148] The system receives a simplified causal subgraph data structure output from step S3. This structure contains a set of process instance nodes highly correlated with specific quality observation point types and their associated directed causal edges. A depth-first traversal is performed on each process instance node in the simplified causal subgraph, reading the material slice identifier field encapsulated in the node metadata. The material slice identifier uses a standardized string format, consisting of the raw material batch code, physical segment number, and logical usage stage code. For example, 'RAW-A20240501-001#S1' indicates the first-use slice of the first batch of raw material A. The parsing engine uses a regular expression matching algorithm to extract the batch number prefix and slice sequence number suffix from the identifier, separating the raw material source information from the specific usage segment information.
[0149] For the extracted material slice identifiers, a semantic integrity check is performed to confirm that the identifiers conform to the predefined naming conventions and are not empty values. If an identifier format error or missing information is detected, an exception handling mechanism is triggered, which retrieves the original event snapshot from the time-series database to complete the missing material context information.
[0150] The verified material slice identifiers are mapped to internally unique numerical index IDs, establishing a fast lookup table from string identifiers to memory address pointers. Based on the correlation strength between the quality observation point type and the process instance, key process nodes directly involved in the generation of the current quality inspection action are selected. For example, for traceability of excessive microbial levels, the process nodes corresponding to filling, sealing, and cleanroom environmental monitoring are extracted as the focus.
[0151] Extract the material slice identifiers consumed at the input of these key process nodes to form an initial candidate set of target material slices. Deduplicate the material slice identifiers in the candidate set, merging duplicate records of the same raw material batch referenced multiple times in the same process, ensuring that each material slice retains only a unique instance in the candidate set.
[0152] By combining the edge weight information in the simplified causal subgraph, the direct causal correlation between each target material slice and the current quality observation point is evaluated. Weakly correlated material slices with a correlation below a preset threshold (e.g., 0.1) are removed, and strongly correlated slices are retained as the core traceability objects.
[0153] The target material slice set, after filtering, deduplication, and correlation evaluation, is encapsulated into a standardized data structure object. This object contains the material slice ID, the process instance ID to which it belongs, the input timestamp, and the initial correlation weight fields.
[0154] Through the above-mentioned parsing, verification, mapping, filtering and encapsulation processes, the simplified cause-effect graph obtained in the previous step is transformed into a set of target material slices with clear traceability, which is then used as the starting anchor point for reverse traceability and input into the upstream link retrieval module. This enables precise positioning from macroscopic quality anomalies to microscopic material sources, laying a data foundation for the subsequent construction of a complete raw material traceability path tree.
[0155] For example, in the filling process of a cosmetic emulsion production line, the system detected that the total number of microorganisms exceeded the standard limit, triggering a quality traceability request. A simplified cause-effect graph has been used to filter out the filling node (ID:PROC-FILL-20240501-08:30:00), the capping node (ID:PROC-CAP-20240501-08:35:00), and the cleanroom air monitoring node (ID:ENV-AIR-20240501-08:00:00). The parsing engine reads the material slice identifier of the filling node as 'BULK-EMUL-20240501-B03#S2' (the second-use slice of emulsified semi-finished product batch B03) and 'PKG-BOTTLE-20240501-K01#S5' (the fifth-use slice of packaging bottle batch K01). The material slice identifier for the capping node is read as 'PKG-CAP-20240501-L02#S1' (the first-time use slice of the L02 batch of packaging caps). The environmental monitoring node shows no direct material input, but related environmental parameter data exists. Regular expression parsing extracts three main material slices: 'BULK-EMUL-20240501-B03#S2', 'PKG-BOTTLE-20240501-K01#S5', and 'PKG-CAP-20240501-L02#S1'. Semantic validation confirms all identifier formats are valid. The mapping engine converts these three string identifiers into internal index IDs: 1024, 2048, and 3072. Based on causal edge weights, the association weight between the filling node and microbiological indicators is 0.85, the capping node is 0.60, and the environmental node is 0.75. Since material slices directly participate in product composition, the direct material association threshold is set to 0.5. The initial association weights of the three material slices were all higher than the threshold, so they were all retained. After deduplication, the candidate set still contained these three unique slices. The final generated target material slice set object contained three records: {ID:1024,Type:'BULK',Weight:0.85}, {ID:2048,Type:'PKG',Weight:0.85}, and {ID:3072,Type:'PKG',Weight:0.60}. This set served as the starting anchor point, clearly identifying the specific material object to be traced upstream, avoiding invalid traversal of all materials, and significantly improving traceability efficiency.
[0156] S4.2: Based on the starting anchor point, perform a reverse topology traversal operation in the memory-resident directed acyclic event graph to identify and aggregate all upstream raw material slice paths pointing to the target material slice, thereby constructing a raw material traceability path tree containing complete parent-child inheritance relationships.
[0157] The set of target material slices obtained from the previous step S4.1 is received as the starting anchor point for reverse tracing. This set contains one or more material slice identifiers directly associated with the current quality observation point. In the index structure of the memory-resident directed acyclic event graph (DAG), the node object that completely matches the identifier in the starting anchor point is located, and the list of incoming edge pointers stored in the node is extracted as the initial search space for reverse traversal.
[0158] Traverse the list of incoming edge pointers, visiting each predecessor process instance node pointing to the current node one by one, and reading the metadata information of the predecessor node, including the node ID, trigger timestamp, process type code, and the material slice identifier associated with the predecessor node itself. Determine whether the predecessor node is a process instance of the raw material input type. If so, mark the predecessor node as a leaf node of the raw material traceability path tree, and record its material slice identifier as an upstream raw material slice candidate.
[0159] If the predecessor node is an intermediate process instance that is not a raw material input type, it is added to the processing queue, and a directed parent-child connection is established from the current node to the predecessor node. This connection is stored in a temporarily constructed raw material traceability path tree structure. For each intermediate process node in the processing queue, the incoming edge pointer extraction and predecessor node access operations are repeatedly executed, recursively expanding the search range upstream until all branches are traced back to the leaf node of the raw material input type or the graph boundary is reached.
[0160] During the recursive traversal, the splitting and merging logic of material slices is detected and processed. When a predecessor node corresponds to multiple upstream material slice inputs (such as in a mixing process), the predecessor node is treated as a convergence point, and the traceability paths of all its input material slices are traced, generating corresponding branch structures in the path tree. When an upstream material slice is split for multiple downstream processes (such as in a packaging process), based on the principle of temporal proximity, the traceability path branch with the shortest time interval to the current quality inspection action is preferentially retained, or all relevant branches are recorded through bitmap marking for subsequent weight calculation.
[0161] The constructed raw material traceability path tree is subjected to loop detection and pruning optimization. Since the underlying data structure is a directed acyclic graph, there are theoretically no loops, but invalid backtracking paths caused by data anomalies need to be excluded. Isolated node branches in the path tree that cannot connect to any known raw material batch library are removed to ensure that every path in the path tree from the root node (the slice associated with the current quality observation point) to the leaf node (the upstream raw material slice) is a valid physical production flow link.
[0162] Through the above-mentioned reverse topology traversal and path tree construction process, the target material slices determined in the previous step are transformed into structured raw material traceability path tree data containing complete parent-child inheritance relationships. This achieves accurate mapping from a single quality observation point to all upstream raw material slices, providing a complete topological foundation and data context for subsequent contribution factor calculation based on temporal proximity and process coupling.
[0163] For example, taking the traceability scenario of excessive microorganisms after a batch of moisturizing lotion is filled as an example, the target material slice identifier output by S4.1 is 'PKG-B20240501-003#S2' (indicating the second use slice of the third batch of B packaging material). The system locates this node in the memory DAG and finds that its incoming edges point to two predecessor nodes: 'FILL-20240501-L2-005' (filling process example 5) and 'CLEN-20240501-L2-004' (cleaning process example 4).
[0164] First, visit the node 'FILL-20240501-L2-005' and read its incoming edges. We find that its input material slice is 'EMUL-20240501-001#S1' (emulsion slice 1). Continuing to trace 'EMUL-20240501-001#S1', its predecessor node is 'MIX-20240501-L1-002' (mixing process example 2). 'MIX-20240501-L1-002' has two input material slices: 'RAW-A20240501-001#S1' (raw material A slice 1) and 'RAW-C20240501-002#S1' (raw material C slice 2). Both slices point to the raw material inbound node, confirming them as leaf nodes.
[0165] Meanwhile, accessing the node 'CLEN-20240501-L2-004' reveals that its associated material is 'DIS-INF-20240501-001#S1' (disinfectant slice 1), which directly points to the raw material node, confirming it as a leaf node.
[0166] The constructed raw material traceability path tree contains three main branches: First, 'PKG-B20240501-003#S2'←'FILL-20240501-L2-005'←'EMUL-20240501-001#S1'←'MIX-20240501-L1-002'←'RAW-A20240501-001#S1'; Second, 'PKG-B20240501-003#S2'←'F ILL-20240501-L2-005'←'EMUL-20240501-001#S1'←'MIX-20240501-L1-002'←'RAW-C20240501-0 02#S1'; third, 'PKG-B20240501-003#S2'←'CLEN-20240501-L2-004'←'DIS-INF-20240501-001#S1'.
[0167] During this process, the system records the timestamp differences and edge type metadata between each node. For example, the time interval from 'MIX' to 'EMUL' is 30 minutes, and the edge type is 'ProcessTransfer'; the time interval from 'CLEN' to 'FILL' is 15 minutes, and the edge type is 'EnvironmentControl'. The final output raw material traceability path tree clearly shows the potential raw material sources (raw material A, raw material C, disinfectant) that led to the current abnormal microbiological indicators and the process steps they passed through, eliminating interference from irrelevant process nodes and significantly improving the targeting and efficiency of traceability.
[0168] S4.3: Normalize the timestamp difference between adjacent nodes in the raw material traceability path tree to quantify the temporal proximity coefficient of each upstream raw material slice relative to the current quality inspection action, and output the temporal proximity coefficient as the dynamic weight factor of the first dimension.
[0169] S4.4: Use the preset edge type metadata in the raw material traceability path tree to call the historical quality deviation regression analysis model to calculate the process coupling strength value of each process link to the final quality result, and output the process coupling strength value as the dynamic weight factor of the second dimension.
[0170] The edge type metadata of each process node in the raw material traceability path tree is obtained. This edge type metadata represents the logical connection attributes of preceding process instances on subsequent process instances in terms of physical flow or technological impact, including four basic types: material transfer, energy exchange, environmental intervention, and parameter control. Semantic mapping processing is performed on the edge type metadata, converting it into feature encoding vectors recognizable by the historical quality deviation regression analysis model. Material transfer types are mapped to a high linear correlation coefficient benchmark value, and environmental intervention types are mapped to a nonlinear coupling coefficient benchmark value, thus establishing the baseline weights of different process steps on the final quality result.
[0171] A pre-built historical quality deviation regression analysis model is invoked. This model is constructed based on massive historical production data and stores a set of multivariate nonlinear regression parameters for different types of quality observation points (such as pH value, viscosity, and microbial count). The parameter set contains a quantitative mapping relationship between the fluctuation of process parameters and the deviation of quality indicators in each process step. The historical process parameter fluctuation data of the corresponding process instance in the simplified causal subgraph are used as input variables and input into the historical quality deviation regression analysis model. Multidimensional feature matching operation is performed to activate the regression submodel that is most suitable for the current traceability scenario.
[0172] Using the activated regression sub-model, a weighted regression prediction operation is performed on the input historical process parameter fluctuation data to calculate the measured influence strength of each upstream process step on the quality result corresponding to the current quality inspection action. During the calculation, for process nodes involving multivariate coupling, the ridge regression algorithm is used to eliminate multicollinearity interference, ensuring the stability and uniqueness of the process coupling strength value. The process coupling strength value of the i-th upstream process step on the current quality result is calculated using the following formula: in, Indicates the first The process coupling strength value of each upstream process link ranges from 0 to 1; This indicates that in the historical quality deviation regression analysis model, the first... Transposed vector of regression coefficients obtained from training each process step; Indicates the first The standardized process parameter fluctuation vector of each process step under the same historical working conditions; Indicates the first The bias term for each process step; e represents the natural constant. This sigmoid function form ensures the smoothness of the output value and boundary constraints, avoiding interference from extreme values in subsequent weighted fusion.
[0173] The calculated process coupling strength values of each upstream process step are normalized to eliminate the influence of differences in dimensions and orders of magnitude on weight allocation. The Min-Max normalization method is used to map the original process coupling strength values to the [0,1] interval, generating standardized second-dimensional dynamic weight factors. The normalization process linearly scales the values based on the maximum and minimum coupling strength values of all upstream process steps in the current simplified causal subgraph, ensuring the comparability of each weight factor on a relative scale.
[0174] The standardized second-dimensional dynamic weighting factor is associated and bound with the corresponding upstream raw material slice identifier to form weighted traceability path node data carrying the process coupling strength attribute. Through the above processing method, the raw material traceability path tree constructed in the previous step is transformed into a multi-dimensional weighted data structure containing the quantitative process influence strength. This achieves a technical leap from static topology to dynamic process coupling measurement, providing a second-dimensional weighting basis that reflects the real production mechanism for the accurate calculation of subsequent comprehensive contribution factors.
[0175] For example, in a traceability scenario addressing the issue of excessive microbial levels in a batch of whitening essence after bottling, the system has constructed a raw material traceability path tree encompassing three main process nodes: emulsification, cooling, and bottling. For the emulsification node, its edge type is "material transfer + energy exchange," and the historical process parameter fluctuation vector X_1 includes temperature fluctuations of ±0.5℃ and stirring speed fluctuations of ±2rpm. The regression coefficient vector β1, determined through model matching, is [0.8, 0.3]. T The bias term b1 is -0.2.
[0176] Substituting into the formula, the exponential value is -(0.8 + 0.5 + 0.32 - 0.2) = -0.8, e -0.8 The process coupling strength value of the emulsification node is approximately 0.449, therefore, the process coupling strength value CS1 of the emulsification node is 1 / (1+0.449)≈0.69. For the cooling node, its edge type is "environmental intervention", the historical process parameter fluctuation vector X2 includes cooling water temperature fluctuation ±1℃, and the regression coefficient vector β2 is [0.5]. T The bias term b2 is -0.1.
[0177] Substituting into the formula, the exponential value is -(0.51-0.1)=-0.4, e -0.4 The process coupling strength value of the cooling node is approximately 0.670, so the process coupling strength value CS2 = 1 / (1+0.670) ≈ 0.60. For the filling node, its edge type is "contact surface material", the historical process parameter fluctuation vector X3 includes the pipeline cleaning time deviation -5min, and the regression coefficient vector β3 is [1.2]. T The bias term b3 is 0.1.
[0178] Substituting into the formula, the exponential value is -(1.2(-5 / 60)+0.1)≈-(-0.1+0.1)=0, e 0 =1, then the process coupling strength value of the filling node CS3 = 1 / (1+1) = 0.50. The maximum coupling strength value in the current subgraph is 0.69, and the minimum is 0.50. Normalize CS1: (0.69-0.50) / (0.69-0.50) = 1.0; normalize CS2: (0.60-0.50) / (0.69-0.50) ≈ 0.53; normalize CS3: (0.50-0.50) / (0.69-0.50) = 0.0. Finally, the dynamic weight factor of the second dimension of the emulsification node is 1.0, the cooling node is 0.53, and the filling node is 0.0. The results objectively reflect that, under specific microbial contamination scenarios, the impact of hygiene control and material mixing uniformity during the emulsification process on the final quality is significantly higher than that of the cooling process alone. The filling process, due to its smaller cleaning time deviation and lack of direct contamination source, has the lowest coupling strength as determined by the model, thus significantly improving the discriminative power and accuracy of traceability weights.
[0179] S4.5: Perform weighted fusion operation based on time proximity coefficient and process coupling strength value to calculate the comprehensive contribution factor of each upstream raw material slice to the current quality data, and generate a multi-dimensional dynamic binding result list sorted by priority according to the comprehensive contribution factor.
[0180] The temporal proximity coefficient and process coupling strength value output from the preceding steps are obtained as the basic input parameters for calculating the comprehensive contribution factor of upstream raw material slices. For each upstream raw material slice node on the traceability path in the simplified causal subgraph, its corresponding temporal proximity coefficient is extracted. This coefficient represents the temporal closeness between the raw material input time and the current quality anomaly detection time; the closer the value is to 1, the stronger the temporal correlation. Simultaneously, the process coupling strength values of all process edges on the path from the raw material slice node to the current quality observation point are extracted. This value reflects the theoretical influence weight of a specific process step on the final quality indicator. A nonlinear weighted fusion algorithm is used to construct a comprehensive contribution factor calculation model to eliminate the bias of single-dimensional weights in complex production scenarios. Specifically, the temporal proximity coefficient is set as the first-dimensional weight component, and the process coupling strength value is set as the second-dimensional weight component. An adjustment factor is introduced to balance the difference in dimensions and the proportion of importance between the two. The comprehensive contribution factor of each upstream raw material slice is calculated using the following formula: in, Indicates the first The comprehensive contribution factor of each upstream raw material slice; Indicates the first The time proximity coefficient of each upstream raw material slice, with a value ranging from 0 to 1; Indicates the first The cumulative value of the process coupling strength of each upstream raw material slice path, with a value range from 0 to 1; This is the time proximity adjustment coefficient, used to control the sensitivity of the influence of time factors on the contribution factors; This is the process coupling adjustment coefficient, used to control the sensitivity of the process logic to the influence of the contribution factor; The base of the natural logarithm is denoted as . This sigmoid activation function maps the linear weighted sum to the interval between 0 and 1, effectively suppressing extreme value interference while maintaining gradient smoothness to facilitate subsequent feedback optimization. The calculated comprehensive contribution factor is normalized to ensure that the sum of the contribution factors of all candidate raw material slices under the same traceability request is 1, thus forming a responsibility attribution metric in the form of a probability distribution.
[0181] Based on the normalized comprehensive contribution factor values, upstream raw material slices are sorted in descending order to generate a multi-dimensional dynamic binding result list. Each entry in the list includes the raw material slice identifier, its original batch number, comprehensive contribution factor value, a summary of the main influencing process paths, and a confidence level label. Raw material slices with a comprehensive contribution factor exceeding a preset high confidence threshold (e.g., 0.8) are marked as "suspected core cause" and directly associated with the first position in the quality traceability report; raw material slices with contribution factors between the medium and low thresholds are marked as "potential related factors" and arranged in descending order of contribution. Through the above weighted fusion calculation, the dispersed time and process dimension indicators of the previous step are transformed into comprehensive contribution factor data with unified dimensions, achieving quantitative sorting and priority allocation of complex multi-source raw material traceability results, significantly improving the accuracy of quality traceability and the efficiency of decision support.
[0182] Step S5: Store lightweight event snapshots in a columnar structure in the time-series database, and optimize the storage of metadata for the memory-resident directed acyclic event graph using a bitmap index compression strategy. This generates low-memory-consumption hierarchical compressed graph data to reduce memory usage and achieve associated storage and fast indexing of quality traceability data. Specifically, this includes: S5.1: Obtain a lightweight event snapshot set containing trigger timestamps, process instance IDs, material slice identifiers, and quality observation point types. Based on the columnar storage encoding algorithm, perform dictionary encoding and run-length compression on fields of the same type in the lightweight event snapshot set to generate columnar storage data blocks with high compression ratios.
[0183] It should be noted that associated storage refers to establishing a mapping relationship between lightweight event snapshots and the metadata of the memory-resident directed acyclic event graph based on material slice identifiers and process instance IDs. This enables the corresponding lightweight event snapshot data to be quickly located through the node ID or material slice identifier in the metadata during quality traceability queries, thereby achieving associated storage and fast retrieval between data.
[0184] A lightweight event snapshot set containing trigger timestamps, process instance IDs, material slice identifiers, and quality observation point types is obtained as the raw input data source for columnar storage processing. Field separation is performed on the lightweight event snapshot set, decomposing unstructured single data objects into independent attribute columns divided by semantic dimensions, including timestamp, ID, identifier, and type columns, forming a columnar data matrix to be compressed. For the millisecond-level numerical sequences in the timestamp column exhibiting monotonically increasing characteristics, a differential encoding algorithm is used to calculate the time increment value between adjacent records, converting absolute time into relative time difference to significantly reduce the bit width requirement of the numerical values. A run-length encoding (RLE) strategy is applied to the differential time increment sequence to identify and merge consecutively occurring identical increment values or zero-value intervals, generating a compact data stream composed of 'value-repetition count' pairs, eliminating redundant fluctuation information in the time series data. For the high-repetition-rate string features contained in the process instance ID and material slice identifier columns, a global dictionary mapping table is constructed, replacing long text identifiers with short integer index keys, achieving space compression based on dictionary encoding, and significantly reducing character storage overhead.
[0185] For enumerated data with a limited range of values in the quality observation point type column, a bit vector encoding method is adopted to map each observation point type to a fixed-length binary bit pattern. This leverages bitwise operations to achieve high-density storage, avoiding memory fragmentation caused by traditional string storage. The attribute column data blocks, after differential compression, run-length encoding, dictionary mapping, and bit vector encoding, are physically aligned and encapsulated with metadata according to a columnar storage format. Column offset pointers and data type descriptors are added to generate columnar storage data blocks with high compression ratios.
[0186] Through the above multi-dimensional columnar encoding and compression processing methods, the lightweight event snapshot set generated in the previous step is transformed into columnar storage data blocks with high compression ratio, realizing low-occupancy and high-efficiency storage of massive production traceability data in the time series database, and providing basic data support for the rapid indexing of subsequent graph metadata.
[0187] For example, columnar storage processing is performed on 10,000 lightweight event snapshots generated during a single shift on a cosmetics production line. First, each snapshot is split into four independent columns: timestamp, process instance ID, material slice identifier, and quality observation point type. For the timestamp column, the original data is a 13-bit millisecond integer. After differential encoding, since detection actions are typically triggered at a fixed frequency or small intervals, most adjacent time differences are concentrated between 50ms and 200ms, reducing the numerical range to 8-bit integers. Then, run-length encoding is applied. If the production line is in a stable operating state, the time interval between 100 consecutive sampling points is 100ms. The original 100 13-bit integers are compressed into a single '100-100' tuple, reducing storage space by over 90%. For the process instance ID column, such as strings like 'LINE-A-SHIFT1-EMUL-001', there are only about 50 different process combinations in the full dataset. A global dictionary containing 50 entries is constructed, mapping each ID to a short integer index from 1 to 50. The original 25-byte string is compressed to a 2-byte integer, achieving a compression ratio of 12.5:1. The material slice identifier column is similarly compressed, mapping complex identifiers such as 'RAW-A20240501-001#S1' to a 4-byte integer index using dictionary encoding. For the quality observation point type column, eight standard observation points, including pH, viscosity, and microorganisms, are preset and encoded using 3-bit binary bit vectors, saving significant space compared to storing ASCII strings. Finally, the compressed data blocks of each column are integrated, and column header metadata is added. The total size of the generated columnar storage data block is only about 1 / 15 of the original JSON format snapshot data, significantly reducing the disk I / O pressure and memory usage of the time-series database while maintaining the ability to perform fast scanning and aggregation queries based on columns.
[0188] S5.2: Read the node ID sequence and edge type identifier from the columnar storage data block with high compression ratio, construct the node-edge associated bitmap vector based on the sparse matrix mapping rule, and generate the original bitmap index sequence representing the topology of the memory-resident directed acyclic event graph.
[0189] The high-compression columnar storage data block generated in step S5.1 is read, and the node ID sequence and edge type identifier field are extracted as the basic input data for constructing the topology index. A globally unique mapping process is performed on the extracted node ID sequence to establish a hash mapping table from logical process instance IDs to a continuous integer index space, ensuring memory continuity for subsequent bitmap operations. Based on the directed acyclic nature of the cosmetics production process, the row dimension of the sparse matrix is defined as the source process node index, and the column dimension as the target process node index, initializing an all-zero sparse matrix structure. The edge type identifier set is traversed to identify the source node ID and target node ID corresponding to each causal edge, and these are converted into row and column coordinates in the sparse matrix using the hash mapping table. A Boolean value of 1 is placed at the corresponding coordinate position in the sparse matrix, representing a direct causal support relationship between the source node and the target node; other unconnected node pairs remain in a Boolean state of 0. The filled sparse matrix is flattened in row-major order and converted into a one-dimensional binary bitstream sequence, where each bit represents a potential node connection state. Run-length encoding preprocessing is performed on the one-dimensional binary bitstream sequence to count the lengths of consecutive 0s or 1s, generating preliminary bitmap compression fragments to reduce storage redundancy caused by sparse connections. The bitmap compression fragments of all process instance nodes are integrated and assembled into a complete original bitmap index sequence arranged in ascending order of node IDs. This sequence fully represents the static topological connection structure of the memory-resident directed acyclic event graph. Through the above sparse matrix mapping and bitmap serialization processing, the columnar storage data from the previous step is transformed into an original bitmap index sequence with fast topological lookup capabilities, achieving the expected technical effects of efficient compression and low memory consumption of graph structure data.
[0190] For example, considering 5000 lightweight event snapshots generated daily by a cosmetics production line, the columnar storage data block is first parsed to extract 5000 unique process instance IDs (e.g., Emul_001, Homo_002, etc.) and 4800 causal edge records. A hash mapping table is established to map the 5000 string-type process instance IDs to consecutive integer indices from 0 to 4999; for example, Emul_001 is mapped to 0, and Homo_002 to 1. A 5000×5000 sparse matrix is initialized with all initial values of 0. The 4800 edge records are then traversed, and for each edge...<Emul_001,Homo_002> Set 1 at the 0th row and 1st column position of the sparse matrix; for the edge<Homo_002,Fill_003> The value in the first row and second column is set to 1. Due to the highly sparse connection of cosmetic production processes (each node connects to only 2-3 subsequent nodes on average), the vast majority of elements in the matrix are 0. The 5000×5000 sparse matrix is expanded row-wise into a one-dimensional binary bitstream of length 25,000,000. Run-length encoding is performed on this bitstream; for example, 4998 consecutive 0s are encoded as (0,4998), and subsequent 1s are encoded as (1,1). The final generated original bitmap index sequence is only 1 / 50 the size of the traditional adjacency matrix storage method, and supports fast determination of whether there is a direct causal connection between any two processes through bit operations, significantly improving the efficiency of subsequent subgraph projection retrieval.
[0191] S5.3: Receive the original bitmap index sequence and the corresponding weight values and projection label information, and use the Robinhood hash bucketing strategy to discretize and fragment the original bitmap index sequence to generate a metadata fragment index set with fast positioning capability.
[0192] Receive the original bitmap index sequence generated in step S5.2. This sequence represents the topological association between node IDs and edge types in the memory-resident directed acyclic event graph in the form of a sparse matrix. At the same time, obtain the corresponding set of edge weight values and Boolean projection label information set as the input data source for discretization and piecewise processing.
[0193] An open addressable hash table structure based on the Robin Hood Hashing algorithm is constructed. The initial capacity of the hash table is set to 1.5 times the number of non-zero elements in the original bitmap index sequence to reserve sufficient load factor space, reduce the probability of hash collisions, and ensure constant time complexity for subsequent query operations.
[0194] Define a composite key-value pair data structure, combining the node ID and edge type identifier in the original bitmap index as the primary key, and combining the corresponding weight value and projection label information as the load value to form the meta-information unit to be stored, ensuring the atomic binding of the topology structure and attribute data.
[0195] For each metadata unit to be inserted, calculate the hash value of its primary key and determine its position in the base bucket of the hash table. If the base bucket is empty, directly store the metadata unit to complete the first mapping.
[0196] If the reference bucket is already occupied, compare the "detection distance" between the current element to be inserted and the elements already stored in the bucket. The detection distance is defined as the absolute value of the offset between the actual storage location of the current element and the position of its reference bucket.
[0197] When the detection distance of the element to be inserted is greater than the detection distance of the element already stored in the bucket, a "hijacking" operation is performed. The element to be inserted is stored in the current bucket, and the element in the original bucket is squeezed out and used as a new element to continue searching for an empty bucket or performing the next hijacking judgment.
[0198] When the detection distance of the element to be inserted is less than or equal to the detection distance of the element already stored in the bucket, keep the elements in the bucket unchanged, move the element to be inserted to the next bucket position, and repeat the above comparison and insertion logic until an empty bucket is found or the hijacking exchange is completed.
[0199] By employing the Robin Hood hashing strategy described above, the probe distance distribution of all elements in the hash table tends to be uniform and minimized, avoiding the "primary clustering" phenomenon that occurs in traditional linear probing and significantly improving search efficiency under high load.
[0200] After all metadata units are inserted, the hash table is physically partitioned. Based on the high-order bits of the node ID, the hash table is divided into several fixed-size metadata partitions. Each partition contains a set of consecutive hash buckets and their stored metadata data.
[0201] An independent fragment index header is generated for each metadata fragment, recording the starting node ID range of the fragment, the number of valid elements within the fragment, and the maximum detection distance threshold, forming a metadata fragment index set with fast positioning capabilities.
[0202] By using the Robin Hood hash bucketing strategy to discretize and fragment the original bitmap index sequence, the globally complex graph metadata is transformed into a locally ordered, low-collision fragmented index structure, achieving millisecond-level random access response and solving the problems of memory fragmentation and query latency in large-scale event graph retrieval.
[0203] For example, in a traceability scenario for a cosmetic emulsification production line, suppose 10,000 lightweight event snapshots are generated during a certain batch of production. The corresponding directed acyclic event graph contains 10,000 nodes and 15,000 causal edges. The original bitmap index sequence contains 15,000 non-zero elements. The initial capacity of the hash table is set to 22,500 (15,000 * 1.5). For one edge representing "Emulsification Process Instance ID: EM-20240501-001" pointing to "Homogenization Process Instance ID: HM-20240501-002", its primary key is the node ID.<EM-20240501-001,HM-20240501-002> The hash table is structured with a weight of 0.92 and a projection label {microorganism: true, pH: false}. The primary key hash value yields a base bucket index of 1024. If bucket 1024 is already occupied and its elements have a probe distance of 2, and the current element has already moved to bucket 1026 (probe distance 2) due to a previous collision, a comparison shows that their probe distances are equal, so the current element is moved to bucket 1027 to continue trying. If bucket 1027 is empty, the element is stored. After full insertion, the average probe distance of all elements is controlled within 1.5. Subsequently, the hash table is divided into 256 shards based on the first 8 bits of the node ID, with each shard holding an average of approximately 88 metadata units. The generated metadata shard index set contains 256 index headers, each recording the corresponding node ID range (e.g., shard 0 corresponds to the ID prefix 0x00, shard 1 corresponds to 0x01, etc.). When it is necessary to query the associated edge of a specific process, the system first locates the specific shard based on the node ID prefix and probes only in the local hash table of that shard. Compared with a full table scan, the query time is reduced from microseconds to nanoseconds, which significantly improves the response speed of the real-time traceability system. In terms of memory usage, the storage density of metadata is increased by about 40% due to the elimination of traditional pointer overhead.
[0204] S5.4: Traverse the data of each fragment in the metadata fragment index set, and perform incremental calculation processing on the node ID offset and weight change between adjacent fragments based on differential coding technology to generate an incremental metadata stream that retains only the difference information.
[0205] The process iterates through the data in each shard of the metadata shard index set, and performs incremental calculations on the node ID offsets and weight changes between adjacent shards based on differential coding technology to generate an incremental metadata stream that retains only the differences. This sub-step is located in the core compression stage of the storage optimization layer, aiming to eliminate spatial and numerical redundancy in the graph metadata. By extracting local change features to replace the full data storage, it significantly reduces the write load and memory usage of the persistent media.
[0206] Read the metadata fragment index set with fast positioning capability generated in the previous step, and load two adjacent fragment data blocks in sequence as the base unit and target unit for differential calculation according to the physical storage order or logical timestamp sequence of the Robin Hood hash bucket, thus establishing a sliding window traversal mechanism.
[0207] For the baseline and target segments within the current traversal window, extract the sequence of process instance node IDs contained therein. Subtract the ID value of the corresponding position or nearest neighbor node in the baseline segment from the node ID value in the target segment to calculate the differential offset of the node ID. Map the absolute value to the relative displacement to eliminate the high-bit zero-filling redundancy caused by the globally unique identifier.
[0208] Simultaneously extract the weight values and projection marker bits of the associated edges in the reference and target slices. Perform run-length encoding preprocessing on the projection marker bits that remain unchanged between consecutive slices. Perform floating-point difference operation on the weight values that change to generate the weight change delta_weight, which quantifies the fine-tuning amplitude of the process coupling strength.
[0209] The ZigZag encoding algorithm is used to perform unsigned integer mapping on the calculated node ID differential offset and weight change. The difference with positive and negative signs is converted into a non-negative integer sequence, ensuring that the smaller integer value corresponding to small fluctuations occupies fewer bits in the binary representation, thus optimizing the efficiency of subsequent variable-length encoding.
[0210] Based on the Varint (variable length integer) compression protocol, the differential offset and weight change sequence after ZigZag mapping is converted into a byte stream. Small absolute values of the difference are allocated with single-byte storage, while large absolute values of the difference are dynamically extended in byte length, achieving extreme compression of high-frequency, small-fluctuation data.
[0211] The compressed node ID differential byte stream, weight change byte stream, and run-length encoding results of the projection flag are structurally concatenated, and fragment boundary identifiers and checksum fields are added to encapsulate them into independent incremental metadata record units, thus completing the data processing of a single traversal window.
[0212] The window is continuously slid through to the next adjacent shard pair, and the above differential calculation, symbol mapping, variable length encoding and encapsulation operations are repeated until all shard data in the metadata shard index set is covered, and all incremental metadata record units are aggregated to form a continuous incremental metadata stream.
[0213] By combining differential coding with variable-length compression, the discrete and redundant metadata fragment index set from the previous step is transformed into a compact incremental metadata stream. This achieves lossless high-rate compression of the graph topology and attribute weights, providing a low-volume, high-throughput data foundation for subsequent hierarchical and packaged storage, and effectively solving the problem of increased data storage complexity during dynamic binding.
[0214] S5.5: Integrates columnar storage data blocks with high compression ratios and incremental metadata streams, and uses a hierarchical packaging protocol to physically isolate and encapsulate full static data and dynamic incremental data to generate the final low-memory-occupancy hierarchical compressed map data and write it to persistent storage media.
[0215] In a preferred embodiment, the method according to the present invention further includes: Three types of quantitative features are extracted from manual confirmation or rejection operations to construct reward signals for reinforcement learning. First, confirmation or rejection instructions from the manual review terminal are parsed to generate original records of manual intervention carrying operational intent identifiers. Based on these records, the corresponding multi-dimensional dynamic binding results and simplified causal subgraphs are retrieved. The difference between the system-predicted process timestamps and the actual production log timestamps is calculated, and a weighted aggregation (based on the causal distance between nodes and quality observation points and edge weights) is used to obtain a comprehensive time offset, reflecting the timing alignment accuracy. Second, the system-recommended raw material slice set is compared with the manually identified raw material slice set. The matching deviation is calculated using the Jaccard similarity coefficient. Further analysis is conducted on the average confidence loss of falsely reported slices (system-recommended but manually rejected) and the potential correlation strength of falsely reported slices (manually identified but not recommended by the system), generating a material slice matching deviation index. Third, based on the inverse topology of the simplified causal subgraph, the number of non-continuous process jumps occurring during the tracing from the quality observation point to the source raw material slice is statistically analyzed. This is normalized using the time offset to obtain a statistical value of the number of process instance jumps, reflecting the process logic coherence. Finally, the three features—time offset, material slice matching deviation, and number of process instance jumps—are vectorized using a multi-dimensional feature weighted fusion algorithm to generate a standardized binding confidence feedback signal, which serves as the reward input for subsequent reinforcement learning.
[0216] Using the bound confidence feedback signal as a reward, this study iteratively optimizes the edge weight decay coefficients and the dimension sensitivity threshold of the subgraph projector in a memory-resident directed acyclic event graph. First, the feedback signal is scalarized into an immediate reward value. Combined with historical edge weight data in the current event graph, a temporal difference error algorithm is used to calculate the deviation between the immediate reward and the expected reward, yielding a gradient update direction vector. This vector indicates the adjustment direction (increase or decrease) of each directed edge weight. Second, an adaptive step-size decay strategy is introduced. Based on the consistency of the gradient direction of each edge in recent iterations, an independent learning rate is dynamically calculated. Simultaneously, the strength of causal support relationships is used as a regularization constraint—a smaller decay is applied to strongly correlated edges to maintain stability, while a larger decay is applied to weakly correlated edges to accelerate pruning. A new set of weight decay coefficients for each edge is generated through weighted fusion. Next, based on the new edge weight decay coefficients and the distribution characteristics of historical quality observation points, multidimensional sensitivity analysis is performed to calculate the information gain rate and frequency weight of different quality indicator dimensions (such as microorganisms, viscosity, and color), obtaining the sensitivity score for each dimension. Based on this, the filtering boundary thresholds for the corresponding dimensions in the subgraph projector are dynamically adjusted: the threshold is relaxed for high-sensitivity dimensions to expand recall, and the threshold is tightened for low-sensitivity dimensions to suppress noise. Finally, the updated set of edge weight decay coefficients and the set of dimension sensitivity threshold parameters are encapsulated into a structured configuration object, generating optimized dynamically bound model parameters that can be called subsequently.
[0217] By replacing the original configuration with optimized model parameters, the entire process from snapshot generation to binding result output is re-executed when subsequent quality checks are triggered, achieving adaptive accuracy improvement. First, based on the time offset, matching bias, and number of jumps in the binding confidence feedback signal generated in the previous round of reinforcement learning, gradient descent is performed to update the edge weight decay coefficients, generating updated decay coefficients with time-sensitive correction capabilities. Second, using this updated coefficient as a constraint, combined with the historical dimension-sensitive threshold benchmark value of the subgraph projector, a random search algorithm is used to optimize in the global solution space: by simulating projection to calculate the critical link retention rate and irrelevant node redundancy rate under the candidate threshold, a comprehensive fitness score is constructed, and the optimal dimension-sensitive threshold parameters are obtained through iterative convergence. Third, the optimized threshold parameters and the updated decay coefficients are used to construct a new set of dynamic binding model parameters. Atomic replacement operations (such as file renaming or pointer swapping) are used to hot reload the original configuration file in the runtime environment, generating a real-time dynamic binding model instance loaded with the latest adaptive strategy, ensuring zero downtime during configuration switching. Subsequently, newly triggered quality inspection action signals are monitored. Based on the updated decay coefficient in the real-time model instance, the causal correlation strength of the newly generated lightweight event snapshot is recalculated: using an exponential decay function and combining the time interval between the previous and current processes, the weight of each edge in the event graph is dynamically updated to form a dynamically updated event graph structure reflecting the latest process coupling relationships. Finally, based on this updated graph structure and calling the optimized dimension-sensitive threshold configured in the model instance, simplified causal subgraph projection and raw material slice reverse aggregation processing are performed on traceability requests of specific quality observation point types to generate a new round of multi-dimensional dynamic binding results with higher traceability accuracy and confidence, thus forming a closed-loop adaptive iteration.
[0218] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.
[0219] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the element or object preceding “comprising” or “including” encompasses the element or object listed following “comprising” or “including” and its equivalents, and do not exclude other elements or objects. The “multiple” mentioned in the embodiments of this application refers to two or more. A and / or B indicate three possibilities: A; B; and A and B.
[0220] The above description is merely an exemplary embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for linking, storing, and rapidly indexing quality traceability data for cosmetic production batches, characterized in that: include: Acquire quality inspection action signals triggered at each process node in the cosmetic production process, and generate lightweight event snapshots with contextual semantics based on NTP synchronization calibration time, dynamically generated process instance ID, material slice identifier, and standardized quality observation point type; The lightweight event snapshot is structured and parsed to extract temporal causal relationship features. Based on the regression analysis results of quality deviation under the same historical working conditions, a memory-resident directed acyclic event graph containing four types of meta-information, including node ID, edge type, weight, and projection label, is constructed. Receive traceability requests for specific quality observation point types, and automatically activate the corresponding subgraph projector according to the quality observation point type. Filter out process instance nodes and associated edges related to environmental control, disinfectant addition, and contact surface material from the memory-resident directed acyclic event graph to form a simplified causal subgraph. Based on the material slice identifiers of each node in the simplified causal subgraph, all upstream raw material slices are back-aggregated, and the contribution factor of each raw material slice to the current quality data is calculated using time proximity and process coupling degree as weighting parameters, generating multi-dimensional dynamic binding results. The lightweight event snapshots are stored in the time-series database in a columnar structure, and the metadata of the memory-resident directed acyclic event graph is optimized for storage using a bitmap index compression strategy to generate low-memory-occupancy hierarchical compressed data, thereby reducing memory usage and achieving associated storage and fast indexing of quality traceability data.
2. The method for quality traceability data association, storage, and rapid indexing for cosmetic production batches according to claim 1, characterized in that, Also includes: Obtain the confirmation or rejection operation signal of the multidimensional dynamic binding result by the human, and extract the time offset, material slice matching deviation and process instance jump number features from it to generate a binding confidence feedback signal for reinforcement learning training. Based on the binding confidence feedback signal as the reward input, the decay coefficient of the edge weights in the memory-resident directed acyclic event graph and the dimension sensitivity threshold of the subgraph projector are fine-tuned and updated to generate optimized dynamic binding model parameters. By replacing the original configuration with the optimized dynamic binding model parameters, the entire process of generating the lightweight event snapshot and outputting the multi-dimensional dynamic binding result is re-executed when subsequent quality inspection actions are triggered, thereby achieving adaptive iterative improvement in the binding accuracy between quality data and production batches.
3. The method for quality traceability data association, storage, and rapid indexing for cosmetic production batches according to claim 1, characterized in that, The lightweight event snapshot is structured and parsed to extract temporal causal relationship features. Based on the regression analysis results of quality deviation under historical working conditions, a memory-resident directed acyclic event graph containing four types of metadata: node ID, edge type, weight, and projection label is constructed, including: Obtain a lightweight event snapshot set carrying contextual semantics, and perform structured parsing on the trigger timestamp, process instance ID, material slice identifier and quality observation point type fields in the snapshot based on predefined event pattern matching rules to extract the original event feature vector sequence with temporal consistency; Using the temporal order of adjacent process instances and the inheritance relationship of material slices in the original event feature vector sequence, a directed causal edge derivation algorithm is executed to identify and establish logical connection relationships from the previous process instance node to the subsequent process instance node, and generate an initial set of directed edges. The regression analysis model for quality deviation under the same working condition stored in the historical database is invoked. The historical process parameter fluctuation data corresponding to each edge in the initial directed edge set is used as input variables to perform regression prediction calculation, so as to quantify the measured influence intensity of the preceding process on the subsequent quality result and generate an edge weight parameter set with numerical confidence. Based on the preset quality index dimension sensitivity threshold mapping table, attribute matching processing is performed on the quality observation point type associated with each edge in the initial directed edge set, Boolean projection flag bits are assigned for subsequent subgraph projection filtering, and an enhanced edge element information object containing dimension filtering attributes is generated. The enhanced edge information objects, which have been weighted and labeled, and the corresponding process instance node identifiers are integrated. The physical storage mapping relationship between nodes and edges is constructed using a memory pointer reference mechanism. This is then assembled into a memory-resident directed acyclic event graph instance that retains only four types of meta-information: node ID, edge type, weight value, and projection label.
4. The method for quality traceability data association, storage, and rapid indexing for cosmetic production batches according to claim 1, characterized in that, Based on the material slice identifiers of each node in the simplified causal subgraph, all upstream raw material slices are back-aggregated, and the contribution factor of each raw material slice to the current quality data is calculated using time proximity and process coupling degree as weighting parameters, generating a multi-dimensional dynamic binding result, including: The material slice identifiers carried by each process instance node in the simplified cause-effect subgraph are parsed to extract the target material slice set directly associated with the current quality observation point, and the target material slice set is used as the starting anchor point for reverse tracing. Based on the starting anchor point, a reverse topology traversal operation is performed in the memory-resident directed acyclic event graph to identify and aggregate all upstream raw material slice paths pointing to the target material slice, thereby constructing a raw material traceability path tree containing complete parent-child inheritance relationships. The timestamp difference between adjacent nodes in the raw material traceability path tree is normalized to quantify the temporal proximity coefficient of each upstream raw material slice relative to the current quality inspection action, and the temporal proximity coefficient is output as the dynamic weight factor of the first dimension. The historical quality deviation regression analysis model is invoked using the preset edge type metadata in the raw material traceability path tree to calculate the process coupling strength value of each process link to the final quality result, and the process coupling strength value is output as the dynamic weight factor of the second dimension. A weighted fusion operation is performed based on the time proximity coefficient and the process coupling strength value to calculate the comprehensive contribution factor of each upstream raw material slice to the current quality data, and a multi-dimensional dynamic binding result list sorted by priority is generated according to the comprehensive contribution factor.
5. The method for linking, storing, and rapidly indexing quality traceability data for cosmetic production batches according to claim 1, characterized in that, The lightweight event snapshot is obtained by collecting and preprocessing sensor signals, synchronizing with NTP clock, dynamically encoding process instance IDs, slicing material logic, standardizing parameters, and encapsulating and integrating them.
6. The method for quality traceability data association, storage, and rapid indexing for cosmetic production batches according to claim 1, characterized in that, The simplified causal subgraph data structure is obtained by parsing traceability requests, activating the subgraph projector, filtering related process nodes, filtering high-confidence related edges, and integrating and reconstructing.
7. The method for quality traceability data association, storage, and rapid indexing for cosmetic production batches according to claim 6, characterized in that, The subgraph projector filters nodes and edges based on the dimension-sensitive threshold, retaining causal links that are strongly correlated with the target quality observation point.
8. The method for quality traceability data association storage and rapid indexing for cosmetic production batches according to claim 1, characterized in that, The hierarchical compressed data of the graph is obtained and persistently stored after columnar compression, bitmap index construction, Robin Hood hash fragmentation, differential incremental encoding and hierarchical packaging.
9. The method for quality traceability data association, storage, and rapid indexing for cosmetic production batches according to claim 8, characterized in that, The bitmap index sequence and the incremental metadata stream work together to achieve compressed storage of event primitive information, which can support high-speed indexing and low-latency access in batch tracing scenarios.
10. The method for quality traceability data association storage and rapid indexing for cosmetic production batches according to claim 1, characterized in that, The lightweight event snapshot data structure simultaneously carries a time base, process instance ID, material slice ID, and multi-dimensional standardized quality observation point type. It can be extended to carry process and environmental parameters, and the parameter values support floating-point and enumeration types to adapt to multiple scenarios.