WebSocket protocol-based robot control method, system, and readable storage medium

Through the robot control method of WebSocket protocol, the problems of resource sharing and batch scheduling in the existing patrol robot system are solved, the secure sharing and intelligence of multi-robot systems are realized, and the robot operation efficiency and information interaction capabilities are improved.

CN115383754BActive Publication Date: 2025-08-22GUANGZHOU GOSUNCN ROBOTICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210945433.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-08
Publication Date
2025-08-22
Estimated Expiration
2042-08-08

AI Technical Summary

Technical Problem

In the existing patrol robot system, the map and task information of each robot cannot be shared, resulting in repetitive map scanning and patrol work, and the lack of large-scale and systematic multi-robot resource sharing and batch scheduling.

Method used

The robot control method based on the WebSocket protocol is adopted to pair the preset login key with the server to establish a communication connection, obtain patrol and scheduling data packets, realize resource sharing and batch operations between robots, and reduce repetitive image scanning and patrol tasks.

Benefits of technology

It realizes the secure sharing and large-scale application of multiple robot resources, improves the intelligence level of multi-robot systems, reduces repetitive work, and improves the robot's operation efficiency and information interaction capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115383754B_ABST
    Figure CN115383754B_ABST
Patent Text Reader

Abstract

The present invention discloses a robot control method, system, and readable storage medium based on the WebSocket protocol. The method includes: establishing a communication connection between at least two robots and a preset server based on the WebSocket protocol, wherein the connection is established by pairing with the server via a preset login key; obtaining a patrol data packet from the server, and controlling the robots to complete corresponding patrol operations based on the patrol data packet, wherein the robots send patrol status data to the server during the patrol process; obtaining a scheduling data packet from the server to identify whether the robots currently need to be scheduled, wherein when the robots currently are scheduled, the robots are controlled to complete the scheduling operations based on the scheduling data packet. The present invention batch-controls robots through WebSocket, ensuring the security conditions for multi-robot resource sharing, reducing repetitive scanning and patrol work, and improving the large-scale application of robots and the intelligence level of multi-robot systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of robotics technology, and more specifically, to a robot control method, system, and readable storage medium based on the WebSocket protocol. Background Art

[0002] A robot is an automated machine. The difference is that this machine has some intelligent capabilities similar to those of humans or living things, such as perception, planning, movement and coordination. It is an automated machine with high flexibility. As people's understanding of the intelligent nature of robotics technology deepens, robotics technology has begun to continuously penetrate into various fields of human activities.

[0003] In line with the application characteristics of these fields, people have developed a variety of special robots and various intelligent robots with perception, decision-making, action and interaction capabilities, such as manufacturing robots and patrol robots. However, the existing patrol robots are independent individuals, and the map, task, action and other information of each robot are not shared. Some robots need to be scanned separately, and some need to perform tasks separately. There is no secure access, large-scale, systematic multi-robot resource sharing and batch scheduling system. Summary of the Invention

[0004] The purpose of the present invention is to provide a robot control method, system and readable storage medium based on the WebSocket protocol, which can batch operate robots through WebSocket, ensure the safety conditions of multi-robot resource sharing, reduce repetitive scanning and patrol work, and improve the large-scale application of robots and the intelligence level of multi-robot systems.

[0005] A first aspect of the present invention provides a robot control method based on the WebSocket protocol, comprising the following steps:

[0006] Establishing a communication connection between at least two of the robots and a preset server based on the WebSocket protocol, wherein the connection is established by pairing with the server through a preset login key;

[0007] Obtaining a patrol data packet from the server, and controlling the robot to complete a corresponding patrol operation based on the patrol data packet, wherein the robot sends patrol status data to the server during the patrol process;

[0008] Obtain a scheduling data packet from the server to identify whether the robot currently needs to be scheduled, wherein when the robot is currently scheduled, control the robot to complete the scheduling task based on the scheduling data packet.

[0009] In this solution, the connection with the server by pairing with a preset login key specifically includes:

[0010] Obtaining the login key based on an identity module preset on the robot;

[0011] Sending an online request to the server based on the login key, wherein:

[0012] If the server successfully pairs with the login key, a communication connection between the robot and the server is established, and the robot successfully goes online;

[0013] If the server fails to pair the login key, the robot fails to go online.

[0014] In this solution, the method further includes obtaining map information scanned by the robot and uploading it to the server, specifically including:

