Disclosure of Invention
In order to solve the problems in the related art, the application provides a method for selecting an elevator by multiple robots, electronic equipment and a storage medium, and aims to solve the problem of how to reasonably and efficiently schedule multiple robots so as to maximize the utilization of the elevator and avoid the waste of the elevator.
The technical scheme for solving the technical problems is as follows: a method for selecting an elevator by multiple robots comprises the following steps: step 1, selecting the current optimal elevator through a first algorithm according to the allocated elevators to obtain a determined elevator; step 2, requesting to acquire the determined elevator to obtain a request result; step 3, queuing the multiple robots in the request result through a second algorithm to obtain a queuing sequence; and 4, determining that one robot arranged at the head of the queuing sequence uses the determined elevator.
Preferably, the first algorithm is an algorithm for selecting an elevator, and the current optimal elevator is selected by the first algorithm according to the allocated elevator, so as to obtain the determined elevator, and the method specifically includes the following steps: step 101, acquiring self ID information of a robot and position information of the robot under a machine map; step 102, obtaining the allocated elevator ID information and the elevator state information; 103, inputting the self ID information of the robot, the position information of the robot, the ID information of the allocated elevator and the state information of the elevator into a distributed calculator to obtain a score selected by the robot to the allocated elevator; and 104, determining the elevator with the optimal score as the determined elevator.
Preferably, the calculation formula for optimal score is as follows:
TCost=max(αax(,βxT2)+γγxT+δxT4+εxT5
TCost is the cost of the time required by the robot to take the elevator, T1 is the time required by the elevator to reach the current floor of the robot, alpha is a coefficient for adjusting the time required by T1 to the overall scoring weight, T2 is the time required by the robot to reach the elevator entrance, beta is a coefficient for adjusting the time required by T2 to the overall scoring weight, T3 is the time required by the elevator to reach the target floor after receiving the robot, gamma is a coefficient for adjusting the time required by T3 to the overall scoring weight, T4 is the time required by the robot to wait for the elevator to open the door and enter the elevator, delta is a coefficient for adjusting the time required by T4 to the overall scoring weight, T5 is the time for the robot to call the elevator and to influence the whole available elevator group, and epsilon is a coefficient for adjusting the time required by T5 to the overall scoring weight.
Preferably, the elevators are allocated to the robots by a central server.
Preferably, the first algorithm continues to select the elevator with a fixed time sequence before the current best elevator is selected by the first algorithm to obtain the determined elevator.
Preferably, when the first algorithm continues to select elevators by a fixed time sequence, it is determined whether the elevator selected for the first time is the same as the elevator selected for the second time.
Preferably, when the elevator selected for the first time is different from the elevator selected for the second time, the elevator selected for the second time is filtered through a filtering algorithm to obtain the determined elevator.
Preferably, each robot communicates with the other robots in a manner complementary to 2.4g and 4g when requesting to obtain said determined elevator.
A second aspect of an embodiment of the present application provides an electronic device, including:
a processor; and one or more processors; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the methods described above.
A third aspect of the application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method as described above.
The application provides a method for selecting an elevator by multiple robots, electronic equipment and a storage medium, wherein the current optimal elevator is selected by a first algorithm to obtain a determined elevator, and when the determined elevator is requested to be obtained, each robot is mutually communicated with other robots in a 2.4g and 4g complementary mode, so that multiple robots can mutually communicate in real time in many-to-many mode, the robots can use the elevator by themselves in a certain consensus, and the decision of real-time elevator allocation of the multiple robots is realized; the multiple robots which acquire the determined elevator are queued through a second algorithm to obtain a queuing sequence of the multiple robots, the queuing sequence does not need to be transmitted in communication, the robots only share information such as self positions and cost scores, and therefore the robots can continuously transform elevator allocation results which are most suitable for the situation according to field environment transformation, the multiple robots can freely pass through the same building, and multiple robots can simultaneously pass through equipment elevators such as a gate machine, an automatic door, an elevator and the like.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Detailed Description
Preferred embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While the preferred embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms "first," "second," "third," etc. may be used herein to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
The technical solutions of the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for selecting an elevator by multiple robots according to a first embodiment of the present application, as shown in fig. 1, the method includes the following steps:
and step S1, selecting the current optimal elevator through a first algorithm according to the allocated elevator to obtain the determined elevator.
In particular, when allocating elevators, the robots are allocated elevators by a central server, wherein a group of available elevators is given to all robots, respectively, such as: pass-through gates, automatic doors, elevators, the central server may be the same or different for the elevators assigned to each robot. A plurality of robots will each select among the available elevator pools. Normally, a group of available elevators is a group of elevators having the same capacity, e.g. all elevators in the same elevator lobby and reaching the same destination floor are a group of available elevators.
In one of the embodiments, the elevator is obtained in real time by the server of the robot. In other embodiments, the elevator can be input to the robot from the outside, and the elevator can also be dead in the program of the robot through writing; or to determine the elevator at the start of the program of the robot.
In one embodiment, before the current optimal elevator is selected through a first algorithm to obtain the determined elevator, the first algorithm continuously selects the elevator through a fixed time sequence, when the first algorithm continuously selects the elevator through the fixed time sequence, whether the elevator selected for the first time is the same as the elevator selected for the second time is judged, and when the elevator selected for the first time is not the same as the elevator selected for the second time, the elevator selected for the second time is filtered through a filtering algorithm to obtain the determined elevator.
All robots use the same set of selection algorithms, i.e. all robots use the first algorithm to select the current best elevator. The selection of the robot is continuously carried out before the elevator is determined to be available, and the selection is carried out in a short fixed time sequence, namely, before the current optimal elevator is selected through a first algorithm to obtain the determined elevator, the elevator is continuously selected through the first algorithm through the fixed time sequence. And each time the first algorithm gives an optimal solution, namely an optimal elevator is output, if the output result is different from the last time, the output result needs to pass through the filtering algorithm, and if the output result successfully passes through the filtering algorithm, the robot is determined to select the elevator, namely the determined elevator is obtained. The filtering algorithm is used for preventing results from shaking and avoiding that the results selected by the robot are changed all the time. The filtering algorithm is mainly used for reducing the jitter of the optimal elevator caused by the jitter of various data acquired by the robot and the real-world sensor. The filter algorithm can also be used for making an exclusion according to the difference of the filter algorithms of the robots when a plurality of robots select the same elevator at the same time, so that the robot more suitable for the elevator preferentially keeps selecting the elevator.
And step S2, requesting to acquire the determined elevator and obtaining a request result.
In one embodiment, a first time of the determined elevator to the destination is estimated, and a second time of the robot to the destination is estimated; when the time difference between the second time and the first time is equal to a third preset value, the multiple robots respectively request to acquire the determined elevators to obtain request results, wherein the request results can be that the multiple robots simultaneously request the same determined elevator, and the request results can also be that one robot requests the multiple determined elevators.
In one embodiment, the time for starting the request can be dynamically determined, the time for the elevator to reach the destination is estimated, the time for the robot to move to the elevator door is estimated, and if the estimated elevator arrival time is greater than the estimated time for the robot to approach the elevator door, the robot can start to request to acquire the elevator, so that when the robot arrives at the elevator door, the elevator just arrives, and the effect of calling the elevator in advance is achieved, but the effect of calling the elevator not too early is avoided.
The elevator determined in the procedure in which elevator allocation and elevator selection are performed is not known by other robots or the elevator itself, and exists only in the concept of the robot itself.
In the procedure of requesting to pick up an elevator, the robot will transfer said determined elevator in the assignment selection procedure of itself to other robots by mutual communication between the robots. In one example, each robot communicates with the other robots in a manner complementary to 2.4g and 4g when requesting to obtain the determined elevator. Namely, the robots send appointment fields in a multi-robot protocol in a mode of complementing 2.4g and 4g so that a plurality of robots can communicate with each other.
In the process of requesting to acquire the elevator, the request command only needs to be updated when the determined elevator is changed every time, and the request command is continuously sent to other robots at a preset time sequence.
And step S3, queuing the multiple robots in the request result through a second algorithm to obtain a queuing sequence.
Step S4, determining that the robot with the top ranking in the queuing order uses the determined elevator.
Specifically, the second algorithm is a queuing algorithm, all robots use the same queuing algorithm, that is, multiple robots that acquire the determined elevator all use the same queuing algorithm, and when multiple robots select and request the same elevator, the second algorithm ensures the sequential use relationship of the multiple robots. And queuing the plurality of robots of the determined elevator through a second algorithm to obtain the queuing sequence of the plurality of robots. The calculation of the queuing order is based on the robot's own positioning, e.g. calculating the distance and angle to the target elevator, and deciding which robot can pass faster, the second algorithm ranks the robot in the preferred position. Wherein said second algorithm should ensure that the robot currently most suited to use the elevator is ranked first in the queuing order when calculating the queuing result. The queuing sequence does not need to be transmitted in communication, and the robots only share the information such as self positions, cost scores and the like.
When the robot uses the determined elevator, if the current robot can use a certain allocated applied elevator, the process of waiting in line does not need to be continued, wherein the usable conditions at least comprise:
1. the robot has requested and is requesting the elevator;
2. the robot is arranged at the head in the queuing sequence;
3. the situation is reached in a physical environment where the elevator can be used immediately (e.g. the robot has waited for entry at the elevator entrance)
4. The requested elevator is already available (e.g. the elevator has reached the current floor and the door is open and stable).
In the embodiment, the current optimal elevator is selected through a first algorithm to obtain a determined elevator, when the determined elevator is requested to be obtained, each robot is mutually communicated with other robots in a complementary mode of 2.4g and 4g, so that a plurality of robots can mutually communicate in real time in many-to-many mode, the robots can use the elevator by themselves in a certain consensus, and the decision of real-time elevator allocation of the robots is realized; and queuing the plurality of robots of the determined elevator through a second algorithm to obtain a queuing sequence of the plurality of robots, wherein the queuing sequence does not need to be transmitted in communication, and the robots only share the information such as self positions, cost scores and the like, so that the robots can continuously transform the most suitable elevator allocation result according to field environment transformation, and the effect of queuing the plurality of robots to use the elevator is achieved.
Referring to fig. 2, fig. 2 is another schematic flow chart of a method for selecting an elevator by multiple robots according to a second embodiment of the present application. The second embodiment is to add the following steps on the basis of the above embodiments, specifically as follows:
the first algorithm is an algorithm for selecting an elevator, the current optimal elevator is selected through the first algorithm according to the allocated elevator, and the determined elevator comprises the following steps:
step 101, acquiring self ID information of a robot and position information of the robot under a machine map.
Specifically, the ID of each robot is preset by a central station manager, and the central station manager ensures that the ID information of each robot is unique. The position information of the robot is (x1, y1, th1), that is, the coordinates of the robot in the robot map coordinate system.
And 102, acquiring the allocated elevator ID information and the state information of the elevator.
Specifically, the state information of the elevator itself includes the floor where the elevator is currently located, the running speed of the elevator, the destination floor to which the elevator is to arrive, and the like.
Step 103, inputting the self ID information of the robot, the position information of the robot, the ID information of the allocated elevator and the state information of the elevator into a distributed calculator to obtain the score selected by the robot to the allocated elevator.
Specifically, the optimal scoring calculation formula is as follows:
TCost=max(αax(,βxT2)+γγxT+δxT4+εxT5
TCost is the cost of the time required by the robot to take the elevator, T1 is the time required by the elevator to reach the current floor of the robot, alpha is a coefficient for adjusting the time required by T1 to the overall scoring weight, T2 is the time required by the robot to reach the elevator entrance, beta is a coefficient for adjusting the time required by T2 to the overall scoring weight, T3 is the time required by the elevator to reach the target floor after receiving the robot, gamma is a coefficient for adjusting the time required by T3 to the overall scoring weight, T4 is the time required by the robot to wait for the elevator to open the door and enter the elevator, delta is a coefficient for adjusting the time required by T4 to the overall scoring weight, T5 is the time for the robot to call the elevator and to influence the whole available elevator group, and epsilon is a coefficient for adjusting the time required by T5 to the overall scoring weight.
And 104, determining the elevator with the optimal score as the determined elevator.
Specifically, the lower the TCost cost is, the better the score is, when one robot selects a plurality of available elevators, the TCost costs of the plurality of elevators are calculated according to a calculation formula with the optimal score, and the robot selects the elevator with the lowest TCost cost as the optimal elevator, that is, the elevator with the lowest TCost cost as the determined elevator.
In the embodiment, the current optimal elevator is selected through a first algorithm to obtain a determined elevator, when the determined elevator is requested to be obtained, each robot is mutually communicated with other robots in a complementary mode of 2.4g and 4g, so that a plurality of robots can mutually communicate in real time in many-to-many mode, the robots can use the elevator by themselves in a certain consensus, and the decision of real-time elevator allocation of the robots is realized; and queuing the plurality of robots of the determined elevator through a second algorithm to obtain a queuing sequence of the plurality of robots, wherein the queuing sequence does not need to be transmitted in communication, and the robots only share the information such as self positions, cost scores and the like, so that the robots can continuously transform the most suitable elevator allocation result according to field environment transformation, and the effect of queuing the plurality of robots to use the elevator is achieved. The multiple robots and the elevators communicate with each other in real time in many-to-many mode, and the multiple robots respectively and independently calculate local optimal selection results observed by the single robots at the current time. All robots have nearly the same input, i.e. the output results are almost always consistent.
Fig. 3 is a schematic structural diagram of an electronic device shown in an embodiment of the present application.
Referring to fig. 3, electronic device 400 includes memory 410 and processor 420.
The Processor 420 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 410 may include various types of storage units, such as system memory, Read Only Memory (ROM), and permanent storage. Wherein the ROM may store static data or instructions that are needed by the processor 1020 or other modules of the computer. The persistent storage device may be a read-write storage device. The persistent storage may be a non-volatile storage device that does not lose stored instructions and data even after the computer is powered off. In some embodiments, the persistent storage device employs a mass storage device (e.g., magnetic or optical disk, flash memory) as the persistent storage device. In other embodiments, the permanent storage may be a removable storage device (e.g., floppy disk, optical drive). The system memory may be a read-write memory device or a volatile read-write memory device, such as a dynamic random access memory. The system memory may store instructions and data that some or all of the processors require at runtime. Further, the memory 410 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), magnetic and/or optical disks, may also be employed. In some embodiments, memory 410 may include a removable storage device that is readable and/or writable, such as a Compact Disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, min SD card, Micro-SD card, etc.), a magnetic floppy disc, or the like. Computer-readable storage media do not contain carrier waves or transitory electronic signals transmitted by wireless or wired means.
The memory 410 has stored thereon executable code that, when processed by the processor 420, may cause the processor 420 to perform some or all of the methods described above.
The aspects of the present application have been described in detail hereinabove with reference to the accompanying drawings. In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments. Those skilled in the art should also appreciate that the acts and modules referred to in the specification are not necessarily required in the present application. In addition, it can be understood that the steps in the method of the embodiment of the present application may be sequentially adjusted, combined, and deleted according to actual needs, and the modules in the device of the embodiment of the present application may be combined, divided, and deleted according to actual needs.
Furthermore, the method according to the present application may also be implemented as a computer program or computer program product comprising computer program code instructions for performing some or all of the steps of the above-described method of the present application.
Alternatively, the present application may also be embodied as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) having stored thereon executable code (or a computer program, or computer instruction code) which, when executed by a processor of an electronic device (or electronic device, server, etc.), causes the processor to perform part or all of the various steps of the above-described method according to the present application.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the applications disclosed herein may be implemented as electronic hardware, computer software, or combinations of both.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present application, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.