Food safety inspection robot control method and system based on industrial vision
By acquiring environmental point cloud information and planning paths in real time based on industrial vision methods, the problem of poor adaptability of food safety inspection robots in complex environments is solved, and efficient and stable food production environment monitoring is achieved.
Patent Information
- Application Number
- CN202510789588.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-06-13
AI Technical Summary
Existing food safety inspection robots have poor adaptability in complex and changing production environments and are unable to adjust their inspection paths in real time, resulting in low inspection efficiency and an inability to meet strict food safety supervision requirements.
Using an industrial vision-based approach, we acquire environmental point cloud information through lidar and depth cameras, combine it with machine learning models to identify production equipment and obstacles, plan and optimize inspection paths in real time, and use multi-dimensional perception sensors for safety monitoring.
The robot can adjust its path flexibly in complex environments, improve inspection efficiency and stability, and ensure safe monitoring of the food production process.
Smart Images

Figure CN120652976A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a food safety inspection robot control method and system based on industrial vision. Background Art
[0002] Existing food safety inspection robots typically use a pre-set, fixed route control system. Before deployment at a food production site, technicians plan one or more fixed routes based on the site layout and key monitoring areas. The robots then follow these pre-set routes for inspection.
[0003] In the current field of food safety inspections, existing inspection robot control methods have numerous drawbacks, the most significant of which is their poor adaptability to the complex and ever-changing food production environment. The food production environment is not static; during the production process, factors such as temporary adjustments to equipment, changes in material stacking, and the frequent movement of personnel cause the inspection environment to constantly change. However, the existing control method of pre-set fixed routes prevents robots from adjusting their inspection paths in real time based on environmental changes. For example, when a new batch of production equipment is placed in a food processing area, blocking the robot's preset route, the robot either stops and waits for manual rerouting, or it forcibly continues along the original route, potentially colliding with obstacles, causing equipment damage and interrupting data collection. This inflexible control method seriously affects inspection efficiency, making it impossible to monitor the food production environment in a timely and comprehensive manner, making it difficult to meet the increasingly stringent food safety regulatory requirements. Summary of the Invention
[0004] The present invention provides a food safety inspection robot control method and system based on industrial vision, which are used to solve the problem of poor adaptability of the robot to complex production environments, improve the efficiency of inspections, and ensure efficient and stable inspection work.
[0005] In a first aspect, the present invention provides a method for controlling a food safety inspection robot based on industrial vision, comprising:
[0006] Controlling the food safety inspection robot to start, and obtaining environmental point cloud information obtained by the food safety inspection robot after performing a full-scale scan of the current food production environment based on industrial vision equipment;
[0007] Performing path planning based on the environmental point cloud information in combination with a preset target inspection area to generate an initial inspection path, and controlling the food safety inspection robot to move along the initial inspection path;
[0008] Optimizing the initial inspection path based on obstacle information collected by the industrial vision device during movement of the food safety inspection robot to obtain a target inspection path;
[0009] The food safety inspection robot is controlled to move along the target inspection path to the target inspection area, and the food production process is safely monitored based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot to obtain food production safety monitoring results.
[0010] In a second aspect, the present invention further provides a food safety inspection robot control system based on industrial vision, which is applied to the food safety inspection robot control method based on industrial vision as described in the first aspect; the food safety inspection robot control system based on industrial vision includes:
[0011] A point cloud data acquisition module is used to control the start-up of the food safety inspection robot and obtain environmental point cloud information obtained by the food safety inspection robot after performing a full-scale scan of the current food production environment based on industrial vision equipment;
[0012] A path planning module, configured to perform path planning based on the environmental point cloud information and a preset target inspection area, generate an initial inspection path, and control the food safety inspection robot to move along the initial inspection path;
[0013] a path optimization module, configured to optimize the initial inspection path based on obstacle information collected by the industrial vision device during movement of the food safety inspection robot to obtain a target inspection path;
[0014] The food monitoring module is used to control the food safety inspection robot to move along the target inspection path to the target inspection area, and to monitor the food production process based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot to obtain food production safety monitoring results.
[0015] In a third aspect, the present invention also provides an electronic device comprising: a memory for storing a computer software program; and a processor for reading and executing the computer software program, thereby implementing any of the above-described methods for controlling a food safety inspection robot based on industrial vision.
[0016] In a fourth aspect, the present invention also provides a non-transitory computer-readable storage medium, in which a computer software program is stored. When the computer software program is executed by a processor, it implements any of the above-mentioned industrial vision-based food safety inspection robot control methods.
[0017] In a fifth aspect, the present invention further provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-described industrial vision-based food safety inspection robot control methods.
[0018] The industrial vision-based food safety inspection robot control method provided by an embodiment of the present invention, on the one hand, plans an initial inspection path by combining environmental point cloud information of the food production environment collected by industrial vision equipment with the target inspection area, thereby ensuring the rationality of the inspection path and improving the efficiency of the inspection. On the other hand, the industrial vision equipment monitors obstacles in the environment in real time and quickly adjusts the inspection path after detecting obstacles, allowing the robot to flexibly respond to environmental changes and avoid stopping due to obstructions. This allows the robot to better adapt to complex food production environments, further improves the efficiency of inspections, and ensures that inspection work is carried out efficiently and stably. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 This is a flow chart of a method for controlling a food safety inspection robot based on industrial vision provided by an embodiment of the present invention;
[0020] Figure 2 Schematic diagram of the structure of a food safety inspection robot control system based on industrial vision provided by an embodiment of the present invention;
[0021] Figure 3 An embodiment diagram of an electronic device provided by an embodiment of the present invention;
[0022] Figure 4 An embodiment diagram of a computer-readable storage medium provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0024] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the specified features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0025] In the description of the present invention, the term "for example" is used to mean "used as an example, illustration or illustration". Any embodiment of the present invention described as "for example" is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any person skilled in the art to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes are not elaborated in detail to avoid obscuring the description of the present invention with unnecessary details. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed herein.
[0026] Optional, see Figure 1 , Figure 1 This is a flow chart of the industrial vision-based food safety inspection robot control method provided by the present invention. In the embodiment of the present invention, the execution subject of the industrial vision-based food safety inspection robot control method is the robot control system. Therefore, the industrial vision-based food safety inspection robot control method includes:
[0027] Step 10: Control the food safety inspection robot to start, and obtain environmental point cloud information obtained after the food safety inspection robot performs a full-scale scan of the current food production environment based on industrial vision equipment.
[0028] Optionally, the robot control system sends a startup command to the food safety inspection robot deployed in the food production workshop through a specific communication protocol (such as the TCP / IP protocol). After receiving the command, the communication module of the inspection robot triggers the internal startup program, and the industrial vision equipment enters the working state. Among them, the laser radar in the industrial vision equipment emits a laser beam tens of thousands of times per second, and the depth camera continuously captures image information. After the laser beam encounters objects in the workshop (such as production lines, shelves, processing equipment, etc.), it is reflected back to the laser radar. The depth camera captures key information such as the spatial position, geometry and distance of objects in the environment through image feature analysis. The key information is converted into discrete points containing attributes such as three-dimensional spatial coordinates, color, and reflection intensity. Many discrete points converge to form point cloud data, which fully depicts the spatial structure and object distribution of the food production environment, and finally generates environmental point cloud information and transmits it back to the robot control system.
[0029] In one embodiment, in a food and beverage production workshop, the robot control system sends a start-up command to a food safety inspection robot located in a corner of the workshop before daily production begins. Upon receiving the command, the inspection robot's onboard laser radar begins rotating at high speed, emitting a laser beam at a frequency of 30,000 times per second. The laser beam strikes objects within the workshop, such as the beverage bottling line, raw material shelves, and conveyor belts, and then reflects back. The laser radar accurately calculates the distance to each reflection point based on the time difference between transmission and reception. Combining its own rotation angle and position information, it converts the reflection points into point cloud data in three-dimensional space. Simultaneously, a depth camera captures images of the workshop environment, assisting the laser radar in acquiring more comprehensive environmental information. For example, if a raw material shelf is detected 8 meters away from the robot, at a 45-degree angle to the left, the laser radar generates a point containing the location coordinates and reflection intensity. As the scan continues, a large number of points converge into an environmental point cloud that fully represents the workshop production environment and transmits this information to the robot control system in real time.
[0030] Step 20: Perform path planning based on the environmental point cloud information and the preset target inspection area to generate an initial inspection path, and control the food safety inspection robot to move along the initial inspection path.
[0031] Furthermore, after receiving the environmental point cloud information, the robot control system first uses a point cloud segmentation algorithm (such as a region growing algorithm) to pre-process the data, removing noise points and redundant data, and enhancing the data's accuracy and usability. Furthermore, the robot control system analyzes the processed point cloud data using a machine learning model (such as a semantic segmentation model based on deep learning), and identifies production equipment areas and impassable areas (such as narrow passages within the workshop and areas where debris is stored) based on their characteristics (such as shape, size, and positional relationships).
[0032] Furthermore, the robot control system retrieves preset target inspection areas (such as the filling production line area and the raw material storage area), clarifies the area scope and key inspection points that need to be inspected, and performs path planning based on the production equipment area, inaccessible area and target inspection area to generate an initial inspection path, as described in steps 201 to 205.
[0033] Furthermore, the robot control system converts the initial inspection path into a control instruction and sends the control instruction to the food safety inspection robot. After receiving the control instruction, the food safety inspection robot moves along the initial inspection path in the control instruction.
[0034] Step 30 : Optimize the initial inspection path based on obstacle information collected by the food safety inspection robot through industrial vision equipment during its movement to obtain a target inspection path.
[0035] Furthermore, as the food safety inspection robot moves along its initial inspection path, the industrial vision equipment maintains real-time monitoring. Once a new obstacle is detected (such as a material box temporarily moved into the passageway or equipment undergoing maintenance), the industrial vision equipment quickly collects information about the obstacle, including its shape, size, and direction of movement, and transmits this information to the robot's control system.
[0036] After receiving the obstacle information, the robot control system compares it with the initial inspection path and uses a collision detection algorithm to determine whether the obstacle will hinder the robot's progress. If an obstacle exists, the robot control system replans and adjusts the initial inspection path to generate a target inspection path, taking into account the new obstacle and aiming to avoid it while maintaining an optimal path. This is described in steps 301 to 304.
[0037] In one embodiment, as the inspection robot moves along its initial inspection path toward the filling line's feed port, the industrial vision system detects a rectangular material box temporarily placed in the passage ahead. The box measures 1.2 meters by 0.9 meters by 0.7 meters and is 1.5 meters from the robot. The industrial vision system quickly collects the box's shape and dimensions and transmits these details to the robot's control system. Using a collision detection algorithm, the robot's control system determines that the box will block the robot's path. Taking this new obstacle into account, the robot replans the initial inspection path and calculates a new path, directing the robot to the right, bypassing the box, and then turning left, returning to its original direction and continuing toward the feed port, ultimately achieving the target inspection path.
[0038] Step 40, control the food safety inspection robot to move along the target inspection path to the target inspection area, and perform safety monitoring of the food production process based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot to obtain food production safety monitoring results.
[0039] Furthermore, the robot control system sends a new control instruction of the target inspection path to the food safety inspection robot. The food safety inspection robot adjusts its moving direction according to the control instruction and continues to move along the target inspection path to the target inspection area.
[0040] Furthermore, once the food safety inspection robot reaches its target inspection area, its multi-dimensional sensing sensors (such as temperature, humidity, gas, and vision sensors) are activated simultaneously. The temperature sensor monitors the temperature of the food production environment in real time, the humidity sensor monitors the air humidity, the gas sensor detects any harmful gas leaks, and the image sensor checks the appearance and packaging integrity of the food.
[0041] Furthermore, the multi-dimensional sensing sensor transmits the collected data to the robot control system in real time via an internal communication module. After receiving the data, the robot control system performs preprocessing, feature extraction, and fusion analysis on the data, comparing it with preset safety standards and thresholds. Based on the comparison results, the robot controls the food production process and generates food production safety monitoring results, as detailed in steps 401 to 404.
[0042] The embodiment of the present invention combines environmental point cloud information of the food production environment collected by industrial vision equipment with the target inspection area to plan an initial inspection path, ensuring the rationality of the inspection path and improving inspection efficiency. Furthermore, by using industrial vision equipment to monitor obstacles in the environment in real time and quickly adjusting the inspection path after an obstacle is detected, the robot can flexibly respond to environmental changes, avoiding situations where it stops working due to obstructions. This allows the robot to better adapt to complex food production environments, further improving inspection efficiency and ensuring efficient and stable inspection work.
[0043] In one embodiment, steps 201 to 205 are described as follows:
[0044] Step 201: Identify the production equipment area and the inaccessible area based on the environmental point cloud information.
[0045] Optionally, the robot control system analyzes the environmental point cloud information through a machine learning model (such as a semantic segmentation model based on deep learning), and identifies the production equipment area and the inaccessible area (such as narrow passages in the workshop and areas where debris is piled up) according to the characteristics of the production equipment and the inaccessible area (such as shape, size, positional relationship, etc.).
[0046] In step 202 , the production equipment area, the impassable area, and the target inspection area are geometrically modeled in three-dimensional space using polyhedrons to obtain a path planning space.
[0047] Furthermore, the robot control system uses a polyhedron modeling method to geometrically model the production equipment area, inaccessible area and target inspection area in three-dimensional space. For example, for areas with regular shapes (such as rectangular raw material shelves and cube-shaped control boxes), corresponding rectangular and cube polyhedrons are directly constructed based on their external dimensions; for areas with irregular shapes (such as curved conveyor belts and complex filling production lines), a triangulation algorithm is used to decompose the area surface into multiple triangular facets. By connecting these triangular facets, an approximate polyhedron model is constructed to obtain the polyhedrons of the production equipment area, inaccessible area and target inspection area in three-dimensional space.
[0048] Furthermore, the robot control system connects the polyhedrons corresponding to the production equipment area, the impassable area, and the target inspection area to obtain a path planning space.
[0049] In one embodiment, in a food and beverage production workshop, the robot control system obtains the beverage filling production line, raw material shelves, inaccessible areas and target inspection areas. For raw material shelves with a rectangular shape and dimensions of 3 meters * 2 meters * 4 meters, they are directly constructed as corresponding rectangular polyhedrons; for irregularly shaped beverage filling production lines, a triangulation algorithm is used to decompose their surfaces into 500 triangular facets, and these facets are connected to construct an approximate polyhedron model; inaccessible areas (such as corner areas where debris is piled up) are also constructed into polyhedrons through triangulation. The target inspection areas (filling production lines and raw material storage areas) are also modeled as polyhedra. The polyhedrons are combined to obtain a path planning space that includes the relevant areas of the entire workshop, clearly presenting the geometric structure and positional relationship of each area in three-dimensional space.
[0050] In step 203, the path planning space is recursively partitioned using an octree. The partitioning stops when the partitioned subspaces completely belong to the production equipment area, the impassable area, the target inspection area, or are empty. This results in multiple subspaces with different attributes. These subspaces include impassable subspaces and impassable subspaces.
[0051] Furthermore, the robot control system uses an octree data structure to recursively partition the path planning space. First, the entire path planning space is taken as the root node and divided into eight equal-sized sub-cubes (eight child nodes of the octree). Then, it is determined whether each sub-cube completely belongs to the production equipment area, the inaccessible area, the target inspection area, or is empty (i.e., does not contain any of the above areas). If one of the above conditions is met, further partitioning of the sub-cube is stopped, and the corresponding attributes (such as "production equipment area", "inaccessible area", "target inspection area" or "empty") are marked for it; if not, the sub-cube is further divided into eight smaller sub-cubes, and the above judgment and partitioning process is repeated until all sub-cubes meet the stop partitioning conditions. After recursive partitioning, the path planning space is divided into multiple sub-spaces with different attributes, among which the traversable sub-space refers to the sub-space that neither belongs to the production equipment area nor the inaccessible area. The inaccessible sub-space refers to the sub-space that belongs to the production equipment area or the inaccessible area.
[0052] In one embodiment, the robot control system divides the path planning space into an octree. Initially, the path planning space of the entire workshop is used as the root node and divided into eight sub-cubes. For one of the sub-cubes, it is determined that it completely contains a part of the raw material shelf and belongs to the production equipment area, so the division of the sub-cube is stopped and marked as "production equipment area"; another sub-cube contains a part of the impassable area (corner debris), and the division is also stopped and marked as "impassable area"; some sub-cubes are empty and are also marked accordingly. For sub-cubes that neither belong to the above situation nor completely contain the target inspection area, recursive division continues until all sub-cubes have clear attribute labels. Finally, the path planning space is divided into a large number of subspaces containing different attributes, and passable subspaces and impassable subspaces are divided.
[0053] Step 204 : Determine a path direction vector based on a space vector between the first current position point of the food safety inspection robot and the center position point of the target inspection area.
[0054] Furthermore, the robot control system obtains the coordinates of the first current position point of the food safety inspection robot and the coordinates of the center position point of the target inspection area, and calculates the spatial vector from the first current position point to the center position point of the target inspection area through the spatial vector calculation method to obtain the path direction vector.
[0055] Step 205 : Path planning is performed based on the path direction vector, the traversable subspace, and the intraversable subspace to generate an initial inspection path for the food safety inspection robot to travel to the target inspection area.
[0056] Furthermore, the robot control system performs path planning based on the path direction vector, the traversable subspace and the intraversable subspace to generate an initial inspection path for the food safety inspection robot to travel to the target inspection area, as specifically described in steps 2051 to 2054.
[0057] The embodiment of the present invention takes into account the robot's motion constraints and generates an initial inspection path from the current position to the target inspection area. It can effectively avoid production equipment and inaccessible areas, and has certain optimization and feasibility. It provides a reliable driving route for the subsequent inspection work of the food safety inspection robot, so that the robot can reach the target inspection area efficiently and safely, monitor the food production process, and improve the inspection efficiency in complex three-dimensional environments.
[0058] In one embodiment, steps 2051 to 2055 are described as follows:
[0059] Step 2051: Based on the spatial vector and spatial distance between each subspace point and the central position point in the traversable subspace, the traversable direction vector and the traversable distance are determined, and the subspace points whose direction angle between the traversable direction vector and the path direction vector is within a preset range and whose traversable distance is less than a preset distance threshold are determined as path candidate nodes.
[0060] Optionally, the robot control system obtains each subspace point in the traversable subspace, and determines the traversable direction vector and the traversable distance based on the space vector and space distance between each subspace point in the traversable subspace and the center position point.
[0061] Furthermore, the robot control system calculates the direction angle between the traversable direction vector and the path direction vector, and determines the subspace points whose direction angle between the traversable direction vector and the path direction vector is within a preset range and whose traversable distance is less than a preset distance threshold as path candidate nodes.
[0062] Step 2052: Connect each candidate path node with the first current position point to obtain a path node segment, and perform a collision test on each path node segment to obtain a test collision result.
[0063] Furthermore, the robot control system connects the coordinates of each candidate path node with the coordinates of the first current position point of the food safety inspection robot to form a path node line segment.
[0064] Furthermore, for each path node segment, a collision test is performed using a ray tracing algorithm. Specifically, starting from the first current position point, a ray is emitted toward the candidate path node to determine whether the ray intersects with the impassable subspace (composed of the subspace corresponding to the production equipment area and the impassable area). If the ray intersects with any polyhedron model in the impassable subspace, the collision test result for the path node segment is intersection; if the ray does not intersect with any polyhedron model in the impassable subspace, the collision test result is non-intersection.
[0065] In one embodiment, three candidate path nodes P1 (5, 5, 2), P2 (6, 6, 2.5), and P3 (7, 4, 2.2) are identified, and the coordinates of the first current position of the food safety inspection robot are (2, 3, 1). The robot control system connects the first current position point with each candidate path node, respectively, to obtain three path node line segments: L1 (connecting (2, 3, 1) and (5, 5, 2)), L2 (connecting (2, 3, 1) and (6, 6, 2.5)), and L3 (connecting (2, 3, 1) and (7, 4, 2.2)). Using a ray tracing algorithm, starting from (2, 3, 1), rays are emitted in the directions of P1, P2, and P3, respectively. Upon detection, ray L2 intersects with the raw material shelves (inaccessible subspace) in the workshop, while L1 and L3 do not intersect with any inaccessible subspace.
[0066] Step 2053: If the test collision result is that the target path node segment intersects with the impassable subspace, the path candidate node corresponding to the target path node segment is eliminated; if the test collision result is that the target path node segment does not intersect with the impassable subspace, the path candidate node corresponding to the target path node segment is retained to obtain the final node of the path.
[0067] Furthermore, for any target path node segment in the path node segments, if the test collision result is that the target path node segment intersects with the inaccessible subspace, the robot control system eliminates the path candidate node corresponding to the target path node segment.
[0068] Furthermore, if the collision test result indicates that the target path node segment does not intersect the impassable subspace, the robot control system retains the path candidate node corresponding to the target path node segment, and the remaining path candidate node is the final path node. Continuing with the above embodiment, in the above example, because path node segment L2 intersects the impassable subspace, the robot control system eliminates path candidate node P2 corresponding to L2. However, since path node segments L1 and L3 do not intersect the impassable subspace, P1 and P3 are retained, and P1 and P3 now become the final path nodes.
[0069] In step 2054, the final nodes of the paths are connected in order of distance from the final node of the path to the center point from near to far, and the first current position point is connected to the nearest final node of the path, the farthest final node of the path, and the center point, respectively, to obtain a preliminary path segment sequence.
[0070] Furthermore, the robot control system calculates the distance between each path final node and the center position point of the target inspection area, and sorts the path final nodes in ascending order of distance.
[0071] Furthermore, the robot control system sequentially connects the sorted final nodes of the path to form a path. At the same time, the robot's first current position point is connected to the sorted final node of the path closest to the center position point, the farthest final node of the path, and the center position point of the target inspection area to obtain a preliminary path segment sequence.
[0072] Continuing with the above example, with the final nodes P1 (5,5,2) and P3 (7,4,2.2) already determined, the distance between P1 and the center point (8,7,3) is calculated to be 3.74, and the distance between P3 and the center point is calculated to be 3.26. Because 3.26 < 3.74, the final nodes of the path are sorted from closest to the center point to P3 and P1. The robot control system sequentially connects P3 and P1, and connects the first current point (2,3,1) with P3, P1, and the center point (8,7,3), obtaining a preliminary path segment sequence.
[0073] In step 2055, the initial path segment sequence is checked to see if three adjacent nodes are approximately collinear. If so, the intermediate nodes are deleted until the entire initial path segment sequence is traversed to obtain the initial inspection path. Whether three adjacent nodes are approximately collinear is determined based on the vector angle and the segment length ratio.
[0074] Furthermore, for the preliminary path segment sequence, the robot control system obtains three adjacent nodes and calculates the vector angle and segment length ratio between the three adjacent nodes based on the node coordinates of the three adjacent nodes. For example, the three adjacent nodes are A(x a ,y a ,z a )、B(x b ,y b ,z b )、C(x c ,y c ,z c ), the vector between three adjacent nodes is and The vector angle between the three nodes is and the ratio of line segment length
[0075] Furthermore, for each group of three adjacent nodes, if the vector angle between the three nodes is less than or equal to a preset angle threshold, and the ratio of the line segment lengths between the three nodes is within a preset length range, then the three adjacent nodes are determined to be approximately collinear, wherein the preset angle threshold and the preset length range are set according to actual conditions.
[0076] Therefore, for each group of three adjacent nodes, the robot control system checks whether the three adjacent nodes are approximately collinear. If so, it deletes the middle node between the three adjacent nodes, that is, deletes the middle node B. The above process is repeated, and the judgment is made for new three adjacent nodes until the entire preliminary path segment sequence is traversed, and the initial inspection path is finally obtained.
[0077] In one embodiment, the three adjacent nodes are A(2,3,1), B(5,5,2), and C(7,4,2.2). Therefore, the vector between the three adjacent nodes is The vector angle α of three adjacent nodes is ≈ 78.5°, the line segment length ratio β = 1.62, and the preset angle threshold is set to α max =80°, and the preset length range is [0.5, 2]. Since 78.5° < 80° and 0.5 ≤ 1.62 ≤ 2, the three adjacent nodes A, B, and C are determined to be approximately collinear, and the middle node B is deleted. The judgment of new adjacent nodes continues until the entire preliminary path segment sequence is traversed to obtain the final initial inspection path.
[0078] The embodiment of the present invention uses spatial vector operations and geometric judgment to generate an initial inspection path from the robot's current position to the target inspection area in a complex food production environment, thereby avoiding inaccessible areas. At the same time, by optimizing node connections, the path turns are reduced, and the smoothness and efficiency of the path are improved. Therefore, in a complex three-dimensional environment, a path suitable for the food safety inspection robot can be planned more accurately and efficiently, thereby improving the efficiency of the inspection and ensuring the efficient and stable implementation of the inspection work.
[0079] In one embodiment, steps 301 to 304 are described as follows:
[0080] Step 301 : Mapping the obstacle to a two-dimensional Cartesian coordinate system with the second current position point of the food safety inspection robot as the origin according to the shape information and the size information.
[0081] Optionally, the robot control system receives obstacle shape information (such as a cuboid, cylinder, etc.) and size information (length, width, height or radius, height, etc.) collected by industrial vision equipment. The second current position point of the food safety inspection robot is used as the origin (0,0) of the two-dimensional Cartesian coordinate system. The positive direction of the x-axis is determined based on the orientation of the robot (such as the direction directly in front of the robot is the positive direction of the x-axis), and the direction perpendicular to the x-axis and on the horizontal plane is the y-axis direction. For obstacles with three-dimensional shapes, the contour of its projection on the horizontal plane is selected, and the coordinates of each vertex of the contour in the two-dimensional Cartesian coordinate system are calculated based on the size information. If the obstacle is a cuboid, its length, width and position in space are known. The coordinates of each vertex of the bottom surface of the cuboid in the two-dimensional Cartesian coordinate system are calculated based on the relative relationship between the current position of the robot and the position of the obstacle; if it is a cylinder, the center coordinates and radius of the circular contour of its bottom surface in the two-dimensional coordinate system are calculated to determine the position of the circular contour in the coordinate system, completing the mapping of the obstacle to the two-dimensional Cartesian coordinate system.
[0082] In one embodiment, while a food safety inspection robot was moving along its initial inspection path, the industrial vision device detected a rectangular obstacle measuring 1.5 meters long, 1 meter wide, and 1.2 meters high, located 3 meters in front of the robot and 1 meter to the right. The robot control system then established a two-dimensional Cartesian coordinate system with the robot's second current position as the origin, with the x-axis directly in front of the robot and the y-axis directly to the right. Based on the relative position of the obstacle and the robot, the coordinates of the four vertices of the bottom surface of the rectangular obstacle in the two-dimensional Cartesian coordinate system were calculated to be (3, 1), (4.5, 1), (4.5, 2), and (3, 2), respectively, successfully mapping the obstacle into the two-dimensional Cartesian coordinate system.
[0083] In step 302, in a two-dimensional Cartesian coordinate system, the traversable area excluding the obstacle is divided into multiple connected sub-areas, with the obstacle as the dividing point. Each sub-area is connected by sub-area path nodes, thereby constructing a topological map of the traversable area. Sub-area path nodes represent the boundary intersection points of the sub-areas.
[0084] Furthermore, in the established two-dimensional Cartesian coordinate system, the robot control system divides the passable area using the mapped obstacle outline as the separation boundary. Among them, the embodiment of the present invention adopts a region division algorithm based on boundary tracking, specifically: starting from a certain point in the coordinate system (such as the origin), searching along the obstacle outline and the coordinate system boundary, and dividing the passable area into multiple non-overlapping and connected sub-areas. For each sub-area, its boundary intersection point is determined as the sub-area path node, and the sub-area path node represents the connection point between the sub-areas. By connecting the path nodes of adjacent sub-areas, a topological map of the passable area is constructed.
[0085] It should be noted that when constructing a topological graph, the coordinates of each sub-region path node and the connection relationship with other sub-region path nodes are recorded to form a graph structure consisting of nodes and edges, where the edges represent the connection paths between sub-regions.
[0086] In one embodiment, after mapping the rectangular obstacle to a two-dimensional Cartesian coordinate system, the robot control system uses a boundary tracking algorithm to divide the traversable area. Starting from the origin (0,0), the search is divided into three connected sub-areas along the obstacle outline and the coordinate system boundary. The boundary intersection points of each sub-area are determined as sub-area path nodes, such as the path nodes A(0,0), B(2,0), and C(2,1) for the first sub-area; the path nodes D(2,1), E(3,1), and F(3,2) for the second sub-area; and the path nodes G(3,2), H(5,2), and I(5,0) for the third sub-area. These nodes are connected to construct a topological graph of the traversable area, such as connecting A and B, B and C, C and D, etc., to form a graph structure containing nodes and edges.
[0087] Step 303: Project each node on the initial inspection path into the topology map, and determine the topology map node closest to each projection point as the node sequence of the initial inspection path in the topology map.
[0088] Furthermore, the robot control system obtains the three-dimensional coordinates of each node on the initial inspection path and projects the three-dimensional coordinates into a two-dimensional Cartesian coordinate system to obtain the projection points of each node on the two-dimensional plane. For each projection point, the distance between it and all nodes in the topological map is calculated using Euclidean distance. Furthermore, the robot control system finds the topological map node closest to the projection point and uses this topological map node as the corresponding node of the initial inspection path in the topological map. According to the order of the nodes on the initial inspection path, the corresponding node of each node in the topological map is determined in turn to obtain the node sequence of the initial inspection path in the topological map, thereby associating the initial inspection path with the topological map.
[0089] In one embodiment, there are three nodes on the initial inspection path: P1(2,3,1), P2(4,4,1.2), and P3(6,3,1.5). The robot control system projects these three nodes into a two-dimensional Cartesian coordinate system, resulting in projection points P1'(2,3), P2'(4,4), and P3'(6,3). For projection point P1', its distance to each node in the topology graph is calculated, such as the distance dB = 3 to node B(2,0), the distance dC = 2 to node C(2,1), and so on, to find the closest node C. Similarly, the topology graph node E corresponding to P2' and the topology graph node H corresponding to P3' are determined, resulting in the node sequence C, E, and H of the initial inspection path in the topology graph.
[0090] Step 304 : With the obstacle as the center, the extended distance determined based on the moving direction and the moving speed is expanded outward to generate an obstacle buffer zone, and the initial inspection path is optimized based on the node sequence and the obstacle buffer zone to obtain a target inspection path.
[0091] Furthermore, the robot control system determines the extended distance r according to the moving speed v of the food safety inspection robot, and the calculation formula is r=v*t+Δr, where t is the preset reaction time and Δr is the safety margin.
[0092] Furthermore, the robot control system takes the mapped obstacle outline as the center and expands outward by a distance r according to the moving direction of the food safety inspection robot to generate an obstacle buffer zone, wherein the buffer zone represents a dangerous area that the robot needs to avoid.
[0093] Furthermore, the robot control system optimizes the initial inspection path according to the node sequence and the obstacle buffer zone to obtain the target inspection path, as specifically described in steps 3041 to 3044 .
[0094] The embodiment of the present invention takes into account the robot's motion characteristics and environmental factors, and through coordinate system mapping and topological structure construction, when encountering obstacles in a complex and changeable food production environment, it can quickly generate a safe and efficient target inspection path, avoiding the situation where work stops due to obstruction by obstacles, enabling the robot to better adapt to the complex food production environment, improving the efficiency of inspection, and ensuring the efficient and stable implementation of inspection work.
[0095] In one embodiment, steps 3041 to 3044 are described as follows:
[0096] Step 3041 , remove the nodes and edges in the topology graph that are within the obstacle buffer range to obtain a restricted path search space.
[0097] Optionally, the robot control system compares the obstacle buffer range with the topology map. For each node in the topology map, determine whether its coordinates are within the boundary range of the obstacle buffer. If they are within the range, the node and its connected edges are removed from the topology map. After the removal operation is completed, a new graph structure is obtained, namely the restricted path search space. Among them, in the restricted path search space, for the remaining nodes, the connection relationship between them is recalculated. If there was an edge between the two nodes and they were not removed, the connection relationship is retained; if they were originally not connected but a new reachable relationship is generated due to the removal of other nodes and edges, a new connection relationship is established. At the same time, based on the coordinates of the two nodes in the two-dimensional Cartesian coordinate system, the distance between any two connected nodes is recalculated in combination with the Euclidean distance algorithm.
[0098] In one embodiment, an obstacle buffer zone is generated, centered around a rectangular obstacle and extending 1.3 meters. This buffer zone is compared with the topological map of the traversable area, revealing that nodes D and F in the topological map are located within the obstacle buffer zone. Nodes D and F, along with their connected edges, are then removed from the topological map, resulting in a restricted path search space. Within this restricted path search space, nodes C and E, previously connected to node D, can now be directly connected due to the removal of node D, establishing a new connection. Simultaneously, the distances between the remaining nodes are recalculated, for example, the distance d between node C (2, 1) and node E (3, 1) is set to 1 meter.
[0099] In step 3042, starting from the current node in the node sequence, multiple candidate path branches are generated within the restricted path search space, with the topology node corresponding to the next uninspected area of the initial inspection path as the target. Each candidate path branch is composed of a series of connected nodes.
[0100] Furthermore, the robot control system selects the current node as the starting point from the node sequence of the initial inspection path in the topological graph. For example, if the node sequence is C, E, H, and the current node is C, then the topological graph node corresponding to the next uninspected area is E. In the restricted path search space, based on the depth-first search algorithm (DFS) or the breadth-first search algorithm (BFS), starting from the starting point, along the edges connected to the starting point, the adjacent nodes are gradually explored to generate different path branches. In the process of generating path branches, the node sequence passed by each path branch is recorded until the target node is found, forming a complete candidate path branch. Repeat the above process to generate multiple different candidate path branches starting from the starting point to ensure that multiple feasible paths from the starting point to the target node are covered.
[0101] Continuing with the above example, in the restricted path search space, the node sequence is C, E, and H, with the current node being C and the target node being E. The robot control system uses a depth-first search algorithm. Starting from node C, it first explores node B connected to C. Continuing from B, it forms path branches CB-...; then, it explores another connected node E from C, forming path branch CE. This continuous exploration generates multiple candidate path branches, such as CBAE, CE, CGHE, and so on.
[0102] Step 3043: For each candidate path branch, calculate its total path length and its directional deviation angle from the initial inspection path direction. The total path length is the sum of the distances between each node, and the directional deviation angle is calculated by calculating the angle between the starting direction of the candidate path branch and the initial inspection path direction.
[0103] Furthermore, for each candidate path branch, the robot control system first calculates its total path length. Specifically, based on the recalculated inter-node distances, the distances between adjacent nodes in the candidate path branch are sequentially added together to obtain the total path length. For example, if a candidate path branch consists of nodes A, B, and C, and the distance between nodes A and B is d{AB}, and the distance between B and C is d{BC}, then the total path length L = d{AB} + d{BC}.
[0104] Furthermore, the robot control system determines the direction vector of the initial inspection path at the current node It can be calculated by the coordinate difference between the current node and the next node on the initial inspection path. For the candidate path branch, determine the starting direction vector That is, the coordinate difference between the starting point of the candidate path branch and the next node, combined with the direction vector through the vector angle formula and the starting direction vector Calculate the direction deviation angle between each candidate path branch and the initial inspection path direction.
[0105] In one embodiment, the direction vector of the initial inspection path at node C is (indicates the right direction), there is a candidate path branch CBAE, whose starting direction vector (Indicates the left direction.) The distance between nodes C and B is 1 meter, the distance between B and A is 2 meters, and the distance between A and E is 3 meters. The total length of the candidate path branch is L = 1 + 2 + 3 = 6 meters. Use the vector angle formula to calculate the direction deviation angle.
[0106] In step 3044 , the candidate path branch with the shortest total path length and the smallest direction deviation angle is determined as the target inspection path.
[0107] Furthermore, the total path length threshold L is set thresh and direction deviation angle threshold θ thresh The robot control system makes a comprehensive comparison of the total path length and direction deviation angle of each candidate path branch, and selects the candidate path branch with a total path length less than L thresh And the direction deviation angle is less than θ thresh If there are multiple candidate paths that meet the conditions, the candidate path with the shortest total length and the smallest directional deviation angle is selected and determined as the target inspection path. If there are no candidate paths that meet both threshold conditions, the candidate path with the shortest total length is selected as the target inspection path.
[0108] In one embodiment, the total path lengths and direction deviation angles of the three candidate path branches are calculated as follows: candidate path branch 1 (total path length 4 meters, direction deviation angle 30°), candidate path branch 2 (total path length 6 meters, direction deviation angle 15°), and candidate path branch 3 (total path length 5 meters, direction deviation angle 25°). Set the total path length threshold L thresh =5 meters, direction deviation angle threshold θ thresh =35°. Candidate path branch 1 and candidate path branch 3 meet the threshold conditions. Among them, candidate path branch 1 has the shortest total path length and a smaller direction deviation angle, so candidate path branch 1 is determined as the target inspection path.
[0109] The embodiments of the present invention adjust the path by comprehensively considering factors such as path length and direction, enabling the robot to flexibly respond to environmental changes and avoiding situations where it would stop working due to obstacles. This allows the robot to better adapt to complex food production environments, improves inspection efficiency, and ensures efficient and stable inspection work. At the same time, while avoiding obstacles, a target inspection path that is closer to the original inspection intent and has a shorter path is generated, which can more efficiently cope with dynamic obstacles, ensuring that the food safety inspection robot completes its inspection tasks in complex environments using a more optimal path, further improving inspection efficiency and safety.
[0110] In one embodiment, steps 401 to 404 are described as follows:
[0111] Step 401 : Analyze the appearance of food based on the food image, and determine the food quality and safety monitoring results during the food production process according to the appearance analysis results.
[0112] Optionally, the multi-dimensional perception sensor in an embodiment of the present invention includes a visual sensor, a gas sensor, a temperature sensor and a humidity sensor. Therefore, the sensor data includes food images, ambient gas concentration, ambient temperature and ambient humidity in the target inspection area.
[0113] Therefore, the robotic control system analyzes the food image and the food's appearance to determine an appearance analysis result. The appearance analysis result indicates whether the food has cracks on its surface, as described in detail in steps 4011 to 4015. Furthermore, the robotic control system determines whether the food has been contaminated during the production process based on the appearance analysis result. If cracks are present, the food may have been contaminated during the production process. If no cracks are present, the food is likely not contaminated during the production process, thereby obtaining a food quality and safety monitoring result for the production process.
[0114] Step 402 : Analyze the concentrations of various preset gases based on the ambient gas concentrations, and determine the ambient gas safety monitoring results during the food production process according to the concentration analysis results.
[0115] Furthermore, the robot control system analyzes the concentrations of various preset gases (such as oxygen, carbon dioxide, and harmful volatile organic compounds (VOCs)) based on the ambient gas concentrations to obtain the preset gas concentrations in the food production environment. Furthermore, the robot control system compares the real-time concentration of each preset gas with a pre-set safety concentration threshold. For oxygen, if the concentration is lower than 19.5% (the lower safety limit for general industrial environments), it is determined that the oxygen concentration is insufficient and there is a safety hazard. For carbon dioxide, if the concentration is higher than 1000ppm (the upper reference limit for indoor air quality), it is considered that the carbon dioxide concentration is too high and may affect food quality and personnel health. For harmful VOCs, if their concentration exceeds a specific occupational exposure limit (such as the exposure limit for benzene is 1ppm), it is determined that there is an excessive amount of harmful gas. Based on the comparison results of the concentrations of different gases, the environmental gas safety status is comprehensively assessed, and an environmental gas safety monitoring result is generated, which clearly indicates the type of gas in question and the degree of danger.
[0116] Step 403: Determine the environmental temperature safety monitoring result during the food production process based on the environmental temperature.
[0117] Furthermore, the robot control system compares the ambient temperature with the temperature range required by the food production process, which is pre-set according to the production standards of different foods. For example, for certain food ingredients that require low-temperature storage, the storage environment temperature should be maintained at 0-4°C; for the sterilization process in the food processing process, the temperature must reach a specific high temperature value (such as 121°C) and be maintained for a certain period of time. If the real-time temperature exceeds the temperature range required by the corresponding process, the robot control system evaluates the severity of the temperature anomaly based on the degree of excess and duration, and generates an ambient temperature safety monitoring result, which clearly displays the temperature anomaly and its possible impact on food production.
[0118] Step 404: Determine the environmental humidity safety monitoring result during the food production process based on the environmental humidity.
[0119] Furthermore, the robot control system compares the ambient humidity with the humidity range specified by the food production process. Different foods have different requirements for the production environment humidity. For example, for baked goods, the production workshop humidity is generally required to be controlled at 40%-60%. For certain dry food storage, the humidity needs to be maintained at a lower level (such as 20%-30%). If the real-time humidity exceeds the corresponding standard range, the robot control system determines the severity of the humidity anomaly based on the degree and duration of the deviation, and generates an environmental humidity safety monitoring result, which explains the humidity anomaly and its potential harm to food production.
[0120] The embodiment of the present invention monitors the safety of the food production process from four key dimensions: food appearance, ambient gas concentration, ambient temperature and ambient humidity. Therefore, it can accurately detect various safety hazards that may exist in the food production process, and conduct all-round control from the quality of the food itself to the production environment factors, thereby improving the accuracy and effectiveness of food safety monitoring, helping to take timely measures to eliminate hidden dangers, and ensure food quality and safety and the stability of the production process.
[0121] In one embodiment, steps 4011 to 4015 are described as follows:
[0122] Step 4011: grayscale processing is performed on the food image to obtain the grayscale value of each pixel in the food image, and target pixels with discrete distribution are obtained according to the grayscale value of each pixel.
[0123] Optionally, the robot control system performs grayscale processing on the food image through a grayscale conversion formula, wherein the grayscale conversion formula is: Gray = 0.299*R+0.587*G+0.114*B, R, G, and B are the red, green, and blue component values of the pixel points in the food image, respectively. Through this formula, the food image is converted into a grayscale image so that each pixel point has a grayscale value between 0-255.
[0124] Furthermore, the robot control system determines the pixel points whose grayscale values are greater than or equal to the grayscale threshold T as target pixel points, wherein the target pixel points are discretely distributed in the image and usually contain key feature information of the food appearance, such as pixel points in edge, defect and other areas.
[0125] Step 4012: For each local area of a preset size, if the target pixel points in the local area are continuous pixel points, the target pixel points are connected in sequence to obtain line contour features.
[0126] Furthermore, the robot control system divides the grayscale-processed image into multiple local regions of a predetermined size (e.g., n*n pixels). For each local region, the robot control system scans the image row by row and column by column to determine whether the target pixels within the region are continuous. If the horizontal or vertical pixel spacing between adjacent target pixels in a row or column is 1, the target pixels are considered continuous.
[0127] Furthermore, consecutive target pixels are connected from left to right and top to bottom to form lines. After traversing the entire local area, all connected lines are combined to obtain the line outline feature of the local area. The line outline feature can reflect the shape and structure of the food appearance in this local area.
[0128] Step 4013: If the line contour feature does not match the preset contour feature, determine the pixel width between target pixels in the line contour feature.
[0129] Furthermore, the robot control system pre-stores preset contour features of qualified food under normal production conditions, and obtains standard line contour data by analyzing a large number of qualified food images. Therefore, the line contour features are compared with the preset contour features, and the shape difference between the two is calculated to determine whether they match. In the embodiment of the present invention, the shape difference can be determined by the Hausdorff distance, which is specifically:
[0130]
[0131] Where A and B represent the point sets in the line contour feature and the preset contour feature, respectively. H(A,B) represents the Hausdorff distance between the line contour feature and the preset contour feature. ||·|| represents the Euclidean distance.
[0132] Furthermore, if the Hausdorff distance is less than or equal to a preset matching threshold, the line profile is determined to match the preset profile, and the appearance analysis result is determined to indicate that the food does not have cracks. If the Hausdorff distance is greater than the preset matching threshold, the line profile is determined to not match the preset profile. In this case, for consecutive target pixels in the line profile, the robot control system calculates the number of pixels perpendicular to the line between adjacent target pixels to obtain the pixel width.
[0133] Step 4014: If the pixel width is greater than or equal to the preset width threshold, determine the pixel overlap rate between target pixels in the line contour feature.
[0134] Furthermore, a pixel width threshold W is set. If the pixel width is determined to be less than the preset width threshold, the appearance analysis result is determined to indicate that the food has no cracks. If the determined pixel width is greater than or equal to the pixel width threshold, it indicates that there may be a significant anomaly in the line profile. Therefore, the robot control system analyzes the distribution of target pixels in the line profile feature and calculates the pixel overlap ratio.
[0135] In the embodiment of the present invention, for adjacent target pixels, the ratio of the number of overlapping pixels in the horizontal or vertical direction to the total number of pixels is calculated as the pixel overlap rate. For example, two adjacent target pixel sets are P1 and P2, and the overlapping pixel set is P 12 , then the pixel overlap rate formula is: OverlapRate=|P 12 | / (|P1|+|P2|-|P 12 |), where |·| represents the number of pixels in the pixel set.
[0136] In step 4015, if the pixel overlap rate is less than the preset overlap rate threshold, the appearance analysis result is determined to be that cracks exist on the food appearance.
[0137] Furthermore, a pixel overlap ratio threshold O is set. If the pixel overlap ratio is determined to be greater than or equal to the preset overlap ratio threshold, the appearance analysis result is determined to be that the food has no cracks. If the pixel overlap ratio is determined to be less than the preset overlap ratio threshold, indicating that the connection between the target pixels is relatively loose and there is a high possibility of breakage, the appearance analysis result is determined to be that the food has cracks.
[0138] In one embodiment, the line profile features of a local area of a beverage bottle are compared with the preset qualified beverage bottle profile features. The difference between the two is calculated using the Hausdorff distance formula, resulting in a Hausdorff distance value of 8. The preset matching threshold is 5, so the line profile features are determined to be mismatched with the preset profile features. Next, the number of pixels perpendicular to the line between adjacent target pixels is calculated to be 3, that is, the pixel width between the target pixels is 3 pixels. The preset width threshold W = 2. Since 3>2, it is necessary to calculate the pixel overlap rate. The two adjacent groups of target pixels are analyzed, and the number of pixels in their overlapping parts is calculated to be 2. The number of pixels in each group of target pixels is 5 and 6, respectively. Substituting this into the pixel overlap rate formula, the result is: OverlapRate = 2 / (5+6-2)≈0.22. The preset overlap rate threshold O = 0.3. Since 0.22<0.3, the appearance analysis result of the beverage bottle is determined to be cracked.
[0139] The embodiments of the present invention deeply analyze food appearance images at the pixel level, can more accurately identify subtle cracks in the food appearance, and achieve high-precision detection of food appearance quality, which helps to promptly discover and deal with foods with appearance quality problems and ensure the quality and safety of food production.
[0140] In one embodiment, after step 40, it is necessary to upload the data from the inspection process to the chain, which specifically includes the description of steps 50 to 80:
[0141] Step 50: Encapsulate the log data of the food safety inspection robot during the inspection process to obtain encapsulated data.
[0142] Optionally, the robot control system obtains log data of the food safety inspection robot during the inspection process, where the log data includes environmental point cloud information, target inspection area, initial inspection path movement, obstacle information, obstacle position, path optimization times, target inspection path and food production safety monitoring results. The obstacle position is the specific coordinates of the obstacle in the production environment, and the path optimization times is the number of times the path is adjusted due to the appearance of obstacles.
[0143] Furthermore, the robot control system encapsulates the log data according to a specific data structure, such as constructing a data object using the JSON format (or other suitable data format), and stores each data as an attribute of the object to form a complete encapsulated data.
[0144] Step 60: Split the robot code of the food safety inspection robot according to the parity of the character bits to obtain an initial odd-bit character sequence and an initial even-bit character sequence, and multiply each character in the initial odd-bit character sequence and the initial even-bit character sequence by different prime number sequences according to their sequence values in the ASCII code table to obtain an encrypted odd-bit character sequence and an encrypted even-bit character sequence.
[0145] Furthermore, the robot control system obtains the unique robot code of the food safety inspection robot, where the robot code consists of characters such as letters and numbers. Therefore, the characters in the robot code are split according to the parity of their positions. Characters in odd positions (1st, 3rd, 5th, ... from left to right) form the initial odd-numbered character sequence, and characters in even positions (2nd, 4th, 6th, ...) form the initial even-numbered character sequence.
[0146] Furthermore, for two different prime number sequences, such as odd-numbered characters corresponding to prime number sequences p odd =[2,3,5,7,11,...], even-numbered characters correspond to prime number sequences p even=[13,17,19,23,29,...]. For each character in the initial odd-numbered character sequence, obtain its sequence value in the ASCII code table, then multiply it by the corresponding prime number in the prime number sequence to obtain a new value, which is converted into the corresponding character to form the encrypted odd-numbered character sequence; similarly, perform the same operation on the initial even-numbered character sequence to obtain the encrypted even-numbered character sequence.
[0147] In one embodiment, the code of the food safety inspection robot is "RB12345", and the robot control system splits it into the initial odd-digit character sequence "R135" and the initial even-digit character sequence "B24". For the initial odd-digit character sequence "R135": the order value of "R" in the ASCII code table is 82, which is multiplied by the prime number sequence p odd The first prime number in is 2, and we get 82*2=164, which is converted to the character "′" (the character corresponding to the ASCII code value 164); the ASCII code value of "1" is 49, multiplied by 3 to get 49*3=147, and the corresponding character is "¨"; the ASCII code value of "3" is 51, multiplied by 5 to get 51*5=255, and the corresponding character is The ASCII code value of "5" is 53, multiplied by 7 to get 53*7=371, modulo 128 (because the ASCII code table range is 0127, which exceeds the partial circular mapping) to get 371mod 128=115, which corresponds to the character "s". Therefore, the encrypted odd-digit character sequence is For the initial even-digit character sequence "B24": the ASCII code value of "B" is 66, multiplied by the prime number sequence p even The first prime number in is 13, so we get 66*13=858, 858mod 128=106, which corresponds to the character "j"; the ASCII code value of "2" is 50, multiplied by 17, we get 50*17=850, 850mod 128=98, which corresponds to the character "b"; the ASCII code value of "4" is 52, multiplied by 19, we get 52*19=988, 988mod 128=124, which corresponds to the character "|". Therefore, the encrypted even-numbered character sequence is "jb|".
[0148] Step 70: Cross-add the encrypted odd-digit character sequence and the encrypted even-digit character sequence to obtain an encryption key, and encrypt the encapsulated data based on the encryption key to obtain encrypted data.
[0149] Furthermore, the robot control system performs a cross-addition operation on the encrypted odd-digit character sequence and the encrypted even-digit character sequence according to the character position, that is, takes the first character of the encrypted odd-digit character sequence and the first character of the encrypted even-digit character sequence, adds their sequential values in the ASCII code table, obtains a new numerical value, and converts the numerical value into the corresponding character; performs this operation on the characters in the same position in the two sequences in turn to obtain a new character sequence, which is the encryption key.
[0150] In one embodiment, the encrypted odd-numbered character sequence is The encrypted even-digit character sequence is "jb|". The first character is added: "′" (ASCII code value 164) + "j" (ASCII code value 106) = 164 + 106 = 270, 270 mod 128 = 14, corresponding to the character "r"; the second character is added: "¨" (ASCII code value 147) + "b" (ASCII code value 98) = 147 + 98 = 245, 245 mod 128 = 117, corresponding to the character "u"; the third character is added: (ASCII code value 255) + "|" (ASCII code value 124) = 255 + 124 = 379, 379 mod 128 = 95, which corresponds to the character "_"; the fourth character is added: "s" (ASCII code value 115). Since the even-numbered character sequence has only 3 characters, the first character "j" (ASCII code value 106) can be recycled here, 115 + 106 = 221, 221 mod 128 = 93, which corresponds to the character "]", so the encryption key is "ru_]".
[0151] Furthermore, the robot control system adopts a symmetric encryption algorithm (such as the AES algorithm), uses the encryption key as the key to encrypt the encapsulated data, converts the original data into ciphertext form, obtains the encrypted data, and ensures the security of the data during transmission and storage.
[0152] Step 80: Pack the robot code and inspection execution time as the packet header and the encrypted data as the packet content, and upload the packaged data to the blockchain platform.
[0153] Furthermore, the robot control system obtains the inspection execution time of the food safety inspection robot during the inspection, in the format of "YYYY-MM-DD-HH:MM:SS", and combines the robot code and the inspection execution time into a packet header in a specific format, such as "robot code-inspection execution time". Furthermore, the robot control system combines the encrypted data as the packet content with the packet header to obtain packaged data.
[0154] Furthermore, the robot control system sends the packaged data to the blockchain network through the interface provided by the blockchain platform. After verification by the consensus mechanism, the data is recorded in the blockchain block, realizing the on-chain storage of the inspection data and ensuring the data's non-tamperability and traceability.
[0155] In one embodiment, the robot code is "RB12345" and the inspection execution time is "2025-04-24 15:30:00". The header line is "RB12345-2025-04-24-15:30:00". The encrypted data and the header line are packaged to obtain the packaged data: "RB12345-2025-04-24-15:30:00 [encrypted data]".
[0156] This embodiment of the present invention encrypts data during the inspection process through robot coding, effectively preventing theft or tampering during transmission and storage, and ensuring data security. Furthermore, data is packaged using the robot code and inspection time as headers and uploaded to the blockchain. Leveraging blockchain's distributed storage and consensus mechanisms, this data is tamper-proof and traceable, providing strong support for subsequent data analysis and accountability tracing, helping to enhance the transparency and security of the food production process and ensure the quality and safety of the food supply chain.
[0157] Furthermore, the food safety inspection robot control system based on industrial vision provided by the present invention is described below. The food safety inspection robot control system based on industrial vision described below and the food safety inspection robot control method based on industrial vision described above can be referenced to each other.
[0158] Reference Figure 2 , Figure 2 This is a structural diagram of the industrial vision-based food safety inspection robot control system provided by the present invention. The industrial vision-based food safety inspection robot control system includes:
[0159] Point cloud data acquisition module 210, used to control the start-up of the food safety inspection robot and obtain environmental point cloud information obtained by the food safety inspection robot after performing a full-scale scan of the current food production environment based on industrial vision equipment;
[0160] The path planning module 220 is used to perform path planning based on the environmental point cloud information and the preset target inspection area, generate an initial inspection path, and control the food safety inspection robot to move along the initial inspection path;
[0161] a path optimization module 230 for optimizing the initial inspection path based on obstacle information collected by the food safety inspection robot through industrial vision equipment during movement, to obtain a target inspection path;
[0162] The food monitoring module 240 is used to control the food safety inspection robot to move along the target inspection path to the target inspection area, and to monitor the food production process based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot to obtain food production safety monitoring results.
[0163] The embodiment of the present invention combines environmental point cloud information of the food production environment collected by industrial vision equipment with the target inspection area to plan an initial inspection path, ensuring the rationality of the inspection path and improving inspection efficiency. Furthermore, by using industrial vision equipment to monitor obstacles in the environment in real time and quickly adjusting the inspection path after an obstacle is detected, the robot can flexibly respond to environmental changes, avoiding situations where it stops working due to obstructions. This allows the robot to better adapt to complex food production environments, further improving inspection efficiency and ensuring efficient and stable inspection work.
[0164] See also Figure 3 , Figure 3 This is a diagram of an embodiment of an electronic device provided by an embodiment of the present invention. Figure 3 As shown, an embodiment of the present invention provides an electronic device 300, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor 320. When the processor 320 executes the computer program 311, the following steps are implemented:
[0165] Control the food safety inspection robot to start up and obtain environmental point cloud information obtained by the food safety inspection robot after performing a full-scale scan of the current food production environment based on industrial vision equipment;
[0166] Based on the environmental point cloud information and the preset target inspection area, path planning is performed to generate an initial inspection path, and the food safety inspection robot is controlled to move along the initial inspection path;
[0167] Based on the obstacle information collected by the industrial vision equipment during the movement of the food safety inspection robot, the initial inspection path is optimized to obtain the target inspection path;
[0168] The food safety inspection robot is controlled to move along the target inspection path to the target inspection area. The food production process is safely monitored based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot to obtain the food production safety monitoring results.
[0169] See also Figure 4 , Figure 4 Detailed description of an embodiment of a computer-readable storage medium provided by an embodiment of the present invention. Figure 4As shown, this embodiment provides a computer-readable storage medium 400 on which a computer program 311 is stored. When the computer program 311 is executed by a processor, the following steps are implemented:
[0170] Control the food safety inspection robot to start up and obtain environmental point cloud information obtained by the food safety inspection robot after performing a full-scale scan of the current food production environment based on industrial vision equipment;
[0171] Based on the environmental point cloud information and the preset target inspection area, path planning is performed to generate an initial inspection path, and the food safety inspection robot is controlled to move along the initial inspection path;
[0172] Based on the obstacle information collected by the industrial vision equipment during the movement of the food safety inspection robot, the initial inspection path is optimized to obtain the target inspection path;
[0173] The food safety inspection robot is controlled to move along the target inspection path to the target inspection area. The food production process is safely monitored based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot to obtain the food production safety monitoring results.
[0174] On the other hand, the present invention further provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the industrial vision-based food safety inspection robot control method provided by the above methods, which includes:
[0175] Control the food safety inspection robot to start up and obtain environmental point cloud information obtained by the food safety inspection robot after performing a full-scale scan of the current food production environment based on industrial vision equipment;
[0176] Based on the environmental point cloud information and the preset target inspection area, path planning is performed to generate an initial inspection path, and the food safety inspection robot is controlled to move along the initial inspection path;
[0177] Based on the obstacle information collected by the industrial vision equipment during the movement of the food safety inspection robot, the initial inspection path is optimized to obtain the target inspection path;
[0178] The food safety inspection robot is controlled to move along the target inspection path to the target inspection area. The food production process is safely monitored based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot to obtain the food production safety monitoring results.
[0179] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0180] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A food safety inspection robot control method based on industrial vision, characterized in that: include: Controlling the food safety inspection robot to start, and obtaining environmental point cloud information obtained by the food safety inspection robot after performing a full-scale scan of the current food production environment based on industrial vision equipment; Performing path planning based on the environmental point cloud information in combination with a preset target inspection area to generate an initial inspection path, and controlling the food safety inspection robot to move along the initial inspection path; Optimizing the initial inspection path based on obstacle information collected by the industrial vision device during movement of the food safety inspection robot to obtain a target inspection path; The food safety inspection robot is controlled to move along the target inspection path to the target inspection area, and the food production process is safely monitored based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot to obtain food production safety monitoring results.
2. The method for controlling a food safety inspection robot based on industrial vision according to claim 1, characterized in that: The path planning based on the environmental point cloud information and the preset target inspection area is performed to generate an initial inspection path, including: Identifying a production equipment area and an inaccessible area based on the environmental point cloud information; The production equipment area, the impassable area, and the target inspection area are geometrically modeled in a three-dimensional space using a polyhedron to obtain a path planning space; The path planning space is recursively partitioned using an octree, and the partitioning is stopped when the partitioned subspace completely belongs to the production equipment area, the impassable area, the target inspection area, or is empty, thereby obtaining multiple subspaces containing different attributes; the subspaces include impassable subspaces and impassable subspaces; Determining a path direction vector based on a space vector between a first current position point of the food safety inspection robot and a center position point of the target inspection area; Path planning is performed based on the path direction vector, the traversable subspace, and the intraversable subspace to generate an initial inspection path for the food safety inspection robot to travel to the target inspection area.
3. The method for controlling a food safety inspection robot based on industrial vision according to claim 2, characterized in that: The performing path planning based on the path direction vector, the traversable subspace, and the impassable subspace to generate an initial inspection path for the food safety inspection robot to travel to the target inspection area includes: Determine a traversable direction vector and a traversable distance based on the spatial vector and spatial distance between each subspace point in the traversable subspace and the central position point, and determine as a candidate path node a subspace point whose angle between the traversable direction vector and the path direction vector is within a preset range and whose traversable distance is less than a preset distance threshold; Connecting each candidate path node with the first current position point to obtain a path node segment, and performing a collision test on each path node segment to obtain a test collision result; If the test collision result is that the target path node segment intersects the impassable subspace, the path candidate node corresponding to the target path node segment is eliminated; if the test collision result is that the target path node segment does not intersect the impassable subspace, the path candidate node corresponding to the target path node segment is retained to obtain the final node of the path; Connecting the final nodes of the path in descending order of distance from the final node of the path to the central position point, and connecting the first current position point with the nearest final node of the path, the farthest final node of the path, and the central position point, respectively, to obtain a preliminary path segment sequence; For the preliminary path segment sequence, check whether the three adjacent nodes are approximately collinear. If so, delete the intermediate nodes until the entire preliminary path segment sequence is traversed to obtain the initial inspection path; whether the three adjacent nodes are approximately collinear is determined based on the vector angle and the segment length ratio.
4. The method for controlling a food safety inspection robot based on industrial vision according to claim 1, characterized in that: The obstacle information includes shape information, size information, and moving direction; the initial inspection path is optimized based on the obstacle information of the obstacle collected by the industrial vision device during the movement of the food safety inspection robot to obtain a target inspection path, including: Mapping the obstacle into a two-dimensional Cartesian coordinate system with the second current position point of the food safety inspection robot as the origin according to the shape information and the size information; In a two-dimensional Cartesian coordinate system, the traversable area excluding the obstacle is divided into multiple connected sub-areas with the obstacle as the dividing point. Each sub-area is connected by a sub-area path node to construct a topological map of the traversable area. The sub-area path node represents the boundary intersection point of the sub-area. Projecting each node on the initial inspection path into the topology map, and determining the topology map node closest to each projection point as the node sequence of the initial inspection path in the topology map; Taking the obstacle as the center, the expansion distance determined based on the moving direction and the moving speed is expanded outward to generate an obstacle buffer zone, and the initial inspection path is optimized based on the node sequence and the obstacle buffer zone to obtain the target inspection path.
5. The method for controlling a food safety inspection robot based on industrial vision according to claim 4, characterized in that: The optimizing the initial inspection path based on the node sequence and the obstacle buffer zone to obtain the target inspection path includes: Eliminating nodes and edges within the obstacle buffer range in the topological graph to obtain a restricted path search space; recalculating the connection relationships and distances between the remaining nodes within the restricted path search space; Taking the current node in the node sequence as a starting point, within the restricted path search space, and taking the topology map node corresponding to the next uninspected area of the initial inspection path as a target, a plurality of candidate path branches are generated; each candidate path branch is composed of a series of connected nodes; For each candidate path branch, calculate its total path length and the direction deviation angle from the initial inspection path direction; the total path length is the sum of the distances between each node, and the direction deviation angle is calculated by calculating the angle between the starting direction of the candidate path branch and the initial inspection path direction; The candidate path branch with the shortest total path length and the smallest direction deviation angle is determined as the target inspection path.
6. The method for controlling a food safety inspection robot based on industrial vision according to claim 1, characterized in that: The multi-dimensional perception sensor includes a visual sensor, a gas sensor, a temperature sensor and a humidity sensor; the sensor data includes food images, ambient gas concentration, ambient temperature and ambient humidity in the target inspection area; The food production process is monitored for safety based on the sensor data collected by the multi-dimensional sensing sensor in the food safety inspection robot to obtain food production safety monitoring results, including: Analyzing the appearance of the food based on the food image, and determining the food quality and safety monitoring results during the food production process according to the appearance analysis results; Analyzing the concentrations of various preset gases based on the ambient gas concentrations, and determining the ambient gas safety monitoring results during the food production process according to the concentration analysis results; Determining an environmental temperature safety monitoring result during a food production process based on the environmental temperature; The environmental humidity safety monitoring result during the food production process is determined based on the environmental humidity.
7. The method for controlling a food safety inspection robot based on industrial vision according to claim 6, characterized in that: The step of analyzing the appearance of the food based on the food image to obtain the appearance analysis result includes: Performing grayscale processing on the food image to obtain a grayscale value of each pixel in the food image, and obtaining discretely distributed target pixels according to the grayscale value of each pixel; For each local area of a preset size, if the target pixel points in the local area are continuous pixel points, the target pixel points are connected in sequence to obtain line contour features; If the line contour feature does not match the preset contour feature, determining the pixel width between target pixels in the line contour feature; If the pixel width is greater than or equal to a preset width threshold, determining a pixel overlap rate between target pixels in the line contour feature; If the pixel overlap rate is less than a preset overlap rate threshold, the appearance analysis result is determined to be that cracks exist on the appearance of the food.
8. The method for controlling a food safety inspection robot based on industrial vision according to any one of claims 1 to 7, characterized in that: After the food production process is safety monitored based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot and the food production safety monitoring result is obtained, the method further includes: Encapsulating the log data of the food safety inspection robot during the inspection process to obtain encapsulated data; the log data includes environmental point cloud information, target inspection area, initial inspection path movement, obstacle information, obstacle location, path optimization times, target inspection path, and food production safety monitoring results; Splitting the robot code of the food safety inspection robot according to the parity of the character bits to obtain an initial odd-numbered character sequence and an initial even-numbered character sequence, and multiplying each character in the initial odd-numbered character sequence and the initial even-numbered character sequence by different prime number sequences according to their sequence values in the ASCII code table to obtain an encrypted odd-numbered character sequence and an encrypted even-numbered character sequence; Cross-adding the encrypted odd-numbered character sequence and the encrypted even-numbered character sequence to obtain an encryption key, and encrypting the encapsulated data based on the encryption key to obtain encrypted data; The robot code and inspection execution time are used as the packet header, and the encrypted data is used as the packet content for packaging, and the packaged data is uploaded to the blockchain platform.
9. A food safety inspection robot control system based on industrial vision, characterized in that: The method for controlling a food safety inspection robot based on industrial vision according to any one of claims 1 to 8 is applied; the control system for the food safety inspection robot based on industrial vision comprises: A point cloud data acquisition module is used to control the start-up of the food safety inspection robot and obtain environmental point cloud information obtained by the food safety inspection robot after performing a full-scale scan of the current food production environment based on industrial vision equipment; A path planning module, configured to perform path planning based on the environmental point cloud information and a preset target inspection area, generate an initial inspection path, and control the food safety inspection robot to move along the initial inspection path; a path optimization module, configured to optimize the initial inspection path based on obstacle information collected by the industrial vision device during movement of the food safety inspection robot to obtain a target inspection path; The food monitoring module is used to control the food safety inspection robot to move along the target inspection path to the target inspection area, and to monitor the food production process based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot to obtain food production safety monitoring results.
10. A non-transitory computer-readable storage medium storing a computer software program, wherein: When the computer software program is executed by the processor, the industrial vision-based food safety inspection robot control method as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Intelligent detection method and system based on food recognition and unmanned aerial vehicle
CN109324637A
Robot real-time obstacle avoidance path planning method and device
CN114756034A
Power transformation equipment inspection robot path planning method, equipment and storage medium
CN115933637A
Intelligent control system of track AI inspection robot
CN116203973A
Path navigation system of inspection robot
CN118534936A