Workpiece sorting method and device based on spatial sorting, electronic equipment and medium

By using a spatial sorting method, spatial partitioning and sorting are performed using the coordinates of the workpiece center point and a serial number list. This solves the adaptability and efficiency problems of robot sorting technology in personalized and dense workpiece scenarios, and achieves a high-efficiency and stable sorting process.

CN122057705APending Publication Date: 2026-05-19CHONGQING PHOENIX TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING PHOENIX TECHNOLOGY CO LTD
Filing Date
2026-03-20
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing robotic sorting technology has poor adaptability to personalized sorting needs and densely distributed workpieces, resulting in low sorting efficiency and easy workpiece obstruction problems.

Method used

A spatial sorting method is adopted, which obtains the center point coordinates and serial number list of the workpieces to be sorted, and performs spatial partitioning and workpiece sorting by combining sorting dictionary data and width parameters. Flexible sorting logic is configured to adapt to different scenario requirements and avoid workpiece occlusion.

Benefits of technology

It improves the adaptability and efficiency of robot sorting, reduces the impact of workpiece obstruction, meets personalized sorting needs, and enhances sorting stability and success rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122057705A_ABST
    Figure CN122057705A_ABST
Patent Text Reader

Abstract

The invention discloses a workpiece sorting method and device based on spatial sorting, electronic equipment and a medium, and belongs to the technical field of robot sorting. The method comprises the steps that a first list of to-be-sorted workpieces, a second list corresponding to the first list, sorting dictionary data configured according to a robot sorting scene and used for space partition sorting and width parameters used for space partition are obtained, and the first list is a list formed by center point coordinates of the to-be-sorted workpieces; the second list is a list formed by serial numbers of the workpieces to be sorted; and according to the first list, the second list, the sorting dictionary data and the width parameters, space partitioning and workpiece sorting are conducted, and a serial number list of the multiple to-be-sorted workpieces after sorting is obtained. According to the embodiment of the invention, the sorting dictionary data and the width parameter are configured according to the robot sorting scene, so that the task of sorting workpieces by the robot in different scenes can be realized, meanwhile, the workpiece sorting can be executed after space partitioning, and the sorting reliability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of robot sorting technology, specifically relating to a workpiece sorting method based on spatial sorting, a workpiece sorting device based on spatial sorting, an electronic device, and a readable storage medium. Background Technology

[0002] With the rapid development of intelligent manufacturing and smart logistics industries, robot sorting technology, with its advantages of high efficiency and precision, has been widely used in e-commerce warehousing, pharmaceutical sorting, industrial production and other fields, becoming one of the core supporting technologies for improving sorting efficiency and reducing labor costs.

[0003] Currently, in the process of robot sorting, the sorting of workpieces is usually as follows: (1) a sorting method based on fixed rules, such as sequential sorting along the conveyor direction or fixed coordinate axis direction; (2) a sorting method based on simple coordinate distance, which calculates the straight-line distance between the workpiece and the initial position of the robotic arm and sorts them from near to far or from far to near.

[0004] The above sorting method is only applicable to simple scenarios and cannot meet personalized sorting needs. Furthermore, the above sorting method is a general sorting logic. When the workpieces in the picking area are densely distributed, the workpieces may block each other, which may lead to picking failure due to blockage. The positions need to be readjusted, which reduces sorting efficiency and reliability. Summary of the Invention

[0005] The purpose of this application is to provide a workpiece sorting method, apparatus, electronic device and medium based on spatial sorting, which can solve the problems of poor adaptability to current robot sorting scenarios and low sorting efficiency during overall sorting.

[0006] To solve the above-mentioned technical problems, this application is implemented as follows: In a first aspect, embodiments of this application provide a workpiece sorting method based on spatial sorting, the method comprising: Obtain a first list of workpieces to be sorted, a second list corresponding to the first list, sorting dictionary data configured for spatial partitioning and sorting according to the robot sorting scenario, and width parameters for spatial partitioning. The first list is a list composed of the center point coordinates of the workpieces to be sorted, and the second list is a list composed of the serial numbers of the workpieces to be sorted. Based on the first list, the second list, the sorting dictionary data, and the width parameter, spatial partitioning and workpiece sorting are performed to obtain a list of serial numbers of the sorted workpieces to be sorted. The workpieces to be sorted are sorted according to the serial number list.

[0007] Optionally, the step of sorting the workpieces after spatial partitioning according to the first list, the second list, the sorting dictionary data, and the width parameter to obtain the sorted serial number list of the plurality of workpieces to be sorted includes: Space is partitioned according to the first list, the sorting dictionary data, and the width parameter to obtain multiple partition containers sorted according to partition sequence information, wherein the partition sequence information is generated when the multiple partition containers are arranged according to the partition direction defined in the sorting dictionary data; Based on the first list and the second list, each target workpiece in the workpieces to be sorted is assigned to a target container in the plurality of partitioned containers; Within the target container, the sorting dictionary data is used to sort multiple target workpieces contained within the target container to obtain workpiece sorting information in the target container; The sorting information of multiple workpieces is sequentially concatenated according to the partition sequence information to obtain a list of serial numbers of the sorted workpieces.

