Food safety inspection robot control method and system based on industrial vision

By using industrial vision and machine learning technologies to plan and optimize inspection paths in real time, the problem of poor adaptability of food safety inspection robots in complex environments has been solved, improving inspection efficiency and stability and meeting the needs of food safety supervision.

CN120652976BActive Publication Date: 2026-03-31CHENGDU WEST TAILI INTELLIGENT EQUIP CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing food safety inspection robots are poorly adaptable to complex and ever-changing production environments and cannot adjust their inspection paths in real time, resulting in low inspection efficiency and failing to meet stringent food safety regulatory requirements.

Method used

An industrial vision-based approach is adopted, which uses LiDAR and depth cameras to acquire environmental point cloud information, combines machine learning models to identify production equipment and obstacles, plans and optimizes inspection paths in real time, and uses multi-dimensional sensing sensors for safety monitoring.

Benefits of technology

This enables the robot to adapt flexibly to complex environments, improves inspection efficiency, ensures efficient and stable inspection work, and avoids situations where work stops due to obstacles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120652976B_ABST
    Figure CN120652976B_ABST
Patent Text Reader

Abstract

The application provides a food safety inspection robot control method and system based on industrial vision, which comprises the following steps: controlling the robot to start, obtaining environment point cloud information obtained by the robot based on an industrial vision device after omnidirectional scanning of a current food production environment; planning a path based on the environment point cloud information and a preset target inspection area, generating an initial inspection path, and controlling the robot to move along the initial inspection path; optimizing the initial inspection path based on obstacle information of obstacles collected by the industrial vision device during movement of the robot, and obtaining a target inspection path; controlling the robot to move to the target inspection area along the target inspection path, and performing safety monitoring on a food production process based on sensor data collected by a multi-dimensional perception sensor in the robot, and obtaining a food production safety monitoring result. The application improves the inspection efficiency and ensures efficient and stable inspection work.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a control method and system for a food safety inspection robot based on industrial vision. Background Technology

[0002] Existing food safety inspection robots typically employ a pre-set, fixed-route control method. Before deployment at a food production site, technicians plan one or more fixed routes based on the site layout and key monitoring areas. The robot then conducts inspections along these routes according to a pre-set program.

[0003] In the current field of food safety inspection, existing control methods for inspection robots have many drawbacks, the most significant being their poor adaptability to the complex and ever-changing food production environment. The food production environment is not static; during production, factors such as temporary equipment adjustments, changes in material stacking, and frequent personnel movement all lead to continuous changes in the inspection environment. However, existing control methods with preset fixed routes prevent robots from adjusting their inspection paths in real time according to environmental changes. For example, when a new batch of production equipment is placed in the food processing area, blocking the robot's preset route, the robot either stops working 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 severely impacts inspection efficiency, fails to provide timely and comprehensive monitoring of the food production environment, and struggles to meet increasingly stringent food safety regulatory requirements. Summary of the Invention

[0004] This invention provides a food safety inspection robot control method and system based on industrial vision, which solves the problem of poor adaptability of robots to complex production environments, improves inspection efficiency, and ensures efficient and stable inspection work.

[0005] In a first aspect, the present invention provides a food safety inspection robot control method based on industrial vision, comprising:

[0006] The food safety inspection robot is activated, and environmental point cloud information is obtained after the food safety inspection robot performs a comprehensive scan of the current food production environment based on industrial vision equipment.

[0007] 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.

[0008] The initial inspection path is optimized based on the obstacle information collected by the industrial vision device during the movement of the food safety inspection robot to obtain the target inspection path.

[0009] The food safety inspection robot is controlled to move along the target inspection path to the target inspection area. Based on the sensor data collected by the multi-dimensional sensing sensors in the food safety inspection robot, the food production process is monitored for safety, and the food production safety monitoring results are obtained.

[0010] Secondly, the present invention also provides a food safety inspection robot control system based on industrial vision, 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] The point cloud data acquisition module is used to control the start of the food safety inspection robot and acquire the environmental point cloud information obtained by the food safety inspection robot after performing a comprehensive scan of the current food production environment based on industrial vision equipment.

[0012] The path planning module is used to plan a path 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.

[0013] The path optimization module is used to optimize the initial inspection path based on the obstacle information of the obstacles collected by the industrial vision device during the movement of the food safety inspection robot, so as to obtain the 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 perform safety monitoring of the food production process based on the sensor data collected by the multi-dimensional perception sensors in the food safety inspection robot, so as to obtain the food production safety monitoring results.

[0015] Thirdly, the present invention also provides an electronic device, comprising: a memory for storing computer software programs; and a processor for reading and executing the computer software programs, thereby realizing the food safety inspection robot control method based on industrial vision as described above.

[0016] Fourthly, the present invention also provides a non-transitory computer-readable storage medium storing a computer software program, which, when executed by a processor, implements the food safety inspection robot control method based on industrial vision as described above.

[0017] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the industrial vision-based food safety inspection robot control method as described above.

[0018] The food safety inspection robot control method based on industrial vision provided in this 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, ensuring the rationality of the inspection path and improving inspection efficiency. On the other hand, by monitoring obstacles in the environment in real time through industrial vision equipment and quickly adjusting the inspection path after detecting obstacles, the robot can flexibly respond to environmental changes and avoid stopping work due to obstacles. This allows the robot to better adapt to complex food production environments, further improving inspection efficiency and ensuring efficient and stable inspection work. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating the control method for a food safety inspection robot based on industrial vision provided in an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram of the structure of the food safety inspection robot control system based on industrial vision provided in an embodiment of the present invention;

[0021] Figure 3 An embodiment diagram of the electronic device provided in this invention;

[0022] Figure 4 An embodiment diagram of a computer-readable storage medium provided in accordance with the present invention. Detailed Implementation

[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0024] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0025] In the description of this invention, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this invention is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed herein.

[0026] Optional, see below Figure 1 , Figure 1 This is a flowchart illustrating the food safety inspection robot control method based on industrial vision provided by the present invention. In this embodiment, the execution entity of the food safety inspection robot control method based on industrial vision is the robot control system. Therefore, the food safety inspection robot control method based on industrial vision includes:

[0027] Step 10: Control the food safety inspection robot to start and obtain environmental point cloud information obtained by the food safety inspection robot after performing a comprehensive scan of the current food production environment based on industrial vision equipment.

[0028] Optionally, the robot control system sends a start command to the food safety inspection robot deployed in the food production workshop via a specific communication protocol (such as TCP / IP). Upon receiving the command, the robot's communication module triggers its internal startup program, and the industrial vision equipment enters operational mode. The industrial vision equipment uses a lidar that emits tens of thousands of laser beams per second, while a depth camera continuously captures image information. When the laser beams encounter objects in the workshop (such as production lines, shelves, and processing equipment), they reflect back to the lidar. The depth camera analyzes image features to capture key information such as the spatial location, geometry, and distance of objects in the environment. This key information is converted into discrete points containing attributes such as three-dimensional spatial coordinates, color, and reflection intensity. These numerous discrete points converge to form point cloud data, comprehensively depicting the spatial structure and object distribution of the food production environment. Finally, the generated environmental point cloud information is transmitted back to the robot control system.

