Sorting simulation method and device, electronic equipment and storage medium
By setting different threads in the virtual car of the virtual sorting line and performing dormant processing, the problem of slow speed caused by large calculation load for simulated items in the prior art is solved, and the effect of speeding up the simulation speed is achieved.
Patent Information
- Application Number
- CN202311873603.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-30
- Publication Date
- 2025-07-01
AI Technical Summary
In the prior art, when simulating the item sorting process, the calculation load is large, resulting in slow simulation speed and unable to effectively shorten the simulation time.
The load of simulated calculation is reduced by setting different threads in the virtual car of the virtual sorting line and entering the dormant state when passing through the sorting position without sorting action.
It realizes the reduction of simulation calculation load, shortening simulation time, and speeding up the sorting simulation process, which can speed up the simulation sorting speed by multiple multiples.
Smart Images

Figure CN120235520A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical fields of logistics and artificial intelligence, and particularly to a method, apparatus, electronic device, and storage medium for sorting simulation. Background Art
[0002] With the popularization of online shopping, the sorting process of items has become increasingly important. If a new item sorting strategy is developed, it often cannot be directly put into application online, but needs to be tested before it can be applied in practice.
[0003] If a new item sorting strategy is directly tested in an actual scenario, the cost is very high, and once a problem occurs, it may trigger a serious sorting accident, causing a very bad impact. Based on this, it is necessary to perform item sorting simulation to test the advantages and disadvantages of the strategy. The sorting process often involves multiple virtual trolleys and multiple items in the entire sorting line. Therefore, the computational load on the processor in the electronic device is very large, and this computational load has become an important limiting factor for the simulation speed. How to reduce the computational load of the simulation to shorten the simulation time and accelerate the speed of the simulation process is an urgent problem to be solved. Summary of the Invention
[0004] In view of this, the purpose of the present disclosure is to propose a method, apparatus, electronic device, and storage medium for sorting simulation, and the present disclosure can specifically solve existing problems.
[0005] Based on the above purpose, in a first aspect, the present disclosure proposes a method for sorting simulation, including: in response to receiving an instruction for simulating sorting, when an item is received by a target virtual trolley among multiple virtual trolleys on a virtual sorting line, running a thread of the target virtual trolley, putting the thread of the target virtual trolley into a sleep state, where an execution position of a sorting action among sorting positions on the virtual sorting line belongs to a sorting position outside the sorting positions passed by the virtual trolley in the sleep state; waking up the thread of the target virtual trolley when a preset wake-up condition is met; and ending the thread of the target virtual trolley when the item is transferred from the target virtual trolley to a preset sorting position.
[0006] In a second aspect, a simulation sorting device is further provided, including: a running unit configured to, in response to receiving an instruction for simulation sorting, when an item is received by a target virtual cart among a plurality of virtual carts on a virtual sorting line, run the thread of the target virtual cart and put the thread of the target virtual cart into a sleep state, where an execution position of a sorting action among sorting positions on the virtual sorting line belongs to a sorting position other than the sorting positions passed by the virtual cart in the sleep state; a waking unit configured to wake up the thread of the target virtual cart when a preset waking condition is met; and an ending unit configured to end the thread of the target virtual cart when the item is transferred from the target virtual cart to a preset sorting position.
[0007] In a third aspect, an electronic device is further provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor runs the computer program to implement the method of the first aspect.
[0008] In a fourth aspect, a computer-readable storage medium is further provided, on which a computer program is stored, and the program is executed by a processor to implement the method of any item of the first aspect.
[0009] Generally speaking, the present disclosure has at least the following beneficial effects: By setting different threads for different virtual carts in the simulation sorting process and putting the virtual carts passing through the sorting positions without sorting actions into a temporary sleep state, the load of simulation calculation is reduced, so as to shorten the simulation time and accelerate the speed of the sorting simulation process. For example, the speed of the simulation sorting can be accelerated by several times. Description of the Drawings
[0010] In the drawings, unless otherwise specified, the same reference numerals throughout the several drawings denote the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed according to the present disclosure and should not be regarded as a limitation on the scope of the present disclosure.
[0011] Figure 1 A flowchart showing a method for simulation sorting according to an embodiment of the present disclosure is shown;
[0012] Figure 2 Another flowchart showing a method for simulation sorting according to an embodiment of the present disclosure is shown;
[0013] Figure 3a A schematic diagram of an application scenario of a sorting line according to an embodiment of the present disclosure is shown;
[0014] Figure 3b Another schematic diagram of an application scenario of a sorting line according to an embodiment of the present disclosure is shown;
[0015] Figure 3cShows another application scenario schematic diagram of the sorting line according to an embodiment of the present disclosure;
[0016] Figure 4 Shows a schematic diagram of a device for simulating sorting according to an embodiment of the present disclosure;
[0017] Figure 5 Shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure;
[0018] Figure 6 Shows a schematic diagram of a storage medium provided by an embodiment of the present disclosure. Detailed implementation manners
[0019] The present disclosure will be further described in detail below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. Additionally, it should be noted that for the sake of description, only the parts related to the relevant invention are shown in the drawings.
[0020] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other. The present disclosure will be described in detail below with reference to the drawings and embodiments.
[0021] Figure 1 Shows the method for simulating sorting of the present disclosure. In an embodiment of the present disclosure, the method includes:
[0022] Step S101, in response to receiving an instruction for simulating sorting, when the target virtual trolley among the multiple virtual trolleys on the virtual sorting line receives an item, run the thread of the target virtual trolley and put the thread of the target virtual trolley into a sleep state, where the execution position of the sorting action in the sorting position of the virtual sorting line belongs to the sorting position other than the sorting positions passed by the virtual trolley in the sleep state.
[0023] In this embodiment, when the execution entity of the method for simulating sorting receives an instruction for simulating sorting, if there is a virtual trolley that receives an item, the thread of the virtual trolley, that is, the target virtual trolley, can be run, and the thread of the target virtual trolley is put into a sleep state. The above instruction can be triggered by the user through the user device or can be triggered regularly.
[0024] The simulated sorting and the actual sorting execute exactly the same sorting steps. Each virtual trolley can correspond to a preset thread, that is, a mapping relationship between the thread and the virtual trolley can be established in advance. In this way, before the virtual trolley receives an item, the thread of the virtual trolley can be in a suspended state. When the virtual trolley receives an item, the thread of the virtual trolley can be started. Alternatively, during the simulated sorting process, the above-mentioned execution entity can also create a thread for the virtual trolley that receives an item in real time and then run the thread.
[0025] After running the thread of the target virtual trolley, the target virtual trolley will then go through a sorting stage without preset sorting actions. During this sorting stage, the target virtual trolley can enter the sleep state. At the sorting positions passed during this sorting stage, there are no sorting actions. Specifically, the sorting action refers to a sorting operation that advances the sorting process. For example, the sorting actions include scanning the item code and dropping the item into the grid. Here, dropping into the grid means the item enters the grid opening. There are bags in the grid opening, and through dropping into the grid, the item can be put into the bag, thus completing the sorting.
[0026] The virtual trolley can be understood as the load-carrying platforms adjacent to each other in the front and back positions on the sorting line. During the sleep state of the target virtual trolley, the thread of the target virtual trolley is suspended and waits to be awakened. During the process when the thread of the target virtual trolley is not in the sleep state, the thread can record the position of the virtual trolley. During the sleep process of the thread of the target virtual trolley, the thread may not record the position of the virtual trolley, or the main thread of the simulated sorting can record the position of the virtual trolley.
[0027] Specifically, the item can be conveyed to the virtual trolley through the loading platform on the sorting line. During the virtual sorting process, each item on the loading platform can be conveyed to a virtual trolley. The above-mentioned execution entity can record the loading timestamp and the loading platform number of the item. As the virtual trolley runs forward virtually, the virtual trolley will reach the position for scanning. A scanning device such as a six-sided scanner can be set at this position to scan the item. The scanning device obtains information about the item such as the item number through scanning. Then, the sorting plan table is queried to find the grid opening number of the grid where the item should fall. If the corresponding grid opening number is not found, it is defaulted to go to the return grid opening. The above-mentioned execution entity can record the first scanning timestamp and the scanning device number of the item. As the sorting line runs, the item reaches the grid opening position. The above-mentioned execution entity can query whether the grid corresponding to the found grid opening number can be dropped into. If the query result is yes, a drop instruction can be sent to the virtual trolley to make the virtual trolley drop the item into the grid. If the query result is no, that is, in the locked grid state, the above-mentioned execution entity can find other available grid openings in the item flow direction of the item on the sorting line and record the drop timestamp and the grid opening number where the item is dropped.
[0028] Step S102: When a preset wake-up condition is met, wake up the thread of the target virtual trolley.
[0029] In this embodiment, the above-mentioned execution entity can wake up the thread of the target virtual trolley when a preset wake-up condition is met. The preset wake-up condition can be various conditions. For example, the preset wake-up condition can be that the duration of the current sleep reaches a preset duration. Or, the preset wake-up condition can be that the main thread detects that the target virtual trolley has reached a preset sorting position. For example, the preset sorting position is at least one sorting position in front of the scanning position. During the sorting process, the target virtual trolley will first reach at least one previous sorting position and then reach the scanning position.
[0030] Step S103: When an item is transferred from the target virtual trolley to a preset sorting position, end the thread of the target virtual trolley.
[0031] In this embodiment, the above-mentioned execution entity can end the thread running on the target virtual trolley when the item received by the target virtual trolley leaves the target virtual trolley and is transferred to a preset sorting position, that is, the above-mentioned execution entity can suspend the thread again. In some application scenarios, the preset sorting position can be the end position of the sorting line, such as a grid opening. Each item can be preset with a grid opening number where it should fall. Therefore, the preset sorting position can be the grid opening corresponding to the grid opening number. For example, the grid opening number corresponding to the item can be preset in the sorting plan table.
[0032] The present disclosure can set different threads for different virtual trolleys in the simulated sorting process, and temporarily put the virtual trolleys passing through the sorting positions without sorting actions into sleep, thereby reducing the load of simulation calculation, shortening the simulation time, and accelerating the speed of the sorting simulation process. For example, it can achieve accelerating the sorting simulation speed by multiple times.
[0033] In some optional implementation manners of any embodiment of the present disclosure, the method further includes: establishing a thread pool for simulated sorting. The thread pool includes threads respectively corresponding to multiple virtual trolleys, and there are multiple concurrent threads in the thread pool during simulated sorting.
[0034] In these implementation manners, threads respectively corresponding to multiple virtual trolleys can be generated by establishing a thread pool. The above-mentioned execution entity can establish corresponding threads for each sorting device in the sorting line, that is, establish a mapping relationship between the sorting device and the thread. For example, the thread pool can include 211 threads, among which 200 threads are used to control and record the transportation of virtual trolleys, 10 threads are used to control the loading of 10 loading stations, and 1 thread is used to manage all grid openings.
[0035] There can be multiple concurrent threads in the thread pool. That is, at the same time, there can be at least two threads of virtual trolleys running. The running threads include the threads in the sleeping state.
[0036] These implementation methods can smoothly achieve multi-thread management by establishing a thread pool, which in turn helps to achieve the thread sleep of the virtual trolley.
[0037] Figure 2 Show a method for simulated sorting according to an embodiment of the present disclosure. As Figure 2 shown, the method includes:
[0038] Step S201, in response to receiving an instruction for simulated sorting, when the target virtual trolley among multiple virtual trolleys on the virtual sorting line receives an item, run the thread of the target virtual trolley and put the thread of the target virtual trolley into the sleeping state, where the execution position of the sorting action among the sorting positions on the virtual sorting line belongs to the sorting positions other than those passed by the virtual trolley in the sleeping state.
[0039] Step S202, when the preset wake-up condition is met, wake up the thread of the target virtual trolley.
[0040] Step S203, when the item is transferred from the target virtual trolley to the preset sorting position, end the thread of the target virtual trolley.
[0041] Step S204, in response to any moment in the arrival time sequence, perform the following operations: determine the sorting position corresponding to the arrived moment as the target sorting position; when the target sorting position is the execution position of the sorting action, send an action execution instruction to the target virtual trolley so that the target virtual trolley performs the sorting action corresponding to the target sorting position.
[0042] In this embodiment, there is a time sequence for the target virtual trolley, and this time sequence corresponds to each moment in the sorting process of the simulated sorting. The sorting position corresponding to at least one moment in the time sequence is the execution position of the sorting action. The execution entity of the simulated sorting method can perform preset operations when the current moment reaches any moment in the time sequence. Specifically, the operations can include: determining the sorting position corresponding to the arrived moment, and when the target sorting position is the execution position of the sorting action, determining the sorting action corresponding to this sorting position, and sending an action execution instruction instructing to execute this sorting action to the target virtual trolley.
[0043] Specifically, the sorting positions can include, for example: the position where the virtual trolley arrives, the scanning position, and the grid position. Correspondingly, the sorting actions can include at least one of the following: scanning the code, dropping into the grid.
[0044] For example, the information at each moment in the time sequence may include the moment, the virtual trolley number, and the event type. This event type is also the event type field corresponding to the sorting operation. The sorting operation is not necessarily an operation action. It may be a following operation such as the virtual trolley moving forward, that is, a non-action step. Specifically, the time sequence may include the moments corresponding to all sorting steps of the target virtual trolley on the sorting line after it has loaded the items.
[0045] In the case where the target sorting position is only the position passed by the virtual trolley moving forward rather than the position where the action is executed, the above-mentioned execution entity may send a null operation instruction.
[0046] In this embodiment, when arriving at each sorting position, the sorting action corresponding to the arrived position can be triggered, so as to smoothly implement the sorting process.
[0047] In some optional implementation manners of this embodiment, in response to arriving at any moment in the time sequence, the following operations are performed, including: after waking up the thread of the target virtual trolley, in response to arriving at any moment in the time sequence, the operations are executed through the thread of the target virtual trolley.
[0048] In these optional implementation manners, the above-mentioned execution entity can perform the above operations in the thread of the target virtual trolley after the target virtual trolley is woken up, so as to implement targeted sorting actions for the target virtual trolley through the time sequence and thread corresponding to the target virtual trolley.
[0049] In some optional application scenarios of any implementation manner of this embodiment, the method may further include: when the target virtual trolley of the virtual sorting device receives an item, for the target virtual trolley, determining the position distance between the current sorting position and the end sorting position, and determining the number of virtual trolley lengths included in the position distance; for the target virtual trolley, generating a time sequence including a number of moments, where the adjacent moments in the time sequence differ by one clock cycle, and the clock cycle is the duration for the virtual trolley to travel one virtual trolley length.
[0050] In these application scenarios, when the item is transferred from the loading table to the virtual trolley, the above-mentioned execution entity may calculate the position distance between the current sorting position and the end sorting position, and calculate the number of virtual trolley lengths included in the position distance. Then, the above-mentioned execution entity may generate a time sequence for the target virtual trolley, and the moments in the time sequence are a number of moments.
[0051] For example, when the item is transferred from the loading table to the virtual trolley, the above-mentioned execution entity may calculate how many virtual trolley lengths the distance from the virtual trolley to the nearest scanning device, such as a six-sided scanner, is, and how many virtual trolley lengths the virtual trolley after scanning is to the target grid.
[0052] The above-mentioned execution entity can set a clock cycle T. The clock cycle is the duration for the virtual trolley to travel a virtual trolley length. The frequency of the clock is 1 / T. Every time the clock cycle is reached, it triggers the virtual trolley to move a distance of one virtual trolley length in the direction of the end sorting position. The end sorting position is the last sorting position on the sorting line, such as the grid position.
[0053] For example, the time sequence can be expressed as:
[0054] K*T|virtual trolley number|event type; K*T + 1*T|virtual trolley number|event type; K*T + 2*T|virtual trolley number|event type...
[0055] Among them, K represents the sorting action that the virtual trolley needs to execute at the Kth clock cycle. The scanning code in the sorting action can include at least one of the following: calling the scanning code function, writing the scanning time stamp, and querying the target grid of the item. When dropping into the grid, if the grid is available for dropping, then drop. And write the virtual dropping time of the item, clear the object record of the item on the virtual trolley, and notify the grid thread to store the item object in the corresponding queue. If the grid is in the locked state, then calculate the quantity corresponding to the next target grid and the corresponding time sequence.
[0056] If the current time is not in the time sequence, the virtual trolley thread is in a suspended state. If the virtual trolley is not carrying an item, the thread of the virtual trolley remains in a suspended state until the virtual trolley is occupied by an item transferred from the loading table.
[0057] These application scenarios can use the received item as the trigger condition for generating the time sequence, and determine the time sequence through the sorting distance passed during the sorting process. Moreover, by measuring the sorting distance through the clock cycle corresponding to the virtual trolley length, the sorting distance of the sorting process based on the virtual trolley can be accurately quantified, which helps to improve the accuracy of the simulated sorting.
[0058] In some optional implementation manners of any embodiment of the present disclosure, the method may further include: obtaining the first quantity and the second quantity of multiple simulation time periods within a preset simulation cycle for the simulated sorting, where the first quantity is the number of items actually sorted in each simulation time period, and the second quantity is the number of items simulated to be sorted in each simulation time period; determining the fidelity of the simulated sorting within the preset simulation cycle according to the first quantity and the second quantity.
[0059] In these alternative implementations, the above-mentioned execution entity can adopt various methods to determine the fidelity of simulated sorting within a preset simulation period based on the quantity of items sorted during each simulation period and the actual quantity of items sorted within the preset simulation period. Completion of sorting can mean that a specified sorting action such as dropping into a bin has been performed.
[0060] For example, the above-mentioned execution entity can determine the fidelity within each simulation period of the preset simulation period, average the fidelities of each simulation period, and use the averaged result as the fidelity within the preset simulation period. For example, averaging can be calculating the average value or performing a weighted average. The fidelity within a simulation period can be the result obtained by inputting the first quantity and the second quantity into a fidelity determination model. For example, the fidelity determination model can be a deep neural network model.
[0061] The preset simulation period can be the duration for sorting all items during a transportation shift of logistics. In some cases, the preset simulation period can also be a fixed duration.
[0062] These implementation methods can accurately determine the fidelity of simulated sorting by determining the quantity of items for each period within the preset simulation period.
[0063] In some alternative application scenarios of these alternative implementation methods, determining the fidelity of simulated sorting within the preset simulation period based on the first quantity and the second quantity can include: determining the difference between the first quantity and the second quantity; determining the ratio of the difference to the first quantity, and using the difference between 1 and the ratio as the first period value; using the ratio of the second quantity to the cycle quantity as the second period value, where the cycle quantity is the quantity of items actually sorted and completed within the preset simulation period; determining the product of the period values for each simulation period within the preset simulation period, where the product of the period values is the product of the first period value and the second period value within the simulation period; summing up the products of the period values for each simulation period within the preset simulation period, and obtaining the fidelity of simulated sorting within the preset simulation period based on the summation result.
[0064] In these alternative application scenarios, the above-mentioned execution entity or other electronic devices can set the first quantity as NR i , and the second quantity as NV i , where i = 1, 2, 3, …, h, and h is the number of simulation periods within the preset simulation period.
[0065] The difference between the first quantity and the second quantity can be expressed as NR i - NV i . The ratio of the difference to the first quantity is expressed as The first period value can be expressed as
[0066] The second period value can be expressed as where P is the periodic piece quantity.
[0067] The above-mentioned execution entity can, for each simulation period within a preset simulation cycle, determine the product of the first period value and the second period value within the simulation period to obtain the period value product.
[0068] The above-mentioned execution entity can sum up the period value products of all simulation periods within the preset simulation cycle:
[0069]
[0070] The above-mentioned execution entity can adopt various methods to obtain the fidelity of the simulated sorting within the preset simulation cycle according to the summation result. For example, the above-mentioned execution entity can determine the summation result as the fidelity of the simulated sorting within the preset simulation cycle. Or, the above-mentioned execution entity can input the above summation result into a preset model and obtain the fidelity output from the model. The model can use the summation result to generate the fidelity.
[0071] These application scenarios can accurately quantify the difference between the simulated and the actual sorting through the difference between the actual piece quantity and the simulated piece quantity. Moreover, by using the second piece quantity to obtain the period value product, the numerical weight of the simulated piece quantity can be increased, and a fidelity with a greater relevance to the simulated sorting can be obtained, which helps to accurately quantify the fidelity of the simulated sorting.
[0072] In some optional cases of these optional application scenarios, obtaining the fidelity of the simulated sorting within the preset simulation cycle according to the summation result includes: in the case where the clock cycles of the simulated sorting and the actual sorting are of equal length, determining the quotient obtained by dividing the first period value by the number of simulation periods within the preset simulation cycle; summing up the quotients of each simulation period within the preset simulation cycle, where the summation result is the first fidelity of the simulated sorting and the summation result is the second fidelity of the simulated sorting; determining the fidelity of the simulated sorting within the preset simulation cycle according to the first fidelity and the second fidelity.
[0073] In these optional cases, the above-mentioned execution entity can determine the first fidelity that is not additionally associated with the simulated piece quantity and balance the association of the simulated piece quantity of the second fidelity through the first fidelity.
[0074] In the case where the clock cycle of the simulated sorting is consistent with the clock cycle of the actual sorting, the technical solution of determining the fidelity of the simulated sorting according to the first fidelity and the second fidelity can be executed.
[0075] The above-mentioned first fidelity is equal to the quotient of the first period value and the number of simulation periods within the preset simulation cycle, and this quotient can be expressed as
[0076] The above-mentioned execution entity can sum up the quotients for each simulation period within a preset simulation cycle:
[0077]
[0078] The above-mentioned execution entity can use various methods to determine the fidelity of simulated sorting within a preset simulation cycle according to the first fidelity and the second fidelity. For example, the first fidelity and the second fidelity are weighted according to the weights of the first fidelity and the second fidelity. The above-mentioned execution entity can use the weighted result as the fidelity of simulated sorting. For example, the weights of the first fidelity and the second fidelity can both be 0.5.
[0079] Alternatively, the above-mentioned execution entity can input the first fidelity and the second fidelity into a specified model and obtain the fidelity output from the model. The model can use the first fidelity and the second fidelity to determine the fidelity of simulated sorting.
[0080] In these cases, when the clock cycle of simulated sorting is equal to the clock cycle of actual sorting, the first fidelity can be added to determine the fidelity of simulated sorting, so that the fidelity can be added to the time-related attributes, which helps to improve the accuracy of the fidelity while weakening the influence of the quantity of items obtained by simulation on the fidelity.
[0081] In some alternative implementation manners of this embodiment, the method may further include: determining the magnitude relationship between the fidelity and the fidelity threshold; when the magnitude relationship is that the fidelity is less than the fidelity threshold, adjusting the related parameters of the binning in simulated sorting, and the related parameters of the binning have an impact on the binning time of the items that meet the binning conditions in simulated sorting; when the adjustment result is that the calculated fidelity after adjustment is less than the fidelity threshold, stop adjusting the related parameters of the binning.
[0082] In these alternative implementation manners, the above-mentioned execution entity can adjust the related parameters of the binning when the fidelity does not reach the fidelity threshold. The related parameters of the binning have an impact on the binning time of the items that meet the binning conditions in simulated sorting. For example, the related parameters of the binning can be at least one of the following: the number of items in the bin and the locking duration of the bin. The related parameters of the binning are parameters set for each bin. For a bin, the number of items in the bin refers to the number of items that the bag of the bin can hold, that is, the quantity of items. The locking duration of the bin refers to the locking duration of the bin when the bin meets the locking conditions. In the locked state, the bin does not receive the items transported by the virtual trolley.
[0083] Specifically, the above-mentioned execution entity may adopt at least one of a preset personnel packing model and a preset grid-drop model to adjust the parameters related to grid dropping. The adjustment steps in these implementation manners can be iteratively executed multiple times until the calculated fidelity after adjustment is less than the fidelity threshold, and then the adjustment can be stopped.
[0084] These implementation manners can adjust the grid-drop timing of items in the simulated sorting through the parameters related to grid dropping, thereby improving the fidelity of the simulated sorting.
[0085] As Figure 3a shown, this figure is a schematic diagram of the application scenario of the sorting line. Multiple item loading platforms and multiple trolleys are shown in the figure. The item loading platform can transfer items to the trolleys.
[0086] As Figure 3b shown, this figure is another schematic diagram of the application scenario of the sorting line. It shows that the trolleys pass through the scanning device in sequence, and the scanning device scans the items on the trolleys. Specifically, the scanning device in the figure is a six-sided scanner.
[0087] As Figure 3c shown, this figure is another schematic diagram of the application scenario of the sorting line. It shows that the items loaded on the trolleys fall into the grids.
[0088] The embodiments of the present disclosure provide a device for simulated sorting, which is used to execute the method for simulated sorting in the above-mentioned embodiments. As Figure 4 shown, the device includes: an operation unit 401, configured to respond to receiving an instruction for simulated sorting, when the target virtual trolley among the multiple virtual trolleys on the virtual sorting line receives an item, run the thread of the target virtual trolley, and put the thread of the target virtual trolley into the sleep state, where the execution position of the sorting action in the sorting position on the virtual sorting line belongs to the sorting position other than the sorting positions passed by the virtual trolley in the sleep state; a wake-up unit 402, configured to wake up the thread of the target virtual trolley when the preset wake-up condition is satisfied; an end unit 403, configured to end the thread of the target virtual trolley when the item is transferred from the target virtual trolley to the preset sorting position.
[0089] Optionally, there is a time sequence corresponding to each moment in the sorting process of the simulated sorting for the target virtual trolley; the device further includes: an execution unit, configured to respond to reaching any moment in the time sequence and perform the following operations: determine the sorting position corresponding to the reached moment as the target sorting position; when the target sorting position is the execution position of the sorting action, send an action execution instruction to the target virtual trolley to enable the target virtual trolley to perform the sorting action corresponding to the target sorting position.
[0090] Optionally, the execution unit is further configured to perform the following operations in response to any moment in the arrival time sequence in the following manner: after waking up the thread of the target virtual trolley, in response to any moment in the arrival time sequence, perform operations through the thread of the target virtual trolley.
[0091] Optionally, the device further includes: a first determination unit, configured to, when the target virtual trolley of the virtual sorting device receives an item, determine, for the target virtual trolley, the position distance between the current sorting position and the end sorting position, and determine the number of virtual trolley lengths included in the position distance; a generation unit, configured to generate, for the target virtual trolley, a time sequence including a number of moments, where, among the multiple moments included in the time sequence, the adjacent moments differ by one clock cycle, and the clock cycle is the duration for the virtual trolley to travel one virtual trolley length.
[0092] Optionally, the device further includes: an establishment unit, configured to establish a thread pool for simulated sorting, where the thread pool includes threads corresponding to multiple virtual trolleys respectively, and in the simulated sorting, there are multiple concurrent threads in the thread pool.
[0093] Optionally, the device further includes: an acquisition unit, configured to acquire the first quantity and the second quantity of multiple simulation periods within a preset simulation period for the simulated sorting, where the first quantity is the number of items actually sorted in each simulation period, and the second quantity is the number of items simulated to be sorted in each simulation period; a second determination unit, configured to determine the fidelity of the simulated sorting within the preset simulation period according to the first quantity and the second quantity.
[0094] Optionally, the second determination unit is further configured to perform the following operations to determine the fidelity of the simulated sorting within the preset simulation period according to the first quantity and the second quantity: determine the difference between the first quantity and the second quantity; determine the ratio of the difference to the first quantity, and use the difference between 1 and the ratio as the first period value; use the ratio of the second quantity to the period quantity as the second period value, where the period quantity is the number of items actually sorted within the preset simulation period; determine the product of the period values of each simulation period within the preset simulation period, where the product of the period values is the product of the first period value and the second period value within the simulation period; sum up the products of the period values of each simulation period within the preset simulation period, and obtain the fidelity of the simulated sorting within the preset simulation period according to the summation result.
[0095] Optionally, the second determination unit is further configured to obtain the fidelity of the simulated sorting within a preset simulation period according to the summation result in the following manner: when the clock cycles between the simulated sorting and the actual sorting are of equal length, determine the quotient obtained by dividing the first period value by the number of simulated periods within the preset simulation period; sum the quotients of each simulated period within the preset simulation period, where the summation result is the first fidelity of the simulated sorting and the summation result is the second fidelity of the simulated sorting; determine the fidelity of the simulated sorting within the preset simulation period according to the first fidelity and the second fidelity.
[0096] Optionally, the apparatus is further configured to: determine the magnitude relationship between the fidelity and the fidelity threshold; when the magnitude relationship is that the fidelity is less than the fidelity threshold, adjust the related parameters of the binning in the simulated sorting, where the related parameters of the binning affect the binning time of the items that meet the binning conditions in the simulated sorting; when the adjustment result is that the calculated fidelity after adjustment is less than the fidelity threshold, stop adjusting the related parameters of the binning.
[0097] The sorting simulation apparatus provided in the above embodiments of the present disclosure and the sorting simulation method provided in the embodiments of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0098] The present disclosure embodiment also provides an electronic device corresponding to the sorting simulation method provided in the foregoing embodiment to execute the above sorting simulation method. The present disclosure embodiment does not make any limitations.
[0099] Please refer to Figure 5 , which shows a schematic diagram of an electronic device provided in some embodiments of the present disclosure. As Figure 5 shown, the electronic device 50 includes: a processor 500, a memory 501, a bus 502, and a communication interface 503. The processor 500, the communication interface 503, and the memory 501 are connected through the bus 502; a computer program that can run on the processor 500 is stored in the memory 501, and when the processor 500 runs the computer program, it executes the method provided in any one of the foregoing embodiments of the present disclosure.
[0100] Among them, the memory 501 may include a high-speed random access memory (RAM: Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 503 (which can be wired or wireless), a communication connection is established between the system network element and at least one other network element, and the Internet, wide area network, local area network, metropolitan area network, etc. can be used.
[0101] The bus 502 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 501 is used to store programs. After receiving the execution instruction, the processor 500 executes the program. Any implementation manner of the sorting simulation method disclosed in any embodiment of the present disclosure can be applied to or implemented by the processor 500.
[0102] The processor 500 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 500 or the instructions in the form of software. The above-mentioned processor 500 can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present disclosure can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 501, and the processor 500 reads the information in the memory 501 and combines its hardware to complete the steps of the above method.
[0103] The electronic device provided by the embodiments of the present disclosure and the sorting simulation method provided by the embodiments of the present disclosure are based on the same inventive concept and have the same beneficial effects as the method adopted, run, or implemented by it.
[0104] The present disclosure embodiment also provides a computer-readable storage medium corresponding to the sorting simulation method provided in the foregoing embodiment. Please refer to Figure 6 which shows that the computer-readable storage medium is an optical disc 60, on which a computer program (i.e., a program product) is stored. When the computer program is run by the processor, it will execute the sorting simulation method provided in any of the foregoing embodiments.
[0105] It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other optical and magnetic storage media, which will not be elaborated here one by one.
[0106] The computer-readable storage medium provided by the above embodiments of the present disclosure and the sorting simulation method provided by the embodiments of the present disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by the application programs stored therein.
[0107] It should be noted that:
[0108] In the above text, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device including a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the phrase "including a..." does not exclude the presence of additional identical elements in the process, method, article, or device including such element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present disclosure is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0109] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present disclosure, 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 disc) and includes several instructions for causing a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present disclosure.
[0110] The embodiments of the present disclosure have been described above in conjunction with the accompanying drawings, which are only specific embodiments of the present disclosure. However, the present disclosure is not limited to the above specific embodiments. The above specific embodiments are merely illustrative rather than restrictive. Under the inspiration of the present disclosure, those of ordinary skill in the art can also make many forms without departing from the purpose of the present disclosure and the scope protected by the claims, and all of them fall within the protection scope of the present disclosure.
Claims
1. A method for simulation sorting, characterized in that, Including: In response to receiving an instruction for simulated sorting, when an item is received by a target virtual trolley among multiple virtual trolleys on a virtual sorting line, run the thread of the target virtual trolley, and put the thread of the target virtual trolley into a sleep state, where, among the sorting positions on the virtual sorting line, the execution position of the sorting action belongs to a sorting position other than the sorting positions passed by the virtual trolley in the sleep state; Wake up the thread of the target virtual trolley when a preset wake-up condition is met; End the thread of the target virtual trolley when the item is transferred from the target virtual trolley to a preset sorting position.
2. The method according to claim 1, wherein The target virtual trolley has a time sequence corresponding to each moment during the sorting process of the simulated sorting; The method further includes: In response to reaching any moment in the time sequence, perform the following operations: Determine the sorting position corresponding to the reached moment as the target sorting position; When the target sorting position is the execution position of the sorting action, send an action execution instruction to the target virtual trolley so that the target virtual trolley executes the sorting action corresponding to the target sorting position.
3. The method according to claim 2, wherein The "In response to reaching any moment in the time sequence, perform the following operations" includes: After waking up the thread of the target virtual trolley, in response to reaching any moment in the time sequence, execute the operations through the thread of the target virtual trolley.
4. The method according to any one of claims 2 or 3, characterized in that, The method further includes: When an item is received by the target virtual trolley of the virtual sorting device, for the target virtual trolley, determine the position distance between the current sorting position and the end sorting position, and determine the number of virtual trolley lengths included in the position distance; For the target virtual trolley, generate a time sequence including the number of moments, where, among the multiple moments included in the time sequence, the adjacent moments differ by one clock cycle, and the clock cycle is the duration for the virtual trolley to travel one virtual trolley length.
5. The method according to claim 1, characterized in that, The method further includes: Establish a thread pool for the simulated sorting, where the thread pool includes the threads corresponding to the multiple virtual trolleys respectively, and in the simulated sorting, there are multiple concurrent threads in the thread pool.
6. The method according to claim 1, characterized in that, The method further includes: Obtain the first quantity and the second quantity of multiple simulation periods within a preset simulation period of the simulated sorting, where the first quantity is the number of items actually sorted in each simulation period, and the second quantity is the number of items simulated to be sorted in each simulation period; Determine the fidelity of the simulated sorting within the preset simulation period according to the first quantity and the second quantity.
7. The method according to claim 6, wherein The "Determine the fidelity of the simulated sorting within the preset simulation period according to the first quantity and the second quantity" includes: Determine the difference between the first quantity and the second quantity; Determine the ratio of the difference to the first quantity, and take the difference between 1 and the ratio as the first period value; Take the ratio of the second quantity to the periodic quantity as the second period value, where the periodic quantity is the number of items actually sorted within the preset simulation period. Determine the product of the time period values for each simulation time period within the preset simulation period, where the product of the time period values is the product of the first time period value and the second time period value within the simulation time period; Sum up the products of the time period values for each simulation time period within the preset simulation period, and obtain the fidelity of the simulated sorting within the preset simulation period according to the summation result.
8. The method according to claim 7, characterized in that, The obtaining the fidelity of the simulated sorting within the preset simulation period according to the summation result includes: When the clock cycles between the simulated sorting and the actual sorting are of equal length, determine the quotient obtained by dividing the first time period value by the number of simulation time periods within the preset simulation period; Sum up the quotients for each simulation time period within the preset simulation period, where the summation result is the first fidelity of the simulated sorting, and the summation result is the second fidelity of the simulated sorting; Determine the fidelity of the simulated sorting within the preset simulation period according to the first fidelity and the second fidelity.
9. The method according to any one of claims 6-8, characterized in that, The method further includes: Determine the magnitude relationship between the fidelity and the fidelity threshold; When the magnitude relationship is that the fidelity is less than the fidelity threshold, adjust the related parameters of the binning in the simulated sorting, where the related parameters of the binning affect the binning time of the items that meet the binning conditions in the simulated sorting; When the adjustment result is that the calculated fidelity after adjustment is less than the fidelity threshold, stop adjusting the related parameters of the binning.
10. A device for simulated sorting, characterized in that, Includes: A running unit, configured to, in response to receiving an instruction for simulated sorting, when an item is received by a target virtual cart among multiple virtual carts on a virtual sorting line, run the thread of the target virtual cart and put the thread of the target virtual cart into a sleep state, where, among the sorting positions on the virtual sorting line where sorting actions are executed, the execution position belongs to the sorting positions other than those passed by the virtual cart in the sleep state; A waking unit, configured to wake up the thread of the target virtual cart when a preset waking condition is met; An ending unit, configured to end the thread of the target virtual cart when the item is transferred from the target virtual cart to a preset sorting position.
11. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor runs the computer program to implement the method according to any one of claims 1-9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the method according to any one of claims 1-9.