Method and system for tracing impurities of intermediate of flomoxef based on knowledge graph

By constructing a knowledge graph of the synthesis process of fluorocephalosporin intermediates and combining it with data from chromatography-mass spectrometry and process conditions, the impurity transfer path was traced in reverse. This solved the problems of unclear paths and reliance on experience in the tracing of impurities in fluorocephalosporin intermediates, and achieved precise location of the impurity introduction step and reliability of the tracing results.

CN123182818APending Publication Date: 2026-11-27GUANGDONG LIGUO PHARMACY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611428773.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-15
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing methods for tracing impurities in fluorocephalosporin intermediates cannot effectively reconstruct the transmission path of impurities in multi-step reaction networks. Relying on human experience makes it difficult to quantitatively compare the contributions of each step, and the traceability results have poor batch-to-batch repeatability.

Method used

Based on knowledge graphs, the chemical reaction relationships and material transfer relationships of the synthesis process of fluorocephalosporin intermediates were constructed. The impurity propagation intensity sequence was obtained by chromatography-mass spectrometry. The probability of side reaction generation was calculated by combining process condition parameters and molecular structure characteristics. The contribution of back propagation was attributed and the penetration rate was reduced to determine the main steps of impurity introduction.

Benefits of technology

It enables precise location of impurity introduction steps in the synthesis process, solves the problems of isolated impurity data, unclear paths, and reliance on experience in traditional methods, and improves the reliability of traceability results and batch-to-batch repeatability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123182818A_ABST
    Figure CN123182818A_ABST
Patent Text Reader

Abstract

The application relates to a fluoroxymycin intermediate impurity tracing method and system based on a knowledge graph, relates to the technical field of knowledge graphs, and comprises the following steps: constructing a knowledge graph based on the synthesis process of a fluoroxymycin intermediate F-3; obtaining mass spectrum integral intensities of target impurities in each intermediate to form a propagation sequence; for each side reaction path pointing to the target impurity, calculating a side reaction probability according to process conditions, and combining a structure fingerprint similarity to obtain an edge weight; starting from the integral intensity of a final product, propagating in the graph according to the edge weight in a reverse direction to obtain initial attribution scores of each intermediate; using the sequence to calculate an impurity penetration rate to reduce the initial scores to obtain final attribution scores; and taking a step corresponding to a node with the maximum score as a main introduction step of the impurities. The application solves the technical problem that it is difficult to accurately trace the main introduction step of the impurities of the intermediate F-3 in the fluoroxymycin synthesis process, and the problem that the main introduction step is easily disturbed by factors such as purification and degradation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of knowledge graph technology, and in particular to a knowledge graph-based method and system for tracing impurities in fluorocephalosporin intermediates. Background Technology

[0002] Fluoxetine is a broad-spectrum cephalosporin antibiotic. The synthesis of its intermediate F-3 involves multiple chemical reactions, including core construction, methoxylation, side-chain introduction, condensation, and deprotection. It is widely used in the industrial production of anti-infective drugs. During the scale-up process of fluoxetine intermediate F-3, various impurities have been identified in both the intermediate and the final product. These impurities mainly originate from byproducts generated in the aforementioned process steps, incompletely converted intermediates, and degradation products. Their content directly affects the quality of the final product. Therefore, it is necessary to identify the main introduction steps of each impurity during the process development stage and control them accordingly.

[0003] Traditional impurity tracing methods typically employ stepwise sampling and detection, which involves performing liquid chromatography or chromatography-mass spectrometry analysis on the intermediates after each reaction step and subsequent separation and purification. By comparing the detection and content changes of impurities in each intermediate step, and combining this with the experience of process engineers, possible side reaction steps or degradation steps can be identified, thereby pinpointing the process steps where impurities may be introduced.

[0004] However, this traditional method has the following shortcomings: First, it can only provide isolated information on whether impurities are detected and their relative content in each intermediate step, and cannot reconstruct the complete transport path of impurities in the multi-step reaction network. When an impurity is not detected in an intermediate step but reappears in a subsequent step, it is difficult to trace whether the impurity originated from implicit transport in the previous step, secondary generation in the subsequent step, or cross-contamination during the separation and purification process.

[0005] Secondly, impurity tracing relies heavily on the personal experience of process engineers. During the synthesis of the cephalosporin intermediate F-3, multiple side reaction pathways may simultaneously point to the same impurity. The contribution of different side reaction pathways needs to be determined through comprehensive analysis. Manual analysis makes quantitative comparison difficult, easily overlooking well-hidden side reaction pathways, and it's hard to unify the judgment criteria among different personnel.

[0006] Finally, existing methods cannot effectively utilize the intrinsic correlation between process condition parameters and material structural characteristics at each reaction step for quantitative attribution. When reaction temperature, pH, residence time, and other conditions deviate from those in the pilot-scale stage during process scale-up, it is difficult to assess the impact of process condition changes on the tendency of side reaction formation based solely on the detection data of intermediates at each step, resulting in poor repeatability and reliability of traceability conclusions across different batches. Summary of the Invention

[0007] This application provides a knowledge graph-based method and system for tracing impurities in fluorocephalosporin intermediates, which improves the technical problems in the prior art, such as isolated impurity data, unclear transmission paths, reliance on manual experience making it difficult to quantitatively compare the contributions of each step, and poor batch-to-batch repeatability of tracing results.

[0008] This application discloses the following technical solution: In a first aspect, this application provides a knowledge graph-based method for tracing impurities in fluorocephalosporin intermediates, the method comprising: Based on the chemical reaction and material transfer relationships among the starting materials, intermediates, by-products and target impurities in the F-3 intermediate of fluorocephalosporin, a knowledge graph of the synthesis process of the fluorocephalosporin intermediate F-3 is constructed. The integral intensity of the extracted ion current of each intermediate in the process scale-up batch within the retention time window of the target impurity in the chromatography-mass spectrometry instrument was obtained to form an impurity propagation intensity sequence. For each candidate side reaction path pointing to the target impurity node in the knowledge graph, the probability of side reaction generation is calculated based on the process condition parameters of each edge on the path, and the edge route weight is obtained by combining the structural fingerprint similarity of the nodes at both ends of the corresponding edge. Starting with the integral strength of the final product step, backpropagation is performed step by step along the edges of the knowledge graph. The attribution contribution of the current node is recursively distributed and superimposed on each predecessor node according to the weight of the outgoing edge path to obtain the initial attribution score of each intermediate node. Based on the impurity propagation intensity sequence, the integral intensity between each predecessor node and its corresponding successor node is extracted to calculate the impurity penetration rate, and the initial attribution score of each intermediate node is reduced to obtain the final attribution score of each intermediate node. The process step corresponding to the intermediate node with the highest final attribution score is determined as the main introduction step of the target impurity.

[0009] Secondly, this application provides a knowledge graph-based system for tracing impurities in fluorocephalosporin intermediates, the system comprising: The graph construction module is used to construct a knowledge graph of the synthesis process of the fluorocephalosporin intermediate F-3 based on the chemical reaction relationships and material transfer relationships between the starting materials, intermediates, by-products and target impurities in the F-3 intermediate of each step of the synthesis reaction of fluorocephalosporin. The intensity acquisition module is used to acquire the integral intensity of the extracted ion current of intermediates in each step of the process scale-up batch within the retention time window of the target impurity in the chromatography-mass spectrometry instrument, and form an impurity propagation intensity sequence. The weight calculation module is used to calculate the probability of side reaction generation for each candidate side reaction path pointing to the target impurity node in the knowledge graph, based on the process condition parameters of each edge on the path, and obtain the edge route weight by combining the structural fingerprint similarity of the nodes at both ends of the corresponding edge. The attribution allocation module is used to perform backpropagation step by step along the edges of the knowledge graph, starting with the integral intensity of the final product step, and recursively allocate and superimpose the attribution contribution of the current node to each predecessor node according to the weight of the outgoing edge path, so as to obtain the initial attribution score of each intermediate node. The intensity reduction module is used to extract the integral intensity between each predecessor node and the corresponding successor node based on the impurity propagation intensity sequence to calculate the impurity penetration rate, and to reduce the initial attribution score of each intermediate node to obtain the final attribution score of each intermediate node. The source tracing and location module is used to determine the process step corresponding to the intermediate node with the largest final attribution score as the main introduction step of the target impurity.

[0010] One or more technical solutions provided in this application have at least the following technical effects or advantages: This application's technical solution achieves precise location of impurity introduction steps in the synthesis process by providing a knowledge graph-based impurity tracing method for fluorocephalosporin intermediates. First, a knowledge graph is constructed based on the chemical reaction relationships and material transport relationships of each step in the fluorocephalosporin synthesis. Starting materials, intermediates, byproducts, and target impurities are organized as structured graph data in the form of material nodes and reaction edges. This achieves a topological expression of chemical reactions and impurity transport paths in multi-step synthesis processes, solving the problem that traditional methods cannot intuitively display the multi-source and multi-path transport network of impurities.

[0011] Secondly, the integral intensity of the extracted ion current of each intermediate in the process scale-up batch within the retention time window of the target impurity in the chromatography-mass spectrometry instrument is obtained and a sequence of impurity propagation intensity is formed. The isolated detection values ​​of each step are converted into quantitative signals arranged in an orderly manner along the process chain, which solves the problem that traditional single-point detection cannot reflect the dynamics of impurity transfer across steps.

[0012] Furthermore, for each candidate side reaction path pointing to the target impurity node in the knowledge graph, the probability of side reaction generation is calculated based on the process condition parameters of each edge on the path, and the edge route weight is obtained by combining the structural fingerprint similarity of the nodes at both ends of the edge. The process conditions and molecular structure features are fused and quantified into path credibility, which solves the problem that traditional experience judgment cannot quantitatively distinguish the contribution of multiple possible side reaction paths.

[0013] Based on this, backpropagation is performed step by step along the knowledge graph edge with the integral intensity of the final product step as the starting value. The attribution contribution is allocated and superimposed according to the weight of the outgoing edge path to obtain the initial attribution score of each intermediate node. This realizes the reverse quantitative attribution from the measured value of the final product to the upstream of the process, and solves the problem that the traditional method can only trace forward and cannot decompose the contribution of each step from the result.

[0014] Furthermore, based on the impurity propagation intensity sequence, the impurity penetration rate of each side is calculated, and the initial attribution score of each intermediate node is reduced to obtain the final attribution score of each intermediate node. The theoretical attribution is combined with the measured purification effect, which solves the problem of result distortion caused by relying solely on topological attribution without considering the actual separation, purification and removal effect.

[0015] Finally, the process step corresponding to the intermediate node with the highest final attribution score is determined as the main introduction step of the target impurity.