[0029] In one embodiment, in a food and beverage production workshop, the robot control system sends a start command to a food safety inspection robot located in a corner of the workshop before daily production. Upon receiving the command, the inspection robot's onboard LiDAR begins to rotate at high speed, emitting laser beams at a frequency of 30,000 times per second. The laser beams reflect off objects such as the beverage bottling line, raw material shelves, and conveyor belts within the workshop. Based on the time difference between emission and reception, the LiDAR accurately calculates the distance to each reflection point and, combined with its own rotation angle and position information, converts the reflection points into point cloud data in three-dimensional space. Simultaneously, a depth camera captures images of the workshop environment, assisting the LiDAR in obtaining more comprehensive environmental information. For example, if a raw material shelf 8 meters away from the robot is detected at a 45-degree angle to the left, the LiDAR generates a point containing the coordinates and reflection intensity of that location. As scanning continues, a large number of points converge into an environmental point cloud that fully represents the workshop's production environment, and this data is transmitted to the robot control system in real time.

[0030] Step 20: Based on the environmental point cloud information and the preset target inspection area, perform path planning 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 preprocesses the data using point cloud segmentation algorithms (such as region growing algorithms) to remove noise points and redundant data, thereby enhancing the accuracy and usability of the data. Further, the robot control system analyzes the processed point cloud data using machine learning models (such as deep learning-based semantic segmentation models), identifying production equipment areas and impassable areas (such as narrow passages or areas where miscellaneous items are stored) based on the characteristics of production equipment and impassable areas (such as shape, size, and positional relationships).

[0032] Furthermore, the robot control system retrieves the preset target inspection area (such as the filling production line area and the raw material storage area), clarifies the area to be inspected and the key inspection points, and performs path planning based on the production equipment area, the impassable area and the 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 control commands and sends these commands to the food safety inspection robot. Upon receiving the control commands, the food safety inspection robot moves along the initial inspection path specified in the commands.

[0034] Step 30: Optimize the initial inspection path based on the obstacle information collected by the food safety inspection robot through industrial vision equipment during its movement to obtain the target inspection path.

[0035] Furthermore, as the food safety inspection robot moves along the initial inspection path, the industrial vision device maintains real-time monitoring. Once a new obstacle is detected (such as a material box temporarily moved into the aisle or equipment under maintenance), the industrial vision device quickly collects obstacle information, including shape, size, and direction of movement, and sends the obstacle information to the robot control system.

[0036] Furthermore, after receiving obstacle information, the robot control system compares and analyzes it with the initial inspection path, and uses a collision detection algorithm to determine whether the obstacle will hinder the robot's movement. If an obstacle exists, the robot control system, considering new obstacles, replans and adjusts the initial inspection path with the goal of avoiding obstacles and ensuring the optimal path, generating a target inspection path, as described in steps 301 to 304.

[0037] In one embodiment, as the inspection robot moves along the initial inspection path toward the filling production line inlet, the industrial vision device detects a rectangular material box temporarily placed in the passage ahead. The box measures 1.2 meters * 0.9 meters * 0.7 meters and is 1.5 meters away from the robot. The industrial vision device quickly collects the shape and size information of the material box and sends it to the robot control system. The robot control system uses a collision detection algorithm to determine that the material box will obstruct the robot's path. Therefore, considering this new obstacle, the initial inspection path is replanned, and a new path is calculated. The robot first detours to the right, bypassing the material box, then turns to the left, returning to its original direction to continue moving toward the inlet, thus obtaining 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 on the food production process based on the sensor data collected by the multi-dimensional perception sensors in the food safety inspection robot to obtain the food production safety monitoring results.

[0039] Furthermore, the robot control system sends new control instructions for the target inspection path to the food safety inspection robot. The food safety inspection robot adjusts its movement direction according to the control instructions and continues to move along the target inspection path to the target inspection area.

[0040] Furthermore, once the food safety inspection robot arrives at the target inspection area, its multi-dimensional sensing sensors (such as temperature sensors, humidity sensors, gas sensors, and vision sensors) simultaneously activate. 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 the presence of harmful gas leaks, and the image sensor checks the integrity of the food's packaging.

[0041] Furthermore, the multi-dimensional sensing sensor transmits the collected data to the robot control system in real time through the internal communication module. After receiving the data, the robot control system performs preprocessing, feature extraction, and fusion analysis on the data, compares it with preset safety standards and thresholds, and monitors the food production process based on the comparison results to obtain the food production safety monitoring results, as detailed in steps 401 to 404.

[0042] This invention utilizes point cloud information of the food production environment collected by industrial vision equipment, combined 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 adjust the inspection path upon detection, the robot can flexibly respond to environmental changes, avoiding situations where it stops working due to obstacles. This allows the robot to better adapt to complex food production environments, further improving inspection efficiency and ensuring the efficient and stable operation of the inspection work.

[0043] In one embodiment, steps 201 to 205 are described as follows:

[0044] Step 201: Identify the production equipment area and the impassable area based on the environmental point cloud information.

[0045] Optionally, the robot control system analyzes the environmental point cloud information through machine learning models (such as semantic segmentation models based on deep learning), and identifies the production equipment area and the impassable area (such as narrow passages in the workshop and areas where debris is piled up) based on the characteristics of the production equipment and the impassable area (such as shape, size, positional relationship, etc.).

[0046] Step 202: Use polyhedra to geometrically model the production equipment area, impassable area, and target inspection area in three-dimensional space to obtain the path planning space.

[0047] Furthermore, the robot control system employs a polyhedral modeling method to geometrically model the production equipment area, impassable area, and target inspection area in three-dimensional space. For areas with regular shapes (such as rectangular raw material shelves or cubic control boxes), corresponding rectangular or cubic polyhedra are directly constructed based on their external dimensions. For areas with irregular shapes (such as curved conveyor belts or complex filling production lines), a triangulation algorithm is used to decompose the surface of the area into multiple triangular facets. By connecting these triangular facets, an approximate polyhedral model is constructed, resulting in the polyhedra of the production equipment area, impassable area, and target inspection area in three-dimensional space.

[0048] Furthermore, the robot control system connects the polyhedra corresponding to the production equipment area, the impassable area, and the target inspection area to obtain the path planning space.

[0049] In one embodiment, in a food and beverage production workshop, the robot control system acquires information about the beverage bottling production line, raw material shelves, impassable areas, and target inspection areas. For the rectangular raw material shelves with dimensions of 3m x 2m x 4m, they are directly constructed as corresponding rectangular polyhedra. For the irregularly shaped beverage bottling production line, a triangulation algorithm is used to decompose its surface into 500 triangular facets, and these facets are connected to construct an approximate polyhedral model. Impassable areas (such as corner areas where miscellaneous items are piled up) are also constructed as polyhedra through triangulation. The target inspection areas (bottling production line and raw material storage area) are also modeled as polyhedra. Combining these polyhedra yields a path planning space encompassing all relevant areas of the workshop, clearly presenting the geometric structure and positional relationships of each area in three-dimensional space.

[0050] Step 203: Recursively partition the path planning space using an octree. The partitioning stops when the resulting subspace is entirely within the production equipment area, an inaccessible area, the target inspection area, or is empty, resulting in multiple subspaces with different attributes. These subspaces include accessible and inaccessible 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 (the eight child nodes of the octree). Then, it is determined whether each sub-cube completely belongs to the production equipment area, the impassable area, the target inspection area, or is empty (i.e., does not contain any of the above areas). If one of these conditions is met, further partitioning of the sub-cube stops, and it is labeled with the corresponding attribute (e.g., "production equipment area," "impassable area," "target inspection area," or "empty"). 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 stopping partitioning condition. After recursive partitioning, the path planning space is divided into multiple subspaces with different attributes. The traversable subspace is one that does not belong to either the production equipment area or the impassable area. The impassable subspace is one that belongs to either the production equipment area or the impassable area.

