Vegetable disease time sequence knowledge graph completion method and device, equipment and medium

By combining periodic mapping, complex coupling, and frequency domain modulation, the problem of insufficient fitting of dynamic changes of diseases in the vegetable disease time-series knowledge graph completion method is solved, and the accurate characterization of seasonal cycles and short-term dynamic changes of diseases is achieved, thus improving the accuracy of completion.

CN123030964APending Publication Date: 2026-11-03ANHUI AGRICULTURAL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing methods for completing vegetable disease time-series knowledge graphs are insufficient in their ability to fit the dynamic changes of diseases, resulting in low accuracy.

Method used

By mapping known entities, relationships, and time information in the vegetable disease time-series knowledge graph to a vector space of a preset dimension, performing periodic mapping on the time embedding vector to generate a periodic time representation, and performing coupling transformation in the complex representation space, then performing frequency domain modulation, and using a scoring function to score candidate entities to complete missing quadruplets.

Benefits of technology

It achieves a unified characterization of the seasonal cyclical patterns and dynamic changes of vegetable diseases across multiple time scales, significantly improving the accuracy of disease time-series knowledge graph completion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123030964A_ABST
    Figure CN123030964A_ABST
Patent Text Reader

Abstract

The application discloses a vegetable disease time sequence knowledge graph completion method and device, equipment and medium, and relates to the technical field of time sequence knowledge graph. The method comprises the following steps: acquiring a disease time sequence quadruple with entity missing, mapping the entities, relations and time in the quadruple to a low-dimensional vector space to obtain embedding vectors; performing period mapping on the time embedding to generate a period time representation, and then coupling the period time representation with the relation embedding to obtain a time-modulated relation representation; performing frequency domain modulation processing on the time-modulated relation representation to obtain a target relation representation; finally, scoring all candidate entities in the graph by using a scoring function, selecting predicted entities according to the scores, and completing quadruple completion. Through the synergistic effect of period mapping and frequency domain modulation, the application realizes unified description of the seasonal periodicity law of vegetable diseases and the change characteristics under different time scales, and effectively improves the accuracy of vegetable disease time sequence knowledge graph completion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of temporal knowledge graph technology, specifically to a method for completing a temporal knowledge graph of vegetable diseases and a method for training a model. Background Technology

[0002] Knowledge graphs, as a structured form of semantic knowledge representation, have been widely applied in information retrieval, intelligent recommendation, and natural language processing in recent years. Traditional knowledge graphs provide a clear knowledge organization form for complex data by constructing static links between entities and relations. Traditional knowledge graph data is typically represented in the form of triples. ,in This represents the head entity. Representing a relation. This represents the Tail Entity.

[0003] In agriculture, particularly in vegetable disease knowledge management, existing research has constructed knowledge graphs containing entities such as vegetable crops, diseases, symptoms, pathogens, and pesticides. However, in actual production, the occurrence of vegetable diseases exhibits significant temporal dynamics—for example, downy mildew is prevalent in spring, powdery mildew is frequent in autumn, and climatic conditions from different years also affect the prevalence of diseases. To model this dynamic knowledge, temporal knowledge graphs are needed, typically represented in quadruplicate form. ,in Represents time information (Timestamp).

[0004] Existing methods for completing vegetable disease time-series knowledge graphs typically predict missing entities by learning entity embeddings, relation embeddings, and temporal embeddings, and constructing scoring functions. However, existing methods simply fuse temporal information as an additional feature of entity or relation embeddings, resulting in insufficient fitting ability to the dynamic changes of diseases and low accuracy in completing vegetable disease time-series knowledge graphs. Summary of the Invention

[0005] To address the technical problem of low accuracy in existing methods for completing vegetable disease time-series knowledge graphs, this application proposes a method, apparatus, equipment, and medium for completing vegetable disease time-series knowledge graphs that can improve accuracy.

[0006] According to one aspect, a method for completing a vegetable disease temporal knowledge graph is provided. The method includes: obtaining a quadruple to be completed from the vegetable disease temporal knowledge graph, wherein the quadruple to be completed includes a head entity, a relation, a tail entity, and time information, wherein one of the head entity and the tail entity is an entity to be predicted, and the other is a known entity; inputting the quadruple to be completed into a pre-trained vegetable disease temporal knowledge graph completion model to obtain a completed quadruple, wherein the vegetable disease temporal knowledge graph completion model is configured to perform the following operations: mapping the known entity, relation, and time information in the quadruple to be completed to a vector space of a preset dimension to obtain a known entity embedding vector, a relation embedding vector, and a time embedding vector. The input vector is used to perform periodic mapping on the time embedding vector to obtain a periodic time representation. The relationship embedding vector and the periodic time representation are coupled and transformed in the complex representation space to obtain a time-modulated relationship representation. Frequency domain modulation is performed on the time-modulated relationship representation to obtain a target relationship representation. Each candidate entity is scored using a scoring function, the known entity embedding vector, and the target relationship representation to obtain a scoring result for each candidate entity. The candidate entities are entities that already exist in the vegetable disease time series knowledge graph. Based on the scoring results, a predicted entity is determined from each candidate entity, and the predicted entity is used to complete the quadruple to be completed to obtain the completed quadruple.

[0007] According to the above aspects, in one embodiment, the periodic time representation includes a real part and an imaginary part; the step of performing periodic mapping on the time embedding vector to obtain the periodic time representation includes: performing a linear transformation on the time embedding vector through a learnable parameter matrix to obtain a phase angle vector; applying a sine function mapping to the phase angle vector to obtain the real part of the periodic time representation; and applying a cosine function mapping to the phase angle vector to obtain the imaginary part of the periodic time representation.

[0008] According to the above aspects, in one embodiment, the step of coupling the relation embedding vector and the periodic time representation in the complex representation space to obtain the time-modulated relation representation includes: converting the relation embedding vector and the periodic time representation from the real number domain to the complex number domain respectively to obtain a relation embedding vector in complex form and a periodic time representation in complex form; performing a Hadamard product coupling transformation on the relation embedding vector in complex form and the periodic time representation in complex form in the complex number domain to generate the time-modulated relation representation.

