Digital Twin-Based Modeling and Synchronization Method for Pig Farm Sand Table
The digital twin-based pig farm modeling and synchronization method addresses lagging environmental monitoring and resource inefficiencies by constructing accurate digital twin models with real-time conflict resolution, enhancing adaptability and precision in pig farm management.
Patent Information
- Application Number
- CN202510585695.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-05-08
AI Technical Summary
The traditional pig farm management model has problems such as lag in breeding environment monitoring and regulation, difficulty in disease prevention and control, and inefficiency in resource utilization, which restricts the improvement of pig farm breeding efficiency and sustainable development.
Based on digital twins, a pig farm sand table modeling and synchronization method is used to build a digital twin sand table through three-dimensional modeling technology, detect path conflicts in real time and perform virtual elastic deformation modeling, combining the Internet of Things and autonomous path search algorithm to realize synchronization and closed-loop feedback control of virtual and real devices.
It improves the real-time and accuracy of pig farm management, enhances the adaptability of the system and the dynamic correlation intensity reflection between equipment, reduces synchronization delay, and improves the intelligence level of pig farm management.
Smart Images

Figure CN120107492B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent breeding, and particularly to a method for modeling and synchronizing a pig farm sand table based on digital twin. Background Art
[0002] In the context of the rapid development of the livestock industry today, pig breeding, as an important part of the agricultural field, has been continuously increasing in scale and intensification. With the rapid development of information technology, digital twin technology, as a new technical means, provides new ideas and methods for the intelligent upgrading of pig farm management. The traditional pig farm management model faces many challenges, such as the lag in monitoring and controlling the breeding environment, the difficulty in disease prevention and control, and the low efficiency of using breeding resources, which seriously restricts the improvement of pig farm breeding efficiency and sustainable development. Summary of the Invention
[0003] The present invention aims at the technical problems existing in the prior art and provides a method for modeling and synchronizing a pig farm sand table based on digital twin.
[0004] The technical solution for the present invention to solve the above technical problems is as follows: A method for modeling and synchronizing a pig farm sand table based on digital twin, comprising the following steps:
[0005] S101. According to the dynamic topology relationship data, a basic model of the digital twin sand table is constructed through three-dimensional modeling technology, including establishing a dynamic two-way binding relationship between the entity device number and the twin body identifier;
[0006] S102. During the movement of the twin body, the path conflicts on its movement path are detected in real time. After the conflicts are detected, through virtual elastic deformation modeling, the position and posture of the twin body are adjusted to avoid path conflicts;
[0007] S103. When an operation instruction is generated and the state changes in the physical sand table, relevant information sends a first synchronization instruction to the digital twin platform through the Internet of Things;
[0008] S104. The state and topology relationship of the corresponding twin body in the digital twin sand table are updated according to the synchronization deviation correction parameters.
[0009] In a preferred embodiment, in the physical pig farm sand table in S101, multi-modal sensors are deployed in various entity devices, a data acquisition system is built, an Internet of Things gateway is used as the core device, the scattered sensors are connected to the gateway, the data acquisition system is started, and device operation data, environmental parameters, and the physical connection status between devices are continuously collected. Through a preset topology weight algorithm, the dynamic association strength between devices is comprehensively considered. The weight algorithm includes a device distance attenuation factor and data interaction frequency as well as operation dependence , and + + = 1, set the preset threshold of the association strength , used to screen high-priority topological links, extract the distance data, data interaction frequency, and operation dependency relationship between devices from the data storage server, clean these data, remove outliers and duplicate data, for each pair of devices, calculate the dynamic association strength between each pair of devices according to the topological weight algorithm, the distance between device A and device B is , the data interaction frequency is , the operation dependency is o , then the specific calculation formula of the dynamic association strength S is as follows:
[0010]
[0011] Among them, and respectively represent the maximum values of the data interaction frequency and operation dependency, obtained by statistical analysis of all device data, compare the calculated dynamic association strength of each pair of devices with the preset threshold . When the dynamic association strength S > , then mark this pair of devices as a high-priority topological link, record the device numbers, dynamic association strength values, and related parameters of these links, generate a dynamic topological map, where nodes represent devices and edges represent the connection relationships between devices in the map, and different weights and color identifications are assigned to the edges according to the dynamic association strength;
[0012] According to the obtained dynamic topological relationship data, follow the preset adaptive topological mapping rules, and use three-dimensional modeling technology to construct a digital twin sand table basic model that is 1:1 mapped to the physical sand table. During the modeling process, define a unique identification rule for each physical device and its corresponding twin. Let the set of device types be , each device type corresponds to a unique code, the set of serial numbers is . For the physical device , its physical device type is , and the serial number is , then the calculation formula for the physical device number is:
[0013]
[0014] Among them, Identify the j-th specific device type in the set T of device types. In 3D modeling software, add an adaptive attribute to each device model to store its corresponding physical device number, add an attribute to each twin in the digital twin sandbox to store its identifier, and establish a dynamic two-way binding relationship between the physical device number and the twin identifier to ensure that when the number of the physical device changes, the corresponding twin identifier in the digital twin sandbox can also be automatically updated, ensuring a one-to-one correspondence between virtual and physical devices.
[0015] In a preferred embodiment, when the position of the physical device changes in S102, the autonomous pathfinding algorithm of the twin in the digital twin sandbox is triggered by means of the binding relationship, and the autonomous pathfinding algorithm is called to calculate a collision-free path of the twin from the current position to the new position. During the movement of the twin, whether there is a spatial overlap area with other twins and obstacles on its path is detected in real time through the collision detection algorithm, and conflict detection is carried out through the space segmentation algorithm. The space of the digital twin sandbox is divided into an octree structure, and each node represents a subspace. Suppose the twin is located at the octree node , the twin is located at the octree node . When and are the same node and they have a common ancestor node, it means that there is a conflict between the two twins. When a conflict is detected, virtual elastic deformation modeling is carried out on the spatial overlap area on the movement path of the twin through the conflict resolution strategy. The conflicting twins can be regarded as elastic bodies, and the force F they receive is proportional to the deformation amount , and the proportionality coefficient is the elastic coefficient k. The specific formula is as follows:
[0016]
[0017] where the negative sign indicates that the direction of the force is opposite to the direction of the deformation amount. In the digital twin space, suppose the displacement vector of the twin is , then the force vector received:
[0018]
[0019] where, represents the received force vector. Through the calculated force vector and combining Newton's second law, the acceleration vector can be obtained, where m represents the mass of the twin. According to the kinematic formula, calculate the update formula of the velocity and the update formula of the position. The update formula of the velocity is the velocity vector , where, represents the acceleration vector of the twin. The update formula of the position is , where, represents the position vector at time t, represents the position vector of the twin at time t + 1, that is, the new position vector of the twin after a time interval, represents the velocity vector of the twin at time t + 1, represents the time interval. According to the position update formula, the position and attitude of the twin are adjusted to move along the virtual elastic path, generate a collision-free migration trajectory, and synchronize the trajectory spatio-temporal parameters backward to the physical sand table actuator to construct a closed-loop feedback control of the virtual and real sand tables.
[0020] In a preferred embodiment, in S103, the operation instructions and status changes of the physical sand table are monitored in real time, a unique code is assigned to each operation type, and the device numbers involved in the operation are recorded at the same time. The first synchronization instruction including the operation type and the device number is sent to the digital twin platform through the Internet of Things, and the digital twin platform receives the first synchronization instruction from the Internet of Things platform;
[0021] Based on LSTM, a digital twin sand table preview model is constructed. The edge computing node uses the preview model, inputs the current historical synchronization instruction sequence and device response delay data, predicts the operation instruction types and corresponding device numbers that may be triggered in the next time window, and according to the prediction results, pre-loads the 3D model resources of relevant twins from the resource library of the digital twin platform to the edge cache in advance, pre-renders the types of the loaded 3D model resources, generates a pre-render queue, and during the pre-rendering process, factors such as lighting, materials, and textures are considered to improve the rendering results;
[0022] Collect the transmission delay of the first synchronization instruction from the physical sand table to the digital twin platform and the processing delay of the digital twin platform in processing the instruction. Let the transmission delay of the first synchronization instruction from the physical sand table to the digital twin platform be , and the processing delay of the digital twin platform in processing the instruction be , record the instruction sending time through a timestamp 、receiving time and processing completion time , then the specific calculation formulas for the transmission delay and the processing delay are as follows:
[0023]
[0024] Based on the collected delay data, combined with the predicted instruction information, perform delay compensation calculation. Let the time deviation between the physical sand table and the digital twin sand table be , calculate the average time deviation by measuring the transmission delay and the processing delay multiple times, and according to the predicted instruction information and the delay data, the predicted instruction arrival time 、actual instruction arrival time , and the average time deviation ,
[0025]
[0026] According to the generated synchronization deviation correction parameter , correct the timestamp of the first synchronization instruction. Let the original timestamp be , then the corrected timestamp is:[[]]
[0027]
[0028] Among them, represents the corrected timestamp. According to the generated synchronization deviation correction parameter, correct the first synchronization instruction, and send the corrected instruction to the digital twin sand table to drive the relevant twins to perform corresponding operations, so as to realize the synchronization of the virtual and real scenarios.
[0029] In a preferred embodiment, the deviation correction parameter is obtained in S104, and the position, attitude, and operating parameters of the corresponding twins in the digital twin sand table are modified according to the correction parameter. According to the corrected twin state, combined with the preset topological weight algorithm, the dynamic association strength between devices is recalculated, and the topological relationship data in the digital twin sand table is updated, including the connection state and association strength value between devices.
[0030] The beneficial effects of the present invention are as follows: The present invention uses the topological weight algorithm to calculate the dynamic association strength between devices, and the generated dynamic topological relationship data accurately reflects the actual relationship between devices, providing a solid data foundation for subsequent modeling and analysis. Based on the dynamic topological relationship data, the digital twin sand table basic model is constructed by using three-dimensional modeling technology, and a dynamic two-way binding relationship between the physical device number and the twin identifier is established, ensuring the accurate mapping between the physical sand table and the digital twin sand table. The application of the autonomous pathfinding algorithm and conflict resolution strategy enables the digital twin sand table to flexibly respond to the position change of the physical device, realizing the closed-loop feedback control of the virtual and real sand tables, improving the adaptability and accuracy of the model, performing resource preparation and delay compensation operations in advance, effectively reducing the synchronization delay between the digital twin sand table and the physical sand table, and improving the real-time performance and accuracy of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 is the flowchart of the present invention;
[0032] Figure 2 is the flowchart of the construction of the digital twin sand table of the present invention;
[0033] Figure 3 is the schematic flowchart of conflict resolution of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0034] Next, in combination with the accompanying drawings in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present application.
[0035] In the description of the present application, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of the described features. In the description of the present application, "a plurality" means two or more, unless otherwise specifically defined.
[0036] In the description of the present application, the term "for example" is used to mean "serving as an example, illustration, or explanation". Any embodiment described as "for example" in the present application is not necessarily construed as being more preferred or having more advantages than other embodiments. In order for any person skilled in the art to implement and use the present invention, the following description is given. In the following description, details are set forth for the purpose of explanation. It should be understood that those of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other instances, well-known structures and processes are not elaborated in detail to avoid unnecessary details from obscuring the description of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope that conforms to the principles and features disclosed in the present application.
[0037] As Figures 1-3 , this embodiment provides: a method for digital twin-based pig farm sand table modeling and synchronization, specifically including the following steps:
[0038] S101. According to the dynamic topological relationship data, construct the basic model of the digital twin sand table through 3D modeling technology, including establishing a dynamic two-way binding relationship between the entity device number and the twin body identifier;
[0039] Further, in the physical pig farm sand table, deploy multimodal sensors in various entity devices, including feed feeders, environmental control devices, and monitoring cameras, build a data acquisition system, use the Internet of Things gateway as the core device, connect the scattered sensors to the gateway, start the data acquisition system, continuously collect device operation data, environmental parameters, and the physical connection status between devices, and store them in the data storage server. Through a preset topological weight algorithm, comprehensively consider the dynamic association strength between devices. The weight algorithm includes a device distance attenuation factor , data interaction frequency and the operation dependence , and + + = 1, set the preset threshold of the association strength , which is used to screen high-priority topological links, extract the distance data, data interaction frequency, and operation dependence between devices from the data storage server, clean these data, remove outliers and duplicate data, and for each pair of devices, calculate the dynamic association strength between each pair of devices according to the topological weight algorithm. The distance between device A and device B is , the data interaction frequency is , and the operation dependence is o , then the specific calculation formula of the dynamic association strength S is as follows:
[0040]
[0041] Among them, and respectively represent the maximum values of the data interaction frequency and operation dependence, which are obtained by statistically analyzing all device data. Compare the calculated dynamic association strength of each pair of devices with the preset threshold . When the dynamic association strength S > , then mark this pair of devices as a high-priority topological link, record the device numbers, dynamic association strength values, and related parameters of these links, generate a dynamic topological map, where nodes represent devices and edges represent the connection relationships between devices in the map, and different weights and color identifications are assigned to the edges according to the dynamic association strength;
[0042] According to the obtained dynamic topological relationship data, follow the preset adaptive topological mapping rules and use 3D modeling technology to construct a digital twin sand table basic model that is 1:1 mapped to the physical sand table. During the modeling process, define a unique identification rule for each physical device and its corresponding twin. Let the set of device types be , and each device type corresponds to a unique code. The set of serial numbers is . For the physical device , its physical device type is , and the serial number is , then the calculation formula for the physical device number is:
[0043]
[0044] Among them, Identify the j-th specific device type in the set T of device types. In 3D modeling software, add an adaptive attribute to each device model to store its corresponding physical device number, add an attribute to each twin in the digital twin sandbox to store its identifier, and establish a dynamic two-way binding relationship between the physical device number and the twin identifier to ensure that when the number of the physical device changes, the corresponding twin identifier in the digital twin sandbox can also be automatically updated, ensuring a one-to-one correspondence between virtual and physical devices.
[0045] It should be noted that the preset threshold of the association strength By analyzing a large amount of information such as the collected device operation data, environmental parameters, and the physical connection status between devices. First, the association strength between all pairs of devices can be calculated, and then the distribution of these association strength values can be observed. For example, draw a histogram or probability density function curve of the association strength to find some characteristic points in the data distribution, such as inflection points, modes, etc., and use them as a reference for the threshold, or through statistical analysis methods, such as setting a percentage, and taking the association strength values higher than this percentage as the threshold, that is, considering the pairs of devices with a relatively high level of association strength as high-priority topological links.
[0046] S102. During the movement of the twin, real-time detect the path conflicts on its moving path. After detecting a conflict, through virtual elastic deformation modeling processing, adjust the position and posture of the twin to avoid path conflicts;
[0047] Furthermore, when the position of the physical device changes, trigger the autonomous pathfinding algorithm of the twin in the digital twin sandbox by virtue of the binding relationship, call the autonomous pathfinding algorithm to calculate the collision-free path of the twin from the current position to the new position. During the movement of the twin, through the collision detection algorithm, real-time detect whether there is a spatial overlap area with other twins and obstacles on its path, and conduct conflict detection through the space division algorithm. Divide the space of the digital twin sandbox into an octree structure, and each node represents a subspace. Suppose the twin is located at the octree node , and the twin is located at the octree node . When and are the same node and they have a common ancestor node, it means that there is a conflict between the two twins. When a conflict is detected, conduct virtual elastic deformation modeling on the spatial overlap area on the moving path of the twin through the conflict resolution strategy. The twins in conflict can be regarded as elastic bodies, and the force F acting on them is proportional to the deformation amount , and the proportionality coefficient is the elastic coefficient k. The specific formula is as follows:
[0048]
[0049] Among them, the negative sign indicates that the direction of the force is opposite to the direction of the deformation amount. In the digital twin space, let the displacement vector of the twin body be , then the force vector received:
[0050]
[0051] Among them, represents the received force vector. By combining the calculated force vector with Newton's second law, the acceleration vector can be obtained. Among them, m represents the mass of the twin body. According to the kinematic formula, the update formula of the velocity and the update formula of the position are calculated. The update formula of the velocity is the velocity vector Among them, represents the acceleration vector of the twin body. The update formula of the position Among them, represents the position vector at time t, represents the position vector of the twin body at time t + 1, that is, the new position vector of the twin body after a time interval, represents the velocity vector of the twin body at time t + 1, represents the time interval. According to the position update formula, the position and attitude of the twin body are adjusted to make it move along the virtual elastic path, generate a collision-free migration trajectory, and reverse-synchronize the trajectory spatio-temporal parameters to the physical sand table actuator to construct a closed-loop feedback control of the virtual and real sand tables.
[0052] It should be noted that the "virtual elastic deformation modeling" described in the present invention refers to applying the linear elastic theory in continuum mechanics to the conflict resolution process in the digital twin space. By establishing a mathematical model that conforms to physical laws, the elastic response behavior of virtual entities during spatial conflicts is simulated. This modeling method combines the spatial discretization technology in computer graphics with classical mechanics theory to achieve a balance between the physical credibility and computational efficiency of the conflict resolution process.
[0053] The virtual elastic deformation modeling method adopted by the present invention is based on the following physical theories:
[0054] (1). The linear elastic theory in continuum mechanics, regarding the twin bodies in the conflict area as elastic bodies that satisfy Hooke's law;
[0055] (2). Establishing the relationship between force and acceleration through Newton's second law;
[0056] (3). Using explicit Euler integration to update the position and velocity.
[0057] It should be noted that the adaptive topology mapping rule performs clustering analysis on information such as the association strength and spatial coordinates between devices in the dynamic topology relationship data, clustering devices with similar characteristics into one category. For example, according to factors such as the function, location, and data interaction frequency of the devices, devices that are in the same area and are functionally related are grouped together. Then, corresponding topology mapping rules are formulated for each category of devices to ensure that devices in the same category have similar topology structures and mapping methods in the digital twin sandbox. Using the association rule mining algorithm, potential association rules between devices are discovered from the dynamic topology relationship data. For example, by analyzing the data, it is found that when the feed feeder is running, certain environmental control devices will also adjust their parameters accordingly. According to this association rule, the topology connection and mapping relationship between these two types of devices in the digital twin sandbox can be determined, that is, when the feed feeder model in the digital twin sandbox is in the running state, the corresponding environmental control device model should also make corresponding state changes.
[0058] Furthermore, the autonomous pathfinding algorithm includes the following steps:
[0059] S1. Represent the graph as the environment of the digital twin sandbox, where V is the set of nodes, representing each position point in the sandbox scene. These position points can be any position that the twin can reach, such as different areas of the pigsty and the positions where the devices are located. E is the set of edges, representing the connection relationships between the position points, that is, the paths along which the twin can move from one position to another.
[0060] S2. First, determine a starting node Q, which is the initial position of the twin. For the distance from the starting node Q to itself, initialize it to . For all other nodes v, which belong to the node V but do not include the starting node Q, we initialize their distances to the starting node Q to infinity, denoted by .
[0061] S3. During the running of the algorithm, start from the starting node Q and gradually explore its adjacent nodes. For the currently explored node u, check all its adjacent nodes v. Each edge connecting node u and node v has a weight , which represents the cost of moving from node u to node v, such as their actual distance and the time required for movement. When it is found that the total distance from the starting node Q through the current node u to node v is less than the currently recorded distance d(v) of node v to the starting node Q, it means that we have found a shorter path to reach node v. At this time, we can update the value of d(v) and set it to . By continuously checking adjacent nodes and updating the distances, shorter paths from the starting node to other various nodes can be gradually found.
[0062] S4. In each iteration, there are two sets of nodes. One is the set of nodes to be explored, which contains the nodes whose shortest paths from the starting node have not been determined yet. The other is the set of explored nodes, which contains the nodes whose shortest paths have been determined. We select the node with the smallest d(v) value from the set of nodes to be explored. This node means that we have found the shortest path from the starting node to it. Therefore, we move it from the set of nodes to be explored to the set of explored nodes. Taking this newly determined shortest path node as the current node u, we repeat the above process of updating distances and selecting nodes until the set of nodes to be explored is empty. At this time, we have found the shortest paths from the starting node to all nodes in the digital twin sand table environment, thus realizing the autonomous pathfinding of the twin in this environment.
[0063] S103. When the physical sand table generates operation instructions and its state changes, the relevant information sends a first synchronization instruction to the digital twin platform through the Internet of Things.
[0064] Furthermore, the operation instructions and state changes of the physical sand table are monitored in real time. A unique code is assigned to each operation type, and the device numbers involved in the operation are recorded at the same time. The first synchronization instruction containing the operation type and device number is sent to the digital twin platform through the Internet of Things, and the digital twin platform receives the first synchronization instruction from the Internet of Things platform.
[0065] Based on LSTM, a digital twin sand table preview model is constructed. The edge computing node uses the preview model, inputs the current historical synchronization instruction sequence and device response delay data, predicts the types of operation instructions and corresponding device numbers that may be triggered within the next time window, and according to the prediction results, preloads the 3D model resources of the relevant twins from the resource library of the digital twin platform to the edge cache in advance, and pre-renders the types of the loaded 3D model resources to generate a pre-render queue. During the pre-rendering process, factors such as lighting, materials, and textures are considered to improve the rendering results.
[0066] Collect the transmission delay of the first synchronization instruction from the physical sand table to the digital twin platform and the processing delay of the digital twin platform in processing the instruction. Let the transmission delay of the first synchronization instruction from the physical sand table to the digital twin platform be and the processing delay of the digital twin platform in processing the instruction be Record the instruction sending time and receiving time as well as the processing completion time through timestamps. Then the specific calculation formulas for the transmission delay and processing delay are as follows:
[0067]
[0068] Based on the collected latency data and combined with the predicted instruction information, perform latency compensation calculations. Let the time deviation between the physical sand table and the digital twin sand table be , calculate the average time deviation by measuring the transmission latency and processing latency multiple times , according to the predicted instruction information and latency data, the predicted instruction arrival time , the actual instruction arrival time , and the average time deviation , generate a synchronization deviation correction parameter , the specific calculation formula is as follows:
[0069]
[0070] According to the generated synchronization deviation correction parameter , correct the timestamp of the first synchronization instruction. Let the original timestamp be , then the corrected timestamp is:
[0071]
[0072] Among them, represents the corrected timestamp. According to the generated synchronization deviation correction parameter, correct the first synchronization instruction and send the corrected instruction to the digital twin sand table to drive the relevant twins to perform corresponding operations to achieve the synchronization of the virtual and real scenarios.
[0073] It should be noted that the synchronization deviation correction parameter: is a dynamic adjustment quantity used to compensate for the timing difference between the physical sand table and the digital twin sand table, specifically including:
[0074] 1. Continuously monitor the instruction transmission situation between the physical sand table and the digital twin sand table, and perform a measurement record of the transmission latency and processing latency every fixed period. Then the total measured latency can be calculated through + , and calculate the average time deviation through the formula . This parameter reflects the average time difference in instruction transmission and processing between the physical sand table and the digital twin sand table.
[0075] 2. Obtain the predicted instruction information arrival time and the actual instruction information arrival time . When the actual instruction arrives at the digital twin sand table, record the actual instruction arrival time. Substitute the predicted instruction arrival time , the actual instruction arrival time , and the average time deviation into the formula , and calculate and generate a synchronization deviation correction parameter .
[0076] It should be noted that predicting the types of operation instructions that may be triggered in the next time window and the corresponding device numbers is based on linear weighting. In the historical synchronization instruction sequence of the past N time steps, let the number of occurrences of the operation instruction type be { }, where k is the total number of operation instruction types, and the number of occurrences of the device numbers is counted as { }, where l represents the total number of device numbers. At the same time, record the average response delay of the devices in the past N time steps as . Set a basic weight for each type of operation instruction, and consider the influence factor of the average response delay of the devices, and calculate the prediction score of each type of operation instruction:
[0077]
[0078] Select the operation instruction type with the highest score as the prediction result, that is, the predicted operation instruction type O = arg . Set a basic weight for each device number, and consider the influence factor of the average response delay of the devices, and calculate the prediction score of each type of operation instruction:
[0079]
[0080] Select the operation device number with the highest score as the prediction result, that is, the predicted operation instruction type E = arg .
[0081] S104. Update the states and topological relationships of the corresponding twins in the digital twin sandbox according to the synchronization deviation correction parameters;
[0082] Furthermore, obtain the deviation correction parameters, modify the positions, postures, and operating parameters of the corresponding twins in the digital twin sandbox according to the correction parameters, and recompute the dynamic association strength between devices based on the corrected twin states, and update the topological relationship data in the digital twin sandbox, including the connection states and association strength values between devices.
[0083] It should be noted that in the above embodiments, the descriptions of the various embodiments have their own emphases. For parts not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0084] Those skilled in the art will understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) that contain computer-usable program code.
[0085] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in one Figure 1 flow or multiple flows and / or blocks Figure 1 or multiple blocks.
[0086] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in one Figure 1 flow or multiple flows and / or blocks Figure 1 or multiple blocks.
[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are performed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one Figure 1 flow or multiple flows and / or blocks Figure 1 or multiple blocks.
[0088] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
[0089] Obviously, those skilled in the art can make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.
Claims
1. A method for digital-twin-based pig farm sand table modeling and synchronization, characterized in that It includes the following steps: S101. Based on the dynamic topology relationship data, construct the basic model of the digital twin sand table through 3D modeling technology, including establishing a dynamic two-way binding relationship between the entity device number and the twin body identifier; S102. During the movement of the twin body, real-time detect the path conflicts on its moving path. After detecting the conflicts, through virtual elastic deformation modeling, adjust the position and posture of the twin body to avoid path conflicts; S103. When the physical sand table generates operation instructions and its state changes, relevant information sends a first synchronization instruction to the digital twin platform through the Internet of Things; According to the current historical synchronization instruction sequence and device response delay data, predict the instruction information within the next time window. According to the predicted instruction information, pre-load the 3D model resources of relevant twin bodies from the resource library of the digital twin platform to the edge cache; Collect the transmission delay of the first synchronization instruction from the physical sand table to the digital twin platform and the processing delay of the digital twin platform in processing the instruction; Based on the collected delay data, combined with the predicted instruction information, perform delay compensation calculation; The delay compensation calculation compares the predicted instruction arrival time with the actual instruction arrival time to generate a synchronization deviation correction parameter; S104. Update the state and topology relationship of the corresponding twin body in the digital twin sand table according to the synchronization deviation correction parameter; Among them, step S102 includes: when detecting the change of the entity device number and position, trigger the autonomous path finding algorithm of the corresponding twin body in the digital twin sand table; The execution of the autonomous pathfinding algorithm includes dividing the space of the digital twin sand table into an octree structure, where each node represents a subspace. Suppose the twin body is located at the octree node , and the twin body is located at the octree node . When and are the same node and they have a common ancestor node, it means that there is a conflict between the two twin bodies. When a conflict is detected, a virtual elastic deformation model is built for the space overlapping area on the moving path of the twin body through a conflict resolution strategy, which specifically includes: S1. The conflicting twins can be regarded as elastic bodies. The force F they receive is proportional to the deformation amount and the proportionality coefficient is the elastic coefficient k. The elastic force is calculated according to Hooke's law, and the specific formula is as follows: where the negative sign indicates that the direction of the force is opposite to the direction of the deformation. In the digital twin space, let the displacement vector of the twin be , then the force vector received is: Among them, represents the force vector received, the force vector calculated; S2. Combining Newton's second law, the acceleration vector can be obtained , where m represents the mass of the twin S3. Update the position. According to the kinematic formula, calculate the update formula for velocity and the update formula for position. The update formula for velocity is the velocity vector , where represents the acceleration vector of the twin, and the update formula for the position is , where represents the position vector at time t, represents the position vector of the twin at time t + 1, that is, the new position vector of the twin after a time interval, represents the velocity vector of the twin at time t + 1, represents the time interval, and adjust the position and attitude of the twin according to the position update formula.
2. The method for digital twin-based pig farm sand table modeling and synchronization according to claim 1, wherein In S101, in the physical pig farm sandbox, multi-modal sensors are deployed in various physical devices to build a data acquisition system. Using the Internet of Things gateway as the core device, the scattered sensors are connected to the gateway, and the data acquisition system is started to continuously collect device operation data, environmental parameters, and the physical connection status between devices. Through the preset topological weight algorithm, the dynamic association strength between devices is comprehensively considered. The weight algorithm includes the device distance attenuation factor , data interaction frequency , and operation dependence , and + + = 1. A preset threshold for the association strength is set to screen high-priority topological links. The distance data, data interaction frequency, and operation dependence relationship between devices are extracted from the data storage server, and these data are cleaned to remove outliers and duplicate data. For each pair of devices, the dynamic association strength between each pair of devices is calculated according to the topological weight algorithm.
3. The method for pig farm sand table modeling and synchronization based on digital twin according to claim 2, wherein The calculation of the dynamic association strength is based on the distance between Device A and Device B , the data interaction frequency , the operation dependence o , then the specific calculation formula for the dynamic association strength S is as follows: Among them, and respectively represent the maximum values of data interaction frequency and operation dependence, obtained by statistically analyzing all device data. Compare the calculated dynamic association strength of each pair of devices with the preset threshold . When the dynamic association strength S > , mark the device pair as a high-priority topology link, record the device numbers, dynamic association strength values, and related parameters of these links, and generate a dynamic topology map.
4. The method for pig farm sand table modeling and synchronization based on digital twin according to claim 1, characterized in that, In S101, based on the obtained dynamic topological relationship data, following the preset adaptive topological mapping rules, the digital twin sand table basic model that is mapped 1:1 with the physical sand table is constructed using 3D modeling technology. During the modeling process, a unique identification rule is defined for each physical device and its corresponding twin. Let the set of device types be , and each device type corresponds to a unique code. The set of serial numbers is . For the physical device , its physical device type is , and the serial number is . Then the calculation formula for the physical device number is: Among them, Identify the j-th specific device type in the set T of device types. In the 3D modeling software, add an adaptive attribute to each device model to store its corresponding physical device number, add an attribute to each twin in the digital twin sandbox to store its identifier, and establish a dynamic two-way binding relationship between the physical device number and the twin identifier.
5. The method for pig farm sand table modeling and synchronization based on digital twin according to claim 1, characterized in that, In S103, real-time monitor the operation instructions and state changes of the physical sand table, and assign a unique code to each operation type; Send a first synchronization instruction to the digital twin platform through the Internet of Things, and the first synchronization instruction includes the operation type and the device number; Based on LSTM, construct a digital twin sand table preview model, input the current historical synchronization instruction sequence and device response delay data, predict the operation instruction types and corresponding device numbers that may be triggered within the next time window, and according to the prediction results, pre-load the 3D model resources of relevant twin bodies from the resource library of the digital twin platform to the edge cache.
6. The method for pig farm sand table modeling and synchronization based on digital twin according to claim 5, wherein, Collect the transmission delay of the first synchronization instruction sent from the physical sand table to the digital twin platform and the processing delay of the digital twin platform in processing the instruction. Let the transmission delay of the first synchronization instruction sent from the physical sand table to the digital twin platform be , and the processing delay of the digital twin platform in processing the instruction be . Record the instruction sending time , receiving time and processing completion time through timestamps. Then the specific calculation formulas for the transmission delay and the processing delay are as follows: Based on the collected delay data, combined with the predicted instruction information, perform delay compensation calculation.
7. The method for digital-twin-based pig farm sand table modeling and synchronization according to claim 6, characterized in that, The delay compensation calculation sets the time deviation between the physical sand table and the digital twin sand table as and calculates the average time deviation by measuring the transmission delay and processing delay multiple times According to the predicted instruction information and delay data, the predicted instruction arrival time , the actual instruction arrival time , and the average time deviation , According to the generated synchronization deviation correction parameter , correct the timestamp of the first synchronization instruction. Let the original timestamp be , then the corrected timestamp is: Among them, represents the corrected timestamp.
8. The method for digital twin-based pig farm sand table modeling and synchronization according to claim 7, wherein According to the generated synchronization deviation correction parameter, correct the first synchronization instruction, and send the corrected instruction to the digital twin sand table to drive the relevant twin bodies to perform corresponding operations, realizing the synchronization of the virtual and real scenarios.
9. The method for digital-twin-based pig farm sand table modeling and synchronization according to claim 1, wherein In S104, obtain the deviation correction parameter, modify the position, posture and operation parameters of the corresponding twin body in the digital twin sand table according to the correction parameter. According to the corrected twin body state, combined with the preset topology weight algorithm, recalculate the dynamic association strength between devices, and update the topology relationship data in the digital twin sand table, including the connection state and association strength value between devices.
Citation Information
Patent Citations
Digital twinborn monitoring modeling system and modeling method for cloud-edge collaborative plant
CN115392883A
Multilayer superposition delay correction method and system based on digital twinning
CN119788231A