Fruit and vegetable transportation path planning method and system based on knowledge graph

Through a knowledge graph-based method, combined with deep neural network and segmented greedy algorithm, the fruit and vegetable transportation paths are dynamically optimized, which solves the problem of fruit transportation path selection in the existing technology that is not real-time and dynamic, and achieves the maximum fruit freshness and quality Limit protection.

CN118941195APending Publication Date: 2024-11-12YTO EXPRESS CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202410828762.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The prior art is difficult to select the optimal path in real-time and dynamically in fruit and vegetable transportation, resulting in large losses and economic losses of fruits, which cannot meet consumers' demand for fresh fruits.

Method used

Using a knowledge graph-based method, the deep neural network model and segmented greedy algorithm are dynamically adjusted by obtaining order information, building weighted undirected graphs, combining self-attention mechanisms, and the path weight is optimized to reduce the loss of fruit freshness.

Benefits of technology

It is achieved to maximize the freshness and quality of fruits, reduce transportation costs, and improve transportation efficiency while considering road conditions, transportation equipment and transportation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941195A_ABST
    Figure CN118941195A_ABST
Patent Text Reader

Abstract

The invention discloses a fruit and vegetable transportation path planning method and system based on a knowledge graph, which comprehensively considers the influence of road conditions, transportation equipment and transportation time on the freshness of fruits so as to select an optimal transportation path and can maintain the freshness and quality of the fruits to the greatest extent. According to the technical scheme, the method comprises the steps that S1, order information is acquired and preprocessed; s2, on the basis of a deep neural network model fused with a self-attention mechanism, a sequence labeling method is adopted to extract a corresponding relation triple from the order information preprocessed in the step S1, and then a knowledge graph is constructed on the basis of the relation triple; s3, constructing a weighted undirected graph on the basis of the knowledge graph model constructed in the step S2; and S4, dynamically adjusting the time weight in the edge of the weighted undirected graph according to the transportation time, and solving a local optimal solution under the variable weight by using a segmented greedy algorithm to obtain an optimal path with the minimum freshness loss as a global optimal solution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of article transportation route planning, and in particular to a fruit and vegetable transportation route planning method and system based on a knowledge graph. Background Art

[0002] According to the National Bureau of Statistics, my country is the world's largest fruit producer. However, my country's annual fruit loss is very large, with about 12 million tons of fruit lost in transportation each year. The rotten and lost fruits and vegetables can meet the basic nutritional needs of nearly 200 million people, causing economic losses of 75 billion yuan. Different routes may involve different distances, traffic conditions, and transportation methods. Therefore, choosing a suitable transportation route can improve the transportation efficiency of fruits. By choosing the best route, it can reduce transportation time, reduce costs, and maximize the freshness and quality of fruits, so that fruits can reach the market more quickly from the place of production, reduce cargo detention and losses, and meet consumers' demand for fresh fruits.

[0003] The knowledge graph is a structured, semantically rich knowledge representation model that can integrate information and knowledge from multiple fields, fuse different types of data, and provide comprehensive and rich background information to support path planning decisions. In addition, the knowledge graph can be regarded as a graph structure. Converting the knowledge graph into a weighted undirected graph can obtain the weight relationship between the relevant nodes, which can be used to find the optimal path in path planning and provide more efficient and accurate path planning results. Finally, the knowledge graph is regarded as a dynamic knowledge base that can be continuously updated and expanded. In path planning, information such as road networks and traffic conditions may change continuously. By combining real-time data and new knowledge with the knowledge graph, real-time path planning and dynamic route optimization can be achieved to adapt to changes in actual conditions.

[0004] Therefore, how to utilize the characteristics of the above-mentioned knowledge graph to realize the route selection of fruit and vegetable transportation in a more real-time and dynamic manner is a problem that needs to be solved urgently in the industry. Summary of the invention

[0005] A brief summary of one or more aspects is given below to provide a basic understanding of these aspects. This summary is not an exhaustive overview of all conceived aspects, and is neither intended to identify the key or critical elements of all aspects nor to define the scope of any or all aspects. Its only purpose is to give some concepts of one or more aspects in a simplified form as a prelude to a more detailed description that will be given later.