[0009] According to the above aspects, in one embodiment, performing frequency domain modulation on the time-modulated relation representation to obtain a target relation representation includes: mapping the time-modulated relation representation from the time domain to the frequency domain to obtain a relation frequency structure representation; inputting the relation frequency structure representation into a parameterized network to obtain frequency weights, and performing weighted modulation on the relation frequency structure representation using the frequency weights to obtain a modulated relation frequency structure representation; and restoring the modulated relation frequency structure representation from the frequency domain to the time domain to obtain the target relation representation.

[0010] According to the above aspects, in one embodiment, the parameterized network includes a linear transformation layer and an activation function layer; the step of inputting the relational frequency structure representation into the parameterized network to obtain frequency weights, and using the frequency weights to perform weighted modulation on the relational frequency structure representation to obtain a modulated relational frequency structure representation includes: inputting the relational frequency structure representation into the linear transformation layer to obtain a linear transformation result; inputting the linear transformation result into the activation function layer to obtain the frequency weights; and using the frequency weights to perform element-wise multiplication on the relational frequency structure representation to obtain the modulated relational frequency structure representation.

[0011] Based on the above aspects, in one embodiment, the scoring function is a trilinear inner product function in complex space.

[0012] According to the above aspects, in one embodiment, the method further includes: acquiring a training dataset, the training dataset including a plurality of positive sample quadruples and corresponding negative sample quadruples; the positive sample quadruples are complete quadruples that actually exist in the vegetable disease time-series knowledge graph, and the negative sample quadruples are generated by replacing the head entity or tail entity in the positive sample quadruples; iteratively training the original vegetable disease time-series knowledge graph completion model using each of the positive sample quadruples and the corresponding negative sample quadruples to obtain the pre-trained vegetable disease time-series knowledge graph completion model; wherein, for each iteration: the positive sample quadruples are input into the intermediate vegetable disease time-series knowledge graph. The model is completed to obtain positive sample scores; the negative sample quadruples are input into the intermediate vegetable disease time-series knowledge graph completion model to obtain negative sample scores; the negative log-likelihood loss is calculated based on the positive sample scores and the negative sample scores, as the first loss value; the time smoothing loss is calculated based on the temporal modulation relationship representation of adjacent time steps, as the second loss value; the frequency consistency loss is calculated based on the frequency structure representation of the relationship before and after frequency domain modulation, as the third loss value; the total loss value of the current iteration process is determined based on the weighted sum of the first loss value, the second loss value, and the third loss value; the model parameters of the intermediate vegetable disease time-series knowledge graph completion model are adjusted based on the total loss value.

[0013] According to the second aspect, a vegetable disease temporal knowledge graph completion device is provided, comprising: a data acquisition module, used to acquire a quadruple to be completed in the vegetable disease temporal knowledge graph, wherein the quadruple to be completed includes a head entity, a relation, a tail entity, and time information, wherein one of the head entity and the tail entity is an entity to be predicted, and the other is a known entity; a vector mapping module, used to map the known entity, relation, and time information in the quadruple to be completed to a vector space of a preset dimension, to obtain a known entity embedding vector, a relation embedding vector, and a time embedding vector; a periodic encoding module, used to perform periodic mapping on the time embedding vector to obtain a periodic time representation; and a complex coupling module, used to... The relationship embedding vector and the periodic time representation are coupled and transformed in the complex representation space to obtain the time-modulated relationship representation; the frequency domain modulation module is used to perform frequency domain modulation on the time-modulated relationship representation to obtain the target relationship representation; the scoring and completion module is used to score each candidate entity using a scoring function, the known entity embedding vector, and the target relationship representation to obtain the scoring result corresponding to each candidate entity, determine the predicted entity from each candidate entity based on the scoring result, and use the predicted entity to complete the quadruple to be completed, thereby completing the vegetable disease time-series knowledge graph; the candidate entity is an entity that already exists in the vegetable disease time-series knowledge graph.

[0014] According to a third aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the above-mentioned method for completing the vegetable disease time-series knowledge graph when executing the computer program.

[0015] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, wherein when executed by a processor, the computer program causes the processor to implement the above-described method for completing the vegetable disease time-series knowledge graph.

[0016] The beneficial effects of this application are as follows: According to the vegetable disease temporal knowledge graph completion method of this application, the known entities, relations, and time information in the vegetable disease temporal knowledge graph are mapped to a vector space of a preset dimension. Periodic mapping is performed on the time embedding vector to obtain a periodic time representation, thus endowing the time representation with seasonal cyclical characteristics. Then, the relation embedding vector and the periodic time representation are coupled and transformed in the complex representation space to generate a time-modulated relation representation that dynamically changes with time. Next, frequency domain modulation is performed on the time-modulated relation representation to separate low-frequency long-term trends from high-frequency short-term fluctuations and achieve adaptive control of different frequency components. Finally, the known entity embedding vector, the target relation representation, and the scoring function are used to score each candidate entity, and the highest-scoring entity is selected to complete the missing quadruple. The method of this application, through the synergistic effect of periodic mapping, complex coupling, and frequency domain modulation, achieves a unified characterization of the seasonal cyclical patterns and dynamic changes of vegetable diseases at multiple time scales, effectively improving the accuracy of vegetable disease temporal knowledge graph completion. Attached Figure Description

[0017] Figure 1 This is a flowchart of a method for completing a vegetable disease time-series knowledge graph according to an embodiment of this application.

[0018] Figure 2 This is a comparison chart of evaluation metrics of different methods according to an embodiment of this application on a vegetable disease time-series knowledge graph dataset.

[0019] Figure 3 This is a schematic diagram of the structure of a vegetable disease time-series knowledge graph completion device according to an embodiment of this application.

[0020] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0021] like Figure 1 As shown, in one embodiment of this application, a method for completing a vegetable disease time-series knowledge graph is provided, including steps 101 and 102.

[0022] Step 101: Obtain the quadruple to be completed in the vegetable disease time-series knowledge graph. The quadruple to be completed includes a head entity, a relation, a tail entity, and time information. One of the head entity and the tail entity is the entity to be predicted, and the other is a known entity. In the quadruple to be completed, the entity to be predicted is the missing item to be predicted.