[0008] Optionally, the step of performing spatial partitioning according to the first list, the sorted dictionary data, and the width parameter to obtain multiple partition containers sorted according to partition sequence information includes: The partitioning direction is determined based on the sorted dictionary data; Determine the maximum and minimum values ​​of the center points of the workpieces to be sorted in the first list in the partition direction; The total width data of the workpiece area to be sorted is determined based on the maximum value and the minimum value; The total width data is spatially partitioned using the width parameter as the partitioning unit, resulting in multiple partition containers arranged according to the partition sequence information.

[0009] Optionally, assigning each target workpiece in the workpieces to be sorted to a target container in the plurality of partitioned containers based on the first list and the second list includes: Traverse the center point coordinates of each workpiece to be sorted in the first list and the serial number of each workpiece to be sorted in the second list to determine the target container corresponding to the target workpiece in the multiple partition containers. Construct tuple data based on the center point coordinates of the target workpiece and its corresponding serial number; The tuple data is assigned to the target container.

[0010] Optionally, the step of sorting multiple target workpieces contained in the target container using the sorting dictionary data to obtain workpiece sorting information in the target container includes: The sorting rules for the workpieces within the partition are determined based on the sorting dictionary data; The multiple target workpieces contained in the target container are sorted according to the sorting rules to obtain the sorting information of the workpieces in the target container.

[0011] Optionally, before performing spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data, and the width parameter, the following steps are included: The number of workpieces to be sorted is determined based on the first list; When the number of workpieces exceeds a preset number, the process of spatial partitioning and workpiece sorting based on the first list, the second list, the sorting dictionary data, and the width parameter is executed.

[0012] Optionally, it also includes: Determine whether the center point coordinates and / or the width parameter in the first list are integer data; When the center point coordinates and / or the width parameter are determined to be integer data, spatial partitioning and workpiece sorting are performed according to the first list, the second list, the sorting dictionary data, and the width parameter. When determining that the center point coordinates and / or the width parameter are not integer data, the center point coordinates and / or the width parameter are converted into integer coordinates, and then spatial partitioning and workpiece sorting are performed according to the first list, the second list, the sorting dictionary data, and the width parameter.

[0013] Secondly, embodiments of this application provide a workpiece sorting device based on spatial sorting, the device comprising: The data acquisition module is used to acquire a first list of workpieces to be sorted, a second list corresponding to the first list, sorting dictionary data configured according to the robot sorting scenario for spatial partitioning and sorting, and width parameters for spatial partitioning. The first list is a list composed of the center point coordinates of the workpieces to be sorted, and the second list is a list composed of the serial numbers of the workpieces to be sorted. The serial number list generation module is used to perform spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data and the width parameter to obtain the serial number list of the sorted workpieces to be sorted. The sorting module is used to sort the workpieces to be sorted according to the serial number list.

[0014] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.

[0015] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.

[0016] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.

[0017] In this embodiment, during the robot sorting process, a first list and a second list, as well as sorting dictionary data and width parameters for performing spatial sorting, can be configured for the workpieces to be sorted. Then, the robot can use the input data to perform spatial partitioning and workpiece sorting, obtaining multiple sorted serial number lists of workpieces. In this process, different sorting dictionary data and width parameters can be configured for different robot sorting scenarios, making the sorting method applicable to workpiece sorting in different types of scenarios and meeting personalized sorting needs. Simultaneously, during the robot sorting process, the sorting dictionary and width parameters can be configured for spatial partitioning, thereby improving sorting efficiency and avoiding the impact of workpiece occlusion in scenarios where workpieces are densely distributed or obstructed. Attached Figure Description

[0018] Figure 1 This is a schematic flowchart of a workpiece sorting method based on spatial sorting in an embodiment of this application; Figure 2 This is a schematic flowchart of a workpiece sorting method based on spatial sorting in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a workpiece sorting device based on spatial sorting in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

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

[0020] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0021] The workpiece sorting method based on spatial sorting provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0022] With the rapid development of intelligent manufacturing and smart logistics industries, robotic sorting technology, with its advantages of high efficiency and precision, has been widely applied in various fields such as e-commerce warehousing, pharmaceutical sorting, and industrial production, becoming one of the core supporting technologies for improving sorting efficiency and reducing labor costs. Currently, the core components of a robotic sorting system mainly include visual inspection, target localization and spatial sorting, and path planning and execution. Among these, target spatial sorting based on visual inspection is a key step that determines sorting efficiency and stability.