[0015] Obtaining the map information based on a scanning device preset on the robot;

[0016] The map information obtained by the robot corresponding to the scanning is uploaded to the server for forming a map data package.

[0017] In this solution, the method further includes obtaining the map data packet to control the robot to complete the corresponding map scanning operation, specifically including:

[0018] Obtain the map data package for judgment, wherein,

[0019] If the map data packet already contains the map information scanned by the current robot, the current robot does not need to scan the map in the corresponding area;

[0020] If the map data packet does not include the map information currently scanned by the robot, the robot continues to scan the map in the corresponding area.

[0021] In this solution, obtaining the patrol data packet from the server and controlling the robot to complete the corresponding patrol operation based on the patrol data packet specifically includes:

[0022] Acquire the patrol data packet, wherein the patrol data packet includes a patrol route, a patrol action group, and a patrol time;

[0023] Controlling the robot to patrol along the patrol route within the patrol time, and controlling the robot to complete the patrol action group during the patrol process;

[0024] The robot is controlled to send patrol status data to the server during patrolling, wherein the patrol status data includes patrol location information and patrol duration information.

[0025] In this solution, the same scheduling data packet corresponds to at least one robot that needs to be scheduled.

[0026] A second aspect of the present invention further provides a WebSocket protocol-based robot control system, comprising a memory and a processor, wherein the memory comprises a WebSocket protocol-based robot control method program, and when the WebSocket protocol-based robot control method program is executed by the processor, the following steps are implemented:

[0027] Establishing a communication connection between at least two of the robots and a preset server based on the WebSocket protocol, wherein the connection is established by pairing with the server through a preset login key;

[0028] Obtaining a patrol data packet from the server, and controlling the robot to complete a corresponding patrol operation based on the patrol data packet, wherein the robot sends patrol status data to the server during the patrol process;

[0029] Obtain a scheduling data packet from the server to identify whether the robot currently needs to be scheduled, wherein when the robot is currently scheduled, control the robot to complete the scheduling task based on the scheduling data packet.

[0030] In this solution, the connection with the server by pairing with a preset login key specifically includes:

[0031] Obtaining the login key based on an identity module preset on the robot;

[0032] Sending an online request to the server based on the login key, wherein:

[0033] If the server successfully pairs with the login key, a communication connection between the robot and the server is established, and the robot successfully goes online;

[0034] If the server fails to pair the login key, the robot fails to go online.

[0035] In this solution, the method further includes obtaining map information scanned by the robot and uploading it to the server, specifically including:

[0036] Obtaining the map information based on a scanning device preset on the robot;

[0037] The map information obtained by the robot corresponding to the scanning is uploaded to the server for forming a map data package.

[0038] In this solution, the method further includes obtaining the map data packet to control the robot to complete the corresponding map scanning operation, specifically including:

[0039] Obtain the map data package for judgment, wherein,

[0040] If the map data packet already contains the map information scanned by the current robot, the current robot does not need to scan the map in the corresponding area;

[0041] If the map data packet does not include the map information currently scanned by the robot, the robot continues to scan the map in the corresponding area.

[0042] In this solution, obtaining the patrol data packet from the server and controlling the robot to complete the corresponding patrol operation based on the patrol data packet specifically includes:

[0043] Acquire the patrol data packet, wherein the patrol data packet includes a patrol route, a patrol action group, and a patrol time;

[0044] Controlling the robot to patrol along the patrol route within the patrol time, and controlling the robot to complete the patrol action group during the patrol process;

[0045] The robot is controlled to send patrol status data to the server during patrolling, wherein the patrol status data includes patrol location information and patrol duration information.

[0046] In this solution, the same scheduling data packet corresponds to at least one robot that needs to be scheduled.

[0047] The third aspect of the present invention provides a computer-readable storage medium, which includes a robot control method program based on the WebSocket protocol for a machine. When the robot control method program based on the WebSocket protocol is executed by a processor, the steps of a robot control method based on the WebSocket protocol as described in any one of the above items are implemented.