[0006] The purpose of the present invention is to solve the above-mentioned problems and provide a method and system for planning fruit and vegetable transportation routes based on a knowledge graph, which comprehensively considers the impact of road conditions, transportation equipment, and transportation time on the freshness of fruits, thereby selecting the optimal transportation route to maximize the freshness and quality of fruits.

[0007] The technical solution of the present invention is: the present invention discloses a fruit and vegetable transportation route planning method based on knowledge graph, the method comprising:

[0008] Step S1: Obtain order information and pre-process it;

[0009] Step S2: Based on the deep neural network model integrated with the self-attention mechanism, the corresponding relationship triples are extracted from the pre-processed order information in step S1 using a sequence labeling method, and then a knowledge graph is constructed based on the relationship triples;

[0010] Step S3: construct a weighted undirected graph based on the knowledge graph model constructed in step S2;

[0011] Step S4: Dynamically adjust the time weights in the edges of the weighted undirected graph according to the length of transportation time, use the piecewise greedy algorithm to solve the local optimal solution under variable weights, and obtain the optimal path with the minimum freshness loss as the global optimal solution.

[0012] According to an embodiment of the fruit and vegetable transportation route planning method based on the knowledge graph of the present invention, the order information in step S1 includes: the shipping place, the receiving place, and the pre-selected transportation vehicle type; in the knowledge graph constructed in step S2, the shipping place and the receiving place are nodes of the knowledge graph, and the node information includes the shipping place and the receiving place, as well as the distance between the shipping place and the receiving place.

[0013] According to an embodiment of the fruit and vegetable transportation route planning method based on knowledge graph of the present invention, step S2 further includes:

[0014] The users are classified according to the transport vehicle types pre-selected by the users, and a knowledge graph is constructed for each type of user, wherein the user cost scores are calculated according to factors including the planting scale, the user cost scores are sorted, and the user corresponding to the minimum value is determined as the minimum cost user, and the minimum cost user is used as the initial starting point of the weighted undirected graph constructed in step S3;

[0015] Before building a knowledge graph for the user, determine whether the idle number and capacity of the pre-selected vehicles meet the transportation needs. If there are still idle vehicles, based on the deep neural network model integrating the self-attention mechanism, the sequence labeling method is used to jointly extract the information in step S1 to obtain the relationship triples and build the knowledge graph.

[0016] According to an embodiment of the fruit and vegetable transportation route planning method based on knowledge graph of the present invention, the sequence labeling method further includes:

[0017] Symbols are used to represent the entities of "shipping place", "receiving place", "transportation tools", "fruits and vegetables" and the relationships of "shipping to" and "transportation" involved in the logistics transportation process;

[0018] Define the label set for the symbolic representation in the previous step according to the BIOE system in sequence annotation;

[0019] Based on the BIOE system and symbolic representation, relation triples are extracted from order information.

[0020] According to an embodiment of the fruit and vegetable transportation path planning method based on knowledge graph of the present invention, the deep neural network model integrating the self-attention mechanism is stacked by the XLnet model, the bidirectional gated recurrent unit, and the conditional random field model.

[0021] According to an embodiment of the fruit and vegetable transportation path planning method based on knowledge graph of the present invention, the processing process of the deep neural network model integrating the self-attention mechanism includes:

[0022] First, the order information is processed to obtain an input sequence of length n. The representation vector corresponding to each word is learned through the XLNet network. The representation vector extracts the context information of the order information and the position information of the word itself.

[0023] Afterwards, the results learned by the XLNet network are used as the input data of the bidirectional gated recurrent unit layer, and the forward GRU and reverse GRU are used to extract text context information;

[0024] Then, a self-attention layer is added between the bidirectional gated recurrent unit layer and the conditional random field model. The attention mechanism is used to focus on the important feature information of the entity to reduce the problem of inconsistent entity annotations. The output of the bidirectional gated recurrent unit layer is used as the input of the self-attention layer. The part of the output sequence with a label other than 0 is selected and multiplied by the weight matrix to obtain the query vector. All output sequences are selected and multiplied by the weight matrix respectively to obtain the key vector and value vector, and the final output of the self-attention layer is calculated.