[0052] In one embodiment, the robot control system uses an octree to partition the path planning space. Initially, the entire workshop's path planning space is used as the root node and divided into eight sub-cubes. For one sub-cube, it is determined that it completely contains a portion of the raw material shelf, belonging to the production equipment area; therefore, partitioning of this sub-cube stops, and it is marked as "production equipment area." Another sub-cube contains a portion of an impassable area (corner clutter); similarly, partitioning stops, and it is marked as "impassable area." Some sub-cubes are empty and are also marked accordingly. For sub-cubes that neither belong to the above categories nor completely contain the target inspection area, recursive partitioning continues until all sub-cubes have clear attribute labels. Ultimately, the path planning space is divided into numerous subspaces containing different attributes, distinguishing between traversable and impassable subspaces.

[0053] Step 204: Determine the path direction vector based on the spatial 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 acquires 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. Through the spatial vector calculation method, it calculates the spatial vector pointing from the first current position point to the center position point of the target inspection area to obtain the path direction vector.

[0055] Step 205: Based on the path direction vector, traversable subspace, and impassable subspace, perform path planning to generate the 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 impassable subspace to generate the initial inspection path for the food safety inspection robot to travel to the target inspection area, as described in steps 2051 to 2054.

[0057] The embodiments of the present invention take into account robot motion constraints and generate an initial inspection path from the current position to the target inspection area. This path can effectively avoid production equipment and impassable areas, and has a certain degree of optimization and feasibility. It provides a reliable travel route for the subsequent inspection work of the food safety inspection robot, enabling the robot to 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 center point in the passable subspace, determine the passable direction vector and passable distance, and determine the subspace points whose direction angle between the passable direction vector and the path direction vector is within a preset range and whose passable distance is less than a preset distance threshold as path candidate nodes.

[0060] Optionally, the robot control system acquires each subspace point in the traversable subspace and determines the traversable direction vector and traversable distance based on the spatial vector and spatial distance between each subspace point in the traversable subspace and the center position point.

[0061] Furthermore, the robot control system calculates the angle between the traversable direction vector and the path direction vector, and identifies subspace points 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 as path candidate nodes.

[0062] Step 2052: Connect each path candidate node to the first current position point to obtain path node segments, and perform a collision test on each path node segment to obtain the test collision results.

[0063] Furthermore, the robot control system connects the coordinates of each path candidate node with the coordinates of the first current position point of the food safety inspection robot to form path node segments.

[0064] Furthermore, for each path node segment, a ray tracing algorithm is used for collision testing. Specifically, starting from the first current position point, a ray is emitted towards the path candidate node, and it is determined 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) were determined, and the first current position coordinates of the food safety inspection robot were (2,3,1). The robot control system connected the first current position point to each candidate path node, resulting in three path node 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, rays were emitted from (2,3,1) towards P1, P2, and P3 respectively. Detection showed that ray L2 intersected with the raw material shelves (inaccessible subspace) in the workshop, while L1 and L3 did not intersect with any inaccessible subspace.

[0066] Step 2053: If the test collision result is that the target path node segment intersects with the inaccessible subspace, then the path candidate node corresponding to the target path node segment is removed. If the test collision result is that the target path node segment does not intersect with the inaccessible subspace, then the path candidate node corresponding to the target path node segment is retained, and the final path node is obtained.

[0067] Furthermore, for any target path node segment among the path node segments, if the test collision result shows that the target path node segment intersects with the impassable subspace, the robot control system will eliminate 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 with the impassable subspace, the robot control system retains the path candidate node corresponding to the target path node segment. The retained path candidate node is the final path node. Continuing with the above embodiment, in the example above, since path node segment L2 intersects with the impassable subspace, the robot control system eliminates the path candidate node P2 corresponding to L2; while path node segments L1 and L3 do not intersect with the impassable subspace, so P1 and P3 are retained, and P1 and P3 become the final path nodes.

[0069] Step 2054: Connect each path final node in order of distance from the final node to the center position point, from closest to farthest. Also, connect the first current position point to the nearest path final node, the farthest path final node, and the center position point to obtain a preliminary path segment sequence.

[0070] Furthermore, the robot control system calculates the distance between each final node of the path and the center point of the target inspection area, and sorts the final nodes of the path in ascending order of distance.

[0071] Furthermore, the robot control system sequentially connects the final nodes of the sorted path to form a path. At the same time, it connects the robot's first current position point to the final node of the path that is closest to the center position point, the final node of the path that is furthest from the center position point, and the center position point of the target inspection area to obtain a preliminary path segment sequence.

[0072] Continuing with the above embodiment, given that the final path nodes P1(5,5,2) and P3(7,4,2.2) are 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. Since 3.26 < 3.74, the final path nodes are sorted from closest to furthest from the center point as P3 and P1. The robot control system connects P3 and P1 sequentially, and connects the first current position point (2,3,1) with P3, P1, and the center point (8,7,3) to obtain a preliminary path segment sequence.

[0073] Step 2055: For the initial path segment sequence, check whether three adjacent nodes are approximately collinear. If they are approximately collinear, delete the intermediate node. Repeat this process until the entire initial path segment sequence has been traversed to obtain the initial inspection path. Whether three adjacent nodes are approximately collinear is determined based on the vector angle and the ratio of the segment lengths.

[0074] Furthermore, for the initial path segment sequence, the robot control system acquires three adjacent nodes and calculates the vector angle and segment length ratio between the three adjacent nodes based on their coordinates. 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 angle between the vectors of the three nodes is and the ratio of line segment length