[0016] In summary, this application effectively improves the technical problems in the prior art, such as isolated detection data that cannot restore the transmission path, reliance on manual experience that makes it difficult to quantitatively compare path contributions, and poor batch-to-batch repeatability of traceability results, by organically combining the construction of a knowledge graph of the synthesis process, the acquisition of impurity propagation intensity sequences, the calculation of side reaction path weights, the allocation of back propagation attribution, and the reduction of penetration rate. Attached Figure Description

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

[0018] Figure 1 A flowchart illustrating the knowledge graph-based method for tracing impurities in fluorocephalosporin intermediates provided in this application embodiment; Figure 2 Example data for tracing impurities in fluorocephalosporin intermediates based on knowledge graphs provided in this application embodiment; Figure 3 This is a schematic diagram of the structure of the knowledge graph-based cephalosporin intermediate impurity tracing system provided in this application embodiment.

[0019] The components represented by each number in the attached diagram are explained as follows: 11. Atlas construction module, 12. Intensity acquisition module, 13. Weight calculation module, 14. Attribution assignment module, 15. Intensity reduction module, 16. Source tracing and location module. Detailed Implementation

[0020] This application provides a knowledge graph-based method and system for tracing impurities in fluorocephalosporin intermediates, which addresses the technical problems in the prior art, such as isolated impurity data, unclear transmission paths, difficulty in quantitatively comparing the contributions of each step due to reliance on manual experience, and poor batch-to-batch repeatability of tracing results.