[0025] Finally, the output of the self-attention layer is input into the conditional random field model layer, a bias function is added to the conditional random field model layer, and the RMSprop optimization algorithm is used to minimize the negative log-likelihood loss function.

[0026] According to an embodiment of the fruit and vegetable transportation route planning method based on knowledge graph of the present invention, in step S3, the head and tail entities in the knowledge graph are used as nodes of the weighted undirected graph, the relationship between the head and tail entities in the knowledge graph is used as the edge of the weighted undirected graph, and factors including road conditions, time, and transportation equipment are considered as the weights of the edges of the weighted undirected graph.

[0027] The present invention also discloses a fruit and vegetable transportation path planning system based on a knowledge graph, comprising: a memory, a processor, and program instructions stored in the memory for execution by the processor, wherein the processor executes the program instructions to implement the steps of the fruit and vegetable transportation path planning method based on the knowledge graph as described above.

[0028] The present invention also discloses a computer-readable storage medium storing program instructions executable by a processor to implement the steps of the fruit and vegetable transportation path planning method based on the knowledge graph as described above.

[0029] Compared with the prior art, the present invention has the following beneficial effects: the present invention is based on a deep neural network model integrated with a self-attention mechanism, and adopts a sequence labeling method that conforms to the present method to jointly extract relationship triplets, thereby improving the accuracy of labeling; taking into account the characteristics of fruits and vegetables, the influence of road conditions, transportation equipment, and transportation time on the freshness of fruits is considered when calculating weights, thereby maximally ensuring that the freshness loss of fruits during transportation is minimized. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The above features and advantages of the present invention can be better understood after reading the detailed description of the embodiments of the present disclosure in conjunction with the following drawings. In the drawings, the components are not necessarily drawn to scale, and components with similar related properties or features may have the same or similar reference numerals.

[0031] Figure 1A and 1B A flow chart of an embodiment of a method for planning a fruit and vegetable transportation path based on a knowledge graph of the present invention is shown.

[0032] Figure 2 Shows Figure 1A and 1B A schematic diagram of a deep neural network model based on a self-attention mechanism used in an embodiment of the method shown. DETAILED DESCRIPTION

[0033] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. Note that the aspects described below in conjunction with the accompanying drawings and specific embodiments are only exemplary and should not be construed as limiting the scope of protection of the present invention in any way.

[0034] Figure 1A and 1BThe flow chart of an embodiment of the fruit and vegetable transportation path planning method based on knowledge graph of the present invention is shown. Figure 1A and 1B , the implementation steps of the method of this embodiment are described in detail as follows.

[0035] Step S1: Obtain order information and pre-process it.

[0036] Order information includes: shipping location, receiving location, and pre-selected transport vehicle type.

[0037] For example, the order information submitted by the user is shown in Table 1. Then, the necessary information (including order number, shipping place, receiving place, pre-selected vehicle, cargo weight, and cargo volume) is extracted to obtain pre-processed information. Taking Table 1 as an example, the pre-processed information is: "Order number: 20230715103025, send fruits and vegetables from the farm to the supermarket via cold chain trucks, send fruits and vegetables from the farm to the mall via cold chain trucks, the cargo weight is 10kg, and the cargo volume is 5m 3 ”.

[0038] Table 1 Example of customer order information