[0075] Furthermore, for each group of three adjacent nodes, if the included angle between the vectors of the three nodes is less than or equal to a preset included angle threshold, and the ratio of the lengths of the line segments between the three nodes is within a preset length range, then the three adjacent nodes are determined to be approximately collinear. The preset included 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 they are approximately collinear, the middle node of the three adjacent nodes is deleted, i.e., the middle node B is deleted. The above process is repeated to judge the new three adjacent nodes until the entire preliminary path segment sequence has been traversed, and finally the initial inspection path is 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 included angle α of the vectors of three adjacent nodes is approximately 78.5°, and the ratio of line segment lengths is β = 1.62. A preset included angle threshold is set to α. max =80°, with a preset length range of [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 process continues to judge new adjacent nodes until the entire preliminary path segment sequence has been traversed, resulting in the final initial inspection path.

[0078] This invention utilizes 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. This avoids impassable areas and optimizes node connections to reduce path turns, improving path smoothness and efficiency. Therefore, it can more accurately and efficiently plan a suitable path for the food safety inspection robot in complex three-dimensional environments, improving inspection efficiency and ensuring the efficient and stable operation of inspection work.

[0079] In one embodiment, steps 301 to 304 are described as follows:

[0080] Step 301: Map the obstacle to a two-dimensional Cartesian coordinate system with the second current position of the food safety inspection robot as the origin, based on the shape and size information.

[0081] Optionally, the robot control system receives obstacle shape information (such as cuboids, cylinders, etc.) and size information (length, width, height or radius, height, etc.) collected by industrial vision equipment. The second current position of the food safety inspection robot is used as the origin (0,0) of the two-dimensional Cartesian coordinate system. The positive x-axis direction is determined based on the robot's orientation (e.g., the direction directly in front of the robot is the positive x-axis direction), and the direction perpendicular to the x-axis and on the horizontal plane is the y-axis direction. For three-dimensional obstacles, the outline projected onto the horizontal plane is selected, and the coordinates of each vertex of the outline 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 cuboid's base in the two-dimensional Cartesian coordinate system are calculated based on the relative relationship between the robot's current position and the obstacle's position. If it is a cylinder, the coordinates of the center and radius of its circular base outline in the two-dimensional coordinate system are calculated to determine the position of the circular outline in the coordinate system, completing the mapping from the obstacle to the two-dimensional Cartesian coordinate system.

[0082] In one embodiment, as the food safety inspection robot moves along its initial inspection path, the industrial vision device detects a cuboid obstacle measuring 1.5 meters long, 1 meter wide, and 1.2 meters high, located 3 meters to the right front of the robot and 1 meter to its right. At this point, the robot control system establishes a two-dimensional Cartesian coordinate system with the robot's second current position as the origin, with the positive x-axis pointing directly in front of the robot and the positive y-axis pointing to the right. Based on the relative position of the obstacle and the robot, the coordinates of the four vertices of the cuboid's base in the two-dimensional Cartesian coordinate system are calculated as (3,1), (4.5,1), (4.5,2), and (3,2), successfully mapping the obstacle into the two-dimensional Cartesian coordinate system.

[0083] Step 302: In a two-dimensional Cartesian coordinate system, using obstacles as dividing points, the passable area (excluding obstacles) is divided into multiple connected sub-regions. Each sub-region is connected by sub-region path nodes, constructing a topology map of the passable area. Sub-region path nodes represent the boundary intersection points of the sub-regions.

[0084] Furthermore, within the established two-dimensional Cartesian coordinate system, the robot control system uses the mapped obstacle contours as dividing boundaries to segment the passable area. Specifically, this embodiment employs a boundary-tracking-based region segmentation algorithm: starting from a point in the coordinate system (e.g., the origin), a search is performed along the obstacle contours and the coordinate system boundaries to divide the passable area into multiple non-overlapping and connected sub-regions. For each sub-region, its boundary intersection points are determined as sub-region path nodes, representing connection points between sub-regions. By connecting the path nodes of adjacent sub-regions, a topology map of the passable area is constructed.

[0085] It should be noted that when constructing the topology graph, the coordinates of each sub-region path node and its connection relationship with other sub-region path nodes are recorded, forming a graph structure composed of nodes and edges, where edges represent the connecting paths between sub-regions.

[0086] In one embodiment, after mapping the cuboid obstacle to a two-dimensional Cartesian coordinate system, the robot control system uses a boundary tracking algorithm to divide the passable area. Starting from the origin (0,0), the search proceeds along the obstacle outline and the coordinate system boundary, dividing the passable area into three connected sub-regions. The boundary intersection points of each sub-region are determined as path nodes for that sub-region. For example, the path nodes for the first sub-region are A(0,0), B(2,0), and C(2,1); the path nodes for the second sub-region are D(2,1), E(3,1), and F(3,2); and the path nodes for the third sub-region are G(3,2), H(5,2), and I(5,0). Connecting these nodes constructs a topological graph of the passable area, such as connecting A and B, B and C, and C and D, forming a graph structure containing nodes and edges.

[0087] Step 303: Project each node on the initial inspection path onto the topology graph, and determine the topology graph node closest to each projection point as the node sequence of the initial inspection path in the topology graph.

[0088] Furthermore, the robot control system acquires the three-dimensional coordinates of each node on the initial inspection path and projects these 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, its distance to all nodes in the topology graph is calculated using Euclidean distance. Further, the robot control system finds the topology graph node closest to the projection point and uses this node as the corresponding node of the initial inspection path in the topology graph. Following the order of nodes on the initial inspection path, the corresponding nodes in the topology graph are determined sequentially, resulting in the node sequence of the initial inspection path in the topology graph, thus establishing the association between the initial inspection path and the topology graph.

[0089] In one embodiment, the initial inspection path has three nodes 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, obtaining 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 to node B(2,0) dB=3, the distance to node C(2,1) dC=2, etc., 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, obtaining the node sequence C, E, and H of the initial inspection path in the topology graph.

[0090] Step 304: Using the obstacle as the center, expand outwards by the distance determined by the movement direction and speed to generate an obstacle buffer. Optimize the initial inspection path based on the node sequence and the obstacle buffer to obtain the target inspection path.

[0091] Furthermore, the robot control system determines the extension distance r based on the moving speed v of the food safety inspection robot. 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 extends outward by a distance r, centered on the mapped obstacle outline, according to the movement direction of the food safety inspection robot, to generate an obstacle buffer zone, where the buffer zone represents the dangerous area that the robot needs to avoid.

[0093] Furthermore, the robot control system optimizes the initial inspection path based on the node sequence and obstacle buffer to obtain the target inspection path, as described in steps 3041 to 3044.

[0094] This invention takes into account the robot's motion characteristics and environmental factors. Through coordinate system mapping and topology construction, it can quickly generate a safe and efficient target inspection path when encountering obstacles in a complex and ever-changing food production environment. This avoids the robot stopping work due to obstacles, enabling it to better adapt to complex food production environments, improving inspection efficiency, and ensuring the efficient and stable operation of inspection work.

[0095] In one embodiment, steps 3041 to 3044 are described as follows:

[0096] Step 3041: Remove nodes and edges located within the obstacle buffer zone in the topology graph to obtain the restricted path search space.

[0097] Optionally, the robot control system compares the obstacle buffer zone with the topology graph. For each node in the topology graph, it determines whether its coordinates are within the boundary of the obstacle buffer zone. If they are, the node and its connected edges are removed from the topology graph. After the removal operation, a new graph structure is obtained, namely the restricted path search space. Within the restricted path search space, for the remaining nodes, the connections between them are recalculated. If there was an edge between two nodes that was not removed, the connection is retained; if they were not originally connected but new reachability relationships are created due to the removal of other nodes and edges, new connections are established. Simultaneously, based on the coordinates of the two nodes in the two-dimensional Cartesian coordinate system, the distance between any two connected nodes is recalculated using the Euclidean distance algorithm.

[0098] In one embodiment, an obstacle buffer zone with a radius of 1.3 meters centered on a cuboid obstacle has been generated. Comparing this buffer zone with the topology of the passable area reveals that nodes D and F in the topology are located within the obstacle buffer zone. Therefore, nodes D and F, along with their connected edges, are removed from the topology, resulting in a restricted path search space. Within this restricted path search space, nodes C and E, originally 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 1 meter.

[0099] Step 3042: Starting from the current node in the node sequence, within the constrained path search space, multiple candidate path branches are generated, targeting the next uninspected area of ​​the initial inspection path. Each candidate path branch is based on 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 topology graph. For example, if the node sequence is C, E, H, and the current node is C, then the topology graph node corresponding to the next uninspected area is E. Within the restricted path search space, based on the depth-first search (DFS) or breadth-first search (BFS) algorithm, starting from the starting point, it explores adjacent nodes step by step along the edges connected to the starting point, generating different path branches. During the path branch generation process, the node sequence traversed by each path branch is recorded until the target node is found, forming a complete candidate path branch. The above process is repeated to generate multiple different candidate path branches starting from the starting point, ensuring coverage of multiple feasible paths from the starting point to the target node.

[0101] Continuing with the above embodiment, in the restricted path search space, the node sequence is C, E, H, with the current node C and the target node E. The robot control system uses a depth-first search algorithm, starting from node C, first exploring node B connected to C, and continuing to explore from B, forming path branches CB-...; then exploring another connected node E from C, forming path branch CE. Through continuous exploration, multiple candidate path branches are generated, such as CBAE, CE, CGHE, etc.

[0102] Step 3043: For each candidate path branch, calculate its total path length and the 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 obtained 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 distances between nodes, the distances between adjacent nodes in the candidate path branch are added together sequentially to obtain the total path length. For example, if the 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. This can be calculated using the coordinate difference between the current node and the next node on the initial inspection path. For candidate path branches, the starting direction vector is determined. That is, the coordinate difference between the starting point of the candidate path branch and the next node, which is calculated by combining the vector angle formula with the direction vector. and the initial direction vector Calculate the directional 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 (Indicating the rightward direction), there is a candidate path branch CBAE, whose starting direction vector... (Indicating leftward direction). The distance between node 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. Therefore, the total path length L of this candidate path branch = 1 + 2 + 3 = 6 meters. The direction deviation angle is calculated using the vector angle formula.

[0106] Step 3044: The candidate path branch with the shortest total path length and the smallest directional deviation angle is determined as the target inspection path.

[0107] Furthermore, set a threshold L for the total path length. thresh and direction deviation angle threshold θ thresh The robot control system comprehensively compares the total path length and directional deviation angle of each candidate path branch, and selects the path with a total length less than L. thresh And the directional deviation angle is less than θ thresh If multiple candidate path branches satisfy the conditions, the candidate path branch with the shortest total path length and the smallest directional deviation angle is selected as the target inspection path. If no candidate path branch simultaneously satisfies both threshold conditions, the candidate path branch with the shortest total path length is selected as the target inspection path.

[0108] In one embodiment, the total path length and directional deviation angle of the three candidate path branches are calculated as follows: candidate path branch 1 (total path length 4 meters, directional deviation angle 30°), candidate path branch 2 (total path length 6 meters, directional deviation angle 15°), and candidate path branch 3 (total path length 5 meters, directional deviation angle 25°). A path total length threshold L is set. thresh = 5 meters, directional deviation angle threshold θ thresh =35°. Candidate path branch 1 and candidate path branch 3 meet the threshold condition. Among them, candidate path branch 1 has the shortest total path length and the smallest directional deviation angle. Therefore, candidate path branch 1 is determined as the target inspection path.

[0109] This invention adjusts the path by comprehensively considering path length and direction factors, enabling the robot to flexibly respond to environmental changes and avoid stopping work due to obstacles. This allows the robot to better adapt to complex food production environments, improving inspection efficiency and ensuring efficient and stable inspection work. Simultaneously, while avoiding obstacles, it generates a target inspection path that more closely resembles the original inspection intention and is shorter, enabling more efficient handling of dynamic obstacles. This ensures the food safety inspection robot completes inspection tasks with a better path in complex environments, 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 food images, and determine the food quality and safety monitoring results during the food production process based on the appearance analysis results.

[0112] Optionally, the multi-dimensional sensing sensor in this embodiment of the invention includes a vision sensor, a gas sensor, a temperature sensor, and a humidity sensor. Therefore, the sensor data includes food images, ambient gas concentrations, ambient temperature, and ambient humidity of the target inspection area.

[0113] Therefore, the robot control system analyzes the food image to determine the appearance of the food, and determines the appearance analysis result. The appearance analysis result indicates whether there are cracks in the food's appearance, as described in steps 4011 to 4015. Further, the robot control system determines whether the food has been contaminated during the food production process based on the appearance analysis result. If cracks are present in the food's appearance, contamination may have occurred during production; if no cracks are present, contamination is highly probable, thus obtaining the food quality and safety monitoring result during the food production process.

[0114] Step 402: Analyze the concentrations of various preset gases based on the ambient gas concentration, and determine the environmental gas safety monitoring results during the food production process based on 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 concentration to obtain the concentrations of these preset gases in the food production environment. The robot control system then compares the real-time concentration of each preset gas with pre-set safety concentration thresholds. For oxygen, if the concentration is below 19.5% (the general lower limit for industrial environment safety), it is determined that the oxygen concentration is insufficient, posing a safety hazard. For carbon dioxide, if the concentration is above 1000 ppm (the upper limit for indoor air quality reference), it is considered that the carbon dioxide concentration is too high, potentially affecting food quality and human health. For harmful VOCs, if their concentration exceeds specific occupational exposure limits (such as the exposure limit for benzene being 1 ppm), it is determined that there is a problem of excessive harmful gas levels. Based on the comparison results of different gas concentrations, the environmental gas safety status is comprehensively assessed, generating environmental gas safety monitoring results that clearly indicate the types of problematic gases and their degree of danger.

[0116] Step 403: Determine the environmental temperature safety monitoring results during the food production process based on the ambient temperature.

[0117] Furthermore, the robot control system compares the ambient temperature with the temperature range required by the food production process, which is preset according to the production standards of different foods. For example, for some food raw materials that require low-temperature storage, the storage environment temperature should be maintained between 0-4℃; for the sterilization process in food processing, the temperature needs to reach a specific high temperature value (such as 121℃) 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 assesses the severity of the temperature anomaly based on the degree and duration of the anomaly, generates an ambient temperature safety monitoring result, and clearly displays the temperature anomaly and its potential impact on food production.

[0118] Step 404: Determine the environmental humidity safety monitoring results during the food production process based on the ambient humidity.

[0119] Furthermore, the robot control system compares the ambient humidity with the humidity range specified in the food production process, as different foods have different requirements for the humidity of the production environment. For example, for baked goods, the humidity in the production workshop is generally required to be controlled between 40% and 60%; for the storage of certain dry goods, the humidity needs to be maintained at a lower level (such as 20% to 30%). If the real-time humidity exceeds the corresponding standard range, the robot control system judges the severity of the humidity anomaly based on the degree of deviation and its duration, generates an environmental humidity safety monitoring result, and explains the humidity anomaly and its potential hazards to food production.

[0120] This invention monitors the food production process from four key dimensions: food appearance, ambient gas concentration, ambient temperature, and ambient humidity. Therefore, it can accurately identify various potential safety hazards in the food production process, and comprehensively control everything from the quality of the food itself to environmental factors. This improves the accuracy and effectiveness of food safety monitoring, helps to take timely measures to eliminate potential hazards, and ensures food quality and safety as well as the stability of the production process.

[0121] In one embodiment, steps 4011 to 4015 are described as follows:

[0122] Step 4011: Perform grayscale processing on the food image to obtain the grayscale value of each pixel in the food image, and obtain the target pixels that are discretely distributed based on the grayscale value of each pixel.

[0123] Optionally, the robot control system performs grayscale processing on the food image using a grayscale conversion formula: Gray = 0.299*R + 0.587*G + 0.114*B, where R, G, and B are the red, green, and blue component values ​​of the pixels in the food image, respectively. This formula converts the food image into a grayscale image, giving each pixel a grayscale value between 0 and 255.

[0124] Furthermore, the robot control system determines the target pixels as those with gray values ​​greater than or equal to the gray value threshold T. These target pixels are discretely distributed in the image and typically contain key feature information about the food's appearance, such as pixels in areas with edges or defects.

[0125] Step 4012: For each local area of ​​a preset size, if the target pixels in the local area are consecutive pixels, connect the target pixels in sequence to obtain the line contour feature.

[0126] Furthermore, the robot control system divides the grayscale processed image into multiple local regions of a preset size (e.g., n*n pixels). For each local region, it determines whether the target pixels within the region are continuous by scanning row by row and column by column. If, in a certain row or column, the pixel spacing between adjacent target pixels in the horizontal or vertical direction is 1, then the target pixels are determined to be continuous.

[0127] Furthermore, for consecutive target pixels, they are connected sequentially from left to right and from top to bottom to form lines. After traversing the entire local region, all the connected lines are combined to obtain the line contour features of that local region. These line contour features can reflect the shape and structural information of the food's appearance in that local region.

[0128] Step 4013: If the line contour feature does not match the preset contour feature, then 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. Standard line contour data is obtained through analysis of 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 this embodiment of the invention, the shape difference can be expressed using Hausdorff distance, 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, and ||·|| represents the Euclidean distance.

[0132] Furthermore, if the Hausdorff distance is less than or equal to a preset matching threshold, the line contour feature is determined to match the preset contour feature, and the appearance analysis result is determined to be that the food appearance has no cracks. If the Hausdorff distance is greater than the preset matching threshold, the line contour feature is determined to not match the preset contour feature. In this case, for continuous target pixels in the line contour feature, the robot control system calculates the number of pixels between adjacent target pixels in the direction perpendicular to the line to obtain the pixel width.

[0133] Step 4014: If the pixel width is greater than or equal to the preset width threshold, then 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 threshold, the appearance analysis result is determined to be that there are no cracks in the food appearance. If the determined pixel width is greater than or equal to the pixel width threshold, it indicates that there may be obvious anomalies in the line contour. Therefore, the robot control system analyzes the distribution of target pixels in the line contour features and calculates the pixel overlap rate.

[0135] In this embodiment of the 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, if two adjacent target pixel sets are P1 and P2, and the overlapping pixel set is P... 12 The pixel overlap rate formula is: OverlapRate = |P 12 | / (|P1|+|P2|-|P 12 |), where |·| represents the number of pixels in the pixel set.

[0136] Step 4015: If the pixel overlap rate is less than the preset overlap rate threshold, then the appearance analysis result is determined to be that there are cracks in the food appearance.

[0137] Furthermore, a pixel overlap rate threshold O is set. If the pixel overlap rate is determined to be greater than or equal to the preset overlap rate threshold, the appearance analysis result is determined to be that there are no cracks in the food appearance. If the pixel overlap rate is determined to be less than the preset overlap rate threshold, it indicates that the connection between the target pixels is relatively loose and there is a greater possibility of breakage. In this case, the appearance analysis result is determined to be that there are cracks in the food appearance.

[0138] In one embodiment, the line contour features of a local area of ​​the beverage bottle are compared with the preset qualified beverage bottle contour features. The difference between the two is calculated using the Hausdorff distance formula, and the Hausdorff distance value is 8. The preset matching threshold is 5, so it is determined that the line contour features do not match the preset contour features. Next, the number of adjacent target pixels in the direction perpendicular to the line 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, the pixel overlap rate needs to be calculated. The two adjacent groups of target pixels are analyzed, and the number of pixels in their overlapping part is calculated to be 2. The number of pixels in each of the two groups of target pixels are 5 and 6 respectively. Substituting into the pixel overlap rate formula, the overlap rate is calculated as: 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 that there is a crack.

[0139] This invention provides a pixel-level in-depth analysis of food appearance images, enabling more accurate identification of minute cracks in food appearance. This achieves high-precision detection of food appearance quality, helping to promptly identify and address food with appearance quality issues, and ensuring food production quality and safety.

[0140] In one embodiment, after step 40, the data from the inspection process also needs to be uploaded to the blockchain, specifically including the descriptions of steps 50 to 80:

[0141] Step 50: Encapsulate the log data of the food safety inspection robot during the inspection process to obtain the encapsulated data.

[0142] Optionally, the robot control system acquires log data of the food safety inspection robot during the inspection process. 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. The obstacle location is the specific coordinate of the obstacle in the production environment, and the path optimization times are 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 using JSON format (or other suitable data format) to construct data objects, storing each data item as an attribute of the object, forming a complete encapsulated data.

[0144] Step 60: The robot code of the food safety inspection robot is split according to the parity of the character positions to obtain the initial odd-position character sequence and the initial even-position character sequence. Then, each character in the initial odd-position character sequence and the initial even-position character sequence is multiplied by a different prime number sequence according to its order value in the ASCII code table to obtain the encrypted odd-position character sequence and the encrypted even-position character sequence.

[0145] Furthermore, the robot control system obtains the unique robot code of the food safety inspection robot, which consists of letters, numbers, and other characters. Therefore, the characters in the robot code are split according to the parity of their positions. Characters located in odd positions (positions 1, 3, 5... from left to right) form the initial odd-position character sequence, and characters located in even positions (positions 2, 4, 6...) form the initial even-position character sequence.

[0146] Furthermore, for two distinct sequences of prime numbers, such as the sequence p corresponding to an odd number of characters... odd =[2,3,5,7,11,...], where the even-numbered characters correspond to the prime number sequence p. even= [13,17,19,23,29,...]. For each character in the initial odd-numbered character sequence, obtain its ASCII code value, then multiply it by the corresponding prime number in the prime number sequence to obtain a new value. Convert this value 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 food safety inspection robot is coded as "RB12345". The robot control system splits this into an initial odd-numbered character sequence "R135" and an initial even-numbered character sequence "B24". For the initial odd-numbered character sequence "R135": the ASCII code value of "R" is 82, multiplied by the prime number sequence p. odd The first prime number in the sequence, 2, gives 82 * 2 = 164, which is the character “′” (the character corresponding to the ASCII code value 164). The ASCII code value of “1” is 49, which multiplies by 3 to get 49 * 3 = 147, corresponding to the character “¨”. The ASCII code value of “3” is 51, which multiplies by 5 to get 51 * 5 = 255, corresponding to the character… The ASCII code for "5" is 53. Multiplying this by 7 gives 53 * 7 = 371. Taking the remainder of 128 (because the ASCII code range is 0127, and values ​​beyond that range are cyclically mapped) gives 371 mod 128 = 115, which corresponds to the character "s". Therefore, the encrypted sequence of odd-numbered characters is... For the initial even-numbered character sequence "B24": the ASCII code value of "B" is 66, multiplied by the prime number sequence p even The first prime number in the sequence is 13, which gives 66 * 13 = 858. 858 mod 128 = 106, corresponding to the character "j". The ASCII code value of "2" is 50, which multiplies by 17 to get 50 * 17 = 850. 850 mod 128 = 98, corresponding to the character "b". The ASCII code value of "4" is 52, which multiplies by 19 to get 52 * 19 = 988. 988 mod 128 = 124, corresponding to the character "|". Therefore, the encrypted even-numbered character sequence is "jb|".

[0148] Step 70: Cross-add the encrypted odd-numbered character sequence and the encrypted even-numbered character sequence to obtain the encryption key, and encrypt the encapsulated data based on the encryption key to obtain the encrypted data.

[0149] Furthermore, the robot control system performs a cross-add operation on the encrypted odd-numbered character sequence and the encrypted even-numbered character sequence according to the character position. That is, it takes the first character of the encrypted odd-numbered character sequence and the first character of the encrypted even-numbered character sequence, adds their sequential values ​​in the ASCII code table to obtain a new value, and converts the value into the corresponding character. This operation is performed on the characters at 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-numbered character sequence is "jb|". The first character is added together: "′" (ASCII value 164) + "j" (ASCII value 106) = 164 + 106 = 270, 270 mod 128 = 14, corresponding to the character "r"; the second character is added together: "¨" (ASCII value 147) + "b" (ASCII value 98) = 147 + 98 = 245, 245 mod 128 = 117, corresponding to the character "u"; the third character is added together: (ASCII code value 255) + "|" (ASCII code value 124) = 255 + 124 = 379, 379 mod 128 = 95, corresponding to the character "_"; the fourth character is added: "s" (ASCII code value 115). Since the even-numbered character sequence only has 3 characters, we can cycle through and take the first character "j" (ASCII code value 106). 115 + 106 = 221, 221 mod 128 = 93, corresponding to the character "]", so the encryption key is "ru_]".

[0151] Furthermore, the robot control system employs a symmetric encryption algorithm (such as AES) to encrypt the encapsulated data using the encryption key, converting the original data into ciphertext to obtain encrypted data, thus ensuring the security of the data during transmission and storage.

[0152] Step 80: Package the data using the robot code and inspection execution time as the header and the encrypted data as the content, and upload the packaged data to the blockchain platform.

[0153] Furthermore, the robot control system acquires the inspection execution time of the food safety inspection robot during inspections, in the format "YYYY-MM-DD-HH:MM:SS", and combines the robot code and inspection execution time into a packet header according to a specific format, such as "robot code-inspection execution time". Further, the robot control system combines the encrypted data as the packet content with the packet header to obtain the 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 inspection data and ensuring the immutability and traceability of the data.

[0155] In one embodiment, the robot is coded as "RB12345" and the inspection execution time is "2025-04-24 15:30:00", so the packet header is "RB12345-2025-04-24-15:30:00". The encrypted data is packaged with the packet header line to obtain the packaged data as: "RB12345-2025-04-24-15:30:00[encrypted data]".

[0156] This invention encrypts data during the inspection process using robot coding, effectively preventing data theft or tampering during transmission and storage, thus ensuring data security. Simultaneously, data is packaged with robot coding and inspection time as headers and uploaded to the blockchain. Utilizing the distributed storage and consensus mechanism of blockchain, data immutability and traceability are achieved, providing strong support for subsequent data analysis and accountability. This helps improve the transparency and safety of the food production process and ensures 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 will be described below. The food safety inspection robot control system based on industrial vision described below can be referred to in correspondence with the food safety inspection robot control method based on industrial vision described above.

[0158] Reference Figure 2 , Figure 2 This is a schematic diagram of the structure of the food safety inspection robot control system based on industrial vision provided by the present invention. The food safety inspection robot control system based on industrial vision includes:

[0159] The point cloud data acquisition module 210 is used to control the start of the food safety inspection robot and acquire the environmental point cloud information obtained by the food safety inspection robot after performing a comprehensive scan of the current food production environment based on industrial vision equipment.

[0160] The path planning module 220 is used to plan the path based on environmental point cloud information and the preset target inspection area, generate the initial inspection path, and control the food safety inspection robot to move along the initial inspection path.

[0161] The path optimization module 230 is used to optimize the initial inspection path based on the obstacle information of the obstacles collected by the food safety inspection robot through the industrial vision device during the movement, so as to obtain the 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 sensors in the food safety inspection robot, so as to obtain the food production safety monitoring results.

[0163] This invention utilizes point cloud information of the food production environment collected by industrial vision equipment, combined 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 adjust the inspection path upon detection, the robot can flexibly respond to environmental changes, avoiding situations where it stops working due to obstacles. This allows the robot to better adapt to complex food production environments, further improving inspection efficiency and ensuring the efficient and stable operation of the inspection work.

[0164] Please see Figure 3 , Figure 3 An embodiment diagram of an electronic device provided in accordance with the present invention. For example... Figure 3 As shown, this embodiment of the 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, it performs the following steps:

[0165] Control the food safety inspection robot to start and obtain environmental point cloud information after the food safety inspection robot performs a comprehensive scan of the current food production environment based on industrial vision equipment;

[0166] Based on environmental point cloud information and a 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] The initial inspection path is optimized based on obstacle information collected by the food safety inspection robot through industrial vision equipment during its movement, 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. Based on the sensor data collected by the multi-dimensional perception sensors in the food safety inspection robot, the food production process is monitored for safety, and the food production safety monitoring results are obtained.