[0023] For example, in the query "Tomato, disease outbreak, ?, summer", where the head entity is "tomato", the relation is "disease outbreak", the tail entity is missing (to be predicted), and the time is "summer", then the entity to be predicted is the tail entity, and each disease entity in the knowledge graph (such as "early blight", "late blight", "downy mildew", etc.) is a candidate entity. In the query "?, disease outbreak, early blight, summer", the entity to be predicted is the head entity.

[0024] A complete quadruple in the vegetable disease time-series knowledge graph is a quadruple consisting of a head entity, a relation, a tail entity, and time information (i.e., a timestamp). .in Indicates the head entity. Indicates a relationship. Indicates the tail entity. Represents time information. Head entity. Tail-end entity Includes at least one of the following: vegetable crop, disease name, symptoms, pathogen, and pesticide; relationship This includes at least one of the following: disease occurrence, symptom presentation, caused by..., application of control measures, or occurrence in the environment; time information. Includes year, season, month, or phenological period. The set of all entities is denoted as... The set of relations is denoted as The time set is denoted as Subsequently, entities, relationships, and timestamps are mapped with numbers, a unique dictionary is created, and integer IDs are assigned.

[0025] Step 102: Input the quadruple to be completed into the pre-trained vegetable disease time-series knowledge graph completion model.

[0026] The vegetable disease time-series knowledge graph completion model is configured to perform the operations shown in steps A1 to A6.

[0027] Step A1: Map the known entities, relations, and time information in the quadruple to be completed to a vector space of a preset dimension, and obtain the known entity embedding vectors respectively. Relational embedding vectors and temporal embedding vector Each embedding vector has a dimension of 1. (In this embodiment, we take) =300).