[0039] Name: Zhang San Contact: xxxxxxxxxxx Place of shipment: Farm Place of delivery: supermarket, shopping mall Pre-selected vehicle: Refrigerated truck Cargo weight: 10kg <![CDATA[Volume of goods: 5m 3 > Order time:10:30:25 Order date:2023-07-15 Order number:20230715103025

[0040] Step S2: Based on the deep neural network model integrated with the self-attention mechanism, the sequence labeling method is used to extract the corresponding relationship triples from the preprocessed order information in step S1, and then a knowledge graph is constructed based on the relationship triples.

[0041] In the knowledge graph constructed in step S2, the place of shipment and the place of receipt are nodes of the knowledge graph, and the node information includes information such as the place of shipment and the place of receipt, and the distance between the place of shipment and the place of receipt.

[0042] The refinement of step 2 is as follows.

[0043] Users are classified according to the type of transport vehicle they pre-select (for example, into five categories), and a knowledge graph is constructed for each category of users. Considering the different operating conditions of users, the user cost score is calculated based on factors such as the planting scale, and the user cost score is used as the starting point for selection:

[0044]

[0045] Where S co is the cost score, and y is the impact function of different factors on transportation cost:

[0046] y=β CS X CS +β AC X AC +β EB XEB +β DIS X DIS

[0047] Among them, X CS , X AC , X EB , X DIS Represents the planting cost, investable funds, expected economic benefits and the distance between the loading point and the destination, β CS , β AC , β EB , β DIS are the weights of the corresponding influencing factors;

[0048] The cost score S co Sort from small to large, determine the user corresponding to the minimum value as the minimum cost user, and use this user as the initial starting point of the weighted undirected graph constructed in step S3.

[0049] Before building a knowledge graph for users, assume that the total number of vehicles of the type pre-selected by customers is N, and each vehicle is numbered tru (tru = 1, 2, ..., N). When the Mth customer makes an order request, it is necessary to determine whether the idle quantity and capacity of the pre-selected vehicles meet the transportation demand based on the idle state formula FS (tru):

[0050]

[0051] Among them, FS(tru) represents the idle state of the transport vehicle numbered tru, and the constraints are as follows:

[0052]

[0053] Among them, V[tru] represents the remaining capacity of the transport vehicle numbered tru, and W[tru] represents the remaining load of the transport vehicle numbered tru; V[M] represents the volume of the goods transported by the Mth user order, and W[M] represents the weight of the goods transported by the Mth user order.

[0054] If there are still idle vehicles, a deep neural network integrated with a self-attention mechanism is used to jointly extract the information in step S1 using a sequence labeling method to obtain relationship triplets and construct a knowledge graph.

[0055] The sequence labeling method in this step is as follows:

[0056] The following symbols are used to represent the entities of "shipping place", "receiving place", "transportation tools", "fruits and vegetables" and the relationships of "shipping to" and "transportation" involved in the logistics transportation process:

[0057]

[0058]

[0059] According to the BIOE system, the tag set is defined as:

[0060] Label={B-TT-D,I-TT-D,E-TT-D,B-TT-R,I-TT-R,E-TT-R,B-TR-T,I-TR-T,E-TR-T,B-TR-SSF,I-TR-SSF,E-TR-SSF,O}

[0061] Each word has a label, where B represents the beginning of the entity, I represents the middle part of the entity, E represents the end of the entity, and O represents something irrelevant to the extraction result. The relationship type information includes "ship to" and "transport". When extracting information to form triples, entities of the same relationship type are placed in the same set of triples. In the same triple, observe the last item of the label. If it is D or T, it means that the entity is the head entity. If it is R or SSF, it means that the entity is the tail entity.

[0062] For example, taking "send fruits and vegetables from agricultural bases to large supermarkets via cold chain transport vehicles" as an example, the results of labeling this sentence are as follows:

[0063] {O,B-TR-SSF,I-TR-SSF,I-TR-SSF,E-TR-SSF,O,O,B-TR-T,I-TR-T,I-TR-T,I-TR-T ,E-TR-T,O,B-TT-D,I-TT-D,I-TT-D,E-TT-D,O,O,B-TT-R,I-TT-R,I-TT-R,E-TT-R}

[0064] After extraction, the following triples are obtained:

[0065] {cold chain transport vehicles, transport, fruits and vegetables}, {agricultural base, transport to, large supermarkets}

[0066] Finally, these two triples are combined, and the TR relation triple is added to the TT relation as a whole to obtain the final triple {agricultural base, cold chain transport vehicle transported to, large supermarket}.

[0067] See also Figure 2 The deep neural network model integrating the self-attention mechanism is composed of XLnet (a deep language model based on the self-attention mechanism), BiGRU bidirectional gated recurrent unit (Bidirectional Gated Recurrent Unit), and CRF conditional random field (a probabilistic graph model). First, the order information is processed to obtain an input sequence of length n X = {x1, x2, ..., x n}, through the XLNet network, we learn the representation vector X'={x1',x2',...,x n '}, the representation vector X' extracts the context information of the order information and the position information of the word itself; then the result learned by the XLNet network is used as the input data of the BiGRU layer, and the forward GRU and reverse GRU are used to extract the text context information. The specific implementation is as follows:

[0068]

[0069] in, are the forward and backward hidden layer states at time t respectively; are the weights of the forward and backward hidden layer states at time t; b t is the bias of the hidden layer state at time t; the specific calculation of GRU is as follows:

[0070] z t =σ(W z x t +U z h t-1 +b z )

[0071] r t =σ(W r x t +U r h t-1 +b r )

[0072]

[0073] Among them, z t represents the update gate, r t represents the reset gate; σ represents the sigmoid function; than is the activation function; represents the hidden state of the candidate layer; h t-1 、h t Respectively represent the hidden layer states at time t-1 and time t; W and U are weights, and b is the bias. z Represents X t The update gate weight, U z Indicates h t-1 The update gate weight, b z represents the bias term of the update gate; W r Represents X t The reset gate weight, U r Indicates h t-1 The reset gate weight, b r Represents the bias term of the reset gate; W h Represents X tThe candidate layer hidden state weight, U h Represents r t h t-1 The candidate layer hidden state weights, b h The bias term representing the hidden state of the candidate layer.

[0074] Furthermore, a self-attention layer is added between the BiGRU layer and the CRF layer, and the attention mechanism is used to focus on the important feature information of the entity to reduce the problem of inconsistent entity annotations. The output of the BiGRU layer is used as the input of the self-attention layer, and the part of the output sequence with a label other than O is selected and compared with the weight matrix W. Q Multiply them together to get the Query vector; select all output sequences and add them to the weight matrix (W K ,W V ) to obtain the Key and Value vectors, and calculate the final output Z of the self-attention layer:

[0075]

[0076] Q=W Q×K *Query

[0077] Among them, Z is the output of the self-attention layer, which is a self-attention weight matrix. Each row in Z is a softmax distribution, which represents the attention weight of the corresponding input element and other elements. The specific application is to represent the correlation between a certain word and other words, that is, to find the words with strong correlation in the sentence, which is conducive to sequence labeling; softmax is a normalization function, K and V are Key and Value vectors respectively, and d k is the dimension of the Key vector; since Query (dimension is d Q ) and Key (dimension d K ) has different dimensions, so the Query vector is multiplied by the mapping matrix W Q×K (The dimension is d K ×d Q ), project it to the same dimension as Key, and obtain the Q vector after linear transformation.

[0078] Finally, the output result Z of the self-attention layer is input into the CRF layer, a bias function is added to the CRF layer, and the RMSprop optimization algorithm (an optimization algorithm based on adaptive learning rate, mainly used for parameter update in deep learning) is used to minimize the negative log-likelihood loss function. The objective function L is as follows (minimizing the negative log-likelihood loss function, that is, requiring the formula on the right side of the equation to be minimized. The goal of this function is to make the model fit the annotation pattern in the training data as much as possible, thereby improving the performance of the model on unknown data and improving the ability to jointly extract entity relationships):

[0079]

[0080] Among them, m is the number of training data, x i ,y i denote the i-th observation sequence and its corresponding annotation sequence, θ is the CRF parameter vector, D(R) represents the discrimination function for distinguishing relational labels ‘TR’, ‘TT’ and other labels, and λ is the bias weight. The larger its value, the greater its impact on the relevant labels.

[0081] The values ​​of D(R) are as follows:

[0082]

[0083] p(y|x,θ) is the joint probability distribution, which is specifically expressed as:

[0084]

[0085] Among them, k is the number of labels, θ j is the weight corresponding to the jth feature function, f j (y i-1 ,y i ,x,i) is the characteristic function of the ith position, Z(x,θ) is the normalization factor, and its value is the sum of the logarithmic probabilities of all possible annotation sequences, where y' represents all possible annotation sequences, y' i represents all possible annotation sequences at position i, y' i-1 represents all possible label sequences at position i-1:

[0086]

[0087] Step S3: Construct a weighted undirected graph based on the knowledge graph model constructed in step S2, wherein the head and tail entities in the knowledge graph are used as nodes of the weighted undirected graph, the relationship between the head and tail entities in the knowledge graph is used as the edge of the weighted undirected graph, and factors including road conditions, time, and transportation equipment are considered as the weights of the edges of the weighted undirected graph.

[0088] According to the knowledge graph, a weighted undirected graph TWKG (V, E) is constructed, where V represents the set of vertices, E represents the set of weights, and the undirected edge can represent the path from the place of shipment to the destination. i represents the i-th vertex, i≤S, S represents the number of vertices; W mn Represents edge E mn The weight, U mn Represents edge E mn Being exploited, U mn The value of 1 indicates that edge E mn Utilized, a value of 0 means not utilized, and the target formula is as follows:

[0089]

[0090] When counting the number of vertices in a weighted undirected graph, the number of vertices is calculated based on the distance between each departure point and the delivery point in the order information: if the distance between two points is less than a set value (for example, 100 meters), the two points are regarded as one node when constructing the weighted undirected graph.

[0091] Step S4: Dynamically adjust the time weights in the edges of the weighted undirected graph according to the length of transportation time, use the piecewise greedy algorithm to solve the local optimal solution under variable weights, and obtain the optimal path with the minimum freshness loss as the global optimal solution.

[0092] When selecting a path, since the weight of the edge is dynamic, a piecewise greedy algorithm is used to select the optimal path: considering that the time weight changes dynamically, starting from the initial node, after each edge reaches the next node, it is necessary to reselect the path with the smallest freshness loss (that is, select the edge with the smallest weight) as the next optimal path until all vertices are passed.

[0093] In the calculation side E mn The weight W mn When transporting fruits, it is necessary to consider the impact of road conditions, transportation time, and transportation equipment on the freshness of fruits:

[0094] W mn =λ Road W Road +λ Time W Time +λ Equip W Equip

[0095] Among them, W Road , W Time , W Equip They represent the impact of road conditions, transportation time, and transportation equipment on the freshness of fruits, respectively. Road , Time, Equip Respectively represent the weights of factors such as road conditions, transportation time, and transportation equipment, W Road The calculation method is as follows:

[0096]

[0097] Among them, Deg TC is the road congestion level, f(RC K ) is the Gaussian sampling value, RC K Indicates the value represented by the road condition of type K (K = 1, 2, 3, 4, 5, 6), L K Deg represents the distance traveled by the transport equipment on the road condition of type K. TC Range and f(RC K ) is calculated as follows:

[0098]

[0099] Among them, a and b are RC K The upper and lower bounds of X Gau is the Gaussian sampling result, μ is the mean of the Gaussian distribution, σ is the standard deviation of the Gaussian distribution, and Z is a random number that conforms to the standard normal distribution;

[0100] W Time The calculation method is as follows:

[0101]

[0102] Among them, i represents the number of the i-th loading point, n represents the number of the final unloading point, α i represents the amount of fruit in the i-th loading, t i represents the time of the i-th loading, t n Indicates the time of last unloading.

[0103] F(t n -t i ) represents the freshness loss value of the fruit loaded in the i-th time at the final unloading;

[0104] W Equip The calculation method is as follows:

[0105]

[0106] Among them, g(Eq K ) represents the uniform sampling value, Eq K Indicates the impact value of transport equipment of type K (K = 1, 2, 3, 4, 5), L EK represents the distance traveled by the transport equipment of type K, g (Eq K ) is calculated as follows:

[0107] X Ave =a+(ba)*U

[0108] Among them, X Ave is the uniform sampling result, a is Eq. K is the lower bound of the range, b is the upper bound of the range, and U is a random number uniformly distributed in the interval [0,1);

[0109] Different levels of road congestion Deg TC , the numerical values ​​represented by different road conditions RC K And the impact value of different transportation equipment Eq K The specific scoring table is as follows:

[0110] Different levels of road congestion Deg TC Partition table

[0111]

[0112] The impact value of different road conditions RC K Scoring table

[0113]

[0114] The influence of different transportation equipment Eq K Scoring table

[0115]

[0116]

[0117] The optimal route selected in this way comprehensively considers the impact of road conditions, transportation equipment, and transportation time on the freshness of the fruit, thereby maximizing the freshness and quality of the fruit.

[0118] The present invention also discloses a fruit and vegetable transportation path planning system based on a knowledge graph, comprising: a memory, a processor, and program instructions stored in the memory for the processor to execute, wherein the processor executes the program instructions to implement the steps of the above-mentioned fruit and vegetable transportation path planning method embodiment based on the knowledge graph.

[0119] The present invention also discloses a computer-readable storage medium storing program instructions executable by a processor to implement the steps of the above-mentioned fruit and vegetable transportation path planning method embodiment based on knowledge graph.

[0120] Although the above methods are illustrated and described as a series of actions for simplicity of explanation, it should be understood and appreciated that these methods are not limited by the order of the actions, because according to one or more embodiments, some actions may occur in a different order and / or concurrently with other actions from those illustrated and described herein or not illustrated and described herein but understandable to those skilled in the art.

[0121] Those skilled in the art will further appreciate that the various illustrative logic blocks, modules, circuits, and algorithm steps described in conjunction with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or a combination of the two. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the specific application and the design constraints imposed on the overall system. The technician may implement the described functionality in different ways for each specific application, but such implementation decisions should not be interpreted as resulting in a departure from the scope of the present invention.

[0122] The various illustrative logic blocks, modules, and circuits described in conjunction with the embodiments disclosed herein may be implemented or executed with a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. The processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in cooperation with a DSP core, or any other such configuration.

[0123] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software module may reside in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read and write information from / to the storage medium. In an alternative, a storage medium may be integrated into a processor. The processor and the storage medium may reside in an ASIC. The ASIC may reside in a user terminal. In an alternative, the processor and the storage medium may reside in a user terminal as discrete components.

[0124] In one or more exemplary embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented as a computer program product in software, each function may be stored on or transmitted by a computer-readable medium as one or more instructions or codes. Computer-readable media include both computer storage media and communication media, including any medium that facilitates the transfer of a computer program from one place to another. Storage media may be any available medium that can be accessed by a computer. As an example and not limitation, such a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer. Any connection is also properly referred to as a computer-readable medium. For example, if the software is transmitted from a website, a server, or other remote source using a coaxial cable, a fiber optic cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, wherein disk often reproduces data magnetically, while disc reproduces data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0125] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be apparent to those skilled in the art, and the general principles defined herein may be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the examples and designs described herein, but should be granted the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A fruit and vegetable transportation route planning method based on knowledge graph, characterized in that: Methods include: Step S1: Obtain order information and pre-process it; Step S2: Based on the deep neural network model integrated with the self-attention mechanism, the corresponding relationship triples are extracted from the pre-processed order information in step S1 using a sequence labeling method, and then a knowledge graph is constructed based on the relationship triples; Step S3: construct a weighted undirected graph based on the knowledge graph model constructed in step S2; Step S4: Dynamically adjust the time weights in the edges of the weighted undirected graph according to the length of transportation time, use the piecewise greedy algorithm to solve the local optimal solution under variable weights, and obtain the optimal path with the minimum freshness loss as the global optimal solution.