[0169] Please see Figure 4 , Figure 4 An embodiment diagram of a computer-readable storage medium provided in accordance with an embodiment of the present invention is shown. 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, it performs the following steps:

[0170] Control the food safety inspection robot to start and obtain environmental point cloud information after the food safety inspection robot performs a comprehensive scan of the current food production environment based on industrial vision equipment;

[0171] Based on environmental point cloud information and a 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] The initial inspection path is optimized based on obstacle information collected by the food safety inspection robot through industrial vision equipment during its movement, 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. Based on the sensor data collected by the multi-dimensional perception sensors in the food safety inspection robot, the food production process is monitored for safety, and the food production safety monitoring results are obtained.

[0174] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the industrial vision-based food safety inspection robot control method provided by the above methods, the method comprising:

[0175] Control the food safety inspection robot to start and obtain environmental point cloud information after the food safety inspection robot performs a comprehensive scan of the current food production environment based on industrial vision equipment;

[0176] Based on environmental point cloud information and a 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] The initial inspection path is optimized based on obstacle information collected by the food safety inspection robot through industrial vision equipment during its movement, 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. Based on the sensor data collected by the multi-dimensional perception sensors in the food safety inspection robot, the food production process is monitored for safety, and the food production safety monitoring results are obtained.

[0179] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0180] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some 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, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An industrial vision-based food safety inspection robot control method, characterized in that, The method comprises the following steps: controlling a food safety inspection robot to start, obtaining environment point cloud information obtained by the food safety inspection robot based on an industrial vision device after the food safety inspection robot scans the current food production environment in all directions; based on the environment point cloud information, combining a pre-set target inspection area to plan a path, generating an initial inspection path, and controlling the food safety inspection robot to move along the initial inspection path; based on the obstacle information of the obstacle collected by the industrial vision device during the movement of the food safety inspection robot, optimizing the initial inspection path to obtain a target inspection path; controlling the food safety inspection robot to move to the target inspection area along the target inspection path, and based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot, performing safety monitoring on the food production process to obtain a food production safety monitoring result; wherein the obstacle information includes shape information, size information and moving direction; the optimization of the initial inspection path 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 the target inspection path comprises: 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; in the two-dimensional Cartesian coordinate system, taking the obstacle as a separation point, dividing the passable area excluding the obstacle into a plurality of connected sub-areas, connecting each sub-area through a sub-area path node, and constructing a topological graph of the passable 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 topological graph, and determining the topological graph node closest to each projection point as the node sequence of the initial inspection path in the topological graph; expanding outward based on the expansion distance determined by the moving direction and the moving speed with the obstacle as the center to generate an obstacle buffer area, and optimizing the initial inspection path based on the node sequence and the obstacle buffer area to obtain the target inspection path; the optimization of the initial inspection path based on the node sequence and the obstacle buffer area to obtain the target inspection path comprises: removing the nodes and edges in the topological graph within the range of the obstacle buffer area to obtain a restricted path search space; in the restricted path search space, the connection relationship and distance between the remaining nodes are recalculated; taking the current node in the node sequence as the starting point, taking the topological graph node corresponding to the next un-inspected area of the initial inspection path as the target in the restricted path search space, generating a plurality of candidate path branches; each candidate path branch is composed of a series of connected nodes; for each candidate path branch, calculate its path total length and direction deviation angle with the direction of the initial inspection path; the path total length is the sum of the distances between nodes, and the direction deviation angle is obtained by calculating the included angle between the starting direction of the candidate path branch and the direction of the initial inspection path; The candidate path branch with the shortest total path length and the smallest direction deviation angle is determined as the target inspection path.