[0023] Specifically, in the target space sorting process, existing technical solutions mainly fall into two categories: one is a sorting method based on fixed rules, such as sequential sorting along the conveyor belt direction or a fixed coordinate axis; the other is a sorting method based on simple coordinate distances, which calculates the straight-line distance between the workpiece and the initial position of the robotic arm, and sorts the workpieces from near to far or from far to near. These solutions can meet basic sorting requirements in simple scenarios with high structure and regular workpiece distribution, and have already been applied in some standardized sorting scenarios.

[0024] Existing sorting algorithms mostly employ fixed sorting logic, such as a simple "nearest to farthest" or forward sorting along the assembly line, which cannot adapt to the special requirements of different working environments. For example, in reverse sorting scenarios on the assembly line or workpiece basket anti-obstruction sorting scenarios, it is necessary to adjust the sorting direction according to the assembly line direction and the type of robotic arm (left arm / right arm) (e.g., the right arm needs to be "from right to left, from near to farthest," and the left arm needs to be "from left to right"). However, existing technologies cannot flexibly switch sorting logic, resulting in increased sorting difficulty and decreased efficiency, thus exhibiting poor scenario adaptability and failing to meet personalized sorting needs.

[0025] Furthermore, existing sorting algorithms mostly employ a holistic sorting logic without spatial partitioning of the workpieces. When workpieces are densely distributed in the picking area, they are prone to occlusion. When the robotic arm sorts according to the overall sorting order, occlusion may cause grasping failures, requiring repositioning and reducing sorting efficiency and reliability.

[0026] In this embodiment, a first list of workpieces to be sorted, a second list corresponding to the first list, sorting dictionary data configured according to the robot sorting scenario for spatial partitioning, and a width parameter for spatial partitioning are obtained. The first list is a list composed of the coordinates of the center points of the workpieces to be sorted, and the second list is a list composed of the serial numbers of the workpieces to be sorted. Spatial partitioning and workpiece sorting are performed according to the first list, the second list, the sorting dictionary data, and the width parameter to obtain the sorted serial number list of the plurality of workpieces to be sorted.

[0027] In this embodiment, the sorting dictionary data can be set according to different sorting scenarios and can be edited and changed, thereby flexibly switching sorting logic, reducing sorting difficulty, and meeting personalized sorting needs. At the same time, spatial partitioning sorting can be achieved through sorting dictionary data and width parameters, which can improve sorting stability and avoid the impact of workpiece occlusion compared to the existing overall sorting.

[0028] Reference Figure 1 The diagram illustrates a step-by-step flowchart of a workpiece sorting method based on spatial sorting in an embodiment of this application, which may specifically include the following steps: Step S101: Obtain a first list of workpieces to be sorted, a second list corresponding to the first list, sorting dictionary data for spatial partitioning sorting configured according to the robot sorting scenario, and width parameters for spatial partitioning. The first list is a list composed of the center point coordinates of the workpieces to be sorted, and the second list is a list composed of the serial numbers of the workpieces to be sorted. In practical applications, before performing sorting tasks, the robot can input relevant sorting data, which can include a first list and a second list of workpieces to be sorted. The first column represents the center point coordinates of the workpieces. This data structure can be a Python list, where elements are tuples. Each tuple corresponds to the X and Y coordinates of a workpiece's center point. These coordinates can be integer pixel coordinates, obtained through image object detection or instance segmentation methods. Alternatively, they can be non-pixel coordinates, such as meters, centimeters, or other physical coordinates (including decimals). This type of data can be non-integer. The serial number in the second list uniquely identifies each workpiece, corresponding one-to-one with the center point coordinates in the first list. This data structure can be a Python integer list, such as [int, ...].

[0029] Furthermore, for workpiece sorting, sorting dictionary data and width data for spatial partitioning can be configured. The keys in the sorting dictionary data describe the sorting direction, and the values ​​are Boolean. The keys can be set according to different sorting scenarios, allowing the robot to perform sorting tasks in different scenarios. This meets personalized sorting needs. For example, the sorting dictionary data supports combinations of sorting directions such as "right_to_left" (right to left), "left_to_right" (left to right), "near_to_far" (near to far), and "far_to_near" (far to near). For instance, {"right_to_left": True,"down_to_up": True} indicates sorting from right to left within partitions, and then from bottom to top within each partition.

[0030] The width data can be adjusted according to the workpiece size and distribution density. In one example, the width data can be used as a parameter to divide the image into several spatial partitions. The data structure is integer and the default value is 5 pixels.

[0031] Step S102: Perform spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data, and the width parameter to obtain a list of serial numbers of the sorted workpieces.

[0032] In this embodiment, after obtaining the first list, the second list, the sorting dictionary data, and the width parameter, the robot's built-in sorting algorithm, after inputting the first list, the second list, the sorting dictionary data, and the width parameter, can realize the spatial partitioning and sorting of the workpieces, and then output the serial number list obtained after all the workpieces to be sorted have undergone spatial partitioning and sorting.

[0033] Step S103: Sort the workpieces to be sorted according to the serial number list.