2. The fruit and vegetable transportation path planning method based on knowledge graph according to claim 1 is characterized in that: The order information in step S1 includes: the place of shipment, the place of receipt, and the pre-selected transport vehicle type; in the knowledge graph constructed in step S2, the place of shipment and the place of receipt are nodes of the knowledge graph, and the node information includes the place of shipment and the place of receipt, as well as the distance between the place of shipment and the place of receipt.

3. The fruit and vegetable transportation path planning method based on knowledge graph according to claim 2 is characterized in that: Step S2 further comprises: The users are classified according to the transport vehicle types pre-selected by the users, and a knowledge graph is constructed for each type of user, wherein the user cost scores are calculated according to factors including the planting scale, the user cost scores are sorted, and the user corresponding to the minimum value is determined as the minimum cost user, and the minimum cost user is used as the initial starting point of the weighted undirected graph constructed in step S3; Before building a knowledge graph for the user, determine whether the idle number and capacity of the pre-selected vehicles meet the transportation needs. If there are still idle vehicles, based on the deep neural network model integrating the self-attention mechanism, the sequence labeling method is used to jointly extract the information in step S1 to obtain the relationship triples and build the knowledge graph.

4. The fruit and vegetable transportation path planning method based on knowledge graph according to claim 3 is characterized in that: The sequence labeling method further comprises: Symbols are used to represent the entities of "shipping place", "receiving place", "transportation tools", "fruits and vegetables" and the relationships of "shipping to" and "transportation" involved in the logistics transportation process; Define the label set for the symbolic representation in the previous step according to the BIOE system in sequence annotation; Based on the BIOE system and symbolic representation, relation triples are extracted from order information.