[0048] The present invention discloses a robot control method, system and readable storage medium based on the WebSocket protocol, which have the following beneficial effects: multiple robots are connected based on the WebSocket technology, and robot identity verification is added to ensure the security conditions of multi-robot resource sharing; in addition, a large-scale and systematic multi-robot resource sharing and batch scheduling system is formed; resources and tasks stored on the server can be sent to each robot in real time through the WebSocket technology characteristics, and batch robots can be operated, reducing the work of repetitive scanning and patrol tasks, and improving the large-scale application of robots and the intelligence level of multi-robot systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A flowchart of a robot control method based on the WebSocket protocol of the present invention is shown;

[0050] Figure 2 A block diagram of a robot control system based on the WebSocket protocol of the present invention is shown. DETAILED DESCRIPTION

[0051] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.

[0052] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.

[0053] It should be noted that WebSocket is a full-duplex communication protocol over a single TCP connection, which simplifies data exchange between the client and the server and allows the server to actively push data to the client. In the WebSocket API, the browser and the server only need to complete a handshake to directly establish a persistent connection between the two and conduct two-way data transmission.

[0054] Figure 1 A flowchart of a robot control method based on the WebSocket protocol of the present application is shown.

[0055] like Figure 1 As shown, the present application discloses a robot control method based on the WebSocket protocol, comprising the following steps:

[0056] S102, establishing a communication connection between at least two of the robots and a preset server based on the WebSocket protocol, wherein the connection is established by pairing with the server through a preset login key;

[0057] S104, obtaining a patrol data packet from the server, and controlling the robot to complete a corresponding patrol task based on the patrol data packet, wherein the robot sends patrol status data to the server during the patrol process;

[0058] S106, obtaining a scheduling data packet from the server to identify whether the robot currently needs to be scheduled, wherein when the robot currently needs to be scheduled, controlling the robot to complete the scheduling task based on the scheduling data packet.

[0059] Furthermore, in this embodiment, a communication connection between at least two of the robots and the server is established based on the WebSocket protocol, wherein the server acts as a WebSocket server and the robot acts as a WebSocket client. After each of the robots is turned on, it needs to send an online request to the server and establish a WebSocket long connection with the server, which is equivalent to registering the robot on the server. When the communication connection is established online, it is specifically paired through the login key, that is, when the robot sends an online request, it carries the login key together with the request. When the server successfully pairs the login key, the communication connection is established, otherwise it is not established.

[0060] Furthermore, after the communication connection between the robot and the server is established, the patrol data packet of the server is obtained, and the patrol data packet includes information such as patrol location and patrol time, and then the robot is controlled to complete the corresponding patrol operation based on the patrol data packet. During the patrol operation of the robot, the current patrol status data of the robot can also be uploaded to the server, and the patrol status data includes patrol location and patrol progress, etc.

[0061] Furthermore, the scheduling data of the server can also be obtained. Regardless of whether the robot is currently in a patrol state or an online waiting state, it can be identified based on the scheduling data whether the robot currently needs to be scheduled. When the robot currently identifies that it needs to be scheduled, the robot is controlled to complete the scheduling based on the scheduling data packet.

[0062] According to an embodiment of the present invention, the pairing with the server through a preset login key to connect specifically includes:

[0063] Obtaining the login key based on an identity module preset on the robot;

[0064] Sending an online request to the server based on the login key, wherein:

[0065] If the server successfully pairs with the login key, a communication connection between the robot and the server is established, and the robot successfully goes online;

[0066] If the server fails to pair the login key, the robot fails to go online.

[0067] It should be noted that the login key is stored in the identity module preset by each robot, that is, each robot corresponds to a login key. This ensures that each robot can distinguish its identity when it goes online on the server, and sends an online request to the server based on the login key. When the server pairs the login key, it matches it through the key library pre-stored on the server. If the server successfully pairs the login key, the communication connection between the robot and the server is established, and the robot successfully goes online; if the server fails to pair the login key, the robot fails to go online.

[0068] According to an embodiment of the present invention, the method further includes obtaining map information scanned by the robot and uploading it to the server, specifically comprising:

[0069] Obtaining the map information based on a scanning device preset on the robot;

[0070] The map information obtained by the robot corresponding to the scanning is uploaded to the server for forming a map data package.

[0071] It should be noted that, in this embodiment, the method also includes obtaining the map information, specifically, obtaining the map information through the scanning device provided on the robot, wherein the scanning device can be a panoramic camera, and uploading the map information obtained by the corresponding scanning of the robot to the server, wherein the server will summarize the map information uploaded by each of the robots, complete the map stitching to form the map data packet.

