Communication method and device, robot and storage medium
By introducing shim layer technology between the application and the network server, the compatibility problem between the application and the network server with different network communication protocols is solved, and more efficient and flexible network communication is achieved.
Patent Information
- Application Number
- CN202311048689.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, communication between applications and network servers has the challenge of being compatible with different network communication protocols, resulting in low compatibility, bloated applications and high development pressure.
Through the shim layer technology, communication interface services are provided between the application and the network server with different communication protocols, and the corresponding shim layer is determined from the network server, and the application is controlled to communicate with the network server through the shim layer.
It improves the compatibility of applications with different network communication protocols of network servers, reduces the complexity and development costs of applications, and achieves more flexible and efficient network communication.
Smart Images

Figure CN119496834A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and more specifically, to a communication method, device, robot and storage medium. Background Art
[0002] With the development of communication technology, network servers have more and more diverse network communication protocols. At present, in many cases, due to the different product positioning of different devices, different devices may use different network communication protocols. Therefore, in the relevant technology, the communication between applications and network servers faces the challenge of compatibility with different network communication protocols. Summary of the invention
[0003] In view of the above problems, the present application proposes a communication method, device, robot and storage medium, which can provide communication interface services through shim layer technology during the communication between the application and the network server with different communication protocols, thereby improving the compatibility of the application with different network communication protocols of the network server.
[0004] In a first aspect, an embodiment of the present application provides a communication method, which is applied to a robot, wherein the robot is connected to at least one network server, the operating system of the robot includes an application and at least one shim layer, the at least one network server corresponds one-to-one to the at least one shim layer, and the at least one network server respectively corresponds to a different network communication protocol, the method comprising: determining a first network server from the at least one network server; determining a first shim layer corresponding to the first network server from the at least one shim layer; and controlling the application to communicate with the first network server through the first shim layer.
[0005] In the second aspect, an embodiment of the present application provides a communication device, which is applied to a robot, wherein the robot is connected to at least one network server, the operating system of the robot includes an application and at least one shim layer, the at least one network server corresponds to the at least one shim layer one-to-one, and the at least one network server corresponds to a different network communication protocol. The device includes: a first network server determination module, a first shim layer determination module, and an application and network server communication module. Among them, the first network server determination module is used to determine the first network server from the at least one network server; the first shim layer determination module is used to determine the first shim layer corresponding to the first network server from the at least one shim layer; the application and network server communication module is used to control the application to communicate with the first network server through the first shim layer.
[0006] In a third aspect, an embodiment of the present application provides a robot, comprising a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
[0008] The communication method, device, robot and storage medium provided in the embodiments of the present application determine a first network server from at least one network server; determine a first shim layer corresponding to the first network server from at least one shim layer; control an application to communicate with the first network server through the first shim layer, and then provide communication interface services through the shim layer technology during the communication between the application and the network server with different communication protocols, thereby improving the compatibility of the application with different network communication protocols of the network server. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 A schematic diagram of the hardware structure of a robot provided in an embodiment of the present application is shown;
[0011] Figure 2 A schematic diagram of the mechanical structure of a robot provided in one embodiment of the present application is shown;
[0012] Figure 3 A schematic diagram showing communication between a robot and a network server provided by an embodiment of the present application is shown;
[0013] Figure 4 A schematic diagram showing communication between an application and a network server provided in an embodiment of the present application is shown;
[0014] Figure 5 A schematic diagram showing communication between an application and a network server provided in an embodiment of the present application is shown;
[0015] Figure 6 A flow chart of a communication method provided by an embodiment of the present application is shown;
[0016] Figure 7 A schematic diagram showing communication between an application and a network server provided in an embodiment of the present application is shown;
[0017] Figure 8 A schematic diagram showing communication between an application and a network server provided in an embodiment of the present application is shown;
[0018] Fig. 9 A flow chart of a communication method provided by an embodiment of the present application is shown;
[0019] Fig.10 A flow chart of a communication method provided by an embodiment of the present application is shown;
[0020] Fig.11 A flow chart of a communication method provided by an embodiment of the present application is shown;
[0021] Fig.12 A flow chart of a communication method provided by an embodiment of the present application is shown;
[0022] Fig.13 A flow chart of a communication method provided by an embodiment of the present application is shown;
[0023] Fig.14 A flow chart of a communication method provided by an embodiment of the present application is shown;
[0024] Fig.15 A module block diagram of a communication device provided by an embodiment of the present application is shown;
[0025] Fig.16 A block diagram of a robot according to an embodiment of the present application for executing a communication method according to an embodiment of the present application is shown;
[0026] Fig.17 A storage unit for storing or carrying program codes for implementing a communication method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0028] With the development of science and technology, different network communication services can have different network communication protocols. Therefore, applications face the challenge of being compatible with different network communication protocols. Developing applications to support different communication protocols will cause bloated applications and continuous development pressure. In the related art, an adaptation layer technology for switching according to different communication protocols is proposed, but the adaptation layer technology still requires the development of different communication adapter modules according to different communication protocols. In addition, during the operation of the application, the adaptation layer technology cannot perform reasonable operations in real time to switch and start the communication adapter module after the application stops running. Therefore, in the related art, the communication between the application and the network server faces the challenge of being compatible with different network communication protocols.
[0029] In response to the above problems, the inventors have discovered after long-term research and proposed the communication method, device, robot and storage medium provided in the embodiments of the present application. Through the shim layer technology, communication interface services are provided in the process of communication between the application and the network server with different communication protocols, thereby improving the compatibility of the application with different network communication protocols of the network server.
[0030] See also Figure 1 , Figure 1 A schematic diagram of the hardware structure of a robot provided for one of the embodiments of the present application. The robot 100 may be any one of a variety of robot forms, including but not limited to at least one of a wheeled robot, a legged robot, a tracked robot, a crawling robot, a peristaltic robot or a swimming robot. For example, the robot 100 may be a legged robot, a wheeled robot, or a robot that combines a legged robot with a wheeled robot. Among them, legged robots include monopedal, bipedal or multi-legged robots. A multi-legged robot refers to a legged robot with three or more legs, for example, a multi-legged robot may be a quadrupedal robot. A robot refers to a machine that can perform work semi-autonomously or fully autonomously. Robots are not limited to humanoid machine devices, but may also include robots of bionic configurations such as dogs, horses, apes or monkeys. For example, the robot may be a four-legged robot horse, or the robot may not be of a bionic configuration. In Figure 1In the illustrated embodiment, the robot 100 may include at least one of a mechanical unit 101, a communication unit 102, a sensor unit 103, an interface unit 104, a memory 105, a display unit 106, an input unit 107, a processor 110, or a power supply 111. The various components of the robot 100 may be connected in any manner, including wired or wireless connections. Those skilled in the art will appreciate that Figure 1 The specific structure of the robot 100 shown in the figure does not constitute a limitation of the robot 100. The robot 100 may include more or fewer components than shown in the figure. Some components are not essential components of the robot 100 and can be omitted or combined as needed without changing the essence of the invention.
[0031] Among them, the robot 100 can be connected to at least one network server, the operating system of the robot 100 can include an application and at least one shim layer, the at least one network server can correspond one-to-one with the at least one shim layer, and the at least one network server each corresponds to a different network communication protocol.
[0032] Figure 2 Schematic diagram of the mechanical structure of a robot provided according to an embodiment of the present application. Figure 1 and Figure 2 The various components of the robot 100 are introduced in detail:
[0033] The mechanical unit 101 is the hardware of the robot 100. Figure 1 As shown, the mechanical unit 101 may include a driving plate 1011, a motor 1012, and a mechanical structure 1013. Figure 2 As shown, the mechanical structure 1013 may include a body 1014, extendable legs 1015, and feet 1016. The body included in the robot 100 may be a body 1014, or may include a body 1014, extendable legs 1015, or feet 1016. In other embodiments, the mechanical structure 1013 may also include one or more of an extendable mechanical arm (not shown), a rotatable head structure 1017, a swingable tail structure 1018, a load-bearing structure 1019, or a camera structure 1020. It should be noted that each component module of the mechanical unit 101 may be one or more, and may be arranged according to specific circumstances. For example, there may be four legs 1015, and each leg 1015 may be configured with two motors 1012.
[0034] The communication unit 102 can be used to receive and send signals, and can also communicate with the network and other devices, for example, after receiving the instruction information sent by the remote control or other robot 100 to move in a specific direction at a specific speed according to a specific gait, the communication unit 102 is transmitted to the processor 110 for processing. The communication unit 102 may include a WiFi module, a 4G module, a 5G module, a Bluetooth module, an infrared module, etc.
[0035] The sensing unit 103 is used to obtain information data about the environment around the robot 100 and to monitor parameter data of each component inside the robot 100, and send the information data to the processor 110. The sensing unit 103 includes a variety of sensors, such as sensors for obtaining information about the surrounding environment: laser radar (for long-range object detection, distance determination and / or speed value determination), millimeter wave radar (for short-range object detection, distance determination and / or speed value determination), camera, infrared camera, global navigation satellite system (GNSS, Global Navigation Satellite System), etc. For example, sensors for monitoring each component inside the robot 100: inertial measurement unit (IMU, Inertial Measurement Unit) (for measuring the value of velocity value, acceleration value and angular velocity value), plantar sensor (for monitoring the position of the plantar force point, plantar posture, ground contact force size and direction), temperature sensor (for detecting component temperature). As for other sensors such as load sensors, touch sensors, motor angle sensors, torque sensors, etc. that can also be configured for the robot 100, they will not be repeated here.
[0036] The interface unit 104 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more components within the robot 100, or may be used to output (e.g., data information, power, etc.) to an external device. The interface unit 104 may include a power port, a data port (such as a USB port), a memory card port, a port for connecting a device having an identification module, an audio input / output (I / O) port, a video I / O port, etc.
[0037] The memory 105 is used to store software programs and various data. The memory 105 may mainly include a program storage area and a data storage area, wherein the program storage area may store operating system programs, motion control programs, application programs (such as text editors), etc.; the data storage area may store data generated by the robot 100 during use (such as various sensor data acquired by the sensor unit 103, log file data), etc. In addition, the memory 105 may include a high-speed random access memory, and may also include a non-volatile memory, such as a disk storage, a flash memory, or other volatile solid-state storage.
[0038] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0039] The input unit 107 can be used to receive input digital or character information. Specifically, the input unit 107 may include a touch panel 1071 or other input devices 1072. The touch panel 1071, also known as a touch screen, can collect the user's touch operation (such as the user's operation on the touch panel 1071 or near the touch panel 1071 using the palm, finger or suitable accessory), and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include two parts: a touch detection device 1073 and a touch controller 1074. Among them, the touch detection device 1073 detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller 1074; the touch controller 1074 receives the touch information from the touch detection device 1073, converts it into contact coordinates, and then sends it to the processor 110, and can receive and execute commands sent by the processor 110. In addition to the touch panel 1071, the input unit 107 may also include other input devices 1072. Specifically, other input devices 1072 may include but are not limited to one or more of a remote control operating handle, etc., which are not specifically limited here.
[0040] Furthermore, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of the touch event. Then, the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Figure 1 In the embodiment, the touch panel 1071 and the display panel 1061 are used as two independent components to respectively realize the input and output functions. However, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions, which is not limited here.
[0041] The processor 110 is the control center of the robot 100 , and uses various interfaces and lines to connect the various components of the entire robot 100 , and controls the robot 100 as a whole by running or executing software programs stored in the memory 105 , and calling data stored in the memory 105 .
[0042] The power supply 111 is used to supply power to each component. The power supply 111 may include a battery and a power control board. The power control board is used to control functions such as battery charging, discharging, and power consumption management. Figure 1 In the illustrated embodiment, the power supply 111 is electrically connected to the processor 110. In other embodiments, the power supply 111 may also be electrically connected to the sensor unit 103 (such as a camera, a radar, a speaker, etc.) and the motor 1012. It should be noted that each component may be connected to a different power supply 111 or powered by the same power supply 111.
[0043] On the basis of the above embodiments, in some embodiments, the terminal device can be used to communicate with the robot 100. When the terminal device communicates with the robot 100, the terminal device can send instruction information to the robot 100. The robot 100 can receive the instruction information through the communication unit 102, and can transmit the instruction information to the processor 110 after receiving the instruction information, so that the processor 110 can process the target speed value according to the instruction information. The terminal device includes but is not limited to: a mobile phone with an image capture function, a tablet computer, a server, a personal computer, a wearable smart device, and other electrical devices.
[0044] The instruction information may be determined according to preset conditions. In one embodiment, the robot 100 may include a sensing unit 103, and the sensing unit 103 may generate instruction information according to the current environment in which the robot 100 is located. The processor 110 may determine whether the current speed value of the robot 100 meets the corresponding preset conditions according to the instruction information. If satisfied, the current speed value and the current gait of the robot 100 will be maintained; if not satisfied, the target speed value and the corresponding target gait will be determined according to the corresponding preset conditions, so that the robot 100 can be controlled to move with the target speed value and the corresponding target gait. The environmental sensor may include a temperature sensor, an air pressure sensor, a visual sensor, and a sound sensor. The instruction information may include temperature information, air pressure information, image information, and sound information. The communication method between the environmental sensor and the processor 110 may be wired communication or wireless communication. The wireless communication method includes, but is not limited to: wireless network, mobile communication network (3G, 4G, 5G, etc.), Bluetooth, and infrared.
[0045] For example, see Figure 3, which shows a schematic diagram of the communication between the robot and the network server provided in one embodiment of the present application. Among them, AMR application is the application of the mobile robot 100, wherein the application of the robot 100 is not directly connected to the network server, and the application can forward, parse and adapt the information through the shim layer (AMR synq) to communicate with the network server. Among them, the network server can send drive instructions, load instructions, charging instructions, rotation instructions and other information to AMR synq, and AMR synq forwards, parses, adapts and sends the information to the AMR application. Among them, the network server may include a warehouse control system WCS simulator, a MongoDB database, an application server SynQ, an SQL database, etc.
[0046] It should be noted that the shim technology was a small function library in the early stage of development, which was used to transparently intercept API calls, modify the passed parameters, process operations by itself, or redirect operations to other places. This technology was first created by Microsoft. Its initial design idea was to implement an API hook through the shim architecture, and the Windows API was implemented through a set of dynamic link libraries DLL. Each application on the Windows system imports these DLLs and maintains a table (import table) in memory to store the addresses of calling functions. Among them, since the addresses of Windows functions are located in a table, shim directly replaces the addresses in the import table with the addresses in the shim DLL. Therefore, the application usually does not realize that the request is redirected to a shim DLL instead of the Windows system, and the Windows system does not realize that the request does not come from the application (because the shim DLL happens to be located in the application's process).
[0047] For example, see Figure 4 and Figure 5 , Figure 4 A schematic diagram showing a related art application program that does not use shim technology directly interacting with a Windows system is shown. Figure 5 FIG. 1 is a schematic diagram showing an application program using shim technology in the related art to indirectly interact with a Windows system. Figure 5The shim technology shown can be used as an adaptation layer to quickly connect applications. Among them, shim technology can also be used to design as a compatibility layer between different software to avoid compatibility issues that may occur during the development of newer versions of applications. At the same time, due to the design mode of the compatibility layer, it will not cause the main program to crash or abnormal during the modification process. Therefore, the application of shim technology helps to improve the scalability of application code; in addition, it can also prevent code duplication in the application, avoid errors caused by cutting and pasting, and reduce the cost of developing and maintaining applications.
[0048] Among them, the robot 100 can use the Shim layer technology as an adaptation layer tool for fast switching of application network communications, which can be used as the network information interaction layer of the application software of the robot 100, or it can also be understood as a pipeline that runs independently between the main application on the robot 100 and the network server to ensure the realization of the core functions of the application of the robot 100, decouple the application from the network communication service, and make the application compatible with a variety of different network services.
[0049] The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0050] See also Figure 6 , Figure 6 The flow chart of the communication method provided by an embodiment of the present application is shown. The communication method provides a communication interface service in the process of the application communicating with the network server with different communication protocols through the shim layer technology, thereby improving the compatibility of the application with the different network communication protocols of the network server. In a specific embodiment, the communication method can be applied to Fig.15 The communication device 200 and the robot 100 equipped with the communication device 200 ( Fig.16 ). The following will take a robot as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the robot used in this embodiment may include a wheeled robot, a legged robot, etc. The robot can be connected to at least one network server. The robot's operating system may include an application and at least one shim layer. The at least one network server corresponds to the at least one shim layer one by one. The at least one network server corresponds to a different network communication protocol, which is not limited here. Figure 6 The process shown is described in detail, and the communication method may specifically include the following steps:
[0051] Step S110: determining a first network server from the at least one network server.
[0052] In this embodiment, the robot can be connected to at least one network server, wherein the robot's operating system can be configured with one or more applications, such as visual applications, communication applications, etc., which are not limited here. The robot's operating system can also include applications and at least one shim layer, and the at least one network server corresponds to the at least one shim layer one-to-one, and the at least one network server corresponds to a different network communication protocol. The network communication protocol corresponding to the network server can include IP communication protocol, TCP communication protocol, RCS communication protocol, snoxbox communication protocol, etc., which are not limited here.
[0053] Among them, the one-to-one correspondence between the at least one network server and the at least one shim layer can be pre-set in the robot, or can be obtained by the robot from an associated cloud or electronic device through wireless communication technology (such as WiFi, Bluetooth, Zigbee and other technologies), or can be obtained by the robot from an associated electronic device through a serial communication interface (such as a serial peripheral interface, etc.), which is not limited here.
[0054] Exemplarily, the robot is a mobile robot of the KMP600-PCU model, wherein the mobile robot can be connected to a network server with an RCS communication protocol, and the robot can also be connected to a network server with a snoxbox communication protocol, which is not limited here. Accordingly, the mobile robot includes a shim layer corresponding to a network server with an RCS communication protocol, and includes a shim layer corresponding to a network server with a snoxbox communication protocol.
[0055] Among them, it can be understood that the application included in the mobile robot can communicate with the network server with the RCS communication protocol through the shim layer technology, and the application included in the mobile robot can also communicate with the network server with the snoxbox communication protocol through the shimlayer technology, so that the robot in the Linux operating system, the application can adapt to the network server with different communication protocols, thereby improving the compatibility of the robot product with different network communication protocols and increasing the diversity of the robot's application scenarios.
[0056] As an implementable manner, the robot may receive a first communication instruction sent by a user, wherein the first communication instruction may carry the first network server. Accordingly, the robot may parse the first communication instruction to determine the first network server from at least one network server connected to the robot.
[0057] As another feasible manner, the first network server is fixed. Based on this, the robot can pre-determine the first network server from at least one network server connected to the robot. Then, when it is necessary to control the application included in the robot to communicate with the network server, the robot can receive a second communication instruction sent by the user, wherein the second communication instruction does not carry the first network server. Accordingly, the robot can parse the second communication instruction to determine that it is necessary to control the application to communicate with the network server, and then determine the predetermined first network server.
[0058] Step S120: Determine a first shim layer corresponding to the first network server from the at least one shim layer.
[0059] In some embodiments, at least one shim layer may be pre-set in the robot to have a one-to-one correspondence with the network server to which the robot is connected. Based on this, after determining the first network server, the robot may determine the shim layer corresponding to the first network server as the first shim layer from the at least one shim layer included.
[0060] In some embodiments, at least one shim layer may be pre-set in the robot to have a one-to-one correspondence with different network communication protocols. Based on this, after determining the first network server, the robot can determine the network communication protocol possessed by the first network server, and can determine the shim layer corresponding to the network communication protocol as the first shim layer from the at least one shim layer included.
[0061] Step S130: controlling the application to communicate with the first network server through the first shim layer.
[0062] In some embodiments, after the robot determines the first shim layer, it can control the included application to communicate with the first network server through the first shim layer. The robot can control the application to communicate with the first network server through the first shim layer by selecting an IP address in a configuration file.
[0063] For example, see Figure 7, which shows a schematic diagram of an application provided by an embodiment of the present application communicating with a network server through a shim layer. The network server may have a TCP / IP communication protocol. The shim layer module as a whole runs independently in the robot; the shim layer module may include multiple submodules, such as a command conversion module, a command processing module, a service adaptation module, a status collection module, an information response module, etc. The command conversion module may be used to receive information sent by the network server, and may parse the information and send the parsed information to the command processing module on the application side; the command processing module may be used to send the converted information to the application. The service adaptation module may be used to receive information sent by the application and convert it to adapt to the network server, and send the information to the status collection module; the status collection module may be used to collect information uploaded by the service adaptation module, and upload the information to the information response module; the information response module may be used to send the collected information to the adapted network server. The command conversion module, the command processing module, the service adaptation module, and the information response module may realize the function of uploading and issuing communication information flows.
[0064] In some embodiments, the application included in the robot can communicate directly with the network server. Figure 8 , which shows a schematic diagram of the communication between the application and the network server provided by an embodiment of the present application. In the Linux system, the application included in the robot can communicate with the network server through the TCP / IP communication protocol, that is, the application can support communication with the network server with the TCP / IP communication protocol. Based on this, the application can directly communicate with the network server with the TCP / IP communication protocol.
[0065] Among them, combined Figure 7 and Figure 8 , it is understandable that Figure 7 The service adaptation module included in the shim layer module can be functionally connected to the Figure 7 It is equivalent to a network server and is used to generate network communications with applications; among them, Figure 7 The command conversion module, command processing module, service adaptation module and information response module in the communication information flow upload and download functions and Figure 8 The effect of direct communication between the application and the network server is the same. Figure 7The application of shim layer technology can improve the compatibility of applications with various network services. Developers only need to process at the shim layer to improve the compatibility of applications with various network services without developing the functions of the application, thus ensuring the realization of the core functions of the application.
[0066] A communication method provided by an embodiment of the present application determines a first network server from at least one network server; determines a first shim layer corresponding to the first network server from at least one shim layer; controls an application to communicate with the first network server through the first shim layer, and then provides a communication interface service through the shim layer technology during the communication between the application and the network server with different communication protocols, thereby improving the compatibility of the application with different network communication protocols of the network server.
[0067] See also Fig. 9 , Fig. 9 The flow chart of the communication method provided by an embodiment of the present application is shown. The method is applied to the above-mentioned robot, the robot is connected to at least one network server, the operating system of the robot may include an application and at least one shim layer, the at least one network server corresponds to the at least one shim layer one by one, and the at least one network server corresponds to a different network communication protocol. Fig. 9 The process shown is described in detail, and the communication method may specifically include the following steps:
[0068] Step S210: Determine the network communication protocol corresponding to each of the at least one network servers.
[0069] In some embodiments, the robot can be connected to at least one network server, wherein the robot can determine the network communication protocol corresponding to each of the at least one network server. Exemplarily, the robot can determine that the at least one network server includes a network server with a TCP / IP communication protocol, a network server with an RCS communication protocol, a network server with a snoxbox communication protocol, etc.
[0070] Step S220: creating a shim layer corresponding to each of the at least one network servers according to the network communication protocol corresponding to each of the at least one network servers.
[0071] In some embodiments, after determining the network communication protocol corresponding to each of the at least one network servers connected to the robot, the robot can create a shim layer corresponding to each of the at least one network servers according to the network communication protocol corresponding to each of the at least one network servers.
[0072] It is understandable that the robot can, based on the shim layer technology, create a shim layer adaptation layer for a network server with a unique network communication protocol, thereby supporting communication between applications and network servers with different network communication protocols without modifying the functions of the application, thereby improving the delivery efficiency between the robot and different network servers.
[0073] Step S230: constructing a configuration file of the application based on the correspondence between the shim layer and the network communication protocol.
[0074] In some embodiments, after creating a shim layer corresponding to at least one network server according to the network communication protocol corresponding to each network server, the robot can construct a configuration file of the application based on the correspondence between the shim layer and the network communication protocol. Different shim layers can correspond to different network communication protocols; the robot can set the IP address corresponding to each shim layer in the configuration file of the application. Optionally, the IP address included in the configuration file of the application can correspond to the network communication protocol one-to-one, or one-to-one with the network server.
[0075] Among them, the process of the robot constructing the configuration file of the application based on the correspondence between the shim layer and the network communication protocol can be to obtain the Internet Protocol IP address corresponding to the shim layer, and construct the configuration file of the application based on the correspondence between the IP address corresponding to the shim layer and the network communication protocol.
[0076] Step S240: Determine a first network server from the at least one network server.
[0077] For the specific description of step S240, please refer to the specific description of step S110 above, which will not be repeated here.
[0078] Step S250: Determine a first shim layer corresponding to the first network server from the at least one shim layer.
[0079] In some implementations, after determining the first network server, the robot may determine the network communication protocol possessed by the first network server, and may determine a shim layer corresponding to the network communication protocol as the first shim layer from at least one shim layer included in the robot.
[0080] For example, see Fig.10 , which shows a schematic flow diagram of step S250 provided in an embodiment of the present application. Step S250 may include step S251 and step S252:
[0081] Step S251: obtaining a network communication protocol corresponding to the first network server as a first network communication protocol.
[0082] The robot can obtain the network communication protocol corresponding to the first network server as the first network communication protocol based on the connection with the first network server. Optionally, the robot can be connected to the first network server wirelessly or by wire.
[0083] Step S252: Determine the shimlayer to which the IP address corresponding to the first network communication protocol in the configuration file belongs as the first shim layer.
[0084] After the robot determines the first network communication protocol, it can determine the shim layer to which the IP address corresponding to the first network communication protocol in the configuration file of the application belongs as the first shim layer. The configuration file of the application can include the IP address of the shim layer, and the IP address can correspond to the network communication protocol one by one.
[0085] In some embodiments, see Fig.11 , which shows a schematic flow diagram of step S250 provided in an embodiment of the present application. Step S250 may include step S253 and step S254:
[0086] Step S253: Acquire the network communication protocol corresponding to the first network server as the first network communication protocol.
[0087] For the specific description of step S253, please refer to the specific description of step S251 above, which will not be repeated here.
[0088] Step S254: Determine a shimlayer corresponding to the first network communication protocol in the at least one shim layer as the first shim layer.
[0089] After the robot determines the first network communication protocol, the robot may determine the shim layer corresponding to the first network communication protocol in at least one shimlayer included in the robot as the first shim layer. The shim layers included in the robot may correspond to the network communication protocols one by one.
[0090] Step S260: Control the application to communicate with the first network server through the first shim layer.
[0091] In some implementations, after the robot determines the first shim layer, it can control the application to communicate with the first network server through the first shim layer. The content transmitted by the first shim layer may include various types of information such as task information, state information, control instructions, and heartbeat information.
[0092] In some embodiments, see Fig.12 , which shows a schematic flow diagram of step S260 provided in an embodiment of the present application. Step S260 may include step S261 and step S262:
[0093] Step S261: Determine the IP address corresponding to the first network communication protocol in the configuration file as the first IP address.
[0094] After the robot determines the first network communication protocol, it can determine the IP address corresponding to the first network communication protocol in the configuration file of the application as the first IP address.
[0095] Step S262: Control the application to select the first IP address and communicate with the first network server through the first shim layer.
[0096] After determining the first IP address, the robot can control the application to select the first IP address and communicate with the first network server through the first shim layer. The shim layer can provide communication interface services during the application communication process, and can parse, merge, forward, and process the transmitted data (such as upload data streams and download data streams); the shim layer can also provide attachment functions, etc.
[0097] In some embodiments, see Fig.13 , which shows a schematic flow chart of step S260 provided in an embodiment of the present application. Step S260 may include step S263 and step S264:
[0098] Step S263: receiving first information sent by the first network server through the first shim layer, converting the first information through the first shim layer to obtain first target information, and sending the first target information to the application through the first shim layer.
[0099] In some embodiments, the robot may receive the first information sent by the first network server through the first shim layer, convert the first information through the first shim layer to obtain the first target information, and send the first target information to the application through the first shim layer. The first shim layer may parse the first information to obtain the first target information, and may forward the first target information to the application. The first information may include task information, control instructions and other types of information, which are not limited here.
[0100] Step S264: receiving second information sent by the application through the first shim layer, converting the second information through the first shim layer to obtain second target information, and sending the second target information to the first network server through the first shim layer.
[0101] In some embodiments, the robot can receive the second information sent by the application through the first shim layer, convert the second information through the first shim layer to obtain the second target information, and send the second target information to the first network server through the first shim layer. The first shim layer can adapt the second information according to the first network communication protocol to obtain the second target information, and can forward the second target information to the first network server. The second information can include status information, heartbeat information and other types of information, which are not limited here.
[0102] Compared with the communication method provided in an embodiment of the present application, Figure 6The communication method shown in the figure, this embodiment can also determine the network communication protocol corresponding to at least one network server before determining the first network server from at least one network server; create a shim layer corresponding to at least one network server according to the network communication protocol corresponding to the at least one network server; construct a configuration file of the application based on the correspondence between the shim layer and the network communication protocol, and then create an independent shim layer for network servers with different network communication protocols, thereby improving the compatibility of the robot's application to different network communication protocols and avoiding redundancy and cumbersomeness of the application.
[0103] See also Fig.14 , Fig.14 The flow chart of the communication method provided by an embodiment of the present application is shown. The method is applied to the above-mentioned robot, the robot is connected to at least one network server, the operating system of the robot may include an application and at least one shim layer, the at least one network server corresponds to the at least one shim layer one by one, and the at least one network server corresponds to different network communication protocols. Fig.14 The process shown is described in detail, and the communication method may specifically include the following steps:
[0104] Step S310: determining a first network server from the at least one network server.
[0105] Step S320: Determine a first shim layer corresponding to the first network server from the at least one shim layer.
[0106] Step S330: Control the application to communicate with the first network server through the first shim layer.
[0107] For the detailed description of step S310 to step S330, please refer to the detailed description of step S110 to step S130 above, which will not be repeated here.
[0108] Step S340: When the network server communicating with the application is switched from the first network server to a second network server, a second shim layer corresponding to the second network server is determined from the at least one shim layer, wherein the second network server is different from the first network server.
[0109] In some embodiments, the robot may determine a second shim layer corresponding to the second network server from at least one shim layer included in the robot when the network server communicating with the application is switched from the first network server to the second network server, wherein the second network server includes a server different from the first network server in at least one network server connected to the robot.
[0110] As an implementable manner, the robot may receive a third communication instruction sent by a user, wherein the third communication instruction may carry the second network server, and accordingly, the robot may parse the third communication instruction to determine the second network server from at least one network server connected to the robot. Accordingly, the robot may determine that it is necessary to control the application to communicate with the second network server upon receiving the third communication instruction, and based on this, the robot may determine a second shimlayer corresponding to the second network server from at least one shim layer upon switching the network server communicating with the application from the first network server to the second network server.
[0111] The robot can determine that the network communication protocol corresponding to the second server is the second network communication protocol, and accordingly, the robot can determine the second shim layer based on the second network communication protocol. Optionally, the robot can determine the shim layer corresponding to the second network communication protocol as the second shim layer; the robot can also determine the shim layer corresponding to the IP address corresponding to the second network communication protocol in the configuration file of the application as the second shimlayer, which is not limited here.
[0112] As another feasible manner, the second network server is fixed. Based on this, the robot can determine the second network server in advance from at least one network server connected to the robot. Then, when it is necessary to control the application included in the robot to switch from communicating with the first network server to communicating with the second network server, the robot can receive a fourth communication instruction sent by the user, wherein the fourth communication instruction does not carry the second network server. Accordingly, the robot can parse the fourth communication instruction to determine that the network server that communicates with the application needs to be switched from the first network server to the second network server, and then determine the second shim layer corresponding to the second network server from at least one shim layer.
[0113] Step S350: Control the application to communicate with the second network server through the second shim layer.
[0114] In some implementations, the robot can control the application program to communicate with the second network server through the second shim layer by selecting the IP address corresponding to the second shim layer in the configuration file.
[0115] It can be understood that the shim layer provides functional support for applications to communicate with network servers with different network communication protocols without modifying the applications. During the operation of the shim layer, the basic network communication of the application will not be affected. In addition, when the network server communicating with the application changes, the application can switch the IP address of the shim layer in the configuration file so that the shim layer corresponding to the IP address can be quickly accessed to support the communication of the application, thereby allowing the application to quickly switch communications between different network servers, avoiding redundancy and cumbersomeness of the application and improving the decoupling of the application's network communication services.
[0116] Compared with the communication method provided in an embodiment of the present application, Figure 6 According to the communication method shown in the figure, this embodiment can also determine a second shim layer corresponding to the second network server from at least one shim layer when the network server communicating with the application is switched from the first network server to the second network server after controlling the application to communicate with the first network server through the first shim layer, wherein the second network server is different from the first network server; the application is controlled to communicate with the second network server through the second shim layer, thereby improving the compatibility of the application with the network communication protocols of different network servers, and enabling the application to quickly switch communications between different network servers, thereby avoiding redundancy and cumbersomeness of the application and improving the decoupling of the network communication service of the application.
[0117] See also Fig.15 , Fig.15 The module block diagram of the communication device provided by an embodiment of the present application is shown below. Fig.15 The process shown is described in detail, the communication device 200 is applied to the above robot, the robot is connected to at least one network server, the operating system of the robot may include an application and at least one shim layer shimlayer, the at least one network server may correspond to at least one shim layer one by one, and the at least one network server corresponds to a different network communication protocol. The communication device 200 includes: a first network server determination module 210, a first shim layer determination module 220 and an application and network server communication module 230, wherein:
[0118] The first network server determining module 210 is configured to determine a first network server from the at least one network server.
[0119] The first shim layer determining module 220 is configured to determine a first shim layer corresponding to the first network server from the at least one shim layer.
[0120] The application program and network server communication module 230 is used to control the application program to communicate with the first network server through the first shimlayer.
[0121] Furthermore, before determining the first network server from the at least one network server, the communication device 200 may further include: a network communication protocol determination module, a shim layer creation module, and a configuration file construction module, wherein:
[0122] The network communication protocol determination module is used to determine the network communication protocol corresponding to each of the at least one network servers.
[0123] The shim layer creation module is used to create a shim layer corresponding to each of the at least one network servers according to the network communication protocol corresponding to each of the at least one network servers.
[0124] A configuration file construction module is used to construct a configuration file of the application based on the corresponding relationship between the shim layer and the network communication protocol.
[0125] Furthermore, the configuration file construction module may include: an IP address acquisition unit and a configuration file construction subunit, wherein:
[0126] The IP address acquisition unit is used to acquire the Internet Protocol IP address corresponding to the shim layer.
[0127] The configuration file construction subunit is used to construct the configuration file of the application based on the corresponding relationship between the IP address corresponding to the shim layer and the network communication protocol.
[0128] Further, the first shim layer determining module 220 may include: a first network communication protocol obtaining first unit and a first shim layer determining first unit, wherein:
[0129] The first network communication protocol acquiring unit is configured to acquire a network communication protocol corresponding to the first network server as the first network communication protocol.
[0130] The first shim layer determines a first unit, which is used to determine the shim layer to which the IP address corresponding to the first network communication protocol in the configuration file belongs as the first shim layer.
[0131] Further, the application and network server communication module 230 may include: a first IP address determination unit and a first application and network server communication unit, wherein:
[0132] The first IP address determining unit is used to determine the IP address corresponding to the first network communication protocol in the configuration file as the first IP address.
[0133] The first unit for communicating between the application and the network server is used to control the application to select the first IP address and communicate with the first network server through the first shim layer.
[0134] Further, the first shim layer determining module 220 may include: a first network communication protocol obtaining second unit and a first shim layer determining second unit, wherein:
[0135] The first network communication protocol acquisition second unit is used to acquire the network communication protocol corresponding to the first network server as the first network communication protocol.
[0136] The first shim layer determines a second unit, which is used to determine a shim layer corresponding to the first network communication protocol in the at least one shim layer as the first shim layer.
[0137] Furthermore, the application and network server communication module 230 may include: a first communication unit and a second communication unit, wherein:
[0138] The first communication unit is used to receive first information sent by the first network server through the first shim layer, convert the first information through the first shim layer to obtain first target information, and send the first target information to the application through the first shim layer.
[0139] The second communication unit is used to receive second information sent by the application through the first shim layer, convert the second information through the first shim layer to obtain second target information, and send the second target information to the first network server through the first shim layer.
[0140] Further, after controlling the application to communicate with the first network server through the first shim layer, the communication device 200 may further include: a second shim layer determining unit and a second unit for communicating between the application and the network server, wherein:
[0141] and a second shim layer determining unit, configured to determine, from the at least one shim layer, a second shim layer corresponding to the second network server when the network server communicating with the application is switched from the first network server to a second network server, wherein the second network server is different from the first network server.
[0142] The second unit for communicating between the application and the network server is used to control the application to communicate with the second network server through the second shimlayer.
[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0144] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0145] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0146] See also Fig.16 , which shows a structural block diagram of a robot provided in an embodiment of the present application. The robot 100 may be a wheeled robot, a legged robot, or other robot capable of running applications. The robot 100 in the present application may include one or more of the following components: a processor 110, a memory 105, and one or more applications, wherein the one or more applications may be stored in the memory 105 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method as described in the aforementioned method embodiment.
[0147] The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire robot 100, and executes various functions and processes data of the robot 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 105, and calling data stored in the memory 105. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0148] The memory 105 may include a random access memory (RAM) or a read-only memory (ROM). The memory 105 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 105 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the robot 100 during use (such as a phone book, audio and video data, chat record data), etc.
[0149] See also Fig.17 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 300 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0150] The computer readable storage medium 300 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 310 can be compressed, for example, in an appropriate form.
[0151] In summary, the communication method, device, robot and storage medium provided in the embodiments of the present application determine a first network server from at least one network server; determine a first shim layer corresponding to the first network server from at least one shim layer; control the application to communicate with the first network server through the first shim layer, and then provide communication interface services through the shim layer technology in the process of the application communicating with the network server with different communication protocols, thereby improving the compatibility of the application with different network communication protocols of the network server.
[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A communication method, characterized in that: Applied to a robot, the robot is connected to at least one network server, the robot's operating system includes an application program and at least one shim layer, the at least one network server corresponds to the at least one shim layer in a one-to-one manner, and the at least one network server corresponds to a different network communication protocol, the method comprising: determining a first network server from the at least one network server; Determining, from the at least one shim layer, a first shim layer corresponding to the first network server; Control the application to communicate with the first network server through the first shim layer.
2. The method according to claim 1, characterized in that Before determining the first network server from the at least one network server, the method further includes: Determining a network communication protocol corresponding to each of the at least one network servers; Creating a shim layer corresponding to each of the at least one network servers according to the network communication protocol corresponding to each of the at least one network servers; The configuration file of the application is constructed based on the corresponding relationship between the shim layer and the network communication protocol.
3. The method according to claim 2, characterized in that The step of constructing the configuration file of the application based on the correspondence between the shim layer and the network communication protocol includes: Obtaining an Internet Protocol IP address corresponding to the shim layer; The configuration file of the application is constructed based on the corresponding relationship between the IP address corresponding to the shim layer and the network communication protocol.
4. The method according to claim 3, characterized in that The step of determining, from the at least one shim layer, a first shim layer corresponding to the first network server comprises: Acquire a network communication protocol corresponding to the first network server as a first network communication protocol; The shim layer to which the IP address corresponding to the first network communication protocol in the configuration file belongs is determined as the first shim layer.
5. The method according to claim 3, characterized in that: The controlling the application to communicate with the first network server through the first shimlayer includes: Determine an IP address in the configuration file corresponding to the first network communication protocol as a first IP address; The application is controlled to select the first IP address and communicate with the first network server through the first shim layer.
6. The method according to claim 2, characterized in that The step of determining, from the at least one shim layer, a first shim layer corresponding to the first network server comprises: Acquire a network communication protocol corresponding to the first network server as a first network communication protocol; A shim layer corresponding to the first network communication protocol among the at least one shim layer is determined as the first shim layer.
7. The method according to claim 1, characterized in that The controlling the application to communicate with the first network server through the first shimlayer includes: receiving, through the first shim layer, first information sent by the first network server, converting and processing the first information through the first shim layer to obtain first target information, and sending the first target information to the application through the first shim layer; The second information sent by the application is received through the first shim layer, the second information is converted and processed by the first shimlayer to obtain second target information, and the second target information is sent to the first network server through the first shim layer.
8. The method according to any one of claims 1 to 7, characterized in that: After controlling the application to communicate with the first network server through the first shim layer, the method further includes: In a case where the network server communicating with the application is switched from the first network server to a second network server, determining a second shimlayer corresponding to the second network server from the at least one shim layer, wherein the second network server is different from the first network server; Control the application to communicate with the second network server through the second shim layer.
9. A communication device, characterized in that: Applied to a robot, the robot is connected to at least one network server, the robot's operating system includes an application program and at least one shim layer, the at least one network server corresponds to the at least one shim layer in a one-to-one manner, and the at least one network server corresponds to a different network communication protocol, the device includes: A first network server determining module, configured to determine a first network server from the at least one network server; A first shim layer determining module, configured to determine a first shim layer corresponding to the first network server from the at least one shim layer; The application program and network server communication module is used to control the application program to communicate with the first network server through the first shim layer.
10. A robot, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 8.