[0034] Then the robot can control the robotic arm to sequentially grab the workpieces with the corresponding serial numbers according to the serial number list and perform workpiece sorting.

[0035] In one embodiment of this application, before performing spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data, and the width parameter, the number of workpieces to be sorted can be determined based on the first list; then, when the number of workpieces is greater than a preset number, the spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data, and the width parameter can be performed.

[0036] In practical applications, a workpiece quantity check branch (quick response for empty workpieces / single workpieces) can be executed before spatial partitioning and sorting to reduce invalid calculations.

[0037] Specifically, the number of workpieces can be determined based on the first list, and then the spatial division of workpieces into regions will be initiated only when the number of workpieces exceeds the preset number.

[0038] For example, calculate the length of the input object_cxcys (the first list) (i.e., the number of workpieces num_objs). If num_objs=0, return an empty list directly; if num_objs=1, return the input object_ids list directly; if num_objs>1, perform subsequent spatial partitioning, workpiece partitioning, partition sorting, and other processes.

[0039] In one embodiment of this application, various types of data exist in the sorting scenario. To facilitate workpiece sorting in different scenarios and simplify sorting processes, after obtaining a first list and a width parameter in the robot, it can be determined whether the center point coordinates in the first list and / or the width parameter are integer data. When the center point coordinates and / or the width parameter are determined to be integer data, spatial partitioning and workpiece sorting are performed according to the first list, the second list, the sorting dictionary data, and the width parameter. When the center point coordinates and / or the width parameter are determined to be non-integer data, the center point coordinates and / or the width parameter are converted to integer coordinates, and then spatial partitioning and workpiece sorting are performed according to the first list, the second list, the sorting dictionary data, and the width parameter.

[0040] In practical applications, non-integer data can be converted to integer data before step S102 is executed. Therefore, the sorting method in this embodiment can be applied to different types of data without requiring additional coordinate transformation modules or anti-occlusion auxiliary equipment. It achieves multi-scenario adaptation and stable sorting through optimization of the robot's built-in algorithm, reducing hardware investment and system maintenance costs.

[0041] In the embodiments of this application, the center point coordinates and / or width parameters can be converted to integers using any of the following methods: (1) Rounding or discarding the decimal and taking the whole number; (2) Enlarging by the same factor and discarding the decimal and taking the whole number; (3) Adding the same offset and discarding the decimal and taking the whole number.

[0042] The embodiments of this application exhibit excellent compatibility and support multiple types of coordinate input. To address the decimal issue of non-pixel coordinates, various integer conversion schemes are designed, enabling direct processing of physical coordinate input without the need for additional conversion modules. This improves compatibility with different vision detection and positioning systems and reduces system integration complexity.

[0043] For example, the robot's input and output parameters are shown below: (1) Input parameters The list of pixel coordinates of the workpiece center point, object_cxcys, is obtained through image object detection or instance segmentation methods. The data structure is a Python list, and the elements are integer tuples [(int,int), ...]. Each tuple corresponds to the pixel X and Y coordinates of the workpiece center point.

[0044] The serial number list object_ids corresponding to the workpiece: corresponds one-to-one with object_cxcys, used to uniquely identify each workpiece, and the data structure is a Python integer list [int, ...].

[0045] Slice_thickness: The pixel width of the partition along the column or along the row. This parameter is used to divide the image into several spatial partitions. The data structure is an integer, and the default value is 5 pixels. It can be adjusted according to the size of the workpiece and the distribution density.

[0046] The sorting logic `sort_order` is a dictionary that defines the spatial sorting rules. The keys describe the sorting direction, and the values ​​are booleans. It supports combinations of sorting directions such as "right_to_left", "left_to_right", "near_to_far", and "far_to_near". For example, `{"right_to_left":True, "down_to_up": True}` means sorting from right to left in the partitions, and then sorting from bottom to top within each partition.

[0047] (2) Output parameters The sorted workpieces correspond to the serial number list objects_ids_sorted: The data structure is a Python integer list [int, ...], and the order of the list is the sorting order of the workpieces. The algorithm caller can control the robotic arm to pick up the workpieces with the corresponding serial numbers in sequence according to this list.

[0048] The core algorithm of the robot is to perform spatial partitioning, workpiece partition allocation, partition sorting, and recursive extraction of sorting based on input parameters, thereby obtaining the output parameter serial number list.

[0049] In this embodiment, during the robot sorting process, a first list and a second list, as well as sorting dictionary data and width parameters for performing spatial sorting, can be configured for the workpieces to be sorted. Then, the robot can use the input data to perform spatial partitioning and workpiece sorting, obtaining multiple sorted serial number lists of workpieces. In this process, different sorting dictionary data and width parameters can be configured for different robot sorting scenarios, making the sorting method applicable to workpiece sorting in different types of scenarios and meeting personalized sorting needs. Simultaneously, during the robot sorting process, the sorting dictionary and width parameters can be configured for spatial partitioning, thereby improving sorting efficiency and avoiding the impact of workpiece occlusion in scenarios where workpieces are densely distributed or obstructed.