[0072] According to an embodiment of the present invention, the method further includes obtaining the map data packet to control the robot to complete the corresponding map scanning operation, specifically including:

[0073] Obtain the map data package for judgment, wherein,

[0074] If the map data packet already contains the map information scanned by the current robot, the current robot does not need to scan the map in the corresponding area;

[0075] If the map data packet does not include the map information currently scanned by the robot, the robot continues to scan the map in the corresponding area.

[0076] It should be noted that, in this embodiment, the map data packet of the server is obtained to control the robot to complete the corresponding map scanning operation. Since the map data packet includes map information that has been scanned, the map data packet is obtained for judgment. If the map data packet already contains the map information scanned by the current robot, the current robot does not need to scan the map in the corresponding area; if the map data packet does not contain the map information scanned by the current robot, the current robot continues to scan the map in the corresponding area.

[0077] According to an embodiment of the present invention, obtaining the patrol data packet from the server and controlling the robot to complete the corresponding patrol operation based on the patrol data packet specifically includes:

[0078] Acquire the patrol data packet, wherein the patrol data packet includes a patrol route, a patrol action group, and a patrol time;

[0079] Controlling the robot to patrol along the patrol route within the patrol time, and controlling the robot to complete the patrol action group during the patrol process;

[0080] The robot is controlled to send patrol status data to the server during patrolling, wherein the patrol status data includes patrol location information and patrol duration information.

[0081] It should be noted that, in this embodiment, the patrol data packet is obtained to control the robot to complete the corresponding patrol operation, and the obtained patrol data packet includes at least patrol information such as patrol route, patrol action group, patrol time and patrol starting point, wherein, during the actual patrol process, the robot patrols at the patrol starting point to complete the patrol operation according to the patrol route within the patrol time, and completes the patrol action group during the patrol process, such as completing map scanning or knowledge dissemination during the patrol process, etc. Furthermore, during the patrol process, the robot can also send the patrol status data to the server, wherein the patrol status data includes at least the patrol location information and patrol duration information, so that the server can perform data processing and other operations.

[0082] According to an embodiment of the present invention, the same scheduling data packet corresponds to at least one robot that needs to be scheduled.

[0083] It should be noted that, in this embodiment, the scheduling data packet sent by the server includes at least one robot that needs to be scheduled. Specifically, after the robot passes the security authentication and goes online to the server, the user can batch select online and idle robots through the server to issue tasks and map information, so that the robots can execute the same task in batches, which is suitable for robot patrol teams and batch testing scenarios.

[0084] It is worth mentioning that the method also includes identifying the security attributes of the robot's login key, specifically including:

[0085] Before pairing the login key, identify the security attribute value of the login key and make a judgment, wherein:

[0086] If the security attribute value is determined to be a preset attribute value, pairing is performed;

[0087] If the security attribute value is determined to be a non-preset attribute value, it indicates that the robot corresponding to the current login key is in a preset blacklist and will not be paired.

[0088] It should be noted that, in the present embodiment, it is mentioned above that when the server pairs the login key, it matches it through the key library pre-stored by the server. However, in the present embodiment, before pairing the login key, it is necessary to judge the security attribute value of the login key, wherein the preset attribute value is "0001". If the security attribute value is "0001", it indicates that pairing can be performed. If the security attribute value is not "0001", it indicates that the current robot is in the preset blacklist, and pairing will not be performed and connection will be refused, thereby achieving the purpose of robot security access authentication and providing security protection for subsequent resource sharing of multiple robots.

[0089] It is worth mentioning that the method further includes establishing a direct communication connection between at least two of the robots within a preset range.

[0090] It should be noted that after the robot establishes a communication connection with the server, a direct communication connection between at least two of the robots is established within the preset range, including using 4G / 5G mobile communication, or wireless network / Bluetooth communication, etc., and the preset range is taken as "20" meters to improve the robot's operating efficiency and information interaction capabilities. For example, the robot A is "16" meters apart from the robot B. When the robot A is low on power during operation, the robot B connected to it can directly replace the robot A to complete the remaining operating tasks.

[0091] It is worth mentioning that the method further includes obtaining a communication connection permission based on the server, specifically including:

[0092] After the robot establishes a communication connection with the server, the robot obtains the self-communication connection permission based on the server, wherein:

[0093] If the self-communication connection permission is successfully obtained, the current robot may be controlled to directly communicate with the other robots; otherwise, the current robot is controlled not to establish a communication connection with the other robots.

[0094] It should be noted that, in this embodiment, since the robot and the server establish a communication connection based on WebSocket, if the robots want to establish a communication connection, they need to obtain the consent of the server, that is, the self-communication connection permission. Only when the robot obtains the self-communication connection permission can it directly establish a communication connection with the robot that has also obtained the self-communication connection permission. Otherwise, any robot that has not obtained the self-communication connection permission cannot directly establish communication with other robots and can only establish communication with the server. This can ensure that the robot is not controlled by external instructions.

[0095] It is worth mentioning that the scheduling data can be used to identify whether the robot currently needs to be scheduled, specifically including:

[0096] Acquire the identity code value of the robot based on the identity module;

[0097] Obtain the scheduling code value of the scheduling data and pair it with the identity code value, wherein:

[0098] The successfully paired robot serves as the robot to be scheduled and receives the scheduling;

[0099] If pairing is unsuccessful, the scheduling data is returned.

[0100] It should be noted that, in this embodiment, the above step S106 describes obtaining the scheduling data packet of the server to identify whether the current robot needs to be scheduled. Therefore, the scheduling code value of the obtained scheduling data packet is extracted and paired with the identity code value corresponding to the robot. Only the robot that is successfully paired indicates that the robot needs to be scheduled, and then receives the scheduling data to complete the corresponding scheduling task. For the robot that is unsuccessful in pairing, it does not need to be scheduled, and the scheduling data can be directly returned to the server or the scheduling data can be received without corresponding processing.

[0101] Figure 2 A block diagram of a robot control system based on the WebSocket protocol of the present invention is shown.

[0102] like Figure 2 As shown, the present invention discloses a robot control system based on the WebSocket protocol, including a memory and a processor. The memory includes a robot control method program based on the WebSocket protocol. When the robot control method program based on the WebSocket protocol is executed by the processor, the following steps are implemented:

[0103] Establishing a communication connection between at least two of the robots and a preset server based on the WebSocket protocol, wherein the connection is established by pairing with the server through a preset login key;

[0104] Obtaining a patrol data packet from the server, and controlling the robot to complete a corresponding patrol operation based on the patrol data packet, wherein the robot sends patrol status data to the server during the patrol process;

[0105] Obtain a scheduling data packet from the server to identify whether the robot currently needs to be scheduled, wherein when the robot is currently scheduled, control the robot to complete the scheduling task based on the scheduling data packet.

[0106] Furthermore, in this embodiment, a communication connection between at least two of the robots and the server is established based on the WebSocket protocol, wherein the server acts as a WebSocket server and the robot acts as a WebSocket client. After each of the robots is turned on, it needs to send an online request to the server and establish a WebSocket long connection with the server, which is equivalent to registering the robot on the server. When the communication connection is established online, it is specifically paired through the login key, that is, when the robot sends an online request, it carries the login key together with the request. When the server successfully pairs the login key, the communication connection is established, otherwise it is not established.

[0107] Furthermore, after the communication connection between the robot and the server is established, the patrol data packet of the server is obtained, and the patrol data packet includes information such as patrol location and patrol time, and then the robot is controlled to complete the corresponding patrol operation based on the patrol data packet. During the patrol operation of the robot, the current patrol status data of the robot can also be uploaded to the server, and the patrol status data includes patrol location and patrol progress, etc.

[0108] Furthermore, the scheduling data of the server can also be obtained. Regardless of whether the robot is currently in a patrol state or an online waiting state, it can be identified based on the scheduling data whether the robot currently needs to be scheduled. When the robot currently identifies that it needs to be scheduled, the robot is controlled to complete the scheduling based on the scheduling data packet.

[0109] According to an embodiment of the present invention, the pairing with the server through a preset login key to connect specifically includes:

[0110] Obtaining the login key based on an identity module preset on the robot;

[0111] Sending an online request to the server based on the login key, wherein:

[0112] If the server successfully pairs with the login key, a communication connection between the robot and the server is established, and the robot successfully goes online;

[0113] If the server fails to pair the login key, the robot fails to go online.