2. The industrial vision-based food safety inspection robot control method according to claim 1, wherein, The initial inspection path is generated based on the environment point cloud information and a preset target inspection area. The production equipment area and the impassable area are identified based on the environment point cloud information. The production equipment area, the impassable area and the target inspection area are geometrically modeled in a three-dimensional space by using polyhedrons to obtain a path planning space. The path planning space is recursively segmented by using an octree, and the segmentation is stopped when the segmented subspace completely belongs to the production equipment area, the impassable area, the target inspection area or is empty to obtain a plurality of subspaces with different attributes; the subspaces include passable subspaces and impassable subspaces. A path direction vector is determined based on a spatial vector between a first current position point of the food safety inspection robot and a center position point of the target inspection area. An initial inspection path of the food safety inspection robot driving to the target inspection area is generated based on the path direction vector, the passable subspaces and the impassable subspaces.

3. The control method of the food safety inspection robot based on industrial vision according to claim 2, characterized in that, The initial inspection path of the food safety inspection robot driving to the target inspection area is generated based on the path direction vector, the passable subspaces and the impassable subspaces, and includes the following steps. Passable direction vectors and passable distances are determined based on spatial vectors and spatial distances between each subspace point in the passable subspaces and the center position point, and the subspace points with a direction included angle between the passable direction vector and the path direction vector within a preset range and a passable distance less than a preset distance threshold are determined as path candidate nodes. Each path candidate node is connected with the first current position point to obtain path node line segments, and each path node line segment is subjected to collision test to obtain a test collision result. If the test collision result is that a target path node line segment intersects with the impassable subspace, the path candidate node corresponding to the target path node line segment is removed, and if the test collision result is that the target path node line segment does not intersect with the impassable subspace, the path candidate node corresponding to the target path node line segment is retained to obtain path final nodes. The path final nodes are sequentially connected in order of distances from the path final nodes to the center position point from near to far, and the first current position point is connected with the nearest path final node, the farthest path final node and the center position point respectively to obtain a preliminary path line segment sequence. For the preliminary path line segment sequence, whether adjacent three nodes are approximately collinear is checked, if the adjacent three nodes are approximately collinear, the middle node is deleted, and the process is repeated until the entire preliminary path line segment sequence is traversed to obtain the initial inspection path; whether the adjacent three nodes are approximately collinear is determined based on a vector included angle and a line segment length ratio.