[0050] Reference Figure 2 The diagram illustrates a step-by-step flowchart of a workpiece sorting method based on spatial sorting in an embodiment of this application, which may specifically include the following steps: Step S201: Obtain a first list of workpieces to be sorted, a second list corresponding to the first list, sorting dictionary data configured for spatial partitioning and sorting according to the robot sorting scenario, and width parameters for spatial partitioning. The first list is a list composed of the center point coordinates of the workpieces to be sorted, and the second list is a list composed of the serial numbers of the workpieces to be sorted. In practical applications, before performing sorting tasks, the robot can input relevant sorting data, which can include a first list and a second list of workpieces to be sorted. The first column represents the center point coordinates of the workpieces. This data structure can be a Python list, where elements are tuples. Each tuple corresponds to the X and Y coordinates of a workpiece's center point. These coordinates can be integer pixel coordinates, obtained through image object detection or instance segmentation methods. Alternatively, they can be non-pixel coordinates, such as meters, centimeters, or other physical coordinates (including decimals). This type of data can be non-integer. The serial number in the second list uniquely identifies each workpiece, corresponding one-to-one with the center point coordinates in the first list. This data structure can be a Python integer list, such as [int, ...].

[0051] Furthermore, for workpiece sorting, sorting dictionary data and width data for spatial partitioning can be configured. The keys in the sorting dictionary data describe the sorting direction, and the values ​​are Boolean. The keys can be set according to different sorting scenarios, allowing the robot to perform sorting tasks in different scenarios. This meets personalized sorting needs. For example, the sorting dictionary data supports combinations of sorting directions such as "right_to_left" (right to left), "left_to_right" (left to right), "near_to_far" (near to far), and "far_to_near" (far to near). For instance, {"right_to_left": True,"down_to_up": True} indicates sorting from right to left within partitions, and then from bottom to top within each partition.

[0052] The width data can be adjusted according to the workpiece size and distribution density. In one example, the width data can be used as a parameter to divide the image into several spatial partitions. The data structure is integer and the default value is 5 pixels.

[0053] Step S202: Perform spatial partitioning according to the first list, the sorting dictionary data, and the width parameter to obtain multiple partition containers sorted according to the partition sequence information.

[0054] The partition sequence information is generated when the multiple partition containers are arranged according to the partition direction defined in the sorting dictionary data.

[0055] In practical applications, the first list includes the center point coordinates of all workpieces, thus determining the position of each workpiece and the spatial region formed by all workpieces. The sorting dictionary data contains spatial partitioning rules, with the width parameter being the smallest unit of partitioning. Therefore, when retrieving the first list... After sorting the dictionary data and the width parameter, the three can be combined to achieve spatial partitioning and obtain multiple partition containers. The partitioning direction can be predefined in the sorting dictionary data, and then partitioning can be achieved according to the partitioning direction to obtain multiple partition containers. The partition containers can be sorted according to the order of the partitioning direction. This sorting is the partition sequence information, which can be used to splice the order of the workpieces in each container in the subsequent process.

[0056] In one embodiment of this application, the specific process of step S202 is as follows: determine the partitioning direction according to the sorting dictionary data; determine the maximum and minimum values ​​of the center points of the workpieces to be sorted in the first list in the partitioning direction; determine the total width data of the area of ​​the workpieces to be sorted according to the maximum and minimum values; and spatially partition the total width data using the width parameter as the partitioning unit to obtain multiple partition containers arranged according to the partitioning sequence information.

[0057] Specifically, the sorting field data can have a partition direction set in the key, which can be determined based on the sorting dictionary data. By sorting each workpiece to be sorted in the first list according to the partition direction, the maximum and minimum values ​​in the partition direction can be obtained. The maximum and minimum values ​​can determine the total width data of the space, and then the width parameter is used to divide the total width data into multiple partition containers.

[0058] For example: the partitioning direction is determined based on `sort_order` (sorting dictionary data): if the sorting logic is "from left to right" or "from right to left", then partitioning is done along the pixel coordinate X-axis; if it is "from near to far" or "from far to near", then partitioning is done along the pixel coordinate Y-axis. Taking X-axis partitioning as an example, first calculate the maximum value (cx_max) and minimum value (cx_min) of the X-coordinate of the center point of all workpieces, and obtain the pixel width W_roi = cx_max - cx_min of all workpiece regions; then, using `slice_thickness` as the partition width, calculate the number of partitions num_slices = int(W_roi / / slice_thickness) + 1 (foolproofing, ensuring the number of partitions is a positive integer); finally, initialize num_slices empty lists as partition containers `groups`.