[0114] It should be noted that the login key is stored in the identity module preset by each robot, that is, each robot corresponds to a login key. This ensures that each robot can distinguish its identity when it goes online on the server, and sends an online request to the server based on the login key. When the server pairs the login key, it matches it through the key library pre-stored on the server. If the server successfully pairs the login key, the communication connection between the robot and the server is established, and the robot successfully goes online; if the server fails to pair the login key, the robot fails to go online.

[0115] According to an embodiment of the present invention, the method further includes obtaining map information scanned by the robot and uploading it to the server, specifically comprising:

[0116] Obtaining the map information based on a scanning device preset on the robot;

[0117] The map information obtained by the robot corresponding to the scanning is uploaded to the server for forming a map data package.

[0118] It should be noted that, in this embodiment, the method also includes obtaining the map information, specifically, obtaining the map information through the scanning device provided on the robot, wherein the scanning device can be a panoramic camera, and uploading the map information obtained by the corresponding scanning of the robot to the server, wherein the server will summarize the map information uploaded by each of the robots, complete the map stitching to form the map data packet.

[0119] According to an embodiment of the present invention, the method further includes obtaining the map data packet to control the robot to complete the corresponding map scanning operation, specifically including:

[0120] Obtain the map data package for judgment, wherein,

[0121] If the map data packet already contains the map information scanned by the current robot, the current robot does not need to scan the map in the corresponding area;

[0122] If the map data packet does not include the map information currently scanned by the robot, the robot continues to scan the map in the corresponding area.

[0123] It should be noted that, in this embodiment, the map data packet of the server is obtained to control the robot to complete the corresponding map scanning operation. Since the map data packet includes map information that has been scanned, the map data packet is obtained for judgment. If the map data packet already contains the map information scanned by the current robot, the current robot does not need to scan the map in the corresponding area; if the map data packet does not contain the map information scanned by the current robot, the current robot continues to scan the map in the corresponding area.

[0124] According to an embodiment of the present invention, obtaining the patrol data packet from the server and controlling the robot to complete the corresponding patrol operation based on the patrol data packet specifically includes:

[0125] Acquire the patrol data packet, wherein the patrol data packet includes a patrol route, a patrol action group, and a patrol time;

[0126] Controlling the robot to patrol along the patrol route within the patrol time, and controlling the robot to complete the patrol action group during the patrol process;

[0127] The robot is controlled to send patrol status data to the server during patrolling, wherein the patrol status data includes patrol location information and patrol duration information.

[0128] It should be noted that, in this embodiment, the patrol data packet is obtained to control the robot to complete the corresponding patrol operation, and the obtained patrol data packet includes at least patrol information such as patrol route, patrol action group, patrol time and patrol starting point, wherein, during the actual patrol process, the robot patrols at the patrol starting point to complete the patrol operation according to the patrol route within the patrol time, and completes the patrol action group during the patrol process, such as completing map scanning or knowledge dissemination during the patrol process, etc. Furthermore, during the patrol process, the robot can also send the patrol status data to the server, wherein the patrol status data includes at least the patrol location information and patrol duration information, so that the server can perform data processing and other operations.

[0129] According to an embodiment of the present invention, the same scheduling data packet corresponds to at least one robot that needs to be scheduled.

[0130] It should be noted that, in this embodiment, the scheduling data packet sent by the server includes at least one robot that needs to be scheduled. Specifically, after the robot passes the security authentication and goes online to the server, the user can batch select online and idle robots through the server to issue tasks and map information, so that the robots can execute the same task in batches, which is suitable for robot patrol teams and batch testing scenarios.

[0131] It is worth mentioning that the method also includes identifying the security attributes of the robot's login key, specifically including:

[0132] Before pairing the login key, identify the security attribute value of the login key and make a judgment, wherein:

[0133] If the security attribute value is determined to be a preset attribute value, pairing is performed;

[0134] If the security attribute value is determined to be a non-preset attribute value, it indicates that the robot corresponding to the current login key is in a preset blacklist and will not be paired.

[0135] It should be noted that, in the present embodiment, it is mentioned above that when the server pairs the login key, it matches it through the key library pre-stored by the server. However, in the present embodiment, before pairing the login key, it is necessary to judge the security attribute value of the login key, wherein the preset attribute value is "0001". If the security attribute value is "0001", it indicates that pairing can be performed. If the security attribute value is not "0001", it indicates that the current robot is in the preset blacklist, and pairing will not be performed and connection will be refused, thereby achieving the purpose of robot security access authentication and providing security protection for subsequent resource sharing of multiple robots.