4. The control method of the food safety inspection robot based on industrial vision according to claim 1, wherein, The multi-dimensional perception sensor comprises a visual sensor, a gas sensor, a temperature sensor, and a humidity sensor; the sensor data comprises food images, ambient gas concentration, ambient temperature, and ambient humidity of the target inspection area; Based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot, the food production process is monitored for safety, and a food production safety monitoring result is obtained, including: Based on the food images, the appearance of the food is analyzed, and based on the appearance analysis result, a food quality and safety monitoring result in the food production process is determined; Based on the ambient gas concentration, the concentration of various preset gases is analyzed, and based on the concentration analysis result, an ambient gas safety monitoring result in the food production process is determined; Based on the ambient temperature, an ambient temperature safety monitoring result in the food production process is determined; Based on the ambient humidity, an ambient humidity safety monitoring result in the food production process is determined.

5. The control method of the food safety inspection robot based on industrial vision according to claim 4, characterized in that, The step of analyzing the appearance of the food based on the food images to obtain the appearance analysis result comprises: Performing gray scale processing on the food images to obtain the gray scale value of each pixel point in the food images, and obtaining target pixel points in discrete distribution according to the gray scale value of each pixel point; For each local area range of a preset size, if the target pixel points in the local area range are continuous pixel points, the target pixel points are connected in order to obtain a line contour feature; If the line contour feature does not match the preset contour feature, the pixel point width between the target pixel points in the line contour feature is determined; If the pixel point width is greater than or equal to a preset width threshold, the pixel point overlap rate between the target pixel points in the line contour feature is determined; If the pixel point overlap rate is less than a preset overlap rate threshold, it is determined that the appearance analysis result is that there is a crack in the food appearance.