[0028] For example, mapping the known entities, relations, and time information in the quadruple to be completed to a vector space of a preset dimension includes: constructing entity embedding matrices respectively. Relational Embedding Matrix and time embedding matrix ,in, For the total number of entities, For the total number of relations, The total number of timestamps. For the embedding dimension. During model initialization, the initial values ​​of each embedding matrix follow a standard normal distribution and are multiplied by a scaling factor. (For example, λ=0.01) to ensure that the values ​​of each embedding vector remain stable within a small range during the initial training phase. For a given head entity ,relation Tail entity and time information The corresponding embedding vectors are obtained through matrix lookup tables: head entity embedding vector. = [id( Relational embedding vector = [id( ], Tail entity embedding vector = [id( Temporal embedding vector = [id( )).

[0029] Step A2: For the time embedding vector Perform cycle mapping to obtain the cycle time representation. .

[0030] This step gives the time representation cyclical characteristics similar to sine / cosine functions, which can accurately depict the inherent pattern of vegetable diseases appearing cyclically with the changing seasons, such as downy mildew, which occurs frequently in spring and powdery mildew, which occurs frequently in autumn.

[0031] Step A3: Embed the relation into the vector With the periodic time representation A coupling transformation is performed in the complex representation space to obtain the time modulation relation representation. .

[0032] This step deeply integrates time-cycle features into the relation representation by performing amplitude modulation and phase rotation in the complex domain, enabling the same disease relationship to have differentiated vector expressions in different seasons.

[0033] Step A4: Represent the time modulation relationship Perform frequency domain modulation to obtain the target relation representation. .

[0034] In the frequency structure representation, the low-frequency components correspond to the long-term epidemic trend of vegetable diseases (e.g., soil-borne diseases that are aggravated year after year), while the high-frequency components correspond to short-term sudden fluctuations (e.g., blight that breaks out suddenly after rain).

[0035] Step A5: Use the scoring function, known entity embedding vectors, and target relation representation to score each candidate entity and obtain the scoring results corresponding to each candidate entity; the candidate entities are entities that already exist in the vegetable disease time-series knowledge graph.

[0036] Step A6: Determine the predicted entity from each candidate entity based on the scoring results, and use the predicted entity to complete the quadruple to be completed, thus obtaining the completed quadruple.

[0037] According to this embodiment, the vegetable disease time-series knowledge graph completion method of this application achieves the following technical effects: (1) By using periodic time encoding, the time representation has seasonal cyclical characteristics, which can accurately depict the periodic pattern of vegetable diseases recurring with the changing seasons; (2) By using complex domain relation-time coupling transformation, the periodic time features are deeply integrated into the relation representation, so that the same disease relation has different vector expressions in different seasons; (3) By using frequency domain modulation, the disease evolution signal is decomposed into low-frequency long-term trend components and high-frequency short-term fluctuation components, and learnable frequency weights are introduced for adaptive control, realizing the separate modeling and independent adjustment of long-term trends and short-term fluctuations; (4) The combined effect of the above mechanisms enables the vegetable disease time-series knowledge graph completion model of this application to capture both the seasonal cycle and short-term dynamic changes of disease occurrence, effectively improving the accuracy of vegetable disease time-series knowledge graph completion.

[0038] According to one embodiment of this application, the periodic time representation includes a real part and an imaginary part. The process of performing periodic mapping on the time embedding vector in step A2 to obtain the periodic time representation includes steps A21 to A22.

[0039] Step A21: Through the learnable parameter matrix Temporal embedding vectors Perform a linear transformation to obtain the phase angle vector. As shown in the following formula: ; The dimension of this parameter matrix is During model training, learning and updating are performed through backpropagation.

[0040] Step A22: For the phase angle vector Applying a sine function mapping yields the real part of the periodic time representation; for the phase angle vector... Applying a cosine function mapping yields the imaginary part of the periodic time representation. The above results in a periodic time representation with periodic phase characteristics. The process can be illustrated by the following formula: ; In other embodiments of this application, the positions of the sine function and the cosine function can be interchanged, that is, the real part is cosine and the imaginary part is sine, which can also achieve periodic mapping. These substitution methods do not depart from the protection scope of this application.

[0041] The periodicity of sine and cosine functions enables time representation to have cyclical variation capabilities, accurately describing the regularity of vegetable diseases recurring each year during similar phenological periods.

[0042] According to one embodiment of this application, the process of coupling the relation embedding vector and the periodic time representation in the complex representation space in step A3 above includes steps A31 to A32.

[0043] Step A31: Embed the relation into the vectors respectively Representation of periodic time The conversion from the real number field to the complex number field yields a relation embedding vector in complex form and a periodic time representation in complex form.

[0044] The transformation involves mapping the real and imaginary parts of the vector to the complex space, respectively. In one embodiment, the real part of the relation embedding vector is its original vector value, the imaginary part is initialized to zero, and the real part, representing the periodic time, is... The imaginary part is .

[0045] Step A32: Perform a Hadamard product coupled transformation (i.e., element-wise multiplication in the complex domain) on the complex form relation embedding vector and the complex form periodic time representation to generate a time-modulated relation representation. As shown in the following formula: ; in This represents element-wise multiplication of the complex field.

[0046] According to this embodiment, by performing a Hadamard product coupling transformation on the relation embedding and periodic time representation in the complex domain, the time periodic features are deeply integrated into the relation representation by utilizing the amplitude modulation and phase rotation characteristics of complex multiplication, so that the same disease relation has differentiated vector expressions in different seasons; the complex domain representation has richer expressive power and can better characterize the dynamic characteristics of disease relation evolution over time.

[0047] According to one embodiment of this application, step A4 above represents the time modulation relationship. Perform frequency domain modulation to obtain the target relation representation. The process includes steps B1 to B3.

[0048] Step B1: Represent the time modulation relationship Mapping from the time domain to the frequency domain yields the relational frequency structure representation. In one embodiment, a one-dimensional discrete cosine transform (DCT) is used to represent the time modulation relationship. Mapping the real part vector to the frequency domain yields the frequency structure representation of the relation. As shown in the following formula: ; in, This represents the Discrete Cosine Transform (DCT). The DCT has excellent energy compression properties, which can concentrate the energy of the disease evolution signal onto a few low-frequency coefficients, facilitating subsequent frequency selection and modulation.

[0049] Step B2: Represent the relational frequency structure Input the parameterized network to obtain the frequency weights. and using frequency weights Relational frequency structure representation Perform weighted modulation to obtain the modulated relational frequency structure representation. As shown in the following formula: ; in, Represents element-wise multiplication, frequency weight vector By representing the frequency structure Obtained by applying a learnable parameterized network. The value of each element in the table represents the degree of enhancement or suppression of the corresponding frequency component.

[0050] Step B3: Represent the modulated relational frequency structure The target relation representation is obtained by recovering from the frequency domain to the time domain. .

[0051] Specifically, the inverse transformation method corresponding to the mapping method in step B1 is used to represent the modulated relational frequency structure. From the frequency domain, the time domain is recovered. In one embodiment, the inverse discrete cosine transform (IDCT), corresponding to the discrete cosine transform (DCT) described above, is used to recover the time domain representation, thus obtaining the target relation representation. As shown in the following formula: ; in, This represents the inverse discrete cosine transform.

[0052] In other embodiments of this application, the Fast Fourier Transform (FFT) and its corresponding inverse transform can be used instead of the Discrete Cosine Transform and its inverse transform, which can also achieve the mutual mapping between the time domain and the frequency domain.

[0053] According to this implementation, the disease evolution signal is mapped from the time domain to the frequency domain through frequency domain transformation, realizing the separation and extraction of low-frequency long-term trend components and high-frequency short-term fluctuation components; the frequency components are adaptively modulated by frequency weights generated by a learnable parameterized network, enabling the model to flexibly adjust the degree of attention to different frequency components according to the characteristics of disease data (such as enhancing low-frequency components for highly seasonal diseases and retaining high-frequency components for sudden diseases); the modulated frequency structure is restored to the time domain through inverse transformation, so that the final target relationship representation has both the long-term regularity and short-term dynamics of disease changes.

[0054] According to one embodiment of this application, the parameterized network in step B2 above includes a linear transformation layer and an activation function layer. In step B2 above, the relational frequency structure is represented... Input the parameterized network to obtain the frequency weights. and using frequency weights Relational frequency structure representation Perform weighted modulation to obtain the modulated relational frequency structure representation. The process includes steps B21 to B23.

[0055] Step B21: Represent the relational frequency structure Inputting a linear transformation layer yields a linear transformation result. The linear transformation layer contains a weight matrix. and bias vector .

[0056] Step B22: Input the linear transformation result into the activation function layer to obtain the frequency weights. As shown in the following formula: ; Among them, the weight matrix and bias vector All of these are trainable parameters, which are learned and updated through backpropagation during model training. For example, the activation function is the Sigmoid function, which maps the output value to the (0, 1) interval, so that each element of the frequency weight vector has a clear physical meaning (0 means that the corresponding frequency component is completely suppressed, 1 means that the corresponding frequency component is completely preserved, and the middle value means that it is partially preserved).

[0057] Step B23: Using the frequency weight vector Relational frequency structure representation Perform element-wise multiplication to perform weighted modulation, and obtain the modulated relational frequency structure representation. .

[0058] According to this implementation, a learnable frequency weight generation mechanism is constructed by combining a linear transformation layer and an activation function, enabling the model to automatically learn the optimal frequency weight allocation scheme based on the characteristics of disease data. The Sigmoid activation function is used to limit the weight values ​​to the (0,1) range, avoiding excessive enhancement or suppression of frequency components that could lead to signal distortion, and helping to maintain the stability of the frequency structure.

[0059] According to one embodiment of this application, the scoring function in step A6 above is a trilinear inner product function in complex space, as shown in the following formula: ; in, Let be the embedding vector of a known entity in complex space. Let be the target relation representation in complex space. Let be the embedding vector of candidate entities in complex space. This represents the trilinear inner product operation.

[0060] When scoring candidate entities, for the tail entity prediction task (where the known entity is the head entity), the embedding vector of the known entity is fixed. Relationship with target Iterate through the embedding vector of each candidate entity. Calculate the trilinear inner product score; for the head entity prediction task (where the known entity is the tail entity), similarly iterate through the embedding vectors of each candidate head entity to calculate the score. A higher score indicates a higher degree of match between the candidate entity and the given fact.

[0061] According to this implementation, the trilinear inner product function can effectively capture the interaction between known entities, relations, and candidate entities; performing inner product operations in complex space makes full use of the phase information of complex representation, which can more richly express the semantic association between entities and relations; by traversing candidate entities to score and sort them one by one, the knowledge graph completion problem is transformed into a computable sorting problem, realizing the automatic prediction of missing entities.

[0062] According to one embodiment of this application, the vegetable disease time-series knowledge graph completion method of this application also includes a vegetable disease time-series knowledge graph completion model training process, which includes steps T1 to T4.

[0063] Step T1: Obtain the training dataset, which includes several positive sample quadruples and corresponding negative sample quadruples; the positive sample quadruples are complete quadruples that actually exist in the vegetable disease time series knowledge graph, and the negative sample quadruples are generated by replacing the head entity or tail entity in the positive sample quadruples.

[0064] For example, for positive sample quadruplets The head entity can be randomly replaced. For other entities Generate negative sample quadruples Or randomly replace the tail entity For other entities Generate negative sample quadruples In addition, negative sample quadruples can be generated using methods such as Bernoulli sampling and adversarial generation.

[0065] Step T2: Iteratively train the original vegetable disease time-series knowledge graph completion model using each of the positive sample quadruples and the corresponding negative sample quadruples to obtain the pre-trained vegetable disease time-series knowledge graph completion model.

[0066] For example, the model uses a random initialization method to initialize parameters: let the embedding dimension be... The initial values ​​of each embedding matrix follow a standard normal distribution and are multiplied by a scaling factor λ (λ=0.01) to ensure that the values ​​of each embedding vector remain stable within a small range during the initial training phase; the weight embedding matrix... Initialize to all zeros; the frequency low-pass and high-pass scale parameters are initialized to constant values, and the frequency boundary parameter is initialized to the midpoint value of the rank dimension; the linear layer parameters in the frequency weight generation network are initialized using standard Kaiming uniform initialization.

[0067] Each iteration includes the process shown in steps T21 to T26.

[0068] Step T21: Input the positive sample quadruple into the intermediate vegetable disease time series knowledge graph completion model to obtain the positive sample score; input the negative sample quadruple into the intermediate vegetable disease time series knowledge graph completion model to obtain the negative sample score.

[0069] Step T22: Calculate the negative log-likelihood loss based on the positive and negative sample scores, and use it as the first loss value. For example, the first loss value is obtained. The process is shown in the following formula: ; in, Represents the training set, Represents a set of entities. Represents the scoring function. This represents a true positive sample quadruple that exists in the training set. This means replacing the tail entities in the positive samples with candidate entities. The negative sample quadruple constructed later, For each candidate entity.

[0070] Step T23: Calculate the temporal smoothing loss based on the temporal modulation relationship between adjacent time steps, and use it as the second loss value. For example, the second loss value is obtained. The process is shown in the following formula: ; in, For time step The corresponding time modulation relationship is represented as follows: For time step The corresponding time modulation relationship is represented as follows: This represents the squared L2 norm; this time smoothing constraint term penalizes excessive differences between adjacent time steps through L2 distance, ensuring that the disease relationship representation evolves smoothly over time. Second loss value This is used to constrain the variation magnitude between time modulation relationships between adjacent time steps.

[0071] Step T24: Calculate the frequency consistency loss based on the frequency structure representation before and after frequency domain modulation, and use it as the third loss value. For example, a third loss value is obtained. The process is shown in the following formula: ; in, The frequency structure representation before frequency domain modulation. The frequency structure representation after frequency domain modulation. Represents the squared L2 norm. Third loss value. By limiting the frequency structure difference before and after modulation using L2 distance, it ensures that the internal structure information in the frequency domain is not lost due to over-modulation. It is used to constrain the difference between the frequency structure representation before and after frequency domain modulation.

[0072] Step T25: Based on the first loss value Second loss value and the third loss value The weighted sum of these values ​​determines the total loss value for the current iteration, as shown in the following formula: ; in, and These are the weight hyperparameters (in one embodiment, they are 0.1 and 0.05 respectively).

[0073] Step T26: Adjust the model parameters of the intermediate vegetable disease time series knowledge graph completion model based on the total loss value.

[0074] For example, by minimizing the total loss value, the Adam optimizer is applied to all trainable parameters of the model (including entity embedding matrix, relation embedding matrix, temporal embedding matrix, and learnable parameter matrix). Weight matrix of the frequency weight generation network and bias vector The model is iteratively updated until the preset training stopping condition is met (reaching the maximum number of training rounds or the validation set index no longer improving after multiple consecutive rounds), thus obtaining the pre-trained vegetable disease time-series knowledge graph completion model.

[0075] According to this implementation method, the following effects are achieved through the joint optimization of three loss values: (1) The first loss value drives the model to learn the correct completion ability by maximizing the prediction probability of the real entity; (2) The second loss value ensures that the disease evolution law conforms to agricultural reality by suppressing the drastic fluctuations in the relationship between adjacent time steps; (3) The third loss value ensures the integrity of the internal structural information of the frequency by limiting the structural differences before and after frequency domain modulation, thereby improving the stability and generalization ability of the model training. The three loss values ​​work together to make the trained model have accuracy, reasonable time evolution and frequency domain structural stability.

[0076] According to one embodiment of this application, such as Figure 2 As shown, a vegetable disease time-series knowledge graph completion device 200 is provided, which includes the following modules: The data acquisition module 201 is used to acquire the four-tuples to be completed in the vegetable disease time series knowledge graph. The four-tuples to be completed include a head entity, a relation, a tail entity, and time information. One of the head entity and the tail entity is the entity to be predicted, and the other is a known entity.

[0077] The vector mapping module 202 is used to map the known entities, relations and time information in the quadruple to be completed to a vector space of a preset dimension, so as to obtain the known entity embedding vector, relation embedding vector and time embedding vector.

[0078] The periodic encoding module 203 is used to perform periodic mapping on the time embedding vector to obtain a periodic time representation.

[0079] The complex coupling module 204 is used to perform a coupling transformation between the relation embedding vector and the periodic time representation in the complex representation space to obtain the time-modulated relation representation.

[0080] The frequency domain modulation module 205 is used to perform frequency domain modulation on the time modulation relation representation to obtain the target relation representation.

[0081] The scoring and completion module 206 is used to score each candidate entity using a scoring function, a known entity embedding vector, and a target relation representation, to obtain the scoring result corresponding to each candidate entity, to determine the predicted entity from each candidate entity based on the scoring result, and to use the predicted entity to complete the four-tuple to be completed, thereby completing the vegetable disease time-series knowledge graph; the candidate entity is an entity that already exists in the vegetable disease time-series knowledge graph.

[0082] The specific implementation methods of each of the above modules are described in the corresponding method steps above, and will not be repeated here.

[0083] According to one embodiment of this application, an electronic device is provided, such as... Figure 3 As shown, the electronic device includes a processor 110, a communication interface 120, a memory 130, and a communication bus 140. The processor 110 is communicatively connected to the communication interface 120 and the memory 130 via the communication bus 140.

[0084] Processor 110 is the core computing and control unit of the electronic device, and can adopt a heterogeneous computing architecture of CPU and GPU. The CPU is responsible for serial logic operations such as data loading, flow control, and candidate entity sorting; the GPU is responsible for large-scale tensor operations such as parallel computation of embedded vectors, matrix multiplication, and frequency domain transformation. When executing computer programs, processor 110 implements the vegetable disease time-series knowledge graph completion method described in this paper.

[0085] The communication interface 120 is used to realize data interaction between electronic devices and the external environment. It supports wired communication (such as Ethernet interface, USB interface) and wireless communication (such as Wi-Fi module, 4G / 5G module). The acquired data is transmitted to the processor 110 or the memory 130 through the communication bus 140.

[0086] The memory 130 is used to store computer programs, vegetable disease time-series knowledge graph data, model parameters, and intermediate data during the inference process. The model parameters include entity embedding matrices, relation embedding matrices, time embedding matrices, learnable parameter matrices, weight matrices of the frequency weight generation network, and bias vectors.

[0087] The communication bus 140 is used to connect the processor 110, the communication interface 120 and the memory 130 to realize data transfer and control signal transmission among the three.

[0088] When the electronic device executes a computer program, the processor 110 obtains the quadruple data to be processed through the communication interface 120, loads the model parameters from the memory 130, and sequentially executes vector mapping, periodic time encoding, relational-time complex coupling, frequency domain modulation, scoring calculation and sorting. Finally, it outputs the completed quadruple through the communication interface 120 or a display device.

[0089] According to this embodiment, the automated execution of the vegetable disease time-series knowledge graph completion method described in this application is realized through the coordinated operation of the hardware architecture of the electronic device and the computer program. At the same time, it supports the persistent storage and fast loading of trained model parameters in the device, and accelerates the batch operation and scoring calculation of embedded vectors through GPU parallel computing, which significantly improves the real-time performance and computational efficiency of vegetable disease time-series knowledge graph completion.

[0090] According to one embodiment of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, causes the processor to execute the vegetable disease time-series knowledge graph completion method described herein.

[0091] The computer-readable storage media include, but are not limited to, magnetic storage media (such as hard disks, floppy disks, and magnetic tapes), optical storage media (such as CD-ROMs and DVD-ROMs), semiconductor storage media (such as solid-state drives (SSDs), USB flash drives, SD cards, EEPROMs, and flash memory), and cloud storage space.

[0092] The computer program can be stored in the form of source code, object code, bytecode, executable file, or script. The program modules stored in the storage medium include: a data loading module (reading quadruple data from the storage medium), an inference calculation module (performing core inference operations such as vector mapping, periodic encoding, complex coupling, frequency domain modulation, and scoring calculation), and a scoring and ranking module (scoring candidate entities and ranking them to output prediction results).

[0093] The storage medium can also store trained model parameter files (including entity embedding matrix, relation embedding matrix, time embedding matrix, learnable parameter matrix, frequency weight generation network parameters, etc.), stored in binary, JSON or HDF5 format, which facilitates model migration and deployment between different electronic devices.

[0094] According to this embodiment, by storing the computer program on a computer-readable medium, the vegetable disease time-series knowledge graph completion method of this application can be independently copied, distributed and deployed in the form of a computer program product, which is convenient to install and run on different types of electronic devices and has good portability and commercial application value.

[0095] To verify the effectiveness of the method in this application, in one embodiment, the method provided in this application was experimentally verified on a vegetable disease time-series knowledge graph dataset.

[0096] I. Dataset Construction.

[0097] This embodiment uses a self-built vegetable disease time-series knowledge graph dataset. Data sources include publicly available literature in the field of vegetable plant protection, disease monitoring records from agricultural plant protection departments, and expert knowledge bases. It covers more than 10 major vegetable crops such as tomatoes, cucumbers, peppers, eggplants, and green beans, and includes more than 40 common diseases such as downy mildew, powdery mildew, early blight, late blight, viral diseases, root rot, and wilt, along with corresponding symptom descriptions, pathogens, and control agents. The entity types in the knowledge graph include vegetable crops, disease names, symptoms, pathogens, and pesticides; the relationship types include "disease occurs," "has symptoms," "caused by," and "control application," totaling more than 20,000 entities and more than 150,000 quadruples.

[0098] For time-series information annotation, for diseases with clear seasonal occurrence patterns (such as downy mildew being annotated as spring and powdery mildew as autumn), a time-series quadruple set is constructed. The data is randomly divided into training, validation, and test sets at a ratio of 70%, 10%, and 20%, respectively.

[0099] II. Experimental Setup.

[0100] (a) Model parameter settings: Embedding dimension The initial value is uniformly set to 300. Each embedding matrix is ​​initialized according to a standard normal distribution and multiplied by a scaling factor of 0.01. The linear layer parameters in the frequency weight generation network are initialized uniformly using Kaiming. The frequency low-pass and high-pass scale parameters are initialized to a constant value of 0.5, and the frequency boundary parameter is initialized to the midpoint of the rank dimension. During training, the batch size is set to 512, the initial learning rate is set to 0.01, and the Adam optimizer is used for parameter updates. The loss function is based on the first loss value. Second loss value and the third loss value Weighted composition, weight Set to 0.1, weight Set to 0.05. The maximum number of training epochs is set to 300 epochs, and the early stopping mechanism is set to terminate training when the validation set MRR metric no longer improves for 10 consecutive epochs.

[0101] (ii) Comparison method: To verify the effectiveness of the method in this application, various representative baseline methods shown in Table 1 below were selected for comparison.

[0102] Table 1

[0103] TCompoundE models the temporal evolution of entities and relations by encoding temporal information as complex twitch factors. TeRDy characterizes the activity level of relations in different time periods by modeling time intervals. It discretizes the temporal information in the temporal knowledge graph into several time intervals and learns an independent relation representation for each interval, which can better capture the time-varying characteristics of relations.

[0104] III. Evaluation Metrics: This embodiment adopts the following evaluation metrics widely used in temporal knowledge graph completion tasks: MRR (Mean Reciprocal Rank): The inverse average of the rankings of the correct entity in the candidate entity ranking list. The value ranges from (0,1]. The higher the value, the better the performance. It comprehensively reflects the model's ability to rank positive entities. Hit@N (N=1,3,10): The proportion of queries in which the correct entity ranks in the top N positions, measuring the model's ability to rank the correct entity in the Top-N.

[0105] For each query in the test set, all candidate entities are sorted from highest to lowest according to the model's output score, and the ranking position of the correct entity is recorded. The above-mentioned metrics are calculated based on the ranking results of all queries. Higher values ​​for all metrics indicate better model performance.

[0106] IV. Experimental Results.

[0107] Regarding experimental parameter settings, to ensure fairness in model comparison, the embedding dimension (rank) of our method, TeRDy, and TCompoundE was all set to 300, and the batch size was all set to 512. The learning rate for our method and TeRDy was set to 0.0100, and the learning rate for TCompoundE was set to 0.0050. On the same TOMATO dataset, the knowledge graph completion performance of each model is as follows: Figure 4 As shown in the figure. The method of this application achieved the best results in all four evaluation indicators, MRR, Hits@1, Hits@3 and Hits@10, reaching 0.8652, 0.8112, 0.8979 and 0.9584, respectively.

[0108] Specifically, compared to TeRDy, the MRR of the method in this application improved from 0.8124 to 0.8652, an increase of 0.0528, or 5.28 percentage points; Hits@1 improved from 0.7316 to 0.8112, an increase of 0.0796, or 7.96 percentage points; Hits@3 improved from 0.8729 to 0.8979, an increase of 0.0250, or 2.50 percentage points; and Hits@10 improved from 0.9477 to 0.9584, an increase of 0.0107, or 1.07 percentage points. Calculated on a relative improvement basis, the above four indicators improved by approximately 6.50%, 10.88%, 2.86%, and 1.13%, respectively. The improvement in Hits@1 was the most significant, indicating that the method in this application can more effectively prioritize correct entities among candidate entities, thereby improving the accuracy of predicting missing entities.

[0109] Compared to TCompoundE, the method in this application shows more significant advantages, with an MRR improvement of 0.2012 (20.12 percentage points); Hits@1 improvement of 0.2720 (27.20 percentage points); Hits@3 improvement of 0.1627 (16.27 percentage points); and Hits@10 improvement of 0.0415 (4.15 percentage points), corresponding to relative improvements of approximately 30.30%, 50.45%, 22.13%, and 4.53%, respectively. Particularly noteworthy is the approximately 50.45% relative improvement in Hits@1 compared to TCompoundE, indicating that this method not only improves the average ranking of correct entities among all candidate entities but also significantly enhances the accuracy of first-order prediction.

[0110] The performance improvement of the proposed method is not limited to a specific cutoff range, as evidenced by the four metrics: the increased MRR indicates a higher overall average ranking for correct entities; the significant improvement in Hits@1 reflects the enhanced ability of the model to directly distinguish the best candidate entities; the improvement in Hits@3 indicates a further increase in the probability of correct entities entering the top three; and the improvement in Hits@10 shows that the model still has high recall capability within a wider candidate range. Therefore, the proposed method simultaneously improves the overall ranking quality of candidate entities, the accuracy of first-place prediction, and the hit rate under different ranking cutoff conditions, demonstrating a relatively stable and comprehensive advantage in knowledge graph completion performance.

[0111] This performance improvement corresponds to the design of the model in this application: this application uses periodic time representation, complex domain relation-time coupling, and frequency domain modulation to jointly characterize the seasonal periodic patterns, long-term trends, and short-term dynamic fluctuations of vegetable diseases, thereby enhancing the expressive power of the relation representation over time. The above mechanism can be summarized as a unified characterization of seasonal periodic patterns and dynamic changes across multiple time scales.

[0112] V. Experimental Conclusions: The above experimental results show that the periodic time coding and frequency structure modulation mechanism proposed in this application can simultaneously characterize the seasonal cycle and short-term dynamic changes of vegetable diseases. Compared with existing methods that only use time embedding, the technical advantages of this application are reflected in the following aspects: (1) Periodic time coding accurately describes the regularity of the cyclical occurrence of diseases with seasonal alternation; (2) Deep integration of periodic time features and relational semantics is achieved through complex domain relation-time coupling; (3) Separate modeling and adaptive control of long-term epidemic trends and short-term sudden fluctuations of diseases are achieved through frequency domain modulation. The combined effect of the above mechanisms effectively improves the accuracy of vegetable disease time-series knowledge graph completion, providing reliable technical support for intelligent early warning and prevention and control decisions of vegetable diseases.

[0113] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.

Claims

1. A method for completing a vegetable disease time-series knowledge graph, characterized in that, The method includes: Obtain the four-tuples to be completed in the vegetable disease time-series knowledge graph. The four-tuples to be completed include a head entity, a relation, a tail entity, and time information. One of the head entity and the tail entity is the entity to be predicted, and the other is a known entity. The quadruple to be completed is input into a pre-trained vegetable disease time-series knowledge graph completion model to obtain the completed quadruple. The vegetable disease time-series knowledge graph completion model is configured to perform the following operations: The known entities, relations, and time information in the quadruple to be completed are mapped to a vector space of a preset dimension to obtain the known entity embedding vector, relation embedding vector, and time embedding vector. Perform a periodic mapping on the time embedding vector to obtain a periodic time representation; The relationship embedding vector and the periodic time representation are coupled and transformed in the complex representation space to obtain the time modulation relationship representation; Frequency domain modulation is performed on the time modulation relation representation to obtain the target relation representation; Each candidate entity is scored using a scoring function, the known entity embedding vector, and the target relation representation to obtain a scoring result for each candidate entity; the candidate entities are entities that already exist in the vegetable disease time-series knowledge graph. Based on the scoring results, predictive entities are determined from each of the candidate entities, and the predictive entities are used to complete the quadruple to be completed, resulting in the completed quadruple.

2. The method for completing the temporal knowledge graph of vegetable diseases according to claim 1, characterized in that, The periodic time representation includes a real part and an imaginary part; the process of performing periodic mapping on the time embedding vector to obtain the periodic time representation includes: A phase angle vector is obtained by performing a linear transformation on the time embedding vector using a learnable parameter matrix; Applying a sine function mapping to the phase angle vector yields the real part of the periodic time representation; By applying a cosine function mapping to the phase angle vector, the imaginary part of the periodic time representation is obtained.

3. The method for completing the temporal knowledge graph of vegetable diseases according to claim 1, characterized in that, The step of coupling the embedded vector of the relation with the periodic time representation in the complex representation space to obtain the time-modulated relation representation includes: The relation embedding vector and the periodic time representation are respectively converted from the real number field to the complex number field to obtain the relation embedding vector in complex form and the periodic time representation in complex form; Perform a Hadamard product coupling transformation on the complex form relation embedding vector and the complex form periodic time representation in the complex domain to generate the time-modulated relation representation.

4. The method for completing the temporal knowledge graph of vegetable diseases according to claim 1, characterized in that, The step of performing frequency domain modulation on the time modulation relation representation to obtain the target relation representation includes: The time modulation relation is mapped from the time domain to the frequency domain to obtain the frequency structure representation of the relation. The relational frequency structure representation is input into a parameterized network to obtain frequency weights, and the relational frequency structure representation is weighted and modulated using the frequency weights to obtain a modulated relational frequency structure representation. The modulated relational frequency structure representation is restored from the frequency domain to the time domain to obtain the target relational representation.

5. The method for completing the temporal knowledge graph of vegetable diseases according to claim 4, characterized in that, The parameterized network includes a linear transformation layer and an activation function layer; the step of inputting the relational frequency structure representation into the parameterized network to obtain frequency weights, and then using the frequency weights to perform weighted modulation on the relational frequency structure representation to obtain a modulated relational frequency structure representation, includes: The frequency relation structure is input into the linear transformation layer to obtain the linear transformation result; The linear transformation result is input into the activation function layer to obtain the frequency weights; The frequency weights are used to perform element-wise multiplication on the relational frequency structure representation to obtain the modulated relational frequency structure representation.

6. The method for completing the temporal knowledge graph of vegetable diseases according to claim 1, characterized in that, The scoring function is a trilinear inner product function in complex space.

7. The method for completing the temporal knowledge graph of vegetable diseases according to claim 1, characterized in that, The method further includes: Obtain a training dataset, which includes several positive sample quadruples and corresponding negative sample quadruples; the positive sample quadruples are complete quadruples that actually exist in the vegetable disease time series knowledge graph, and the negative sample quadruples are generated by replacing the head entity or tail entity in the positive sample quadruples. The original vegetable disease time-series knowledge graph completion model is iteratively trained using each of the positive sample quadruples and the corresponding negative sample quadruples to obtain the pre-trained vegetable disease time-series knowledge graph completion model. For each iteration: The positive sample quadruple is input into the intermediate vegetable disease time series knowledge graph completion model to obtain the positive sample score; the negative sample quadruple is input into the intermediate vegetable disease time series knowledge graph completion model to obtain the negative sample score. The negative log-likelihood loss is calculated based on the positive sample scores and the negative sample scores, and is used as the first loss value. The temporal smoothing loss is calculated based on the temporal modulation relationship between adjacent time steps and used as the second loss value. The frequency consistency loss is calculated based on the frequency structure representation before and after frequency domain modulation, and used as the third loss value. The total loss value of the current iteration process is determined based on the weighted sum of the first loss value, the second loss value, and the third loss value. The model parameters of the intermediate vegetable disease time-series knowledge graph completion model are adjusted based on the total loss value.

8. A device for completing a vegetable disease time-series knowledge graph, characterized in that, include: The data acquisition module is used to acquire the quadruples to be completed in the vegetable disease time series knowledge graph. The quadruples to be completed include a head entity, a relation, a tail entity, and time information. One of the head entity and the tail entity is the entity to be predicted, and the other is a known entity. The vector mapping module is used to map the known entities, relations, and time information in the quadruple to be completed to a vector space of a preset dimension, so as to obtain the known entity embedding vector, relation embedding vector, and time embedding vector. A periodic encoding module is used to perform periodic mapping on the time embedding vector to obtain a periodic time representation; The complex coupling module is used to couple the relationship embedding vector with the periodic time representation in the complex representation space to obtain the time modulation relationship representation. The frequency domain modulation module is used to perform frequency domain modulation on the time modulation relation representation to obtain the target relation representation; The scoring and completion module is used to score each candidate entity using a scoring function, the known entity embedding vector, and the target relation representation to obtain the scoring result corresponding to each candidate entity. Based on the scoring result, a predicted entity is determined from each candidate entity, and the predicted entity is used to complete the quadruple to be completed, thereby completing the vegetable disease time-series knowledge graph. The candidate entity is an entity that already exists in the vegetable disease time-series knowledge graph.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, characterized in that, When the processor executes the computer program, it implements the vegetable disease time-series knowledge graph completion method as described in any one of claims 1 to 7.

10. A computer-readable storage medium on which a computer program is stored, characterized in that, When executed by a processor, the computer program causes the processor to implement the vegetable disease time-series knowledge graph completion method as described in any one of claims 1 to 7.