Marine Container Assembly Method Based on Sequence Generation and Search
Through the hypergraph attention network and Transformer model, the container transportation sequence is predicted, combined with the central spiral search algorithm, the efficiency and safety problems in container position allocation are solved, efficient and reasonable container loading and loading are achieved, and dock operation efficiency and ship navigation stability are improved.
Patent Information
- Application Number
- CN202510542929.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-04-28
AI Technical Summary
It is difficult to efficiently and reasonably allocate container locations in container transportation in the prior art, resulting in safety hazards and waste of resources during transportation, affecting the loading and unloading efficiency of the wharf and the stability of the ship.
The container transportation order is predicted by the hypergraph attention network (HGAT) and Transformer models, combined with the central spiral search algorithm, the container attribute information is integrated through mixed coding, the graph attention network is used to pay attention to the same characteristic container, and the transportation order is optimized through the Seq2Seq task.
It improves the space utilization rate and ship stability during container transportation, reduces the risks caused by unreasonable placement, and improves the terminal operation efficiency and ship navigation safety.
Smart Images

Figure CN120069706B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of information technology, and particularly to a method for assembling sea containers based on sequence generation and search. Background Art
[0002] With the rapid growth of the global trade transportation demand, the sea container market plays a crucial role in seaports. Under the wave of globalization, the volume of international trade continues to climb, and the scale and frequency of commodity circulation have reached an unprecedented level. Sea transportation, with its unique cost advantage and carrying capacity, has become the main force in international trade transportation. Container transportation, as the core mode of modern sea transportation, not only greatly improves the efficiency of cargo transportation but also reduces the transportation cost and the risk of cargo damage, and its development speed is remarkable.
[0003] Container location allocation is a crucial link in container transportation, which is directly related to the efficiency and production safety of the entire transportation process. Reasonable container location allocation can ensure the balance and stability of the ship, reduce potential safety hazards during transportation, improve the loading and unloading efficiency of the port, and avoid time delays and resource waste caused by unreasonable stacking of containers.
[0004] According to the statistical data of the United Nations Conference on Trade and Development, the container throughput of ports has shown a significant growth trend in the past few decades. In 2020, the global container terminal throughput reached 815.6 million TEUs, a 53.5% increase compared with 531 million TEUs in 2010. This growth not only reflects the prosperity of global trade but also highlights the importance of container transportation in international trade.
[0005] The substantial increase in container transportation volume has undoubtedly brought huge working pressure to ports. Ports need to handle more containers and coordinate more complex logistics processes, which puts higher requirements on the operation efficiency and management level of ports. To address this challenge, the efficient and automated operation of ports becomes particularly important. The application of automation technologies, such as automated cranes, automated guided vehicles, and intelligent warehousing systems, can significantly improve the operation efficiency of ports, reduce labor costs and error rates, and thus ensure that goods can enter and leave the port quickly and safely while meeting the growing transportation demand. Summary of the Invention
[0006] The present disclosure provides a method for loading and stowing sea containers based on hypergraph attention network sequence generation and depth spiral search, including:
[0007] Step 101: Encoding sea containers by using a hybrid encoding method that comprehensively integrates various container attributes;
[0008] Step 102: Based on the encoded representation of the container, update the container feature representation using a hypergraph attention network (HGAT);
[0009] Step 103: Based on the container feature representation, use a Transformer model based on the encoder-decoder architecture to predict the transportation order of the containers within the port;
[0010] Step 104: Based on the predicted transportation order of the containers, use a central spiral search algorithm to determine the placement positions of the containers on the ship.
[0011] In some embodiments, Step 101 includes:
[0012] For different types of container attributes, encode multiple attributes of the container to obtain a feature vector representing the container in numerical form, where the container attributes include: the container ID, the destination; the container weight, height; the bay row layer of the yard where the container is located; whether the container needs to be transported and the container type;
[0013] Divide the yard bay row layer data according to the data order, extract the location information of the yard where it is located and the order of the container in the stack longitudinally; through the above encoding, convert the attribute data of the container into a unified numerical form;
[0014] To integrate the container attribute information, splice the feature vectors in numerical form, and then use a feed-forward neural network (FFN) to capture the non-linear dependence relationship between the features, as follows:
[0015]
[0016]
[0017] In the formula, is the spliced feature vector, n is the number of container features, are learnable parameters, X 1、 X 2、 X n are the initial embeddings of different container features, X is the container feature, and ReLU is the activation function.
[0018] In some embodiments, Step 102 includes:
[0019] Construct a hypergraph structure according to the features of the containers, where each container constitutes a node in the hypergraph, and containers with the same features establish hyperedges. The hypergraph structure is as follows:
[0020]
[0021]
[0022] In the formula is the constructed hypergraph, is the set of nodes, is the set of hyperedges, is a Boolean matrix representing the connection relationship of the hypergraph. When the node is connected by the hyperedge , the value is 1; otherwise, it is 0; H v,e is a 0 / 1 variable representing the connection relationship between the hyperedge and the node;
[0023] For each node contained in the hyperedge , the feature representation of the hyperedge is obtained by aggregating the initialized node features :
[0024]
[0025] In the formula, is the ReLU activation function, is a trainable weight matrix, is the attention coefficient;
[0026] After obtaining the feature representation of the hyperedge, a new aggregator is defined to aggregate all the hyperedges of each node to obtain the updated node features, denoted as :
[0027]
[0028] In the formula, W2 is a trainable weight matrix.
[0029] In some embodiments, step 103 includes:
[0030] The container transportation order prediction problem is reduced to a sequence-to-sequence problem: that is, given a random container sequence, after model modeling and processing, an ordered container sequence is obtained to represent the container transportation order;
[0031] For the container feature X, the input is mapped to a query (Query) vector Q, a key (Key) vector K, and a value (Value) vector V by defining three learnable weight matrices:
[0032]
[0033]
[0034]
[0035] In the formula is a trainable weight matrix, is the feature embedding dimension of the container, ;
[0036] For each query vector , calculate its similarity with all key vectors :
[0037]
[0038] In the formula, is the transpose of the vector ; is the attention score, which captures the pairwise relationships in the input elements. When the value is larger, the correlation between the container and is stronger; subsequently, use the Softmax function to normalize to obtain the attention weights; finally, perform a weighted sum of the attention weights on the value vectors to obtain the final attention output:
[0039]
[0040] In the formula, is the transpose matrix of the key vector K; in order to enable each container to capture feature information at different levels, choose to use the multi-head attention mechanism to splice the self-attention output, specifically as follows:
[0041]
[0042] In the formula is the number of heads,
[0043] After performing a linear transformation and layer normalization on the splicing result of the multi-head attention, obtain the final multi-head attention output:
[0044]
[0045]
[0046] In the formula, are trainable parameters, X attn is the output of the multi-head attention, X input is the original feature input; subsequently, pass the multi-head attention output through a feed-forward neural network to obtain the output of the encoder:
[0047]
[0048] In the decoder of the model, it includes a multi-head self-attention mechanism, an encoder-decoder attention mechanism, and a feed-forward neural network; the multi-head self-attention mechanism in the decoder is used to calculate the attention for the target sequence:
[0049]
[0050] Wherein, Y attn is the output of the masked multi-head attention, is the target sequence, that is, the accurate container arrival order, is the mask matrix, which is used to mask future information;
[0051] The encoder-decoder attention mechanism allows the decoder to focus on the output of the encoder; the , ;
[0052]
[0053] Wherein, Y enc-dec is the output of the cross multi-head attention mechanism;
[0054] Subsequently, similar to the encoder, after passing through the feed-forward neural network and layer normalization, the final output Y dec of the decoder is:
[0055]
[0056] The output of the decoder passes through a linear layer and a Softmax function to obtain the predicted probability of each container step by step:
[0057]
[0058] Wherein, W 、 b are learnable parameters.
[0059] In some embodiments, step 104 includes:
[0060] According to the transportation order of the containers predicted in step 103, each container is placed on the ship in sequence according to a preset rule. The preset rule includes: containers with the same destination are grouped in one area for unloading and management; in the same area, containers with a larger weight ordinal are placed closer to the middle, and containers with a smaller weight ordinal are placed relatively closer to the outside, and for containers placed in the same stack, containers with a larger weight ordinal are placed below, while containers with a smaller weight ordinal are placed above; the height ordinal of the containers stored in each stack conforms to the corresponding hull.
[0061] The advantages of the present disclosure are as follows:
[0062] The present disclosure fully considers key attributes such as the weight, height, and destination of the container, and encodes them to obtain a feature representation of the container. By using a graph attention network, each container can pay attention to other containers with the same specific features.
[0063] The present disclosure transforms the transportation sequence problem into a Seq2Seq task, and utilizes the global dependency modeling ability of the Transformer model to improve the accuracy of transportation sequence prediction.
[0064] The present disclosure uses a central spiral search algorithm to determine the placement position of the container on the ship, and can efficiently find the optimal placement position. This algorithm starts placing heavy containers from the center, which conforms to the rule that heavy containers are placed closer to the center and light containers are placed on the outside. At the same time, through the depth-first search tree algorithm, the most suitable placement position is accurately searched according to the handling sequence of the containers. It improves the space utilization rate, ensures the stability and safety of the ship, and reduces potential risks caused by unreasonable container placement. Description of the Drawings
[0065] In combination with the drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic, and the elements and elements are not necessarily drawn to scale.
[0066] Figure 1 is a flowchart of the method for allocating the central spiral search position of a marine container according to an embodiment of the present disclosure.
[0067] Figure 2 shows the construction process of the container hypergraph structure according to an embodiment of the present disclosure.
[0068] Figure 3 shows an overview of the container loading and stowage process according to an embodiment of the present disclosure.
[0069] Figure 4 shows the process of the central spiral search algorithm according to an embodiment of the present disclosure. Detailed Embodiments
[0070] The embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0071] It should be understood that the various steps described in the method embodiments of the present disclosure may be executed sequentially and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0072] As used herein, the term "including" and its variants are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0073] It should be noted that the concepts such as "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0074] It should be noted that the modification of "one" mentioned in the present disclosure is illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".
[0075] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0076] The present disclosure provides a method for allocating the central spiral search position of a marine container based on Transformer sequence prediction and rules, which is used to utilize the attribute information of the marine container to confirm the allocation position on the ship for the containers in the port, so as to improve the performance and efficiency of container position allocation.
[0077] Refer to Figure 1 , a method for allocating the central spiral search position of a marine container based on Transformer sequence prediction and rules is provided, and the method includes:
[0078] 101: Encoding the marine container by using a hybrid encoding method that comprehensively integrates various container attributes;
[0079] 102: Updating the container feature representation by using a hypergraph attention network (HGAT);
[0080] 103: Predicting the transportation order of the containers in the port by using a Transformer model based on an encoder-decoder architecture;
[0081] 104: Determining the placement position of the container on the ship by using a central spiral search algorithm.
[0082] In some embodiments, a hybrid coding method that comprehensively integrates various container attributes is used to code sea containers. Specifically as follows: In actual port operations, the attribute data of containers is rich and complex. To effectively process this data and make it suitable for subsequent analysis and decision-making processes, the present disclosure uses a hybrid coding method that comprehensively integrates various container attributes. For different types of container attributes, general coding techniques (such as one-hot coding, sequential coding, ordinal coding) are used to code most of the container attributes to obtain a numerical feature representation of the container. The main attributes of the container include: the id of the container, the destination; the weight and height of the container; the bay row layer of the yard where the container is located (bay: the position number of the container, which is equivalent to a row of shelves in a warehouse in space, for example, 01 is the first "bay"; row: the number of columns of the container in the "bay", which is equivalent to the number of columns of a certain cargo position in a certain shelf in a warehouse, generally with the left side as the origin, increasing sequentially from left to right, for example, the first row is row A, the second row is row B; layer: the number of layers of the container in the "row", which is equivalent to the cargo position layer of a certain cargo position in a certain shelf in a warehouse, the bottom layer is layer 01, layer 02 is the second layer, and so on upward); whether the container needs to be transported and the container model. Among many attributes, the coding of the bay row layer of the yard where the container is located is a key issue in port operations. The main approach is to divide the yard bay row layer data in the form of "Y-TSCT-6C4910.4" according to the data order, and extract the location information of the yard where it is located and the order of the container in the longitudinal direction of the stack. Through this hybrid coding method, various container attribute data can be converted into a unified numerical form.
[0083] To integrate the attribute information of the container, these feature vectors are concatenated, and then a feed-forward neural network (FFN) is used to capture the non-linear dependence relationship between the features, as follows:
[0084]
[0085]
[0086] In the formula is the concatenated feature vector, n is the number of container features, are learnable parameters, X 1、 X 2、 X n are the initial embeddings of different container features, X is the container feature, and ReLU is the activation function.
[0087] In some embodiments, a hypergraph attention network (HGAT) is used to update the container feature representation as follows: a hypergraph structure is constructed based on the container features, where each container constitutes a node in the hypergraph, and containers with the same features (destination, location in the bay, model) establish hyperedges. The specific graph structure is as follows:
[0088]
[0089]
[0090] where is the constructed hypergraph, is the set of nodes, is the set of hyperedges, is a boolean matrix representing the connection relationship of the hypergraph. When node is connected by hyperedge the value is 1, otherwise 0; H v,e is a 0 / 1 variable representing the connection relationship between the hyperedge and the node.
[0091] For each node contained in hyperedge , the feature representation of the hyperedge is obtained by aggregating the initial node features as follows:
[0092]
[0093] where is the ReLU activation function, is a trainable weight matrix, is the attention coefficient.
[0094] After obtaining the feature representation of the hyperedge, a new aggregator is defined to aggregate all the hyperedges of each node to obtain the updated node feature, denoted as as follows:
[0095]
[0096] where W2 is a trainable weight matrix. Through the above two aggregators, each container can pay attention to the information of other containers with the same features; at the same time, due to the existence of the attention coefficient, more important containers are given higher attention, effectively improving the feature expression ability of the containers.
[0097] Figure 2Shows the process diagram of container hypergraph construction: Each container is used as a node of the hypergraph, and containers with the same characteristics are connected using hyperedges; As shown in the figure, containers with the same unloading port, container type, and yard are connected using hyperedges to construct the hypergraph.
[0098] In some embodiments, a Transformer model based on the encoder-decoder architecture is used to predict the transportation order of in-port containers, as follows: The problem of predicting the container transportation order is reduced to a sequence-to-sequence (Seq2Seq) problem: that is, given a random container sequence, through model modeling and processing, an ordered container sequence is obtained to represent the container transportation order. Here, a Transformer based on the encoder-decoder architecture is used as the main model architecture.
[0099] For the container feature X, the input is mapped to a query vector Q, a key vector K, and a value vector V by defining three learnable weight matrices:
[0100]
[0101]
[0102]
[0103] In the formula is a trainable weight matrix, is the feature embedding dimension of the container, .
[0104] For each query vector , its similarity with all key vectors can be calculated:
[0105]
[0106] In the formula, is the transpose of the vector ; is the attention score, which captures the pairwise relationships in the input elements. When the value is larger, the correlation between the containers and is stronger; Subsequently, the Softmax function is used to normalize to obtain the attention weights. Finally, the attention weights are weighted and summed for the value vectors to obtain the final attention output:
[0107]
[0108] In the formula, is the transpose matrix of the key vector K; in order to enable each container to capture feature information at different levels, the multi-head attention mechanism is selected to splice the self-attention output, specifically as follows:
[0109]
[0110] In the formula is the number of heads,
[0111] After linear transformation and layer normalization of the splicing result of the multi-head attention, the final multi-head attention output is obtained:
[0112]
[0113]
[0114] In the formula, is a trainable parameter, X attn is the output of the multi-head attention, X input is the original feature input. Subsequently, the multi-head attention output passes through a feed-forward neural network to obtain the output of the encoder:
[0115]
[0116] In the decoder of the model, it includes a multi-head self-attention mechanism, an encoder-decoder attention mechanism, and a feed-forward neural network. The multi-head self-attention mechanism in the decoder is used to calculate the attention for the target sequence. The difference between it and the multi-head self-attention mechanism in the encoder is that a masking operation needs to be added, specifically as follows:
[0117]
[0118] In the formula, Y attn is the output of the masked multi-head attention, is the target sequence (i.e., the accurate container arrival order), is the masking matrix, used to mask future information.
[0119] The encoder-decoder attention mechanism allows the decoder to focus on the output of the encoder. The difference from the self-attention mechanism is that the , . The output of this structure is:
[0120]
[0121] In the formula,Y enc-dec is the output of the cross-head attention mechanism;
[0122] Then, like the encoder, after the feedforward neural network and layer normalization, the final output of the decoder is Y dec for:
[0123]
[0124] Finally, the output of the decoder passes through a linear layer and a Softmax function to obtain the prediction probability of each container step:
[0125]
[0126] In the formula, W , b are learnable parameters.
[0127] In some embodiments, a central spiral search algorithm is used to determine the placement of containers on the ship, as follows: In the process of ship loading, it is of great significance to reasonably determine the placement of containers on the ship to ensure the balance, stability and space utilization of the ship. In the key link of ship loading, the placement of containers has a vital impact on the safety and space utilization of the entire voyage. The present disclosure uses a central spiral search algorithm to accurately determine the placement of containers on the ship. This algorithm is an efficient solution that has been deeply studied and verified in practice. Since heavier containers should be as close to the center as possible, the algorithm for placing heavy containers from the center can best adapt to the task, which can effectively reduce the center of gravity of the ship and improve the stability of navigation. The depth-first search tree algorithm can accurately search for the most suitable placement position for containers according to the order of container handling. It can comprehensively consider various possible placement combinations to ensure that the optimal solution is found. Considering the rules that heavier containers need to be as close to the center as possible, lighter ones are closer to the outside, and heavier containers need to be placed below lighter containers as much as possible, the order of depth-first search should also be used as the search order of depth-first search in the order of unfolding around the central spiral. Therefore, we chose to use the depth-first algorithm with an intermediate spiral expansion to iterate and find the optimal placement of the container. This method not only improves space utilization, ensures the stability and safety of the ship, but also reduces the potential risks caused by unreasonable placement of containers, providing a solid guarantee for the navigation of the ship and the transportation of cargo.
[0128] In some embodiments, the idea of the central spiral search algorithm is derived from the depth-first search (DFS) algorithm in traditional algorithms. Depth-first search is an algorithm used to traverse or search a tree or graph, where the data structure of the tree or graph has a more direct pointing relationship compared to ordinary data and is usually used to model hierarchically structured data. It starts from the root node and searches as deep as possible along the branches of the tree until it can no longer continue, then backtracks to the previous node and continues to explore other branches. During this process, DFS stores each node it passes by and searches for elements that meet the conditions. Although, in the worst case, the time complexity of DFS is O(N), which is no different from traversing the list of all boxes and finding the maximum value. However, in the scenario of container placement at the port, it is usually the case that "light boxes are placed on top and heavy boxes are placed below", and containers of the same type (going to the same row of destinations or from the same company) are generally stacked in the same bay. Therefore, combined with the actual application scenario of the port, DFS can efficiently search for the specific location of the target container in most cases.
[0129] Figure 3 The framework diagram of the depth spiral algorithm is shown: (1) Sort the container lifting order according to the yard location and the on-board space for randomly stacked containers; (2) According to the container lifting order in (1), find the most reasonable position on the ship according to the depth spiral algorithm.
[0130] The specific steps of the algorithm using the central spiral search algorithm to determine the placement position of containers on the ship are as follows ( Figure 4 ):
[0131] (1) First, determine the carrying specifications of the transport ship and the order of containers boarding in the input data. The order of containers boarding is obtained by the method of restoring the yard state in 102 and is defined as , as the initial input sequence.
[0132] (2) According to the structure and load balance requirements of the ship, define the central area of the ship as the priority placement area for heavy containers.
[0133] (3) Starting from the central position, construct a depth search tree in the order of spiral expansion, and start placing containers in the spiral order strictly according to the rule that heavy boxes are placed below and light boxes are placed above. Each node represents a possible container placement position. During the search process, follow the depth-first search strategy, search for C s based on the weight, and match each search node node of DFS one by one. Define the balance , w bi represents the weight of box bi, w bjRepresents the weight of the box bj, and sets the hyperparameter β. If the current balance B > β, the rule is violated and a new search is conducted to make the container layout of the entire ship satisfy the placement rules while maximizing space utilization and transportation stability.
[0134] (4)After placing all the boxes, calculate the total weight of each stack. Denote it as .
[0135] (5)Re - sort each stack from heaviest to lightest by total weight. Thus, the rule that heavier boxes are as close to the center as possible can be satisfied, and here the index V cen (This parameter represents the horizontal balance index) is minimized.
[0136] (6)Re - arrange each stack in a spiral order starting from the center position according to the sorted order, either from left to right or from right to left. In this way, the optimal placement position of each box can be obtained, and the index B < β is satisfied.
[0137] This method combines the DFS algorithm and the adaptability of the ship - loading principle, greatly improving the real - time response speed of the algorithm. Moreover, due to its good adaptability, the algorithm can output a stowage plan highly similar to traditional manual operations, that is, an operation plan that follows the physical laws of ship navigation and does not affect the ship's transportation efficiency and safety.
[0138] During the ship stowage process, reasonably determining the placement position of containers on the ship is of great significance for ensuring the balance, stability, and space utilization of the ship. This disclosure adopts a central spiral search algorithm to optimize the placement position of containers. According to the container transportation sequence formulated in step 103, each container is successively placed on the ship according to certain rules as follows: Containers with the same destination are concentrated in one area for easy unloading and management; in the same area, containers should satisfy the rule that containers with a larger weight ordinal number are as close to the middle as possible, containers with a smaller weight ordinal number should be as close to the outside as possible, and containers placed in the same stack should strictly satisfy that containers with a larger weight ordinal number are below and containers with a smaller weight ordinal number are above. In addition, the height ordinal number of the containers stored in each stack should meet the requirements of the hull. Through these rules, it is ensured that the center - of - gravity distribution of the ship is reasonable, the navigation stability is improved, at the same time, the space of the ship is utilized to the maximum extent, the cargo transportation volume per single voyage is increased, and the transportation efficiency is improved. Therefore, the method of this disclosure realizes efficient and reasonable container ship stowage, improving the efficiency of terminal operations and the navigation stability of the ship.
[0139] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.
[0140] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented combinatorially in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0141] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. A method for assembling sea containers based on sequence generation and search, characterized in that, Including: Step 101: Encode the maritime container using a hybrid coding method that integrates multiple container attributes. Step 102: Based on the container's coded representation, update the container feature representation using a hypergraph attention network. Step 103: Based on the container feature representation, use a Transformer model based on the encoder-decoder architecture to predict the transportation order of containers within the port. Step 104: Based on the predicted transportation order of the containers, use the central spiral search algorithm to determine the placement positions of the containers on the ship. Among them, based on the predicted transportation order of the containers, using the central spiral search algorithm to determine the placement positions of the containers on the ship includes: According to the transportation order of the containers predicted in Step 103, place each container on the ship in turn according to preset rules. The preset rules include: Group the containers with the same destination in one area for unloading and management; in the same area, the containers meet the requirement that the container with a larger weight ordinal number is closer to the middle, the container with a smaller weight ordinal number is relatively closer to the outside, and for the containers placed in the same stack, the container with a larger weight ordinal number is below, while the container with a smaller weight ordinal number is above; the height ordinal number of the containers stored in each stack conforms to the corresponding hull.
2. The method for assembling a shipping container based on sequence generation and search according to claim 1, wherein Step 101 includes: For different types of container attributes, encode multiple attributes of the container to obtain a feature vector representing the container in numerical form. Among them, the container attributes include: the container's id, destination; container weight, height; the bay row layer of the yard where the container is located; whether the container needs to be transported and the container model. Divide the yard bay row layer data according to the data order, extract the location information of its yard area and the order of the container in the longitudinal direction of the stack; through the above encoding, convert the attribute data of the container into a unified numerical form. To integrate the container attribute information, splice the feature vectors in numerical form, and then use a feed-forward neural network (FFN) to capture the non-linear dependence relationship between the features, as follows: ; ; wherein, is the concatenated feature vector, n is the number of container features, are learnable parameters, X 1、 X 2、 X n are the initial embeddings of different container features, X is the container feature, and ReLU is the activation function.
3. The method for assembling a maritime container based on sequence generation and search according to claim 1, characterized in that Step 102 includes: Construct a hypergraph structure according to the container features, where each container forms a node in the hypergraph, and containers with the same features establish hyperedges. The hypergraph structure is as follows: ; ; In the formula is the constructed hypergraph, is the set of nodes, is the set of hyperedges, is a Boolean matrix representing the connection relationship of the hypergraph. When the node is connected by the hyperedge the value is 1, otherwise it is 0; H v,e is a 0 / 1 variable representing the connection relationship between the hyperedge and the node; For a hyperedge for each node contained, the feature representation of the hyperedge is obtained by aggregating and initializing the node features ; ; wherein, is the ReLU activation function, is the trainable weight matrix, is the attention coefficient; After obtaining the feature representation of the hyperedges, a new aggregator is defined to aggregate all hyperedges of each node, resulting in the updated node features, denoted as : ; In the formula, W2 is a trainable weight matrix.
4. The method for assembling a shipping container based on sequence generation and search according to claim 1, wherein Step 103 includes: Reduce the container transportation order prediction problem to a sequence-to-sequence problem: that is, given a random container sequence, through model modeling and processing, obtain an ordered container sequence to represent the transportation order of the containers. For the container feature X, map the input to a query vector Q, a key vector K, and a value vector V by defining three learnable weight matrices: ; ; ; where is a trainable weight matrix, is the feature embedding dimension of the container, ; For each query vector , calculate its similarity to all key vectors : ; Wherein, is the transpose of the vector ; is the attention score, which captures the pairwise relationships in the input elements. The greater the value, the stronger the correlation between the containers and ; Subsequently, the Softmax function is used to normalize to obtain the attention weights; Finally, the attention weights are weighted and summed with the value vectors to obtain the final attention output: ; In the formula, is the transposed matrix of the key vector K; in order to enable each container to capture feature information at different levels, the multi-head attention mechanism is selected to splice the self-attention outputs, as follows: ; wherein is the number of heads, ; After linearly transforming and layer normalizing the concatenation result of the multi-head attention, obtain the final multi-head attention output: ; ; In the formula, is a trainable parameter, X attn is the output of the multi-head attention, X input is the original feature input; subsequently, the output of the multi-head attention is passed through a feed-forward neural network to obtain the output of the encoder: ; In the decoder of the model, it includes a multi-head self-attention mechanism, an encoder-decoder attention mechanism, and a feed-forward neural network; the multi-head self-attention mechanism in the decoder is used to calculate the attention for the target sequence: ; Wherein, Y attn is the output of masked multi-head attention, is the target sequence, that is, the accurate container arrival order, is the mask matrix used to mask future information; The encoder-decoder attention mechanism allows the decoder to focus on the output of the encoder; the , ; ; In the formula, Y enc-dec is the output of the cross multi-head attention mechanism; Subsequently, similar to the encoder, after passing through a feed-forward neural network and layer normalization, the final output of the decoder Y dec is as follows: ; The output of the decoder passes through a linear layer and a Softmax function to obtain the prediction probability of each step of the container: ; In the formula, W , b are learnable parameters.
Citation Information
Patent Citations
Time sequence anomaly detection method and system based on hypergraph attention network
CN117290800A
Goods taking and delivery sequence prediction method based on multi-target deep reinforcement learning
CN118446613A