6. The control method of the food safety inspection robot based on industrial vision according to any one of claims 1 to 5, characterized in that, After the food production safety monitoring result is obtained based on the sensor data collected by the multi-dimensional perception sensor in the food safety inspection robot, it further comprises: Encapsulating the log data of the food safety inspection robot during the inspection process to obtain encapsulated data; the log data includes ambient point cloud information, a target inspection area, initial inspection path movement, obstacle information, obstacle position, path optimization times, a target inspection path, and a food production safety monitoring result; Splitting the robot code of the food safety inspection robot according to the character bit parity to obtain an initial odd bit character sequence and an initial even bit character sequence, and multiplying each character in the initial odd bit character sequence and the initial even bit character sequence by different prime number sequences according to its order value in the ASCII code table to obtain an encrypted odd bit character sequence and an encrypted even bit character sequence; Cross-add the encrypted odd bit character sequence and the encrypted even bit character sequence to obtain an encryption key, and encrypt the encapsulated data based on the encryption key to obtain encrypted data; The robot code and the inspection execution time are taken as a packet header, the encrypted data is taken as packet content for packaging, and the packaged data is chained to a blockchain platform.

7. An industrial vision-based food safety inspection robot control system, characterized in that, The application is applied to the food safety inspection robot control method based on industrial vision in any one of claims 1 to 6; the food safety inspection robot control system based on industrial vision comprises: A point cloud data acquisition module is configured to control the food safety inspection robot to start and obtain environmental point cloud information obtained by the food safety inspection robot based on an industrial vision device after the food safety inspection robot scans the current food production environment in all directions; A path planning module is configured to plan a path 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 is configured to optimize the initial inspection path based on obstacle information of obstacles collected by the industrial vision device during movement of the food safety inspection robot, and obtain a target inspection path; A food monitoring module is configured to control the food safety inspection robot to move to the target inspection area along the target inspection path, monitor the food production process based on sensor data collected by a multi-dimensional perception sensor in the food safety inspection robot, and obtain a food production safety monitoring result; The obstacle information includes shape information, size information, and movement direction; the optimization of the initial inspection path based on the obstacle information of the obstacles collected by the industrial vision device during movement of the food safety inspection robot, and the obtaining of the target inspection path, comprises: Mapping the obstacles to a two-dimensional Cartesian coordinate system with a second current position point of the food safety inspection robot as the origin according to the shape information and the size information; In the two-dimensional Cartesian coordinate system, the passable area excluding the obstacles is divided into multiple connected sub-areas as a separation point, each sub-area is connected through a sub-area path node, and a topological graph of the passable area is constructed; the sub-area path node represents a boundary intersection point of the sub-area; Projecting each node on the initial inspection path into the topological graph, and determining the topological graph node closest to each projection point as the node sequence of the initial inspection path in the topological graph; Expanding outward based on the movement direction and the expansion distance determined based on the movement speed to generate an obstacle buffer zone, and optimizing the initial inspection path based on the node sequence and the obstacle buffer zone to obtain the target inspection path; The optimization of the initial inspection path based on the node sequence and the obstacle buffer zone to obtain the target inspection path comprises: Removing the nodes and edges in the topological graph within the obstacle buffer zone range to obtain a restricted path search space; and recalculating the connection relationship and distance between the remaining nodes in the restricted path search space. starting from a current node in the node sequence, a plurality of candidate path branches are generated within the restricted path search space, with a node in the topological graph corresponding to a next un-inspected area of the initial inspection path as a target; each candidate path branch is composed of a series of connected nodes; for each candidate path branch, a total path length and a direction deviation angle with the initial inspection path direction are calculated; the total path length is a sum of distances between nodes, and the direction deviation angle is obtained by calculating an included angle between a starting direction of the candidate path branch and the initial inspection path direction; a candidate path branch with the shortest total path length and the smallest direction deviation angle is determined as the target inspection path.

8. A non-transitory computer readable storage medium having stored therein a computer software program, characterized in that, The computer software program, when executed by a processor, implements the control method of the food safety inspection robot based on industrial vision as claimed in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Path navigation system of inspection robot

    CN118534936A