[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. It should be noted that the numerical values ​​in the embodiments are for illustrative purposes only and do not constitute a limitation on this application.

[0022] It should be noted that, in the embodiments of this application, the target impurity is one or more process impurities present in the F-3 intermediate, and the process impurities include by-reaction products and / or degradation products.

[0023] Example 1, as shown in the appendix Figure 1 As shown, this application provides a knowledge graph-based method for tracing impurities in fluorocephalosporin intermediates, the method comprising the following steps: S100: Based on the chemical reaction and material transfer relationships among the starting materials, intermediates, by-products and target impurities in the F-3 intermediate of fluorocephalosporin in each step of the synthesis reaction, a knowledge graph of the synthesis process of fluorocephalosporin intermediate F-3 is constructed. In this embodiment, during the scale-up process of synthesizing the fluorocephalosporin intermediate F-3, various impurities were detected in the final product after separation and purification of each intermediate. It was impossible to determine which side reaction generated these impurities or along which material pathway they were transferred to the final product. To construct a structured graph covering the chemical reaction and material transfer relationships between starting materials, intermediates, byproducts, and target impurities in the F-3 intermediate, and to provide a topological basis for subsequent reverse attribution based on the graph path, it is necessary to extract the reactants and products of the main reaction and confirmed side reactions from the F-3 synthesis process and establish material nodes. A structural fingerprint is generated for each material node, main reaction edges and side reaction edges are constructed, and process condition parameters are labeled. Nodes with the same material are merged to form a complete knowledge graph. This addresses the technical problem that traditional impurity tracing methods rely solely on single-step detection data, cannot reconstruct the side reaction paths and material transfer networks in multi-step synthesis, and lack a global topological basis for impurity source localization.

[0024] Step S100 in the method provided in this application embodiment includes: The reactants and products corresponding to the main reactions and confirmed side reactions of each step in the synthesis process of fluorocephalosporin were extracted. Each reactant and each product was established as an independent material node, wherein the material node covers the starting material, intermediates of each step, by-products and target impurities in F-3 intermediate. For each material node, a fixed-length structural fingerprint is generated by molecular fingerprint mapping based on the chemical structural formula corresponding to the material node, and the structural fingerprint is used as an attribute of the material node for labeling. For each main reaction step, a directed edge is constructed from the reactant node to the product node as the main reaction edge. For each side reaction step, a directed edge is constructed from the reactant node to the byproduct node as the side reaction edge. The corresponding reaction temperature, reaction pH and reaction time are recorded on the main reaction edge and the side reaction edge as process condition parameters. By merging the nodes where the same substance appears as both a product and a reactant in adjacent reaction steps, a knowledge graph of the synthesis process of the fluorocephalosporin intermediate F-3 is formed, with these nodes as intersection points and reaction edges as connecting lines. A detailed explanation follows: In this embodiment, a material node refers to a vertex unit in the knowledge graph representing a chemical substance. Each material node corresponds to a unique chemical structural formula and is used to store attribute information such as the structural fingerprint and integral strength of the substance. A main reaction edge refers to a directed connection line from a reactant node to a main product node, indicating the direction of the main reaction. A side reaction edge refers to a directed connection line from a reactant node to a byproduct node, indicating the direction of the side reaction. Process condition parameters refer to the reaction temperature, reaction pH, and reaction time recorded on the reaction edge, used to describe the process operating conditions of the reaction step corresponding to that edge.

[0025] In this step, firstly, in order to convert the chemical reaction information in the synthesis process of the fluorocephalosporin intermediate F-3 into nodes in a graph data structure, it is necessary to extract the raw materials and products of each reaction step from the process specification. A material node is established for each raw material or product. The material node types cover the starting materials, intermediates, by-products, and various target impurities in the F-3 intermediate. This yields a set of material nodes that include all the reactions and transfers involved, solving the problem that traditional impurity analysis only focuses on the target products and ignores the side reaction intermediates.

[0026] Furthermore, in order to establish the directional connections of chemical reactions in the knowledge graph, a directed edge from the reactant node to the product node needs to be constructed for each main reaction step as the main reaction edge, and a directed edge from the reactant node to the byproduct node needs to be constructed for each side reaction step as the side reaction edge. The reaction temperature, reaction pH and reaction time are labeled on each edge as process condition parameters, which can obtain a set of directed graph edges containing reaction directions and process conditions, providing input parameters for solving the subsequent calculation of the probability of side reaction formation.

[0027] Finally, in order to eliminate the graph structure break caused by the repeated creation of multiple nodes for the same substance in adjacent steps, it is necessary to merge two substance nodes that appear as a product in the previous step and as a reactant in the next step into a single node. This allows the graph to form a coherent path with the substance node as the intersection point and the reaction edge as the connecting line, thus obtaining a complete and connected knowledge graph of the fluorocephalosporin synthesis process. This solves the problem that multiple independent subgraphs cannot be directly traced end-to-end.

[0028] Step S100 in the method provided in this application embodiment further includes: The type of molecular fingerprint is selected based on the degree of difference in structural features among substances in multiple material nodes. Obtain the chemical structural formula corresponding to each material node, extract the atom type, bonding relationship and chiral label of all atoms in the chemical structural formula, and form a structural descriptor; According to the predetermined substructure fragment length, the substructure fragments on all consecutive atomic paths are extracted in the structure descriptor to form a set of substructure fragments; The fixed number of bits in the binary fixed-length vector is determined according to the type of the molecular fingerprint, and a fixed-number binary fixed-length vector with all zeros is initialized. For each substructure fragment in the set of substructure fragments, the string identifier corresponding to the substructure fragment is input into a hash function, and an integer between 1 and a fixed number of digits is output as the mapping position; Set the value corresponding to the mapping position in the binary fixed-length vector to 1. For the same binary fixed-length vector, when multiple different substructure segments are mapped to the same mapping position, the mapping position remains 1. After traversal is complete, the binary fixed-length vector is used as the structural fingerprint of the corresponding material node; The generated structural fingerprint is used as an attribute of the corresponding material node and annotated on the material nodes of the knowledge graph in the form of key-value pairs. A detailed explanation follows: In this embodiment, a structural fingerprint refers to a fixed-length binary vector generated from a chemical structural formula through molecular fingerprint mapping, used to characterize the molecular structural features of a substance and serving as the numerical basis for subsequent calculations of structural similarity between substances. A structural descriptor refers to a string representation extracted from a chemical structural formula, containing atom types, bonding relationships, and chiral markers, used to generate substructure fragments. A substructure fragment refers to a continuous atomic path segment truncated from the structural descriptor at a preset length, serving as the input unit for hash mapping. The type of molecular fingerprint refers to either a MACCS Keys fingerprint or an ECFP fingerprint. MACCS Keys fingerprints are generated based on predefined substructure fragments, while ECFP fingerprints are generated based on topological traversal. A hash function is a function that maps the string identifier of a substructure fragment to an integer within a fixed range, used to determine the position of a 1 in the binary vector. A key-value pair refers to the data organization method of attaching the structural fingerprint to the substance node in the form of "attribute name-attribute value".

[0029] In this step, firstly, in order to apply the selected molecular fingerprint type to each material node, the chemical structure formula of each material node needs to be obtained one by one. The atomic type, bonding relationship and chiral mark of all atoms are extracted to form a structure descriptor. According to the preset substructure fragment length, the substructure fragments on all continuous atomic paths are extracted in the structure descriptor to form a set of substructure fragments. The complete set of substructure fragments corresponding to each material node can be obtained. For example, if the atomic type contains C, N, O, S, Cl and F, the chiral mark contains R / S configuration, and the fragment length is 3 atoms, then every 3 consecutive atoms in the structure descriptor generate a substructure fragment.

[0030] Furthermore, in order to convert the variable-length set of substructure fragments into a fixed-length and comparable binary vector, a fixed number of bits needs to be determined according to the selected molecular fingerprint type and the vector is initialized with all zeros. A hash function is executed on the string identifier of each substructure fragment to obtain an integer mapping position between 1 and the fixed number of bits. The value at the corresponding position in the vector is set to 1. In the event of a hash collision, the value remains unchanged at 1. After traversal, the resulting binary vector is the structural fingerprint of the material node, which can obtain a fingerprint code of uniform length. For example, if the ECFP fingerprint is selected with a fixed number of bits of 1024, and the set of substructure fragments contains 256 fragments, after hash mapping, about 200 bits in the 1024-bit vector are set to 1.

[0031] Finally, in order to associate the structural fingerprint with the graph nodes, the generated binary vector needs to be labeled as a key-value pair on the corresponding material node as an attribute, which can support the rapid query and calculation of the structural fingerprint similarity between the nodes at both ends of any edge on the subsequent side reaction path.

[0032] Step S100 in the method provided in this application embodiment further includes: From multiple material nodes, extract the chemical structural formulas corresponding to any two material nodes, and calculate the ratio of the number of different atoms between the two chemical structural formulas to the total number of atoms in the two chemical structural formulas, as the structural difference degree. Traverse all material node pairs and take the minimum value of all structural differences as the minimum structural difference. When the minimum structural difference is greater than the first difference threshold, the MACCS Keys fingerprint based on the predefined substructure fragment is selected as the type of the molecular fingerprint. When the minimum structural difference is less than or equal to the first difference threshold, the extended connectivity fingerprint ECFP based on topological traversal is selected as the type of the molecular fingerprint. The first difference threshold is determined based on the maximum deviation between the structural fingerprint similarity calculated by the MACCS Keys fingerprint and the ECFP fingerprint when cross-validating the same group of structurally similar substances. A detailed explanation follows: In this embodiment, the structural difference degree refers to the ratio of the number of different atoms between the chemical structural formulas corresponding to two material nodes to the total number of atoms in the two structural formulas, used to measure the degree of difference in molecular composition between the two substances. The minimum structural difference degree refers to the minimum value among all structural difference degrees obtained by traversing all material node pairs, reflecting the lower limit of the overall structural difference between substances in the spectrum. MACCS Keys fingerprints refer to binary fingerprints generated by matching 166 predefined substructure fragments; the substructure fragments are fixed, resulting in fast computation. ECFP fingerprints refer to fingerprints that expand outward layer by layer along the topological connections centered on each atom to generate substructure fragments; they are sensitive to subtle structural differences and have stronger discriminative ability. The first difference threshold refers to the boundary value used to determine whether to select MACCS Keys or ECFP fingerprints, determined by the maximum deviation between MACCS Keys and ECFP fingerprints for the same group of substances in cross-validation.

[0033] In this step, firstly, in order to quantify the degree of structural difference between substances in the spectrum, the chemical structural formulas of any two substance nodes need to be extracted. The number of atoms with different types and quantities between the two is counted as the number of different atoms. Dividing this number by the total number of atoms in the two structural formulas gives the degree of structural difference. After traversing all substance node pairs, the minimum value among all structural differences is taken as the minimum structural difference. This gives the lower limit index of the overall structural difference between substances in the spectrum, providing a basis for fingerprint type selection.

[0034] Furthermore, to avoid the computational overhead of ECFP fingerprints when structural differences are large, and to avoid the insufficient distinguishing ability of MACCS Keys fingerprints when structural differences are small, a first difference threshold needs to be set as a dividing value. When the minimum structural difference is greater than the first difference threshold, MACCS Keys fingerprints are selected, and when the minimum structural difference is less than or equal to the first difference threshold, ECFP fingerprints are selected. This can obtain a fingerprint type that matches the material distinguishing requirements and solve the problem that a single fingerprint type cannot balance efficiency and accuracy in scenarios with large structural differences.

[0035] The first difference threshold is determined as follows: From all substances involved in the cephalosporin synthesis process, they are sorted by structural difference from smallest to largest. The top 20 pairs of substances with the smallest structural difference are selected to form a validation set. For each pair of substances in the validation set, structural fingerprint similarity is calculated using both MACCS Keys and ECFP fingerprints. The absolute value of the difference between the two similarity calculations is taken. After iterating through all pairs of substances, the maximum absolute value is recorded as the first difference threshold. For example, if a pair of substances in the validation set has a MACCS Keys similarity of 0.85 and an ECFP similarity of 0.72, the difference is 0.13. The maximum difference among the 20 pairs of substances, 0.19, is the first difference threshold. The first difference threshold is determined through actual cross-validation, avoiding the problem of poor adaptability of empirically set thresholds in different processes.

[0036] In summary, this step establishes material nodes covering starting materials, intermediates, byproducts, and target impurities by extracting reactants and products from the process specification. It selects either MACCSKeys or ECFP molecular fingerprint types based on a comparison of the minimum structural difference degree and a first difference threshold. For each material node, a fixed-length structural fingerprint is generated through substructure fragment extraction and hash mapping, labeled with key-value pairs. Main reaction edges and side reaction edges are constructed, and reaction temperature, pH, and residence time are labeled as process condition parameters. Nodes with the same material are merged to form a complete knowledge graph with material nodes as intersection points and reaction edges as connecting lines. Compared with existing technologies, this step has the following advantages: First, it converts the synthetic process specification recorded in text form into structured graph data, realizing the topological expression of reaction and transmission relationships between substances. Second, by dynamically selecting the molecular fingerprint type and generating structural fingerprints, computational overhead is controlled while ensuring discriminative power. Third, by merging nodes with the same material to form coherent paths, the graph supports end-to-end path traversal from starting materials to final products, establishing a complete graph topology framework for subsequent reverse attribution and tracing of target impurities.

[0037] S200: Obtain the integral intensity of the extracted ion current of each intermediate in the process scale-up batch within the retention time window of the target impurity in the chromatography-mass spectrometry instrument, and form an impurity propagation intensity sequence.

[0038] In this embodiment, given that a knowledge graph of the fluorocephalosporin synthesis process has been constructed and the topological structure of the reaction material nodes and reaction edges at each step has been clarified, but the actual content distribution of the target impurity in each intermediate step and its attenuation or enrichment trend along the process chain are still unclear, in order to obtain quantitative detection data of the target impurity in each intermediate step as the signal basis for subsequent impurity backpropagation attribution and penetration reduction calculations based on measured data, test solutions need to be prepared for each intermediate step sample, retention time windows are determined by the target impurity reference standard, characteristic ion currents are extracted and integrated sequentially in a chromatography-mass spectrometry system, and arranged in the order of process steps to form an impurity propagation intensity sequence. This solves the technical problem that traditional single-point detection cannot reflect the dynamic transfer process of impurities in multi-step synthesis, resulting in a lack of quantitative signal chain support for traceability.

[0039] Step S200 in the method provided in this application embodiment includes: Take intermediate samples from each step of the process scale-up batch after the reaction is completed and after separation and purification, dissolve them in the mobile phase and make up to the same volume to obtain intermediate test solutions for each step; Inject the target impurity reference solution into the chromatography-mass spectrometry instrument, record the retention time of the target impurity, and determine the retention time window of the target impurity by expanding a predetermined width to both sides of the retention time. The intermediate test solutions of each step are injected sequentially into the chromatography-mass spectrometry instrument. The characteristic ion currents corresponding to the target impurities are extracted within the retention time window, and the peak areas of the ion current peaks are integrated to obtain the integrated intensity of the extracted ion currents of each intermediate step. The extraction ion current integral intensities of each intermediate are arranged sequentially according to the process steps to form an impurity propagation intensity sequence. A detailed explanation follows: In this embodiment, the retention time window refers to the time interval in the chromatogram centered on the retention time of the target impurity reference standard, extending to both sides by a predetermined width, used to limit the collection range of the target impurity peak. The extracted ion current integral intensity refers to the value obtained by integrating the peak area of ​​the characteristic ion current chromatographic peak of the target impurity within the retention time window, reflecting the relative content of the target impurity in the sample. The target impurity reference standard solution refers to a reference solution prepared using a target impurity standard of known purity, used to determine the retention time and characteristic ions of the target impurity. The characteristic ion current refers to the curve showing the change of the ion signal corresponding to a specific mass-to-charge ratio of the target impurity over time in mass spectrometry detection. The test solution refers to the analyte solution obtained by dissolving the intermediate samples from each step in the mobile phase and bringing the volume to the same level.

[0040] In this step, firstly, in order to detect intermediate samples from each step under the same standard, intermediate samples from each step of the process scale-up batch after the reaction is completed and after separation and purification are taken, dissolved in the mobile phase and diluted to the same volume to obtain intermediate test solutions for each step. This can eliminate the problem of incomparable peak areas caused by differences in sample concentration and ensure that the integral intensity of each step differs only in the absolute content of impurities. For example, 10 mg of sample from each step is weighed, dissolved and diluted to 10 mL.

[0041] Furthermore, to accurately locate the peak position of the target impurity in the data from the chromatography-mass spectrometry (GC-MS) system, a reference solution of the target impurity needs to be injected into the instrument, and the retention time of the target impurity needs to be recorded. A retention time window is then defined by extending a predetermined width to both sides of this retention time. This avoids the influence of retention time drift caused by batch differences in the chromatographic column or minor changes in the mobile phase. The predetermined width is typically 0.2 min, and this value is determined based on statistical analysis of historical detection data of the half-peak width of the target impurity on the chromatographic column. For example, if the reference standard retention time is 8.5 min and the extended width is 0.2 min, then the retention time window is 8.3 min to 8.7 min.

[0042] Furthermore, in order to specifically extract the signal of the target impurity from the intermediate samples of each step, the test solution of each step needs to be injected into the instrument in sequence, the characteristic ion current corresponding to the target impurity is extracted within the retention time window, and the peak area of ​​the ion current peak is integrated to obtain the integrated intensity of the extracted ion current of each intermediate step. This can eliminate the interference of other components in the sample within the same retention window. For example, the peak area of ​​the characteristic ion current of a certain intermediate step is 15230 within the window.

[0043] Finally, in order to form a curve showing the change in impurity content along the process steps, the integral intensities of each step need to be arranged in sequence to form an impurity propagation intensity sequence. This can intuitively reflect the propagation trend of the target impurity in multi-step synthesis and provide an ordered numerical sequence for subsequent penetration rate calculation. For example, the sequence is: Step 1 integral intensity 0, Step 2 15230, Step 3 2960.

[0044] It should be noted that the impurity propagation intensity sequence only includes detection data of intermediate samples after separation and purification from each main reaction step. Byproduct nodes are not sampled and detected separately during production, and their integrated intensities are not included in this sequence. These missing values ​​will be appropriately set in subsequent calculations based on mass transfer relationships. When the integrated intensity of the extraction ion current for a certain intermediate step is 0, it is recorded as 0 in the sequence, and the case of a denominator of 0 is handled protectively in subsequent penetration rate calculations.

[0045] For example, taking the synthesis route of cephalosporin as an example, in one possible synthetic route, intermediates F-5 and F-4 are both generated sequentially from the starting material CMO core through multiple main reactions. 10.0 mg of intermediate F-5 (step 1), intermediate F-4 (step 2), and intermediate F-3 (step 3) samples were weighed and dissolved in the mobile phase to a final volume of 10 mL to obtain test solutions. The F-3 reference solution was injected, with a retention time of 8.5 min, extended by 0.2 min to obtain a window of 8.3 to 8.7 min. Characteristic ion currents (m / z 456.1) were extracted sequentially, and integration yielded: F-5 showed no detectable target impurities, with an integrated intensity of 0; F-4 peak area was 15230; and F-3 peak area was 2960. Arranging these in the process order yielded an impurity propagation intensity sequence [0, 15230, 2960].

[0046] In summary, this step generates an impurity propagation intensity sequence by preparing intermediate samples of the same concentration, determining retention time windows using target impurity reference standards, sequentially extracting and integrating characteristic ion currents, and arranging them according to the process steps. Addressing the limitation of traditional single-point detection, which only reflects the impurity content in the final product and cannot trace the dynamic transfer of impurities during multi-step synthesis, this step moves the detection point forward to the intermediates after each reaction. The uniform concentration preparation eliminates the interference of sample dilution differences on the detection results, making the integrated intensities of each step directly comparable. The precise positioning of the retention time window using reference standards avoids peak misidentification caused by retention time drift due to batch-to-batch differences in the chromatographic column or minor changes in the mobile phase, ensuring consistent data acquisition conditions for each step. By arranging the integrated intensities of each step into a sequence according to the process order, the originally isolated detection values ​​are converted into continuous signals along the process chain, intuitively reflecting the generation, decay, or enrichment trends of the target impurities. This provides a reliable and orderly quantitative data foundation for subsequent impurity penetration rate calculations and backpropagation attribution based on this sequence.

[0047] S300: For each candidate side reaction path pointing to the target impurity node in the knowledge graph, calculate the probability of side reaction generation based on the process condition parameters of each edge on the path, and obtain the edge route weight by combining the structural fingerprint similarity of the nodes at both ends of the corresponding edge.

[0048] In this embodiment, given that a knowledge graph of the fluorocephalosporin synthesis process has been constructed and the impurity propagation intensity sequence of each intermediate step has been obtained, but it is unclear which of the multiple candidate side reaction paths pointing to the target impurity in the knowledge graph contributes the most to the generation of the target impurity, in order to quantify the probability of side reaction occurrence and the degree of material structural similarity corresponding to each edge of each candidate side reaction path, and to provide edge weight parameters for the weighted allocation of attribution contributions when performing backpropagation along the graph edges, it is necessary to screen candidate side reaction paths with the target impurity node as the endpoint from the knowledge graph, extract reaction temperature, reaction pH and residence time for each edge to calculate the probability of side reaction generation, and extract the structural fingerprints of the nodes at both ends of the edge to calculate the similarity, and multiply the two to obtain the edge route weight, so as to solve the technical problem that traditional tracing methods rely solely on experience to judge side reaction paths and lack the technical problem of integrating process conditions and molecular structural characteristics into a path credibility index.

[0049] Step S300 in the method provided in this application embodiment includes: From the knowledge graph, all directed edges ending at the target impurity node are selected. Each directed edge, along with its upstream node, is taken as the end edge of a candidate side reaction path. The path is backtracked in the reverse direction of the directed edge to the reactant node at the starting point of the path, thus obtaining multiple candidate side reaction paths. For each directed edge on a candidate side reaction path, extract the reaction temperature, reaction pH, and residence time recorded on the directed edge, and calculate the deviation factor of the residence time relative to the baseline residence time. Substitute the reaction temperature, the reaction pH, and the deviation factor into the pre-constructed side reaction probability prediction model to obtain the side reaction generation probability corresponding to the directed edge. The pre-construction steps of the side reaction probability prediction model include: In the small-scale or pilot-scale stages of the synthesis of cephalosporin, for each reaction step involving side reactions, reaction solution samples were collected under different reaction temperatures, different reaction pH and different residence times. The peak area ratio of the target impurities to the main product in the reaction solution was determined by chromatography-mass spectrometry as the measured probability of side reaction formation. Each set of reaction temperature, reaction pH and deviation factor is used as input samples, and the corresponding measured probability of side reaction generation is used as output label to construct a set of sample pairs. A multilayer feedforward neural network is constructed as a side reaction probability prediction model. The input layer of the multilayer feedforward neural network has 3 nodes, which correspond to the reaction temperature, reaction pH and deviation factor, respectively. The hidden layer adopts a nonlinear activation function, and the output layer has 1 node. The output value is mapped to between 0 and 1 by a sigmoid function, which represents the predicted value of the side reaction generation probability. The sample set is divided into a training set and a validation set, and the mean square error between the output layer's predicted value and the measured probability of side reaction generation is used as the loss function. The backpropagation algorithm is used to update the network weights of the multilayer feedforward neural network, and the training is iterated until the loss function converges. The trained multilayer feedforward neural network is then used as the side reaction probability prediction model. For each directed edge on a candidate side reaction path, extract the structural fingerprint of the material nodes at both ends of the directed edge, and calculate the Tanimoto coefficient between the two structural fingerprints as the structural fingerprint similarity. The probability of generating the side reaction corresponding to the same directed edge is multiplied by the structural fingerprint similarity, and the product is used as the edge path weight of the directed edge. A detailed explanation follows: In this embodiment, a candidate side reaction path refers to a continuous path that starts from the initial reactant node and propagates step-by-step along directed edges to the target impurity node. Each edge on the path corresponds to a side reaction step. Edge path weight refers to the numerical value assigned to each directed edge, representing the proportion of that edge's contribution to backpropagation attribution. Side reaction generation probability refers to the likelihood of the side reaction occurring under given reaction temperature, pH, and residence time conditions, with a value ranging from 0 to 1. Structural fingerprint similarity refers to the valley root coefficient between the structural fingerprints of the material nodes at both ends of an edge, reflecting the degree of similarity in molecular structure between the two substances. Deviation factor refers to the ratio of the actual residence time to the baseline residence time specified in the process specification.

[0050] In this step, firstly, in order to determine which paths in the knowledge graph may lead to the generation of the target impurity, it is necessary to filter all directed edges in the knowledge graph that end at the target impurity node. Each directed edge, together with its upstream node, is taken as the end edge of the candidate side reaction path. By backtracking in the reverse direction to the reactant node at the starting point of the path, a set of side reaction paths covering all possible generation of the target impurity can be obtained. This solves the problem that manually sorting out the paths one by one when there are many edges in the graph is inefficient and prone to omissions. For example, if there are 3 directed edges in the graph pointing to the target impurity node, 3 candidate paths can be obtained by backtracking.

[0051] Furthermore, in order to convert the process condition parameters on each edge into input features of the model, it is necessary to extract the reaction temperature, reaction pH, and residence time recorded on the directed edges, and calculate the deviation factor of the residence time relative to the baseline residence time. The baseline residence time refers to the standard residence time specified for this step of the reaction extracted from the process specification of cephalosporin synthesis. The deviation factor is equal to the actual residence time divided by the baseline residence time. This can normalize the absolute difference of residence time between different steps into the relative degree of deviation, solving the problem that the absolute value of residence time cannot be directly used as model input due to the large difference in baseline residence time between different reaction steps. For example, if the baseline residence time for a certain step is 120 min and the actual residence time is 90 min, the deviation factor is 0.75.

[0052] Furthermore, in order to predict the probability of side reactions occurring under given process conditions, the reaction temperature, reaction pH, and deviation factor need to be input into a pre-constructed side reaction probability prediction model. The model outputs the probability of side reaction generation corresponding to that edge, which can be obtained as a continuous value between 0 and 1, thus solving the problem that the risk of side reactions can only be qualitatively determined by experience but cannot be quantified.

[0053] The pre-construction process of the side reaction probability prediction model is as follows: During the pilot or intermediate-scale stages of the synthesis reaction of cephalosporin, reaction solution samples were collected under different reaction temperatures, pH values, and residence times for each reaction step involving side reactions. The peak area ratio of the target impurity to the main product was determined using chromatography-mass spectrometry as the measured probability of side reaction generation. Each set of reaction temperature, pH value, and deviation factor was used as input samples, and the measured probability was used as the output label to construct a sample pair set. A multi-layer feedforward neural network with 3 nodes in the input layer and 1 node in the output layer was constructed. The hidden layers were set to 2 layers: 16 nodes in the first hidden layer and 8 nodes in the second hidden layer. The ReLU function was used as the activation function, and the sigmoid function was used in the output layer to map the output value to between 0 and 1. The Adam optimizer was selected, with a learning rate of 0.001 and a batch size of 32. The sample pair set was divided into a training set and a validation set in an 8:2 ratio. The mean squared error (MSE) was used as the loss function, and the MSE calculation formula is: MSE = ... Where n is the number of samples, Let be the measured probability of side reaction generation for the i-th sample. This represents the predicted value output by the model. The network weights are updated using the backpropagation algorithm, and the training is iterated for 500 epochs until the loss function converges. The trained multilayer feedforward neural network is then used as the side reaction probability prediction model.

[0054] Furthermore, in order to incorporate material structure information to correct the credibility of side reaction pathways, it is necessary to extract the structural fingerprints of the material nodes at both ends of each edge, and calculate the Tanimoto coefficient between two structural fingerprints as the structural fingerprint similarity. The Tanimoto coefficient is equal to the number of bits in the intersection of two vectors divided by the number of bits in the union of two vectors, which can yield a similarity value between 0 and 1, reflecting the degree of closeness of the two substances in molecular structure. For example, if the intersection of the structural fingerprints of two nodes is 128 bits and the union is 256 bits, the Tanimoto coefficient is 0.50.

[0055] Finally, in order to comprehensively consider the influence of process conditions and structural similarity, the probability of side reaction generation along the same edge needs to be multiplied by the structural fingerprint similarity to obtain the edge path weight. This can simultaneously reflect the tendency of the side reaction to occur at the thermodynamic-kinetic level and the degree of correlation between reactants and products at the structural level, providing a basis for allocating the attribution contribution according to the weight ratio in subsequent backpropagation. For example, if the probability of side reaction generation along an edge is 0.65 and the structural fingerprint similarity is 0.50, the edge path weight is 0.325.

[0056] It should be added that the edge weights for each main reaction edge in the knowledge graph are given by the main reaction conversion rate model. The main reaction conversion rate model is constructed as follows: during the small-scale or pilot-scale stages of the synthesis reaction of cephalosporin, reaction solution samples are collected under different reaction temperatures, pH values, and residence times. The main reaction conversion rate is measured, using reaction temperature, pH value, and deviation factor as input samples, and the measured conversion rate as the output label. A multi-layer feedforward neural network with the same structure as the side reaction probability prediction model is constructed and trained. After training convergence, the main reaction conversion rate model is obtained. The edge weights of the main reaction edges are directly taken from the predicted conversion rate values ​​output by this model; the higher the conversion rate, the larger the weight of the main reaction edge.

[0057] For example, consider the synthetic route of the cephalosporin intermediate F-3. The side reaction path contains two directed edges: edge 1 points from F-5 to the target impurity precursor, and edge 2 points from the target impurity precursor to the target impurity. The process conditions for edge 1 are: temperature 10℃, pH 8.0, residence time 90 min, baseline residence time 120 min, and deviation factor 0.75. Inputting the input features 10, 8.0, and 0.75 into the side reaction probability prediction model, the output side reaction generation probability for edge 1 is 0.65, the structural fingerprint coefficient at both ends of the edge is 0.50, and the edge route weight is 0.325. The process conditions for edge 2 are: temperature 25℃, pH 7.0, residence time 60 min, baseline residence time 60 min, and deviation factor 1.0. The model outputs a side reaction generation probability of 0.80, a coefficient of 0.90, and an edge route weight of 0.720. Furthermore, the process conditions for the main reaction edge F-5 pointing to F-4 are a temperature of 10℃, pH 8.0, and residence time of 90 min, with a deviation factor of 0.75. This edge corresponds to the main reaction, not a side reaction, and the edge weight is given by the main reaction conversion model; in this example, it is set to 0.80. The process conditions for the main reaction edge F-4 pointing to F-3 are a temperature of 25℃, pH 7.0, and residence time of 60 min, with a deviation factor of 1.0. The edge weight is also given by the main reaction conversion model; in this example, it is set to 0.80.

[0058] In summary, this step extracts candidate side reaction paths ending at the target impurity node from the knowledge graph, extracts the reaction temperature, reaction pH, and deviation factor for each edge, and predicts the probability of side reaction generation using a neural network model. The valley root coefficient of the structural fingerprints of the nodes at both ends of the edge is calculated as the structural fingerprint similarity, and the two are multiplied to obtain the edge path weight. Compared with existing technologies, this step has the following advantages: First, it quantifies the empirical side reaction risk assessment into a continuous probability value between 0 and 1, solving the problem that traditional methods can only make qualitative judgments and cannot make quantitative comparisons; second, it integrates process condition parameters and molecular structure characteristics to calculate path weights, avoiding the one-sidedness of single-dimensional evaluation; third, it learns from historical data from pilot or intermediate-scale stages through a neural network model, making the probability prediction data-driven and adaptive, with consistent evaluation standards across different process steps.

[0059] S400: Starting with the integral strength of the final product step, backpropagation is performed level by level along the edges of the knowledge graph. The attribution contribution of the current node is recursively distributed and superimposed on each predecessor node according to the weight of the outgoing edge path to obtain the initial attribution score of each intermediate node.

[0060] In this embodiment, given that a knowledge graph of the fluorocephalosporin synthesis process has been constructed, the impurity propagation intensity sequence of each intermediate step has been obtained, and the route weight of each edge on each candidate side reaction path has been calculated, but it is unclear which path the content of the target impurity detected in the final product should be attributed to each intermediate step along, and by what proportion, in order to distribute the measured integral intensity of the target impurity in the final product backward along the edges of the knowledge graph to each precursor node and quantify the contribution of each intermediate step to the impurities in the final product, it is necessary to start with the integral intensity of the final product step, trace back step by step along the edges of the graph from back to front, and distribute the attribution contribution of each node to each precursor node according to the proportion of its incoming edge route weight to the total weight of all incoming edge routes and accumulate them to obtain the initial attribution score of each intermediate node. This solves the technical problem of traditional methods that only know the impurity content of the final product but cannot reverse decompose the contribution of each step along the synthesis route, resulting in a lack of quantitative allocation basis for tracing the source.

[0061] Step S400 in the method provided in this application embodiment includes: Extract the integral intensity corresponding to the final product step from the impurity propagation intensity sequence, and assign the integral intensity to the final product node in the knowledge graph as the attribution contribution of the final product node; Following the reverse order of the process steps, starting from the final product node, each node that has obtained attribution contribution is taken as the current node, and backtracking is performed one by one to each predecessor node along all directed edges in the knowledge graph pointing to the current node. For each directed edge connecting the predecessor node and the current node in the knowledge graph, the attribution contribution of the current node is allocated to the corresponding predecessor node according to the proportion of the edge route weight corresponding to the directed edge in the total weight of all incoming edge routes, and is used as the allocation attribution value obtained by the predecessor node from the directed edge. For the same predecessor node, when there are multiple outgoing edges pointing to different successor nodes, the allocation attribution values ​​obtained by the predecessor node from each outgoing edge are accumulated, and the accumulated result is used as the attribution contribution of the predecessor node. The extraction and accumulation operations are repeated, tracing backward along the edges of the knowledge graph until all intermediate nodes have received an attribution contribution. The attribution contribution of each intermediate node is then used as the initial attribution score. A detailed explanation follows: In this embodiment, backpropagation refers to the calculation process of transmitting attribution contributions from the final product node of the knowledge graph, step by step, in the reverse direction of the directed edges, to the upstream predecessor nodes of the process. The attribution contribution is a numerical value assigned to each material node, representing the relative amount of target impurities allocated to that node in reverse from the final product target impurity integral intensity according to the graph topology and edge weights. A predecessor node refers to the material node located at the starting point of the directed edge connection, pointing towards the successor node, and serves as the target node receiving the attribution allocation in backpropagation. The allocated attribution value refers to the portion of the attribution contribution transmitted from the predecessor node to the current node by a given incoming edge, equal to the current node's attribution contribution multiplied by the proportion of that incoming edge weight to the sum of all incoming edge weights.

[0062] In this step, firstly, in order to initiate the backpropagation process, the integral intensity corresponding to the final product step needs to be extracted from the impurity propagation intensity sequence. This integral intensity is then assigned to the final product node in the knowledge graph as the initial attribution contribution. This allows the measured target impurity content of the final product to become the initial value for the entire backpropagation calculation, solving the problem of lacking an initial benchmark for tracing. For example, if the integral intensity of the final product is 2960, then the attribution contribution of the final product node is 2960.

[0063] Furthermore, in order to trace the source of impurities backward along the process chain, it is necessary to start from the final product node in reverse order of the process steps, and take each node that has obtained attribution contribution as the current node. Then, search for all directed edges (incoming edges) pointing to the current node in the knowledge graph, and backtrack along each incoming edge to the corresponding predecessor node. This can cover all upstream sources that may pass impurities to the current node, and solve the problem of missing the contribution of side reaction paths when only tracing along the main reaction path.

[0064] Furthermore, to allocate the attribution contribution of the current node to each predecessor node according to the weight ratio, for each incoming edge connecting the predecessor node and the current node, it is necessary to calculate the proportion of the edge path weight of that incoming edge to the total weight of all incoming edges of the current node. The attribution contribution of the current node is then multiplied by this proportion to obtain the allocation attribution value corresponding to that incoming edge. The allocation process is based solely on the edge path weights and does not involve the impurity penetration rate, thus making the backpropagation stage and the subsequent penetration rate reduction stage independent of each other and avoiding circular dependencies. For example, if the current node has two incoming edges with edge path weights of 0.325 and 0.720 respectively, a total weight of 1.045, and proportions of 0.311 and 0.689 respectively, and the current node's attribution contribution is 2960, then the two edges will receive allocation attribution values ​​of 921 and 2039 respectively.

[0065] Furthermore, for the same predecessor node, when it simultaneously serves as the upstream source of multiple successor nodes, the allocation attribution values ​​obtained by the predecessor node from each outgoing edge must be accumulated, and the accumulated result is used as the attribution contribution of the predecessor node. If the predecessor node is a byproduct node, the attribution contribution is also accumulated and recorded according to the same rules, and is only used to continue to propagate impurity source information forward in the graph, but is not used as the final intermediate attribution score.

[0066] Finally, the above allocation and accumulation operations are repeated by tracing back along the edges of the knowledge graph until all intermediate nodes and by-product nodes involved in the transmission have obtained attribution contributions. The attribution contributions of each intermediate node at this point are used as the initial attribution scores to provide basic data for subsequent reduction using impurity penetration rate.

[0067] For example, consider the synthesis route of cephalosporin. The final product integral intensity of 2960 is extracted from the impurity propagation intensity sequence [0, 15230, 2960] and assigned to node F-3. Tracing back from node F-3 in reverse order, node F-3 has two incoming edges: the main reaction edge F-4 points to F-3, with a weight of 0.80 and a proportion of 0.80 / 1.52 = 0.526; the side reaction edge, the target impurity edge, points to F-3, with a weight of 0.720 and a proportion of 0.720 / 1.52 = 0.474. The attribution contribution of node F-3 is 2960, with F-4 receiving 1557 and the target impurity receiving 1403. The incoming edge of the target impurity node is from the target impurity precursor to the target impurity, with a weight of 0.720 and a proportion of 1.0; the attribution contribution of 1403 is entirely allocated to the target impurity precursor. The incoming edges of node F-4 include a main reaction edge F-5 pointing to F-4 with a weight of 0.80 and a side reaction edge F-5 pointing to the target impurity precursor with a weight of 0.325. The F-4 attribution score of 1557 is proportionally allocated after adding the attribution contributions from other sources. After all nodes have been allocated, the initial attribution score for each intermediate node is obtained.

[0068] It should be noted that the directed edge from the target impurity node to the F-3 node has the same path weight as the edge from the target impurity precursor to the target impurity, which is 0.720. This setting is based on the fact that the target impurity enters the subsequent reaction steps along with the material transfer after being generated from the precursor, and the two edges are continuous on the material transfer path. Therefore, the latter's path weight inherits the calculated value of the former.

[0069] In summary, this step, starting with the final product integral intensity, propagates backward along the knowledge graph edges, distributing the attribution contribution of each current node to the predecessor nodes according to the proportion of the weight of the incoming edge path to the total weight of all incoming edges, and then accumulating the contributions to obtain the initial attribution scores for each intermediate node. Compared with existing technologies, this step has the following advantages: First, by using the backpropagation mechanism to decompose the impurity content of the final product along the graph topology, quantitative attribution of impurity sources is achieved; second, the allocation according to the proportion of edge path weights integrates information from two dimensions: the probability of side reaction formation and structural fingerprint similarity, making the attribution results more consistent with the objective laws of chemical reactions; third, it supports the convergence of contributions from multiple incoming edge nodes, and can handle the attribution problem of multi-path impurity propagation in complex synthesis processes.

[0070] S500: Based on the impurity propagation intensity sequence, extract the integral intensity between each predecessor node and its corresponding successor node to calculate the impurity penetration rate, and reduce the initial attribution score of each intermediate node to obtain the final attribution score of each intermediate node.

[0071] In this embodiment, after obtaining the initial attribution scores of each intermediate node through backpropagation, but the initial attribution scores only reflect the theoretical attribution under the graph topology and edge weight allocation, and have not yet considered the scenario where the target impurities may be removed or enriched during the actual separation and purification process of each reaction step, in order to correct the theoretical attribution results with the measured impurity propagation intensity sequence and make the attribution scores more realistically reflect the actual transmission of target impurities along the process chain, it is necessary to calculate the impurity penetration rate along each directed edge in the knowledge graph in sequence, and use the penetration rate to subtract the initial attribution scores of each intermediate node to obtain the final attribution scores of each intermediate node. This solves the technical problem that the theoretical backpropagation attribution does not consider the impurity removal effect of each purification operation, resulting in a large deviation between the attribution results and the actual situation.

[0072] Step S500 in the method provided in this application embodiment includes: Along each directed edge in the knowledge graph from the predecessor node to the successor node, the impurity penetration rate of the directed edge is determined based on the comparative attenuation relationship of the integral intensity of the corresponding node in the impurity propagation intensity sequence. For each intermediate node, obtain the impurity penetration rate corresponding to all outgoing edges originating from the node; The initial attribution score of the intermediate node is proportionally reduced by the impurity penetration rate of each outgoing edge, and the reduction result is used as the reduced attribution value after being passed through the corresponding outgoing edge. The reduced attribution values ​​of the same intermediate node after passing through all outgoing edges are aggregated and used as the final attribution score for the intermediate node. A detailed explanation follows: In this embodiment, the impurity penetration rate refers to the ratio of the integral intensity of the successor node to the integral intensity of the predecessor node on a directed edge, reflecting the retention ratio of the target impurity after reaction and purification operations as it is transferred from the predecessor node to the successor node along the edge, and its value is between 0 and 1. The reduced attribution value refers to the portion of the attribution value corresponding to the outgoing edge after the initial attribution score of the predecessor node is reduced by the impurity penetration rate of an outgoing edge. The final attribution score refers to the attribution value obtained by aggregating the penetration rates of all outgoing edges for the intermediate node, and is used to finally determine the contribution of the node to the target impurity in the final product.

[0073] In this step, firstly, in order to quantify the actual transmission ratio of impurities on each edge, it is necessary to extract the integral intensity of the corresponding node from the impurity propagation intensity sequence along each directed edge from the predecessor node to the successor node in the knowledge graph. By comparing the attenuation relationship, the impurity penetration rate of each edge can be calculated, and the penetration rate value corresponding to each directed edge can be obtained, providing parameters for subsequent reduction.

[0074] Furthermore, in order to apply the penetration rate to attribution correction, it is necessary to obtain the impurity penetration rate corresponding to all outgoing edges from each intermediate node. The penetration rate of each outgoing edge is multiplied by the initial attribution score of the intermediate node to obtain the reduced attribution value after transmission through each outgoing edge. This can reflect the difference in the proportion of impurity transmission in different outgoing edge directions. For example, if the initial attribution score of an intermediate node is 5000 and there are two outgoing edges with penetration rates of 0.60 and 0.80 respectively, then the reduced attribution values ​​of the two outgoing edges are 3000 and 4000 respectively.

[0075] Finally, in order to summarize the final attribution contribution of each intermediate node, the reduced attribution values ​​of the same intermediate node after passing through all outgoing edges need to be aggregated as the final attribution score of the intermediate node, so that the comprehensive contribution of the node in the case of multiple outgoing edges can be fully expressed. For example, the reduced attribution values ​​after passing through two outgoing edges are 3000 and 4000 respectively, and the final attribution score after aggregation is 7000.

[0076] Step S500 in the method provided in this application embodiment further includes: For each directed edge in the knowledge graph that points from the predecessor node to the successor node, the integral intensity corresponding to the predecessor node and the integral intensity corresponding to the successor node are extracted from the impurity propagation intensity sequence. Calculate the ratio of the integral strength of the successor node to the integral strength of the predecessor node; When the ratio is less than or equal to 1, the ratio is taken as the impurity penetration rate of the directed edge; When the ratio is greater than 1, a fixed constant of 1 is taken as the impurity penetration rate of the directed edge. A detailed explanation follows: In this step, in order to calculate the penetration rate of each edge from the measured data, it is necessary to extract the integral intensity of the predecessor node and the integral intensity of the successor node from the impurity propagation intensity sequence, and calculate the ratio of the integral intensity of the successor node to the integral intensity of the predecessor node. When the ratio is less than or equal to 1, it indicates that the impurity is diluted or partially removed during the propagation process. This ratio is taken as the impurity penetration rate. When the ratio is greater than 1, it indicates that the impurity has been enriched or the detection fluctuation is abnormal. Taking a fixed constant of 1 as the impurity penetration rate can limit the penetration rate within a reasonable range.

[0077] In this calculation, when the integral intensity of the precursor node is 0, the impurity penetration rate of the directed edge is directly defined as 0 to avoid calculation errors caused by division by zero. For example, if the integral intensity of intermediate F-2 in step 1 is 0, then the impurity penetration rate of each outgoing edge from F-2 is set to 0. Since by-product nodes are not individually sampled and tested during production, their integral intensity is not included in the sequence. The impurity penetration rate of the outgoing edges of by-product nodes is a fixed value of 1, indicating that it is assumed that once a by-product is generated, it is entirely propagated without undergoing an independent purification process. Target impurity nodes are representative nodes of the target impurity in the final product. Their integral intensity is not included in the impurity propagation intensity sequence. In the penetration rate calculation, the integral intensity of the target impurity node is taken as the integral intensity value of the final product node, and the impurity penetration rate of the outgoing edges of the target impurity node is a fixed value of 1.

[0078] For example, the synthesis process of cephalosporin is used. The impurity propagation intensity sequence is [0, 15230, 2960], corresponding to the integrated intensities of nodes F-5, F-4, and F-3, respectively. The target impurity node in the spectrum is the representative node of the target impurity in the final product, and its integrated intensity is taken as the integrated intensity of the finished product node, 2960. The calculation results of the impurity penetration rate on each side are as follows. Figure 2 As shown. The integral intensity of F-5 is 0, and its edge penetration rate is taken as 0 according to the rules; the edge ratio of F-4 to F-3 is 0.194, which is less than 1, so the penetration rate is taken as 0.194; the target impurity precursor is a by-product node with no measured value, so its edge penetration rate is taken as 1.0 according to the rules. The initial attribution scores are aggregated after being reduced by the above penetration rates to obtain the final attribution scores of each intermediate node.

[0079] In summary, this step, by calculating the impurity penetration rate of each edge, addresses the special cases where the integral strength of the precursor node is 0 and the byproduct node lacks measured data. The penetration rate is used to subtract and aggregate the initial attribution scores, yielding the final attribution scores for each intermediate node. Compared to existing technologies, this step has the following advantages: First, it integrates theoretical backpropagation attribution with measured impurity content data, and the penetration rate subtraction ensures that the attribution results conform to the impurity removal effect of the actual purification process. Second, through division-by-zero protection and pre-set rules for byproduct penetration rates, it guarantees full coverage and robustness of the calculation process for all types of nodes. Third, by using the outward edge penetration rate subtraction and aggregation method, the final attribution score of each intermediate node comprehensively reflects the impurity transmission situation of all its downstream paths.

[0080] S600: The process step corresponding to the intermediate node with the largest final attribution score is determined as the main introduction step of the target impurity.

[0081] In this step, the final attribution scores of each intermediate node are sorted from largest to smallest, and the process step corresponding to the intermediate node with the largest final attribution score is determined as the main introduction step of the target impurity. If multiple intermediate nodes have the same final attribution score and are all the maximum value, these multiple intermediate nodes are output simultaneously as parallel candidate main introduction steps, for process engineers to further confirm based on the actual process parameters and equipment conditions of each step.

[0082] It should be noted that although by-product nodes participate in backpropagation and penetration reduction calculations to obtain the final attribution score, by-product nodes do not directly correspond to independent process steps. Their corresponding side reaction steps are subordinate to the main reaction steps corresponding to the intermediate nodes at the starting point of the side reaction. Therefore, when determining the main introductory steps, only the final attribution scores of each intermediate node are compared; the final attribution scores of by-product nodes are not included in the comparison.

[0083] The embodiments of this application, through the specific implementation methods described above, achieve the following technical effects: This application proposes a knowledge graph-based method for tracing impurities in intermediates of fluorocephalosporins. First, a knowledge graph is constructed based on the chemical reaction relationships and material transport relationships of each step in the synthesis of fluorocephalosporins. Then, the extraction ion current integral intensities of each intermediate in a scale-up batch within the retention time window of the target impurity are obtained to form an impurity propagation intensity sequence, and the edge weights of each candidate side reaction path pointing to the target impurity node are calculated. Next, starting with the final product integral intensity, backpropagation is performed level by level along the knowledge graph edges to obtain the initial attribution score for each intermediate node. Then, the impurity penetration rate of each edge is calculated based on the impurity propagation intensity sequence, and the initial attribution score is subtracted to obtain the final attribution score. Finally, the process step corresponding to the intermediate node with the highest final attribution score is determined as the main introduction step of the target impurity. This method solves the problem of accurately locating the target impurity introduction step in multi-step synthesis processes by fusing knowledge graph topology backpropagation with measured impurity propagation intensity attribution.

[0084] Example 2, as shown in the appendix Figure 3 As shown, based on the inventive concept of the knowledge graph-based method for tracing impurities in fluorocephalosporin intermediates provided in Embodiment 1, this application also provides a knowledge graph-based system for tracing impurities in fluorocephalosporin intermediates, specifically including: The graph construction module 11 is used to construct a knowledge graph of the synthesis process of the fluorocephalosporin intermediate F-3 based on the chemical reaction relationships and material transfer relationships between the starting materials, intermediates, by-products and target impurities in the F-3 intermediate of each step of the synthesis reaction of fluorocephalosporin. The intensity acquisition module 12 is used to acquire the integral intensity of the extracted ion current of each intermediate in the process scale-up batch within the retention time window of the target impurity in the chromatography-mass spectrometry instrument, and to form an impurity propagation intensity sequence. The weight calculation module 13 is used to calculate the probability of side reaction generation for each candidate side reaction path pointing to the target impurity node in the knowledge graph, based on the process condition parameters of each edge on the path, and obtain the edge route weight by combining the structural fingerprint similarity of the nodes at both ends of the corresponding edge. The attribution allocation module 14 is used to perform backpropagation step by step along the edge of the knowledge graph, starting with the integral intensity of the final product step, and recursively allocate and superimpose the attribution contribution of the current node to each predecessor node according to the weight of the outgoing edge path, so as to obtain the initial attribution score of each intermediate node. The intensity reduction module 15 is used to extract the integral intensity between each predecessor node and the corresponding successor node based on the impurity propagation intensity sequence to calculate the impurity penetration rate, and to reduce the initial attribution score of each intermediate node to obtain the final attribution score of each intermediate node. The source tracing and positioning module 16 is used to determine the process step corresponding to the intermediate node with the largest final attribution score as the main introduction step of the target impurity.

[0085] In one embodiment, the map construction module 11 is further configured to: extract the reactants and products corresponding to each main reaction and confirmed side reaction from the synthesis process of the fluorocephalosporin intermediate F-3; establish each reactant and each product as an independent material node, wherein the material node covers the starting material, each intermediate, by-product, and target impurities in the F-3 intermediate; for each material node, generate a fixed-length structural fingerprint based on the chemical structural formula corresponding to the material node through molecular fingerprint mapping, and label the structural fingerprint as an attribute of the material node; for each main reaction, construct a directed edge from the reactant node to the product node as the main reaction edge; for each side reaction, construct a directed edge from the reactant node to the by-product node as the side reaction edge; and record the corresponding reaction temperature, reaction pH, and residence time on the main reaction edge and the side reaction edge as process condition parameters. By merging the material nodes where the same substance appears as both a product and a reactant in adjacent reaction steps, a knowledge graph of the synthesis process of the fluorocephalosporin intermediate F-3 is formed, with the material nodes as the intersection points and the reaction edges as the connecting lines.

[0086] Furthermore, the graph construction module 11 is also used to: select the type of molecular fingerprint based on the degree of difference in structural features among substances to be distinguished in multiple material nodes; obtain the chemical structural formula corresponding to each material node; extract the atomic type, bonding relationship, and chiral marker of all atoms in the chemical structural formula to form a structural descriptor; traverse and extract all substructure fragments on continuous atomic paths in the structural descriptor according to a predetermined substructure fragment length to form a set of substructure fragments; determine the fixed number of bits in the binary fixed-length vector according to the type of the molecular fingerprint, and initialize a fixed-number binary fixed-length vector with all zeros; for each substructure fragment in the set of substructure fragments, input the string identifier corresponding to the substructure fragment into a hash function, and output an integer between 1 and the fixed number of bits as the mapping position; set the value corresponding to the mapping position in the binary fixed-length vector to 1; for the same binary fixed-length vector, when multiple different substructure fragments are mapped to the same mapping position, the mapping position remains 1; after traversal, use the binary fixed-length vector as the structural fingerprint of the corresponding material node. The generated structural fingerprint is used as an attribute of the corresponding material node and labeled on the material node of the knowledge graph in the form of key-value pairs.

[0087] Furthermore, the graph construction module 11 is also used to: extract the chemical structural formulas corresponding to any two material nodes from multiple material nodes, calculate the ratio of the number of different atoms between the two chemical structural formulas to the total number of atoms in the two chemical structural formulas, and use this as the structural difference degree. Traverse all material node pairs and take the minimum value of all structural difference degrees as the minimum structural difference degree. When the minimum structural difference degree is greater than a first difference threshold, select the MACCSKeys fingerprint based on predefined substructure fragments as the type of the molecular fingerprint. When the minimum structural difference degree is less than or equal to the first difference threshold, select the extended connectivity fingerprint ECFP based on topological traversal as the type of the molecular fingerprint. Wherein, the first difference threshold is determined by the maximum deviation between the structural fingerprint similarities calculated by the two fingerprints when cross-validating the same group of structurally similar substances based on the MACCS Keys fingerprint and the ECFP fingerprint.

[0088] In one embodiment, the intensity acquisition module 12 is further configured to: take intermediate samples after each step of the process scale-up batch reaction has been completed and purified, dissolve them in the mobile phase and bring them to the same volume to obtain intermediate test solutions for each step. Inject the target impurity reference solution into the chromatography-mass spectrometry (GC-MS) instrument, record the retention time of the target impurity, and determine the retention time window of the target impurity by extending a predetermined width to both sides of the retention time. Inject the intermediate test solutions for each step into the GC-MS instrument sequentially, extract the characteristic ion current corresponding to the target impurity within the retention time window, and integrate the peak area of ​​the ion current peak to obtain the integrated intensity of the extracted ion current for each intermediate step. Arrange the integrated intensities of the extracted ion current for each intermediate step in the order of the process steps to form an impurity propagation intensity sequence.

[0089] In one embodiment, the weight calculation module 13 is further configured to: filter all directed edges ending at the target impurity node from the knowledge graph, take each directed edge and its upstream node as the end edge of a candidate side reaction path, and backtrack along the reverse direction of the directed edge to the reactant node at the starting point of the path to obtain multiple candidate side reaction paths. For each directed edge on each candidate side reaction path, extract the reaction temperature, reaction pH and residence time recorded on the directed edge, and calculate the deviation factor of the residence time relative to the benchmark residence time. Substitute the reaction temperature, the reaction pH and the deviation factor into the pre-constructed side reaction probability prediction model to output the side reaction generation probability corresponding to the directed edge. The pre-construction step of the side reaction probability prediction model includes: in the pilot or intermediate stage of each step of the synthesis reaction of cephalosporin, for each reaction step involving side reactions, collect reaction liquid samples after reaction under different reaction temperatures, different reaction pH and different residence times, and determine the peak area ratio of the target impurity to the main product in the reaction liquid by chromatography-mass spectrometry as the measured side reaction generation probability. Each set of reaction temperature, reaction pH, and deviation factor is used as input samples, and the corresponding measured side reaction generation probability is used as the output label to construct a sample pair set. A multilayer feedforward neural network is constructed as the side reaction probability prediction model. The input layer of the multilayer feedforward neural network has 3 nodes, corresponding to the reaction temperature, reaction pH, and deviation factor respectively. The hidden layer uses a nonlinear activation function, and the output layer has 1 node. The output value is mapped to 0-1 using a sigmoid function, representing the predicted side reaction generation probability. The sample pair set is divided into a training set and a validation set. The mean squared error between the output layer prediction value and the measured side reaction generation probability is used as the loss function. The backpropagation algorithm is used to update the network weights of the multilayer feedforward neural network, and iterative training is performed until the loss function converges. The trained multilayer feedforward neural network is used as the side reaction probability prediction model. For each directed edge on a candidate side reaction path, the structural fingerprints of the material nodes at both ends of the directed edge are extracted, and the valley root coefficient between the two structural fingerprints is calculated as the structural fingerprint similarity. The probability of generating the side reaction corresponding to the same directed edge is multiplied by the structural fingerprint similarity, and the product is used as the edge path weight of the directed edge.

[0090] In one embodiment, the attribution allocation module 14 is further configured to: extract the integral intensity corresponding to the final product step from the impurity propagation intensity sequence, and assign the integral intensity to the final product node in the knowledge graph as the attribution contribution of the final product node. Following the reverse order of the process steps, starting from the final product node, each node that has obtained an attribution contribution is sequentially taken as the current node, and backtracked to each predecessor node along all directed edges pointing to the current node in the knowledge graph. For each directed edge in the knowledge graph connecting the predecessor node and the current node, the attribution contribution of the current node is allocated to the corresponding predecessor node according to the proportion of the edge path weight corresponding to the directed edge in the total weight of all incoming edges, as the allocation attribution value obtained by the predecessor node from the directed edge. For the same predecessor node, when there are multiple outgoing edges pointing to different successor nodes, the allocation attribution values ​​obtained by the predecessor node from each outgoing edge are accumulated, and the accumulated result is used as the attribution contribution of the predecessor node. Repeat the extraction and accumulation operations, tracing forward step by step along the edges of the knowledge graph until all intermediate nodes have obtained attribution contributions, and use the attribution contributions of each intermediate node as the initial attribution score.

[0091] In one embodiment, the intensity reduction module 15 is further configured to: determine the impurity penetration rate of each directed edge from the predecessor node to the successor node in the knowledge graph, based on the comparative attenuation relationship of the integral intensity of the corresponding node in the impurity propagation intensity sequence. For each intermediate node, obtain the impurity penetration rate corresponding to all outgoing edges originating from the node. Apply a proportional reduction to the initial attribution score of the intermediate node using the impurity penetration rate of each outgoing edge, and use the reduction result as the reduced attribution value after being passed through the corresponding outgoing edge. Aggregate the reduced attribution values ​​of the same intermediate node after being passed through all outgoing edges, and use this as the final attribution score of the intermediate node.

[0092] Furthermore, the intensity reduction module 15 is also used to: for each directed edge in the knowledge graph from the predecessor node to the successor node, extract the integral intensity corresponding to the predecessor node and the integral intensity corresponding to the successor node from the impurity propagation intensity sequence. Calculate the ratio of the integral intensity of the successor node to the integral intensity of the predecessor node. When the ratio is less than or equal to 1, take the ratio as the impurity penetration rate of the directed edge. When the ratio is greater than 1, take a fixed constant of 1 as the impurity penetration rate of the directed edge.

[0093] The knowledge graph-based impurity tracing system for fluorocephalosporin intermediates provided in this application enables end-to-end impurity tracing, from constructing a knowledge graph of the synthetic process to collecting impurity propagation intensity sequences, and then to backpropagation attribution and penetration rate reduction, in scenarios such as fluorocephalosporin synthesis process scale-up, target impurity source investigation, and process optimization. It can be integrated into the API production quality control system or process R&D analysis platform, effectively improving the accuracy of locating specific impurity introduction steps in multi-step synthetic processes, reducing the blindness and detection costs of process investigation, and providing data support for subsequent targeted optimization of process parameters. For the specific workflow and tracing details of this system, please refer to Example 1.

[0094] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this specification. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.

Claims

1. A knowledge graph-based method for tracing impurities in fluorocephalosporin intermediates, characterized in that, The method includes: Based on the chemical reaction and material transfer relationships among the starting materials, intermediates, by-products and target impurities in the F-3 intermediate of fluorocephalosporin, a knowledge graph of the synthesis process of the fluorocephalosporin intermediate F-3 is constructed. The integral intensity of the extracted ion current of each intermediate in the process scale-up batch within the retention time window of the target impurity in the chromatography-mass spectrometry instrument was obtained to form an impurity propagation intensity sequence. For each candidate side reaction path pointing to the target impurity node in the knowledge graph, the probability of side reaction generation is calculated based on the process condition parameters of each edge on the path, and the edge route weight is obtained by combining the structural fingerprint similarity of the nodes at both ends of the corresponding edge. Starting with the integral strength of the final product step, backpropagation is performed step by step along the edges of the knowledge graph. The attribution contribution of the current node is recursively distributed and superimposed on each predecessor node according to the weight of the outgoing edge path to obtain the initial attribution score of each intermediate node. Based on the impurity propagation intensity sequence, the integral intensity between each predecessor node and its corresponding successor node is extracted to calculate the impurity penetration rate, and the initial attribution score of each intermediate node is reduced to obtain the final attribution score of each intermediate node. The process step corresponding to the intermediate node with the highest final attribution score is determined as the main introduction step of the target impurity.

2. The method for tracing impurities in fluorocephalosporin intermediates based on knowledge graphs according to claim 1, characterized in that, Based on the chemical reaction and material transfer relationships among the starting materials, intermediates, byproducts, and target impurities in the F-3 intermediate of fluorocephalosporin, a knowledge graph of the synthesis process of the fluorocephalosporin intermediate F-3 is constructed, including: The reactants and products corresponding to the main reactions and confirmed side reactions of each step in the synthesis process of fluorocephalosporin intermediate F-3 were extracted. Each reactant and each product was established as an independent material node, wherein the material node covers the starting material, each step intermediate, by-products and target impurities in F-3 intermediate. For each material node, a fixed-length structural fingerprint is generated by molecular fingerprint mapping based on the chemical structural formula corresponding to the material node, and the structural fingerprint is used as an attribute of the material node for labeling. For each main reaction step, a directed edge is constructed from the reactant node to the product node as the main reaction edge. For each side reaction step, a directed edge is constructed from the reactant node to the byproduct node as the side reaction edge. The corresponding reaction temperature, reaction pH and residence time are recorded on the main reaction edge and the side reaction edge as process condition parameters. By merging the material nodes where the same substance appears as both a product and a reactant in adjacent reaction steps, a knowledge graph of the synthesis process of the fluorocephalosporin intermediate F-3 is formed, with the material nodes as the intersection points and the reaction edges as the connecting lines.

3. The method for tracing impurities in fluorocephalosporin intermediates based on knowledge graphs according to claim 2, characterized in that, For each material node, a fixed-length structural fingerprint is generated based on the corresponding chemical structural formula through molecular fingerprint mapping. This structural fingerprint is then used as an attribute of the material node for annotation, including: The type of molecular fingerprint is selected based on the degree of difference in structural features among substances in multiple material nodes. Obtain the chemical structural formula corresponding to each material node, extract the atom type, bonding relationship and chiral label of all atoms in the chemical structural formula, and form a structural descriptor; According to the predetermined substructure fragment length, the substructure fragments on all consecutive atomic paths are extracted in the structure descriptor to form a set of substructure fragments; The fixed number of bits in the binary fixed-length vector is determined according to the type of the molecular fingerprint, and a fixed-number binary fixed-length vector with all zeros is initialized. For each substructure fragment in the set of substructure fragments, the string identifier corresponding to the substructure fragment is input into a hash function, and an integer between 1 and a fixed number of digits is output as the mapping position; Set the value corresponding to the mapping position in the binary fixed-length vector to 1. For the same binary fixed-length vector, when multiple different substructure segments are mapped to the same mapping position, the mapping position remains 1. After traversal is complete, the binary fixed-length vector is used as the structural fingerprint of the corresponding material node; The generated structural fingerprint is used as an attribute of the corresponding material node and labeled on the material node of the knowledge graph in the form of key-value pairs.

4. The knowledge graph-based method for tracing impurities in fluorocephalosporin intermediates according to claim 3, characterized in that, Based on the degree of difference in structural features among substances in multiple material nodes, the types of molecular fingerprints are selected, including: From multiple material nodes, extract the chemical structural formulas corresponding to any two material nodes, and calculate the ratio of the number of different atoms between the two chemical structural formulas to the total number of atoms in the two chemical structural formulas, as the structural difference degree. Traverse all material node pairs and take the minimum value of all structural differences as the minimum structural difference. When the minimum structural difference is greater than the first difference threshold, the MACCSKeys fingerprint based on the predefined substructure fragment is selected as the type of the molecular fingerprint. When the minimum structural difference is less than or equal to the first difference threshold, the extended connectivity fingerprint ECFP based on topological traversal is selected as the type of the molecular fingerprint. The first difference threshold is determined based on the maximum deviation between the structural fingerprint similarity calculated by the two fingerprints when cross-validating the same group of structurally similar substances using MACCS Keys fingerprint and ECFP fingerprint.

5. The method for tracing impurities in fluorocephalosporin intermediates based on knowledge graphs according to claim 1, characterized in that, The integral intensity of the extracted ion current of each intermediate in the process scale-up batch within the retention time window of the target impurity in the chromatography-mass spectrometry (GC-MS) was obtained to form an impurity propagation intensity sequence, including: Take intermediate samples from each step of the process scale-up batch after the reaction is completed and after separation and purification, dissolve them in the mobile phase and make up to the same volume to obtain intermediate test solutions for each step; Inject the target impurity reference solution into the chromatography-mass spectrometry instrument, record the retention time of the target impurity, and determine the retention time window of the target impurity by expanding a predetermined width to both sides of the retention time. The intermediate test solutions of each step are injected sequentially into the chromatography-mass spectrometry instrument. The characteristic ion currents corresponding to the target impurities are extracted within the retention time window, and the peak areas of the ion current peaks are integrated to obtain the integrated intensity of the extracted ion currents of each intermediate step. According to the sequence of process steps, the integral intensity of the extracted ion current of each intermediate is arranged in order to form an impurity propagation intensity sequence.

6. The method for tracing impurities in fluorocephalosporin intermediates based on knowledge graphs according to claim 1, characterized in that, For each candidate side reaction path pointing to the target impurity node in the knowledge graph, the probability of side reaction generation is calculated based on the process condition parameters of each edge on the path. The edge path weight is then obtained by combining the structural fingerprint similarity of the nodes at both ends of the corresponding edge, including: From the knowledge graph, all directed edges ending at the target impurity node are selected. Each directed edge, along with its upstream node, is taken as the end edge of a candidate side reaction path. The path is backtracked in the reverse direction of the directed edge to the reactant node at the starting point of the path, thus obtaining multiple candidate side reaction paths. For each directed edge on a candidate side reaction path, extract the reaction temperature, reaction pH, and residence time recorded on the directed edge, and calculate the deviation factor of the residence time relative to the baseline residence time. Substitute the reaction temperature, the reaction pH, and the deviation factor into the pre-constructed side reaction probability prediction model to obtain the side reaction generation probability corresponding to the directed edge. The pre-construction steps of the side reaction probability prediction model include: In the small-scale or pilot-scale stages of the synthesis of cephalosporin, for each reaction step involving side reactions, reaction solution samples were collected under different reaction temperatures, different reaction pH and different residence times. The peak area ratio of the target impurities to the main product in the reaction solution was determined by chromatography-mass spectrometry as the measured probability of side reaction formation. Each set of reaction temperature, reaction pH and deviation factor is used as input samples, and the corresponding measured probability of side reaction generation is used as output label to construct a set of sample pairs. A multilayer feedforward neural network is constructed as a side reaction probability prediction model. The input layer of the multilayer feedforward neural network has 3 nodes, which correspond to the reaction temperature, reaction pH and deviation factor, respectively. The hidden layer adopts a nonlinear activation function, and the output layer has 1 node. The output value is mapped to between 0 and 1 by a sigmoid function, which represents the predicted value of the side reaction generation probability. The sample set is divided into a training set and a validation set, and the mean square error between the output layer's predicted value and the measured probability of side reaction generation is used as the loss function. The backpropagation algorithm is used to update the network weights of the multilayer feedforward neural network, and the training is iterated until the loss function converges. The trained multilayer feedforward neural network is then used as the side reaction probability prediction model. For each directed edge on a candidate side reaction path, extract the structural fingerprint of the material nodes at both ends of the directed edge, and calculate the Tanimoto coefficient between the two structural fingerprints as the structural fingerprint similarity. The probability of generating the side reaction corresponding to the same directed edge is multiplied by the structural fingerprint similarity, and the product is used as the edge path weight of the directed edge.

7. The method for tracing impurities in fluorocephalosporin intermediates based on knowledge graphs according to claim 1, characterized in that, Starting with the integral strength of the final product step, backpropagation is performed level by level along the edges of the knowledge graph. The attribution contribution of the current node is recursively distributed and superimposed onto each predecessor node according to the weight of the outgoing edge path, obtaining the initial attribution score for each intermediate node, including: Extract the integral intensity corresponding to the final product step from the impurity propagation intensity sequence, and assign the integral intensity to the final product node in the knowledge graph as the attribution contribution of the final product node; Following the reverse order of the process steps, starting from the final product node, each node that has obtained attribution contribution is taken as the current node, and backtracking is performed one by one to each predecessor node along all directed edges in the knowledge graph pointing to the current node. For each directed edge connecting the predecessor node and the current node in the knowledge graph, the attribution contribution of the current node is allocated to the corresponding predecessor node according to the proportion of the edge route weight corresponding to the directed edge in the total weight of all incoming edge routes, and is used as the allocation attribution value obtained by the predecessor node from the directed edge. For the same predecessor node, when there are multiple outgoing edges pointing to different successor nodes, the allocation attribution values ​​obtained by the predecessor node from each outgoing edge are accumulated, and the accumulated result is used as the attribution contribution of the predecessor node. Repeat the extraction and accumulation operations, tracing forward step by step along the edges of the knowledge graph until all intermediate nodes have obtained attribution contributions, and use the attribution contributions of each intermediate node as the initial attribution score.

8. The method for tracing impurities in fluorocephalosporin intermediates based on knowledge graphs according to claim 1, characterized in that, Based on the impurity propagation intensity sequence, the integral intensity between each predecessor node and its corresponding successor node is extracted to calculate the impurity penetration rate. The initial attribution score of each intermediate node is then reduced to obtain the final attribution score for each intermediate node, including: Along each directed edge in the knowledge graph from the predecessor node to the successor node, the impurity penetration rate of the directed edge is determined based on the comparative attenuation relationship of the integral intensity of the corresponding node in the impurity propagation intensity sequence. For each intermediate node, obtain the impurity penetration rate corresponding to all outgoing edges originating from the node; The initial attribution score of the intermediate node is proportionally reduced by the impurity penetration rate of each outgoing edge, and the reduction result is used as the reduced attribution value after being passed through the corresponding outgoing edge. The reduced attribution values ​​of the same intermediate node after passing through all outgoing edges are aggregated and used as the final attribution score of the intermediate node.

9. The method for tracing impurities in fluorocephalosporin intermediates based on knowledge graphs according to claim 8, characterized in that, Along each directed edge in the knowledge graph pointing from a predecessor node to a successor node, the impurity penetration rate of the directed edge is determined based on the comparative attenuation relationship of the integral intensity of the corresponding nodes in the impurity propagation intensity sequence, including: For each directed edge in the knowledge graph that points from the predecessor node to the successor node, the integral intensity corresponding to the predecessor node and the integral intensity corresponding to the successor node are extracted from the impurity propagation intensity sequence. Calculate the ratio of the integral strength of the successor node to the integral strength of the predecessor node; When the ratio is less than or equal to 1, the ratio is taken as the impurity penetration rate of the directed edge; When the ratio is greater than 1, a fixed constant of 1 is taken as the impurity penetration rate of the directed edge.

10. A knowledge graph-based system for tracing impurities in fluorocephalosporin intermediates, characterized in that, The system is used to execute the knowledge graph-based method for tracing impurities in fluorocephalosporin intermediates as described in any one of claims 1 to 9, the system comprising: The graph construction module is used to construct a knowledge graph of the synthesis process of the fluorocephalosporin intermediate F-3 based on the chemical reaction relationships and material transfer relationships between the starting materials, intermediates, by-products and target impurities in the F-3 intermediate of each step of the synthesis reaction of fluorocephalosporin. The intensity acquisition module is used to acquire the integral intensity of the extracted ion current of intermediates in each step of the process scale-up batch within the retention time window of the target impurity in the chromatography-mass spectrometry instrument, and form an impurity propagation intensity sequence. The weight calculation module is used to calculate the probability of side reaction generation for each candidate side reaction path pointing to the target impurity node in the knowledge graph, based on the process condition parameters of each edge on the path, and obtain the edge route weight by combining the structural fingerprint similarity of the nodes at both ends of the corresponding edge. The attribution allocation module is used to perform backpropagation step by step along the edges of the knowledge graph, starting with the integral intensity of the final product step, and recursively allocate and superimpose the attribution contribution of the current node to each predecessor node according to the weight of the outgoing edge path, so as to obtain the initial attribution score of each intermediate node. The intensity reduction module is used to extract the integral intensity between each predecessor node and the corresponding successor node based on the impurity propagation intensity sequence to calculate the impurity penetration rate, and to reduce the initial attribution score of each intermediate node to obtain the final attribution score of each intermediate node. The source tracing and location module is used to determine the process step corresponding to the intermediate node with the largest final attribution score as the main introduction step of the target impurity.