5. The fruit and vegetable transportation path planning method based on knowledge graph according to claim 3 is characterized in that: The deep neural network model integrating the self-attention mechanism is composed of a stack of XLnet model, bidirectional gated recurrent unit, and conditional random field model.

6. The fruit and vegetable transportation path planning method based on knowledge graph according to claim 5 is characterized in that: The processing of the deep neural network model integrating the self-attention mechanism includes: First, the order information is processed to obtain an input sequence of length n. The representation vector corresponding to each word is learned through the XLNet network. The representation vector extracts the context information of the order information and the position information of the word itself. Afterwards, the results learned by the XLNet network are used as the input data of the bidirectional gated recurrent unit layer, and the forward GRU and reverse GRU are used to extract text context information; Then, a self-attention layer is added between the bidirectional gated recurrent unit layer and the conditional random field model. The attention mechanism is used to focus on the important feature information of the entity to reduce the problem of inconsistent entity annotations. The output of the bidirectional gated recurrent unit layer is used as the input of the self-attention layer. The part of the output sequence with a label other than 0 is selected and multiplied by the weight matrix to obtain the query vector. All output sequences are selected and multiplied by the weight matrix respectively to obtain the key vector and value vector, and the final output of the self-attention layer is calculated. Finally, the output of the self-attention layer is input into the conditional random field model layer, a bias function is added to the conditional random field model layer, and the RMSprop optimization algorithm is used to minimize the negative log-likelihood loss function.

7. The fruit and vegetable transportation path planning method based on knowledge graph according to claim 6 is characterized in that: In step S3, the head and tail entities in the knowledge graph are used as nodes of a weighted undirected graph, the relationship between the head and tail entities in the knowledge graph is used as the edge of the weighted undirected graph, and factors including road conditions, time, and transportation equipment are considered as the weights of the edges of the weighted undirected graph.

8. A fruit and vegetable transportation route planning system based on knowledge graph, comprising: A memory, a processor, and program instructions stored in the memory and executable by the processor, wherein the processor executes the program instructions to implement the steps of the fruit and vegetable transportation path planning method based on the knowledge graph as described in any one of claims 1 to 7.

9. A computer-readable storage medium storing program instructions executable by a processor to implement the steps of the fruit and vegetable transportation path planning method based on knowledge graph as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Petrochemical pipeline full life cycle detection and evaluation method and equipment

    CN119538199A

  • Knowledge graph construction method and system oriented to threat intelligence processing and computer readable storage medium

    CN119719387A

  • Food material distribution intelligent control method and system based on big data

    CN119904159A

  • Intelligent logistics path optimization method based on knowledge graph

    CN121503836A