[0136] It is worth mentioning that the method further includes establishing a direct communication connection between at least two of the robots within a preset range.

[0137] It should be noted that after the robot establishes a communication connection with the server, a direct communication connection between at least two of the robots is established within the preset range, including using 4G / 5G mobile communication, or wireless network / Bluetooth communication, etc., and the preset range is taken as "20" meters to improve the robot's operating efficiency and information interaction capabilities. For example, the robot A is "16" meters apart from the robot B. When the robot A is low on power during operation, the robot B connected to it can directly replace the robot A to complete the remaining operating tasks.

[0138] It is worth mentioning that the method further includes obtaining a communication connection permission based on the server, specifically including:

[0139] After the robot establishes a communication connection with the server, the robot obtains the self-communication connection permission based on the server, wherein:

[0140] If the self-communication connection permission is successfully obtained, the current robot may be controlled to directly communicate with the other robots; otherwise, the current robot is controlled not to establish a communication connection with the other robots.

[0141] It should be noted that, in this embodiment, since the robot and the server establish a communication connection based on WebSocket, if the robots want to establish a communication connection, they need to obtain the consent of the server, that is, the self-communication connection permission. Only when the robot obtains the self-communication connection permission can it directly establish a communication connection with the robot that has also obtained the self-communication connection permission. Otherwise, any robot that has not obtained the self-communication connection permission cannot directly establish communication with other robots and can only establish communication with the server. This can ensure that the robot is not controlled by external instructions.

[0142] It is worth mentioning that the scheduling data can be used to identify whether the robot currently needs to be scheduled, specifically including:

[0143] Acquire the identity code value of the robot based on the identity module;

[0144] Obtain the scheduling code value of the scheduling data and pair it with the identity code value, wherein:

[0145] The successfully paired robot serves as the robot to be scheduled and receives the scheduling;

[0146] If pairing is unsuccessful, the scheduling data is returned.

[0147] It should be noted that, in this embodiment, the above content describes obtaining the scheduling data packet of the server to identify whether the current robot needs to be scheduled. Therefore, the scheduling code value of the obtained scheduling data packet is extracted and paired with the identity code value corresponding to the robot. Only the robot that is successfully paired indicates that the robot needs to be scheduled, and then receives the scheduling data to complete the corresponding scheduling task. For the robot that is unsuccessful in pairing, it does not need to be scheduled, and the scheduling data can be directly returned to the server or only the scheduling data is received without corresponding processing.

[0148] The third aspect of the present invention provides a computer-readable storage medium, which includes a robot control method program based on the WebSocket protocol. When the robot control method program based on the WebSocket protocol is executed by a processor, it implements the steps of a robot control method based on the WebSocket protocol as described in any one of the above items.

[0149] The present invention discloses a robot control method, system and readable storage medium based on the WebSocket protocol, which realizes the access of multiple robots based on the WebSocket technology and adds robot identity verification, thereby ensuring the security conditions for multi-robot resource sharing; in addition, it also forms a large-scale, systematic multi-robot resource sharing and batch scheduling system; resources and tasks stored on the server can be sent to each robot in real time through the WebSocket technology characteristics, so as to perform batch operation of robots, reduce the work of repetitive scanning and patrol tasks, and improve the large-scale application of robots and the intelligence level of multi-robot systems.

[0150] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0151] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0152] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0153] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROMs), random access memories (RWEBSOCKETs), magnetic disks or optical disks, and other media that can store program codes.

[0154] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RWEBSOCKET, magnetic disks or optical disks.

Claims

1. A robot control method based on the WebSocket protocol, characterized in that: The following steps are involved: Establishing a full-duplex communication connection between at least two robots and a preset server based on the WebSocket protocol, wherein the connection is established by pairing a login key preset in the robot identity module with the key library of the server; further comprising obtaining a self-communication connection permission based on the server, specifically comprising: after the robot establishes a communication connection with the server, obtaining the self-communication connection permission based on the server, wherein if the self-communication connection permission is successfully obtained, the current robot can be controlled to directly communicate with the other robots; otherwise, the current robot is controlled not to establish a communication connection with the other robots; Obtaining a patrol data packet from the server, and controlling the robot to complete a corresponding patrol operation based on the patrol data packet, wherein the patrol data packet includes a patrol route, a patrol action group, and a patrol time; controlling the robot to patrol along the patrol route within the patrol time, and controlling the robot to complete the patrol action group during the patrol process; and controlling the robot to send patrol status data to the server during the patrol process, wherein the patrol status data includes patrol location information and patrol duration information; Obtain the scheduling data packet of the server to identify whether the current robot needs to be scheduled, wherein the same scheduling data packet corresponds to at least one robot that needs to be scheduled. When the current robot is scheduled, the robot is controlled to complete the scheduling task based on the scheduling data packet.