[0059] Step S203: Based on the first list and the second list, assign each target workpiece in the workpieces to be sorted to a target container in the plurality of partition containers; The first list contains the center point coordinates of all workpieces, and the second list contains the serial numbers of all workpieces. After spatial partitioning, the range of each partition container can be determined. Then, by combining the first list, it can be determined that each workpiece belongs to each partition container. Finally, by combining the second list, workpiece allocation can be performed.

[0060] In one embodiment of this application, the specific process of step 203 is as follows: the robot traverses the center point coordinates of each workpiece to be sorted in the first list and the serial number of each workpiece to be sorted in the second list to determine the target container corresponding to the target workpiece in the multiple partition containers; constructs tuple data according to the center point coordinates of the target workpiece and the corresponding serial number; and allocates the tuple data to the target container.

[0061] For example: iterate through the coordinates and serial number of each workpiece, calculate its partition number g_id (e.g., when partitioning along the X-axis, g_id = int((x - cx_min) / / slice_thickness)), and add the tuple composed of the workpiece's coordinates and serial number to the corresponding partition container groups[g_id].

[0062] Step S204: Within the target container, the sorting dictionary data is used to sort the multiple target workpieces contained within the target container to obtain workpiece sorting information in the target container. The target container can include target workpieces. The keys in the sorting dictionary data can also set sorting rules within the partitions. Then, combined with the sorting field data, multiple target workpieces can be sorted within each partition in each target container to obtain the workpiece sorting information in the target container.

[0063] In one embodiment of this application, step S204 specifically includes the following steps: determining the sorting rules of the workpieces within the partition according to the sorting dictionary data; sorting the multiple target workpieces contained in the target container according to the sorting rules to obtain the sorting information of the workpieces in the target container.

[0064] Step S205: Sequentially concatenate the sorting information of multiple workpieces according to the partition sequence information to obtain a list of serial numbers of the sorted workpieces to be sorted.

[0065] The partition sequence information is the sorting among multiple partitions, and the multiple workpiece sorting information is the specific workpiece sorting within each partition. By combining the two to achieve sequential concatenation, a list of serial numbers of multiple workpieces to be sorted can be obtained.

[0066] For example, the nine workpieces with serial numbers A to I are divided into three partition containers: partition container 1 (CBA), partition container 2 (DEFG), and partition container 3 (HI). The partition containers are ordered as: partition container 2 - partition container 1 - partition container 3. Then the final serial number list is: DEFGCBAHI.

[0067] Step S206: Sort the workpieces to be sorted according to the serial number list.

[0068] In this embodiment, the sorting logic is flexibly configured through sorting dictionary data, enabling rapid adaptation to different scenarios such as reverse sorting on production lines and workpiece basket anti-obstruction sorting. It also supports the operational requirements of different robotic arms, such as the left arm sorting from left to right and the right arm sorting from right to left, without requiring modification to the core code, resulting in low adaptation costs. Furthermore, the core logic of "partition sorting + recursive extraction" divides densely distributed workpieces into multiple partitions, and the robotic arm sorts them according to the partition order, effectively avoiding grasping failures caused by workpieces obstructing each other, thus improving sorting stability and success rate.

[0069] In this embodiment, performing partitioned sorting reduces the amount of data in a single sorting, further improving sorting efficiency and meeting the real-time requirements of robot sorting.

[0070] The embodiments of this application can also avoid algorithm crashes caused by abnormal parameters through design such as width parameter processing and partition number calculation; at the same time, it can support full scene coverage of 0 to 10 workpieces, improving the robustness of the algorithm.

[0071] In this application embodiment, a "partitioned sorting and flexible configuration" robot sorting target space sorting mechanism is proposed. It achieves rapid adaptation to multiple scenarios through a configurable sorting logic dictionary, and solves the workpiece occlusion problem through the process of "spatial partitioning - intra-partition sorting - recursive extraction". Ultimately, it achieves efficient and stable sorting for different sorting scenarios, different robot arm types and different coordinate inputs, thereby improving the automation level and applicability of robot sorting.

[0072] It should be noted that the workpiece sorting method based on spatial sorting provided in this application embodiment can be executed by a workpiece sorting device based on spatial sorting, or by a control module within the workpiece sorting device for executing the method of loading workpiece sorting based on spatial sorting. This application embodiment uses the execution of the method of loading workpiece sorting based on spatial sorting by a workpiece sorting device as an example to illustrate the workpiece sorting method based on spatial sorting provided in this application embodiment.

[0073] Reference Figure 3 The diagram shows a schematic representation of a workpiece sorting device based on spatial sorting in an embodiment of this application, which may specifically include the following modules: The data acquisition module 301 is used to acquire a first list of workpieces to be sorted, a second list corresponding to the first list, sorting dictionary data configured according to the robot sorting scenario for spatial partitioning and sorting, and width parameters for spatial partitioning. The first list is a list composed of the center point coordinates of the workpieces to be sorted, and the second list is a list composed of the serial numbers of the workpieces to be sorted. The serial number list generation module 302 is used to perform spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data and the width parameter to obtain the serial number list of the sorted multiple workpieces to be sorted. The sorting module 303 is used to sort the workpieces to be sorted according to the serial number list.