2. A robot control method based on the WebSocket protocol according to claim 1, characterized in that: The connecting with the server by pairing with the preset login key specifically includes: Obtaining the login key based on an identity module preset on the robot; Sending an online request to the server based on the login key, wherein: If the server successfully pairs with the login key, a communication connection between the robot and the server is established, and the robot successfully goes online; If the server fails to pair the login key, the robot fails to go online.

3. A robot control method based on the WebSocket protocol according to claim 1, characterized in that: The method further includes obtaining map information scanned by the robot and uploading it to the server, specifically comprising: Obtaining the map information based on a scanning device preset on the robot; The map information obtained by the robot corresponding to the scanning is uploaded to the server for forming a map data package.

4. A WebSocket protocol-based robot control method according to claim 3, characterized in that: The method further includes obtaining the map data packet and controlling the robot to complete the corresponding map scanning operation, specifically including: Obtain the map data package for judgment, wherein, If the map data packet already contains the map information scanned by the current robot, the current robot does not need to scan the map in the corresponding area; If the map data packet does not include the map information currently scanned by the robot, the robot continues to scan the map in the corresponding area.

5. A robot control system based on the WebSocket protocol, characterized in that: The system comprises a memory and a processor, wherein the memory comprises a robot control method program based on the WebSocket protocol, and when the robot control method program based on the WebSocket protocol is executed by the processor, the following steps are implemented: Establishing a full-duplex communication connection between at least two robots and a preset server based on the WebSocket protocol, wherein the connection is established by pairing a login key preset in the robot identity module with the key library of the server; further comprising obtaining a self-communication connection permission based on the server, specifically comprising: after the robot establishes a communication connection with the server, obtaining the self-communication connection permission based on the server, wherein if the self-communication connection permission is successfully obtained, the current robot can be controlled to directly communicate with the other robots; otherwise, the current robot is controlled not to establish a communication connection with the other robots; Obtaining a patrol data packet from the server, and controlling the robot to complete a corresponding patrol operation based on the patrol data packet, wherein the patrol data packet includes a patrol route, a patrol action group, and a patrol time; controlling the robot to patrol along the patrol route within the patrol time, and controlling the robot to complete the patrol action group during the patrol process; and controlling the robot to send patrol status data to the server during the patrol process, wherein the patrol status data includes patrol location information and patrol duration information; Obtain the scheduling data packet of the server to identify whether the current robot needs to be scheduled, wherein the same scheduling data packet corresponds to at least one robot that needs to be scheduled. When the current robot is scheduled, the robot is controlled to complete the scheduling task based on the scheduling data packet.

6. A WebSocket protocol-based robot control system according to claim 5, characterized in that: The connecting with the server by pairing with the preset login key specifically includes: Acquire the login key based on an identity module preset on the robot; Sending an online request to the server based on the login key, wherein: If the server successfully pairs with the login key, a communication connection between the robot and the server is established, and the robot successfully goes online; If the server fails to pair the login key, the robot fails to go online.

7. The WebSocket protocol-based robot control system according to claim 5, characterized in that: The obtaining of the patrol data packet from the server and controlling the robot to complete the corresponding patrol operation based on the patrol data packet specifically includes: Acquire the patrol data packet, wherein the patrol data packet includes a patrol route, a patrol action group, and a patrol time; Controlling the robot to patrol along the patrol route within the patrol time, and controlling the robot to complete the patrol action group during the patrol process; The robot is controlled to send patrol status data to the server during patrolling, wherein the patrol status data includes patrol location information and patrol duration information.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a robot control method program based on the WebSocket protocol. When the robot control method program based on the WebSocket protocol is executed by a processor, the steps of the robot control method based on the WebSocket protocol as described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Network access authentication method for robot, and robot

    CN106792667A

  • Networking control method, home system, server and cleaning robot

    CN111948987A