[0074] In one embodiment of this application, the serial number list generation module 302 may include: The spatial partitioning submodule is used to perform spatial partitioning according to the first list, the sorting dictionary data and the width parameter to obtain multiple partition containers sorted according to partition sequence information, wherein the partition sequence information is generated when the multiple partition containers are arranged according to the partitioning direction defined in the sorting dictionary data; The workpiece allocation submodule is used to allocate each target workpiece in the workpieces to be sorted to the target container in the plurality of partition containers based on the first list and the second list; The sorting submodule is used to sort multiple target workpieces contained in the target container using the sorting dictionary data to obtain workpiece sorting information in the target container. The splicing submodule is used to sequentially splice multiple workpiece sorting information according to the partition sequence information to obtain a list of serial numbers of the multiple workpieces to be sorted.

[0075] In one embodiment of this application, the spatial partitioning submodule may include: A partitioning direction determination unit is used to determine the partitioning direction based on the sorting dictionary data; The extreme value determination unit is used to determine the maximum and minimum values ​​of the center point of the workpiece to be sorted in the first list in the partition direction; The total width determination unit is used to determine the total width data of the workpiece area to be sorted based on the maximum value and the minimum value. The partition container determination unit is used to spatially partition the total width data using the width parameter as the partition unit, thereby obtaining multiple partition containers arranged according to the partition sequence information.

[0076] In one embodiment of this application, the workpiece allocation submodule may include: The target container determination unit is used to traverse the center point coordinates of each workpiece to be sorted in the first list and the serial number of each workpiece to be sorted in the second list to determine the target container corresponding to the target workpiece in the multiple partition containers. The tuple data construction unit is used to construct tuple data according to the center point coordinates of the target workpiece and the corresponding serial number. A tuple data allocation unit is used to allocate the tuple data to the target container.

[0077] In one embodiment of this application, the sorting submodule may include: The sorting rule determination unit is used to determine the sorting rule of the workpieces within the partition based on the sorting dictionary data; The workpiece sorting unit is used to sort multiple target workpieces contained in the target container according to the sorting rules, so as to obtain the sorting information of the workpieces in the target container.

[0078] In one embodiment of this application, the apparatus further includes: The workpiece quantity determination module is used to determine the number of workpieces to be sorted based on the first list; The execution trigger module is used to perform spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data, and the width parameter when the number of workpieces is greater than a preset number.

[0079] In one embodiment of this application, the apparatus may further include: The data type determination module is used to determine whether the center point coordinates and / or the width parameter in the first list are integer data. The direct execution module is used to perform spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data, and the width parameter when the center point coordinates and / or the width parameter are determined to be integer data. The data conversion execution module is used to convert the center point coordinates and / or the width parameter into integer coordinates when it is determined that the center point coordinates and / or the width parameter are not integer data, and then perform spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data and the width parameter.

[0080] In this embodiment, during the robot sorting process, a first list and a second list, as well as sorting dictionary data and width parameters for performing spatial sorting, can be configured for the workpieces to be sorted. Then, the robot can use the input data to perform spatial partitioning and workpiece sorting, obtaining multiple sorted serial number lists of workpieces. In this process, different sorting dictionary data and width parameters can be configured for different robot sorting scenarios, making the sorting method applicable to workpiece sorting in different types of scenarios and meeting personalized sorting needs. Simultaneously, during the robot sorting process, the sorting dictionary and width parameters can be configured for spatial partitioning, thereby improving sorting efficiency and avoiding the impact of workpiece occlusion in scenarios where workpieces are densely distributed or obstructed.

[0081] The workpiece sorting device based on spatial sorting in this application embodiment can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.

[0082] The workpiece sorting device based on spatial sorting in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.

[0083] The workpiece sorting device based on spatial sorting provided in this application embodiment can achieve... Figures 1 to 2 The various processes implemented by the workpiece sorting device based on spatial sorting in the method embodiment will not be described again here to avoid repetition.

[0084] Optionally, this application embodiment also provides an electronic device, including a processor 1010, a memory 1009, and a program or instructions stored in the memory 1009 and executable on the processor 1010. When the program or instructions are executed by the processor 1010, they implement the various processes of the above-described workpiece sorting method embodiment based on spatial sorting and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0085] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0086] Figure 4 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application. The electronic device 1000 includes, but is not limited to, the following components: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.

[0087] The memory 1009 includes applications and an operating system; the user input unit 1007 may include a touch panel 10071 and other input devices 100072; the input unit 1004 may include an image processor 10041 and a microphone 10042; and the display unit 1006 may include a display panel 10061.

[0088] Those skilled in the art will understand that the electronic device 1000 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1010 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here. This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described spatial sorting-based workpiece sorting method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0089] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0090] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described workpiece sorting method embodiment based on spatial sorting, and can achieve the same technical effect. To avoid repetition, it will not be described again here.

[0091] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0092] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0093] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, 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 is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0094] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A workpiece sorting method based on spatial sorting, characterized in that, Applied to robots, the method includes: Obtain a first list of workpieces to be sorted, a second list corresponding to the first list, sorting dictionary data configured for spatial partitioning and sorting according to the robot sorting scenario, and width parameters for spatial partitioning. The first list is a list composed of the center point coordinates of the workpieces to be sorted, and the second list is a list composed of the serial numbers of the workpieces to be sorted. Based on the first list, the second list, the sorting dictionary data, and the width parameter, spatial partitioning and workpiece sorting are performed to obtain a list of serial numbers of the sorted workpieces to be sorted. The workpieces to be sorted are sorted according to the serial number list.

2. The method according to claim 1, characterized in that, The process of spatially partitioning according to the first list, the second list, the sorting dictionary data, and the width parameter, followed by workpiece sorting, yields a list of sorted serial numbers for the plurality of workpieces to be sorted, including: Space is partitioned according to the first list, the sorting dictionary data, and the width parameter to obtain multiple partition containers sorted according to partition sequence information, wherein the partition sequence information is generated when the multiple partition containers are arranged according to the partition direction defined in the sorting dictionary data; Based on the first list and the second list, each target workpiece in the workpieces to be sorted is assigned to a target container in the plurality of partitioned containers; Within the target container, the sorting dictionary data is used to sort multiple target workpieces contained within the target container to obtain workpiece sorting information in the target container; The sorting information of multiple workpieces is sequentially concatenated according to the partition sequence information to obtain a list of serial numbers of the sorted workpieces to be sorted.

3. The method according to claim 2, characterized in that, The step of partitioning the space according to the first list, the sorted dictionary data, and the width parameter to obtain multiple partition containers sorted according to the partition sequence information includes: The partitioning direction is determined based on the sorted dictionary data; Determine the maximum and minimum values ​​of the center points of the workpieces to be sorted in the first list in the partition direction; The total width data of the workpiece area to be sorted is determined based on the maximum value and the minimum value; The total width data is spatially partitioned using the width parameter as the partitioning unit, resulting in multiple partition containers arranged according to the partition sequence information.

4. The method according to claim 2, characterized in that, The step of allocating each target workpiece in the workpieces to be sorted to a target container in the plurality of partitioned containers based on the first list and the second list includes: Traverse the center point coordinates of each workpiece to be sorted in the first list and the serial number of each workpiece to be sorted in the second list to determine the target container corresponding to the target workpiece in the multiple partition containers. Construct tuple data based on the center point coordinates of the target workpiece and its corresponding serial number; The tuple data is assigned to the target container.

5. The method according to claim 2, characterized in that, Within the target container, the sorting dictionary data is used to sort multiple target workpieces contained within the target container to obtain workpiece sorting information in the target container, including: The sorting rules for the workpieces within the partition are determined based on the sorting dictionary data; The multiple target workpieces contained in the target container are sorted according to the sorting rules to obtain the sorting information of the workpieces in the target container.

6. The method according to any one of claims 1 to 5, characterized in that, Before performing spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data, and the width parameter, the process includes: The number of workpieces to be sorted is determined based on the first list; When the number of workpieces exceeds a preset number, the process of spatial partitioning and workpiece sorting based on the first list, the second list, the sorting dictionary data, and the width parameter is executed.

7. The method according to any one of claims 1 to 5, characterized in that, Also includes: Determine whether the center point coordinates and / or the width parameter in the first list are integer data; When the center point coordinates and / or the width parameter are determined to be integer data, spatial partitioning and workpiece sorting are performed according to the first list, the second list, the sorting dictionary data, and the width parameter. When determining that the center point coordinates and / or the width parameter are not integer data, the center point coordinates and / or the width parameter are converted into integer coordinates, and then spatial partitioning and workpiece sorting are performed according to the first list, the second list, the sorting dictionary data, and the width parameter.

8. A workpiece sorting device based on spatial sorting, characterized in that, The device, applied to robots, includes: The data acquisition module is used to acquire a first list of workpieces to be sorted, a second list corresponding to the first list, sorting dictionary data configured according to the robot sorting scenario for spatial partitioning and sorting, and width parameters for spatial partitioning. The first list is a list composed of the center point coordinates of the workpieces to be sorted, and the second list is a list composed of the serial numbers of the workpieces to be sorted. The serial number list generation module is used to perform spatial partitioning and workpiece sorting according to the first list, the second list, the sorting dictionary data and the width parameter to obtain the serial number list of the sorted workpieces to be sorted. The sorting module is used to sort the workpieces to be sorted according to the serial number list.

9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the spatial sorting-based workpiece sorting method as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the spatial sorting-based workpiece sorting method as described in any one of claims 1 to 7.